diff --git a/.craft.yml b/.craft.yml index b2dde339..ae26451c 100644 --- a/.craft.yml +++ b/.craft.yml @@ -4,14 +4,5 @@ preReleaseCommand: bash scripts/craft-pre-release.sh artifactProvider: name: none targets: - - id: release - name: docker - source: ghcr.io/getsentry/action-release-image - target: ghcr.io/getsentry/action-release-image - - id: latest - name: docker - source: ghcr.io/getsentry/action-release-image - target: ghcr.io/getsentry/action-release-image - targetFormat: '{{{target}}}:latest' - name: github tagPrefix: v \ No newline at end of file diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index c4c82289..00000000 --- a/.dockerignore +++ /dev/null @@ -1,10 +0,0 @@ -# Docs: https://docs.docker.com/engine/reference/builder/#dockerignore-file -# These files will be ignore by Docker for COPY and ADD commands when creating a build context -# In other words, if a file should not be inside of the Docker container it should be -# added to the list, otherwise, it will invalidate cache layers and have to rebuild -# all layers after a COPY command -.git -.github -Dockerfile -.dockerignore -*.md diff --git a/.eslintrc.json b/.eslintrc.json index a33bcd3f..f8cc690f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -42,6 +42,7 @@ "@typescript-eslint/type-annotation-spacing": "error", "@typescript-eslint/unbound-method": "error", "github/array-foreach": "off", + "i18n-text/no-en": "off" }, "env": { "node": true, diff --git a/.github/actions/use-local-dockerfile/action.yml b/.github/actions/use-local-dockerfile/action.yml deleted file mode 100644 index 98a078fc..00000000 --- a/.github/actions/use-local-dockerfile/action.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: "Use local Dockerfile" -description: "Use the local Dockerfile to test the action instead of the one on DockerHub" -inputs: - working_directory: - description: 'Directory to manipulate Dockerfile in' - required: true - default: '.' -runs: - using: "composite" - steps: - - name: Replace image on action.yml - shell: bash - run: | - mv ${{inputs.working_directory}}/action.yml ${{inputs.working_directory}}/previous.yml - sed "s|docker://ghcr.io/getsentry/action-release-image:.*[^']|Dockerfile|" ${{inputs.working_directory}}/previous.yml >> ${{inputs.working_directory}}/action.yml - grep "image" ${{inputs.working_directory}}/action.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index cee021ee..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: "build" -on: - push: - branches: - - master - - release/** - pull_request: - -jobs: - docker-build: - name: Build & publish Docker images - runs-on: ubuntu-latest - permissions: - packages: write - strategy: - matrix: - target: - - name: builder - image: action-release-builder-image - - name: app - image: action-release-image - steps: - - name: Checkout repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - # BUILDKIT_INLINE_CACHE creates the image in such a way that you can - # then use --cache-from (think of a remote cache) - # This feature is allowed thanks to using the buildx plugin - # - # There's a COPY command in the builder stage that can easily invalidate the cache - # If you notice, please add more exceptions to .dockerignore since we loose the value - # of using --cache-from on the app stage - - name: Build and push - uses: docker/build-push-action@v6 - with: - platforms: linux/amd64,linux/arm64 - push: true - tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.target.image }}:${{ github.sha }} - cache-from: ghcr.io/${{ github.repository_owner }}/${{ matrix.target.image }}:latest - target: ${{ matrix.target.name }} - build-args: BUILDKIT_INLINE_CACHE=1 diff --git a/.github/workflows/create-release-tags.yml b/.github/workflows/create-release-tags.yml new file mode 100644 index 00000000..8692e882 --- /dev/null +++ b/.github/workflows/create-release-tags.yml @@ -0,0 +1,35 @@ + # Releases always publish a `v[major].[minor].[patch]` tag + # This action creates/updates `v[major]` and `v[major].[minor]` tags + name: Create release tags + + on: + release: + types: [released] + + permissions: + contents: write + + jobs: + create-tags: + name: Create release tags for major and minor versions + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.release.tag_name }} + + - name: Set git user to getsentry-bot + run: | + echo "GIT_COMMITTER_NAME=getsentry-bot" >> $GITHUB_ENV; + echo "GIT_AUTHOR_NAME=getsentry-bot" >> $GITHUB_ENV; + echo "EMAIL=bot@sentry.io" >> $GITHUB_ENV; + + - name: Create and push major and minor version tags + run: | + MAJOR_VERSION=$(echo '${{ github.event.release.tag_name }}' | cut -d. -f1) + MINOR_VERSION=$(echo '${{ github.event.release.tag_name }}' | cut -d. -f1-2) + git tag -f $MAJOR_VERSION + git tag -f $MINOR_VERSION + git push -f origin $MAJOR_VERSION $MINOR_VERSION diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f989467..29245651 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,5 @@ -name: "Action: Prepare Release" +name: Prepare Release + on: workflow_dispatch: inputs: @@ -12,10 +13,13 @@ on: description: Target branch to merge into. Uses the default branch as a fallback (optional) required: false default: master + jobs: release: + name: Release a new version + runs-on: ubuntu-20.04 - name: 'Release a new version' + steps: - name: Get auth token id: token diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c5539a73..570fda18 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,89 +1,103 @@ -name: "integration tests" +name: Integration Tests + on: pull_request: paths-ignore: - - '**.md' + - "**.md" push: branches: - master + - release/** + paths-ignore: + - "**.md" + env: # Variables defined in the repository SENTRY_ORG: ${{ vars.SENTRY_ORG }} - # For master we have an environment variable that selects the action-release project + # For master, we have an environment variable that selects the action-release project # instead of action-release-prs # For other branches: https://sentry-ecosystem.sentry.io/releases/?project=4505075304693760 # For master branch: https://sentry-ecosystem.sentry.io/releases/?project=6576594 SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }} jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install + run: yarn install + + - name: Check format + run: yarn format-check + + - name: Lint + run: yarn lint + + - name: Build + run: yarn build + # You're welcome to make changes on this job as part of your PR in order to test out your changes # We can always undo the changes once we're satisfied with the results # # Secrets on this repo do not get shared with PRs opened on a fork, thus, # add SENTRY_AUTH_TOKEN as a secret to your fork if you want to use this job. - # Checkout the README.md on how to create the internal integration (read: auth token) - create-real-release-per-push: - name: "Test current action" - runs-on: ubuntu-latest - # XXX: This job will fail for forks, skip step on forks and let contributors tweak it when ready - if: github.ref != 'refs/heads/master' + create-staging-release-per-push: + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + runs-on: ${{ matrix.os }} + name: Test current action steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - # For PRs, this supports creating a release using the commits from the branch (rather than the merge commit) - ref: ${{ github.event.pull_request.head.sha || github.sha }} - - # This allows executing the action's code in the next step rather than a specific tag - - uses: './.github/actions/use-local-dockerfile' + - uses: actions/checkout@v4 - - name: Create a staging release - uses: ./ - env: - # If you want this step to be mocked you can uncomment this variable - # MOCK: true - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_LOG_LEVEL: debug - with: - ignore_missing: true + - name: Create a staging release + uses: ./ + env: + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + SENTRY_LOG_LEVEL: debug + with: + ignore_missing: true - mock-release: # Make sure that the action works on a clean machine without building Docker - name: "Build image & mock a release" - runs-on: ubuntu-latest + mock-release: + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + runs-on: ${{ matrix.os }} + name: Mock a release steps: - - uses: actions/checkout@v3 - - - uses: './.github/actions/use-local-dockerfile' + - uses: actions/checkout@v4 - - name: Mock creating a Sentry release - uses: ./ - env: - MOCK: true - with: - environment: production + - name: Mock creating a Sentry release + uses: ./ + env: + MOCK: true + with: + environment: production mock-release-working-directory: - name: "Build image & mock a release in a different working directory" - runs-on: ubuntu-latest + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + runs-on: ${{ matrix.os }} + name: Mock a release in a different working directory steps: - - name: Checkout directory we'll be running from - uses: actions/checkout@v3 - with: - path: main/ - - - name: Checkout directory we'll be testing - uses: actions/checkout@v3 - with: - path: test/ + - name: Checkout directory we'll be running from + uses: actions/checkout@v4 + with: + path: main/ - - uses: './main/.github/actions/use-local-dockerfile' - with: - working_directory: main + - name: Checkout directory we'll be testing + uses: actions/checkout@v4 + with: + path: test/ - - name: Mock creating a Sentry release in a different directory - uses: ./main - env: - MOCK: true - with: - environment: production - working_directory: ./test + - name: Mock creating a Sentry release in a different directory + uses: ./main + env: + MOCK: true + with: + environment: production + working_directory: ../test diff --git a/.github/workflows/verify-dist.yml b/.github/workflows/verify-dist.yml new file mode 100644 index 00000000..e05c1ba2 --- /dev/null +++ b/.github/workflows/verify-dist.yml @@ -0,0 +1,44 @@ +# Inspired by @action/checkout +# +# Compares the checked in `dist/index.js` with the PR's `dist/index.js` +# On mismatch this action fails +name: Verify dist + +on: + push: + branches: + - master + paths-ignore: + - "**.md" + pull_request: + paths-ignore: + - "**.md" + +jobs: + check-dist: + name: Verify dist/index.js file + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Use volta + uses: volta-cli/action@v4 + + - name: Install dependencies + run: yarn install + + - name: Rebuild dist + run: yarn build + + - name: Compare expected and actual dist + run: | + if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then + echo "Detected uncommitted changes after build. Did you forget to commit `dist/index.js`?" + echo "Diff:" + git diff + exit 1 + fi diff --git a/.gitignore b/.gitignore index ffe585b7..ba9e9fc6 100644 --- a/.gitignore +++ b/.gitignore @@ -29,12 +29,6 @@ coverage # nyc test coverage .nyc_output -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - # node-waf configuration .lock-wscript @@ -59,40 +53,9 @@ typings/ # Optional REPL history .node_repl_history -# Output of 'npm pack' -*.tgz - # Yarn Integrity file .yarn-integrity -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache - -# next.js build output -.next - -# nuxt.js build output -.nuxt - -# Vercel build output -dist/ - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - # OS metadata .DS_Store Thumbs.db diff --git a/CHANGELOG.md b/CHANGELOG.md index 50b1de02..d11963f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,16 +2,14 @@ ## Unreleased -- chore(release): Test craft release workflow -This release is purely there to test our new craft release workflow and has functionality change. -With this release, we now publish versioned docker images and each release action will point to their respective docker -image, allowing users to pin versions from here on out. +- **feat(action): Support macos and windows runners** +We now publish a composite action that runs on all runners. Actions can now be properly versioned, allowing pinning versions from here on out. ## 1.9.0 **Important Changes** -- **feat(sourcemaps): Add inject option to inject debug ids into source files and sourcemaps (#229) ** +- **feat(sourcemaps): Add inject option to inject debug ids into source files and sourcemaps (#229)** A new option to inject Debug IDs into source files and sourcemaps was added to the action to ensure proper un-minifaction of your stacktraces. We strongly recommend enabling this by setting inject: true in your action alongside providing a path to sourcemaps. **Other Changes** diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index c339e476..00000000 --- a/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -# The multi stage set up *saves* up image size by avoiding the dev dependencies -# required to produce dist/ -FROM node:18-alpine as builder -WORKDIR /app -# This layer will invalidate upon new dependencies -COPY package.json yarn.lock ./ -RUN export YARN_CACHE_FOLDER="$(mktemp -d)" \ - && yarn install --frozen-lockfile --quiet \ - && rm -r "$YARN_CACHE_FOLDER" -# If there's some code changes that causes this layer to -# invalidate but it shouldn't, use .dockerignore to exclude it -COPY . . -RUN yarn build - -FROM node:18-alpine as app -COPY package.json yarn.lock /action-release/ -# On the builder image, we install both types of dependencies rather than -# just the production ones. This generates /action-release/node_modules -RUN export YARN_CACHE_FOLDER="$(mktemp -d)" \ - && cd /action-release \ - && yarn install --frozen-lockfile --production --quiet \ - && rm -r "$YARN_CACHE_FOLDER" - -# Copy the artifacts from `yarn build` -COPY --from=builder /app/dist /action-release/dist/ -RUN chmod +x /action-release/dist/index.js - -RUN printf '[safe]\n directory = *\n' > /etc/gitconfig - -# XXX: This could probably be replaced with a standard CMD -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] diff --git a/action.yml b/action.yml index 67fbf1bd..ede30e4c 100644 --- a/action.yml +++ b/action.yml @@ -1,6 +1,7 @@ name: 'Sentry Release' description: 'GitHub Action for creating a release on Sentry' author: 'Sentry' + inputs: environment: description: 'Set the environment for this release. E.g. "production" or "staging". Omit to skip adding deploy to release.' @@ -50,9 +51,39 @@ inputs: disable_telemetry: description: 'The action sends telemetry data and crash reports to Sentry. This helps us improve the action. You can turn this off by setting this flag.' required: false + runs: - using: 'docker' - image: 'docker://ghcr.io/getsentry/action-release-image:latest' + using: 'composite' + steps: + - name: Install Sentry CLI v2 + shell: bash + run: yarn add --dev --no-lockfile @sentry/cli@^2.4 + working-directory: ${{ github.action_path }} + + - name: Run Release Action + env: + # Composite actions don't pass the outer action's inputs + # down into these steps, so we have to replicate all inputs to be accessible + # via @actions/core + INPUT_ENVIRONMENT: ${{ inputs.environment }} + INPUT_INJECT: ${{ inputs.inject }} + INPUT_SOURCEMAPS: ${{ inputs.sourcemaps }} + INPUT_DIST: ${{ inputs.dist }} + INPUT_FINALIZE: ${{ inputs.finalize }} + INPUT_IGNORE_MISSING: ${{ inputs.ignore_missing }} + INPUT_IGNORE_EMPTY: ${{ inputs.ignore_empty }} + INPUT_STARTED_AT: ${{ inputs.started_at }} + INPUT_VERSION: ${{ inputs.version }} + INPUT_VERSION_PREFIX: ${{ inputs.version_prefix }} + INPUT_SET_COMMITS: ${{ inputs.set_commits }} + INPUT_PROJECTS: ${{ inputs.projects }} + INPUT_URL_PREFIX: ${{ inputs.url_prefix }} + INPUT_STRIP_COMMON_PREFIX: ${{ inputs.strip_common_prefix }} + INPUT_WORKING_DIRECTORY: ${{ inputs.working_directory }} + INPUT_DISABLE_TELEMETRY: ${{ inputs.disable_telemetry }} + shell: bash + run: yarn start + working-directory: ${{ github.action_path }} branding: icon: 'triangle' color: 'purple' diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 00000000..2563db3e --- /dev/null +++ b/dist/index.js @@ -0,0 +1,123705 @@ +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ 87351: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.issue = exports.issueCommand = void 0; +const os = __importStar(__nccwpck_require__(22037)); +const utils_1 = __nccwpck_require__(5278); +/** + * Commands + * + * Command Format: + * ::name key=value,key=value::message + * + * Examples: + * ::warning::This is the message + * ::set-env name=MY_VAR::some value + */ +function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os.EOL); +} +exports.issueCommand = issueCommand; +function issue(name, message = '') { + issueCommand(name, {}, message); +} +exports.issue = issue; +const CMD_STRING = '::'; +class Command { + constructor(command, properties, message) { + if (!command) { + command = 'missing.command'; + } + this.command = command; + this.properties = properties; + this.message = message; + } + toString() { + let cmdStr = CMD_STRING + this.command; + if (this.properties && Object.keys(this.properties).length > 0) { + cmdStr += ' '; + let first = true; + for (const key in this.properties) { + if (this.properties.hasOwnProperty(key)) { + const val = this.properties[key]; + if (val) { + if (first) { + first = false; + } + else { + cmdStr += ','; + } + cmdStr += `${key}=${escapeProperty(val)}`; + } + } + } + } + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; + return cmdStr; + } +} +function escapeData(s) { + return (0, utils_1.toCommandValue)(s) + .replace(/%/g, '%25') + .replace(/\r/g, '%0D') + .replace(/\n/g, '%0A'); +} +function escapeProperty(s) { + return (0, utils_1.toCommandValue)(s) + .replace(/%/g, '%25') + .replace(/\r/g, '%0D') + .replace(/\n/g, '%0A') + .replace(/:/g, '%3A') + .replace(/,/g, '%2C'); +} +//# sourceMappingURL=command.js.map + +/***/ }), + +/***/ 42186: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.platform = exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = exports.markdownSummary = exports.summary = exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; +const command_1 = __nccwpck_require__(87351); +const file_command_1 = __nccwpck_require__(717); +const utils_1 = __nccwpck_require__(5278); +const os = __importStar(__nccwpck_require__(22037)); +const path = __importStar(__nccwpck_require__(71017)); +const oidc_utils_1 = __nccwpck_require__(98041); +/** + * The code to exit an action + */ +var ExitCode; +(function (ExitCode) { + /** + * A code indicating that the action was successful + */ + ExitCode[ExitCode["Success"] = 0] = "Success"; + /** + * A code indicating that the action was a failure + */ + ExitCode[ExitCode["Failure"] = 1] = "Failure"; +})(ExitCode || (exports.ExitCode = ExitCode = {})); +//----------------------------------------------------------------------- +// Variables +//----------------------------------------------------------------------- +/** + * Sets env variable for this action and future actions in the job + * @param name the name of the variable to set + * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function exportVariable(name, val) { + const convertedVal = (0, utils_1.toCommandValue)(val); + process.env[name] = convertedVal; + const filePath = process.env['GITHUB_ENV'] || ''; + if (filePath) { + return (0, file_command_1.issueFileCommand)('ENV', (0, file_command_1.prepareKeyValueMessage)(name, val)); + } + (0, command_1.issueCommand)('set-env', { name }, convertedVal); +} +exports.exportVariable = exportVariable; +/** + * Registers a secret which will get masked from logs + * @param secret value of the secret + */ +function setSecret(secret) { + (0, command_1.issueCommand)('add-mask', {}, secret); +} +exports.setSecret = setSecret; +/** + * Prepends inputPath to the PATH (for this action and future actions) + * @param inputPath + */ +function addPath(inputPath) { + const filePath = process.env['GITHUB_PATH'] || ''; + if (filePath) { + (0, file_command_1.issueFileCommand)('PATH', inputPath); + } + else { + (0, command_1.issueCommand)('add-path', {}, inputPath); + } + process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; +} +exports.addPath = addPath; +/** + * Gets the value of an input. + * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed. + * Returns an empty string if the value is not defined. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string + */ +function getInput(name, options) { + const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''; + if (options && options.required && !val) { + throw new Error(`Input required and not supplied: ${name}`); + } + if (options && options.trimWhitespace === false) { + return val; + } + return val.trim(); +} +exports.getInput = getInput; +/** + * Gets the values of an multiline input. Each value is also trimmed. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string[] + * + */ +function getMultilineInput(name, options) { + const inputs = getInput(name, options) + .split('\n') + .filter(x => x !== ''); + if (options && options.trimWhitespace === false) { + return inputs; + } + return inputs.map(input => input.trim()); +} +exports.getMultilineInput = getMultilineInput; +/** + * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification. + * Support boolean input list: `true | True | TRUE | false | False | FALSE` . + * The return value is also in boolean type. + * ref: https://yaml.org/spec/1.2/spec.html#id2804923 + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns boolean + */ +function getBooleanInput(name, options) { + const trueValue = ['true', 'True', 'TRUE']; + const falseValue = ['false', 'False', 'FALSE']; + const val = getInput(name, options); + if (trueValue.includes(val)) + return true; + if (falseValue.includes(val)) + return false; + throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` + + `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); +} +exports.getBooleanInput = getBooleanInput; +/** + * Sets the value of an output. + * + * @param name name of the output to set + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function setOutput(name, value) { + const filePath = process.env['GITHUB_OUTPUT'] || ''; + if (filePath) { + return (0, file_command_1.issueFileCommand)('OUTPUT', (0, file_command_1.prepareKeyValueMessage)(name, value)); + } + process.stdout.write(os.EOL); + (0, command_1.issueCommand)('set-output', { name }, (0, utils_1.toCommandValue)(value)); +} +exports.setOutput = setOutput; +/** + * Enables or disables the echoing of commands into stdout for the rest of the step. + * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. + * + */ +function setCommandEcho(enabled) { + (0, command_1.issue)('echo', enabled ? 'on' : 'off'); +} +exports.setCommandEcho = setCommandEcho; +//----------------------------------------------------------------------- +// Results +//----------------------------------------------------------------------- +/** + * Sets the action status to failed. + * When the action exits it will be with an exit code of 1 + * @param message add error issue message + */ +function setFailed(message) { + process.exitCode = ExitCode.Failure; + error(message); +} +exports.setFailed = setFailed; +//----------------------------------------------------------------------- +// Logging Commands +//----------------------------------------------------------------------- +/** + * Gets whether Actions Step Debug is on or not + */ +function isDebug() { + return process.env['RUNNER_DEBUG'] === '1'; +} +exports.isDebug = isDebug; +/** + * Writes debug message to user log + * @param message debug message + */ +function debug(message) { + (0, command_1.issueCommand)('debug', {}, message); +} +exports.debug = debug; +/** + * Adds an error issue + * @param message error issue message. Errors will be converted to string via toString() + * @param properties optional properties to add to the annotation. + */ +function error(message, properties = {}) { + (0, command_1.issueCommand)('error', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); +} +exports.error = error; +/** + * Adds a warning issue + * @param message warning issue message. Errors will be converted to string via toString() + * @param properties optional properties to add to the annotation. + */ +function warning(message, properties = {}) { + (0, command_1.issueCommand)('warning', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); +} +exports.warning = warning; +/** + * Adds a notice issue + * @param message notice issue message. Errors will be converted to string via toString() + * @param properties optional properties to add to the annotation. + */ +function notice(message, properties = {}) { + (0, command_1.issueCommand)('notice', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); +} +exports.notice = notice; +/** + * Writes info to log with console.log. + * @param message info message + */ +function info(message) { + process.stdout.write(message + os.EOL); +} +exports.info = info; +/** + * Begin an output group. + * + * Output until the next `groupEnd` will be foldable in this group + * + * @param name The name of the output group + */ +function startGroup(name) { + (0, command_1.issue)('group', name); +} +exports.startGroup = startGroup; +/** + * End an output group. + */ +function endGroup() { + (0, command_1.issue)('endgroup'); +} +exports.endGroup = endGroup; +/** + * Wrap an asynchronous function call in a group. + * + * Returns the same type as the function itself. + * + * @param name The name of the group + * @param fn The function to wrap in the group + */ +function group(name, fn) { + return __awaiter(this, void 0, void 0, function* () { + startGroup(name); + let result; + try { + result = yield fn(); + } + finally { + endGroup(); + } + return result; + }); +} +exports.group = group; +//----------------------------------------------------------------------- +// Wrapper action state +//----------------------------------------------------------------------- +/** + * Saves state for current action, the state can only be retrieved by this action's post job execution. + * + * @param name name of the state to store + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function saveState(name, value) { + const filePath = process.env['GITHUB_STATE'] || ''; + if (filePath) { + return (0, file_command_1.issueFileCommand)('STATE', (0, file_command_1.prepareKeyValueMessage)(name, value)); + } + (0, command_1.issueCommand)('save-state', { name }, (0, utils_1.toCommandValue)(value)); +} +exports.saveState = saveState; +/** + * Gets the value of an state set by this action's main execution. + * + * @param name name of the state to get + * @returns string + */ +function getState(name) { + return process.env[`STATE_${name}`] || ''; +} +exports.getState = getState; +function getIDToken(aud) { + return __awaiter(this, void 0, void 0, function* () { + return yield oidc_utils_1.OidcClient.getIDToken(aud); + }); +} +exports.getIDToken = getIDToken; +/** + * Summary exports + */ +var summary_1 = __nccwpck_require__(81327); +Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } })); +/** + * @deprecated use core.summary + */ +var summary_2 = __nccwpck_require__(81327); +Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); +/** + * Path exports + */ +var path_utils_1 = __nccwpck_require__(2981); +Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } })); +Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } })); +Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } })); +/** + * Platform utilities exports + */ +exports.platform = __importStar(__nccwpck_require__(85243)); +//# sourceMappingURL=core.js.map + +/***/ }), + +/***/ 717: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +// For internal use, subject to change. +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ +const crypto = __importStar(__nccwpck_require__(6113)); +const fs = __importStar(__nccwpck_require__(57147)); +const os = __importStar(__nccwpck_require__(22037)); +const utils_1 = __nccwpck_require__(5278); +function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); + } + if (!fs.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); + } + fs.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, { + encoding: 'utf8' + }); +} +exports.issueFileCommand = issueFileCommand; +function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + // These should realistically never happen, but just in case someone finds a + // way to exploit uuid generation let's not allow keys or values that contain + // the delimiter. + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); + } + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); + } + return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; +} +exports.prepareKeyValueMessage = prepareKeyValueMessage; +//# sourceMappingURL=file-command.js.map + +/***/ }), + +/***/ 98041: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.OidcClient = void 0; +const http_client_1 = __nccwpck_require__(96255); +const auth_1 = __nccwpck_require__(35526); +const core_1 = __nccwpck_require__(42186); +class OidcClient { + static createHttpClient(allowRetry = true, maxRetry = 10) { + const requestOptions = { + allowRetries: allowRetry, + maxRetries: maxRetry + }; + return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions); + } + static getRequestToken() { + const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN']; + if (!token) { + throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable'); + } + return token; + } + static getIDTokenUrl() { + const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL']; + if (!runtimeUrl) { + throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable'); + } + return runtimeUrl; + } + static getCall(id_token_url) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + const httpclient = OidcClient.createHttpClient(); + const res = yield httpclient + .getJson(id_token_url) + .catch(error => { + throw new Error(`Failed to get ID Token. \n + Error Code : ${error.statusCode}\n + Error Message: ${error.message}`); + }); + const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error('Response json body do not have ID Token field'); + } + return id_token; + }); + } + static getIDToken(audience) { + return __awaiter(this, void 0, void 0, function* () { + try { + // New ID Token is requested from action service + let id_token_url = OidcClient.getIDTokenUrl(); + if (audience) { + const encodedAudience = encodeURIComponent(audience); + id_token_url = `${id_token_url}&audience=${encodedAudience}`; + } + (0, core_1.debug)(`ID token url is ${id_token_url}`); + const id_token = yield OidcClient.getCall(id_token_url); + (0, core_1.setSecret)(id_token); + return id_token; + } + catch (error) { + throw new Error(`Error message: ${error.message}`); + } + }); + } +} +exports.OidcClient = OidcClient; +//# sourceMappingURL=oidc-utils.js.map + +/***/ }), + +/***/ 2981: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; +const path = __importStar(__nccwpck_require__(71017)); +/** + * toPosixPath converts the given path to the posix form. On Windows, \\ will be + * replaced with /. + * + * @param pth. Path to transform. + * @return string Posix path. + */ +function toPosixPath(pth) { + return pth.replace(/[\\]/g, '/'); +} +exports.toPosixPath = toPosixPath; +/** + * toWin32Path converts the given path to the win32 form. On Linux, / will be + * replaced with \\. + * + * @param pth. Path to transform. + * @return string Win32 path. + */ +function toWin32Path(pth) { + return pth.replace(/[/]/g, '\\'); +} +exports.toWin32Path = toWin32Path; +/** + * toPlatformPath converts the given path to a platform-specific path. It does + * this by replacing instances of / and \ with the platform-specific path + * separator. + * + * @param pth The path to platformize. + * @return string The platform-specific path. + */ +function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path.sep); +} +exports.toPlatformPath = toPlatformPath; +//# sourceMappingURL=path-utils.js.map + +/***/ }), + +/***/ 85243: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getDetails = exports.isLinux = exports.isMacOS = exports.isWindows = exports.arch = exports.platform = void 0; +const os_1 = __importDefault(__nccwpck_require__(22037)); +const exec = __importStar(__nccwpck_require__(71514)); +const getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', undefined, { + silent: true + }); + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', undefined, { + silent: true + }); + return { + name: name.trim(), + version: version.trim() + }; +}); +const getMacOsInfo = () => __awaiter(void 0, void 0, void 0, function* () { + var _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput('sw_vers', undefined, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ''; + const name = (_d = (_c = stdout.match(/ProductName:\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : ''; + return { + name, + version + }; +}); +const getLinuxInfo = () => __awaiter(void 0, void 0, void 0, function* () { + const { stdout } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], { + silent: true + }); + const [name, version] = stdout.trim().split('\n'); + return { + name, + version + }; +}); +exports.platform = os_1.default.platform(); +exports.arch = os_1.default.arch(); +exports.isWindows = exports.platform === 'win32'; +exports.isMacOS = exports.platform === 'darwin'; +exports.isLinux = exports.platform === 'linux'; +function getDetails() { + return __awaiter(this, void 0, void 0, function* () { + return Object.assign(Object.assign({}, (yield (exports.isWindows + ? getWindowsInfo() + : exports.isMacOS + ? getMacOsInfo() + : getLinuxInfo()))), { platform: exports.platform, + arch: exports.arch, + isWindows: exports.isWindows, + isMacOS: exports.isMacOS, + isLinux: exports.isLinux }); + }); +} +exports.getDetails = getDetails; +//# sourceMappingURL=platform.js.map + +/***/ }), + +/***/ 81327: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0; +const os_1 = __nccwpck_require__(22037); +const fs_1 = __nccwpck_require__(57147); +const { access, appendFile, writeFile } = fs_1.promises; +exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY'; +exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary'; +class Summary { + constructor() { + this._buffer = ''; + } + /** + * Finds the summary file path from the environment, rejects if env var is not found or file does not exist + * Also checks r/w permissions. + * + * @returns step summary file path + */ + filePath() { + return __awaiter(this, void 0, void 0, function* () { + if (this._filePath) { + return this._filePath; + } + const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR]; + if (!pathFromEnv) { + throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); + } + try { + yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); + } + catch (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + } + this._filePath = pathFromEnv; + return this._filePath; + }); + } + /** + * Wraps content in an HTML tag, adding any HTML attributes + * + * @param {string} tag HTML tag to wrap + * @param {string | null} content content within the tag + * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add + * + * @returns {string} content wrapped in HTML element + */ + wrap(tag, content, attrs = {}) { + const htmlAttrs = Object.entries(attrs) + .map(([key, value]) => ` ${key}="${value}"`) + .join(''); + if (!content) { + return `<${tag}${htmlAttrs}>`; + } + return `<${tag}${htmlAttrs}>${content}`; + } + /** + * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. + * + * @param {SummaryWriteOptions} [options] (optional) options for write operation + * + * @returns {Promise} summary instance + */ + write(options) { + return __awaiter(this, void 0, void 0, function* () { + const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); + const filePath = yield this.filePath(); + const writeFunc = overwrite ? writeFile : appendFile; + yield writeFunc(filePath, this._buffer, { encoding: 'utf8' }); + return this.emptyBuffer(); + }); + } + /** + * Clears the summary buffer and wipes the summary file + * + * @returns {Summary} summary instance + */ + clear() { + return __awaiter(this, void 0, void 0, function* () { + return this.emptyBuffer().write({ overwrite: true }); + }); + } + /** + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer + */ + stringify() { + return this._buffer; + } + /** + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty + */ + isEmptyBuffer() { + return this._buffer.length === 0; + } + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ''; + return this; + } + /** + * Adds raw text to the summary buffer + * + * @param {string} text content to add + * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) + * + * @returns {Summary} summary instance + */ + addRaw(text, addEOL = false) { + this._buffer += text; + return addEOL ? this.addEOL() : this; + } + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); + } + /** + * Adds an HTML codeblock to the summary buffer + * + * @param {string} code content to render within fenced code block + * @param {string} lang (optional) language to syntax highlight code + * + * @returns {Summary} summary instance + */ + addCodeBlock(code, lang) { + const attrs = Object.assign({}, (lang && { lang })); + const element = this.wrap('pre', this.wrap('code', code), attrs); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML list to the summary buffer + * + * @param {string[]} items list of items to render + * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) + * + * @returns {Summary} summary instance + */ + addList(items, ordered = false) { + const tag = ordered ? 'ol' : 'ul'; + const listItems = items.map(item => this.wrap('li', item)).join(''); + const element = this.wrap(tag, listItems); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML table to the summary buffer + * + * @param {SummaryTableCell[]} rows table rows + * + * @returns {Summary} summary instance + */ + addTable(rows) { + const tableBody = rows + .map(row => { + const cells = row + .map(cell => { + if (typeof cell === 'string') { + return this.wrap('td', cell); + } + const { header, data, colspan, rowspan } = cell; + const tag = header ? 'th' : 'td'; + const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan })); + return this.wrap(tag, data, attrs); + }) + .join(''); + return this.wrap('tr', cells); + }) + .join(''); + const element = this.wrap('table', tableBody); + return this.addRaw(element).addEOL(); + } + /** + * Adds a collapsable HTML details element to the summary buffer + * + * @param {string} label text for the closed state + * @param {string} content collapsable content + * + * @returns {Summary} summary instance + */ + addDetails(label, content) { + const element = this.wrap('details', this.wrap('summary', label) + content); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML image tag to the summary buffer + * + * @param {string} src path to the image you to embed + * @param {string} alt text description of the image + * @param {SummaryImageOptions} options (optional) addition image attributes + * + * @returns {Summary} summary instance + */ + addImage(src, alt, options) { + const { width, height } = options || {}; + const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height })); + const element = this.wrap('img', null, Object.assign({ src, alt }, attrs)); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML section heading element + * + * @param {string} text heading text + * @param {number | string} [level=1] (optional) the heading level, default: 1 + * + * @returns {Summary} summary instance + */ + addHeading(text, level) { + const tag = `h${level}`; + const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag) + ? tag + : 'h1'; + const element = this.wrap(allowedTag, text); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML thematic break (
) to the summary buffer + * + * @returns {Summary} summary instance + */ + addSeparator() { + const element = this.wrap('hr', null); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML line break (
) to the summary buffer + * + * @returns {Summary} summary instance + */ + addBreak() { + const element = this.wrap('br', null); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML blockquote to the summary buffer + * + * @param {string} text quote text + * @param {string} cite (optional) citation url + * + * @returns {Summary} summary instance + */ + addQuote(text, cite) { + const attrs = Object.assign({}, (cite && { cite })); + const element = this.wrap('blockquote', text, attrs); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML anchor tag to the summary buffer + * + * @param {string} text link text/content + * @param {string} href hyperlink + * + * @returns {Summary} summary instance + */ + addLink(text, href) { + const element = this.wrap('a', text, { href }); + return this.addRaw(element).addEOL(); + } +} +const _summary = new Summary(); +/** + * @deprecated use `core.summary` + */ +exports.markdownSummary = _summary; +exports.summary = _summary; +//# sourceMappingURL=summary.js.map + +/***/ }), + +/***/ 5278: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toCommandProperties = exports.toCommandValue = void 0; +/** + * Sanitizes an input into a string so it can be passed into issueCommand safely + * @param input input to sanitize into a string + */ +function toCommandValue(input) { + if (input === null || input === undefined) { + return ''; + } + else if (typeof input === 'string' || input instanceof String) { + return input; + } + return JSON.stringify(input); +} +exports.toCommandValue = toCommandValue; +/** + * + * @param annotationProperties + * @returns The command properties to send with the actual annotation command + * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646 + */ +function toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) { + return {}; + } + return { + title: annotationProperties.title, + file: annotationProperties.file, + line: annotationProperties.startLine, + endLine: annotationProperties.endLine, + col: annotationProperties.startColumn, + endColumn: annotationProperties.endColumn + }; +} +exports.toCommandProperties = toCommandProperties; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 71514: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getExecOutput = exports.exec = void 0; +const string_decoder_1 = __nccwpck_require__(71576); +const tr = __importStar(__nccwpck_require__(88159)); +/** + * Exec a command. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code + */ +function exec(commandLine, args, options) { + return __awaiter(this, void 0, void 0, function* () { + const commandArgs = tr.argStringToArray(commandLine); + if (commandArgs.length === 0) { + throw new Error(`Parameter 'commandLine' cannot be null or empty.`); + } + // Path to tool to execute should be first arg + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); + }); +} +exports.exec = exec; +/** + * Exec a command and get the output. + * Output will be streamed to the live console. + * Returns promise with the exit code and collected stdout and stderr + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code, stdout, and stderr + */ +function getExecOutput(commandLine, args, options) { + var _a, _b; + return __awaiter(this, void 0, void 0, function* () { + let stdout = ''; + let stderr = ''; + //Using string decoder covers the case where a mult-byte character is split + const stdoutDecoder = new string_decoder_1.StringDecoder('utf8'); + const stderrDecoder = new string_decoder_1.StringDecoder('utf8'); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout; + const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr; + const stdErrListener = (data) => { + stderr += stderrDecoder.write(data); + if (originalStdErrListener) { + originalStdErrListener(data); + } + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); + } + }; + const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + //flush any remaining characters + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; + }); +} +exports.getExecOutput = getExecOutput; +//# sourceMappingURL=exec.js.map + +/***/ }), + +/***/ 88159: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.argStringToArray = exports.ToolRunner = void 0; +const os = __importStar(__nccwpck_require__(22037)); +const events = __importStar(__nccwpck_require__(82361)); +const child = __importStar(__nccwpck_require__(32081)); +const path = __importStar(__nccwpck_require__(71017)); +const io = __importStar(__nccwpck_require__(47351)); +const ioUtil = __importStar(__nccwpck_require__(81962)); +const timers_1 = __nccwpck_require__(39512); +/* eslint-disable @typescript-eslint/unbound-method */ +const IS_WINDOWS = process.platform === 'win32'; +/* + * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. + */ +class ToolRunner extends events.EventEmitter { + constructor(toolPath, args, options) { + super(); + if (!toolPath) { + throw new Error("Parameter 'toolPath' cannot be null or empty."); + } + this.toolPath = toolPath; + this.args = args || []; + this.options = options || {}; + } + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } + } + _getCommandString(options, noPrefix) { + const toolPath = this._getSpawnFileName(); + const args = this._getSpawnArgs(options); + let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool + if (IS_WINDOWS) { + // Windows + cmd file + if (this._isCmdFile()) { + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } + // Windows + verbatim + else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; + } + } + // Windows (regular) + else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; + } + } + } + else { + // OSX/Linux - this can likely be improved with some form of quoting. + // creating processes on Unix is fundamentally different than Windows. + // on Unix, execvp() takes an arg array. + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } + return cmd; + } + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + // the rest of the string ... + s = s.substring(n + os.EOL.length); + n = s.indexOf(os.EOL); + } + return s; + } + catch (err) { + // streaming lines to console is best effort. Don't fail a build. + this._debug(`error processing line. Failed with error ${err}`); + return ''; + } + } + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env['COMSPEC'] || 'cmd.exe'; + } + } + return this.toolPath; + } + _getSpawnArgs(options) { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; + for (const a of this.args) { + argline += ' '; + argline += options.windowsVerbatimArguments + ? a + : this._windowsQuoteCmdArg(a); + } + argline += '"'; + return [argline]; + } + } + return this.args; + } + _endsWith(str, end) { + return str.endsWith(end); + } + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return (this._endsWith(upperToolPath, '.CMD') || + this._endsWith(upperToolPath, '.BAT')); + } + _windowsQuoteCmdArg(arg) { + // for .exe, apply the normal quoting rules that libuv applies + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); + } + // otherwise apply quoting rules specific to the cmd.exe command line parser. + // the libuv rules are generic and are not designed specifically for cmd.exe + // command line parser. + // + // for a detailed description of the cmd.exe command line parser, refer to + // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 + // need quotes for empty arg + if (!arg) { + return '""'; + } + // determine whether the arg needs to be quoted + const cmdSpecialChars = [ + ' ', + '\t', + '&', + '(', + ')', + '[', + ']', + '{', + '}', + '^', + '=', + ';', + '!', + "'", + '+', + ',', + '`', + '~', + '|', + '<', + '>', + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some(x => x === char)) { + needsQuotes = true; + break; + } + } + // short-circuit if quotes not needed + if (!needsQuotes) { + return arg; + } + // the following quoting rules are very similar to the rules that by libuv applies. + // + // 1) wrap the string in quotes + // + // 2) double-up quotes - i.e. " => "" + // + // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately + // doesn't work well with a cmd.exe command line. + // + // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. + // for example, the command line: + // foo.exe "myarg:""my val""" + // is parsed by a .NET console app into an arg array: + // [ "myarg:\"my val\"" ] + // which is the same end result when applying libuv quoting rules. although the actual + // command line from libuv quoting rules would look like: + // foo.exe "myarg:\"my val\"" + // + // 3) double-up slashes that precede a quote, + // e.g. hello \world => "hello \world" + // hello\"world => "hello\\""world" + // hello\\"world => "hello\\\\""world" + // hello world\ => "hello world\\" + // + // technically this is not required for a cmd.exe command line, or the batch argument parser. + // the reasons for including this as a .cmd quoting rule are: + // + // a) this is optimized for the scenario where the argument is passed from the .cmd file to an + // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. + // + // b) it's what we've been doing previously (by deferring to node default behavior) and we + // haven't heard any complaints about that aspect. + // + // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be + // escaped when used on the command line directly - even though within a .cmd file % can be escaped + // by using %%. + // + // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts + // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. + // + // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would + // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the + // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args + // to an external program. + // + // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. + // % can be escaped within a .cmd file. + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + // walk the string in reverse + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === '\\') { + reverse += '\\'; // double the slash + } + else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '"'; // double the quote + } + else { + quoteHit = false; + } + } + reverse += '"'; + return reverse + .split('') + .reverse() + .join(''); + } + _uvQuoteCmdArg(arg) { + // Tool runner wraps child_process.spawn() and needs to apply the same quoting as + // Node in certain cases where the undocumented spawn option windowsVerbatimArguments + // is used. + // + // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, + // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), + // pasting copyright notice from Node within this function: + // + // Copyright Joyent, Inc. and other Node contributors. All rights reserved. + // + // Permission is hereby granted, free of charge, to any person obtaining a copy + // of this software and associated documentation files (the "Software"), to + // deal in the Software without restriction, including without limitation the + // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + // sell copies of the Software, and to permit persons to whom the Software is + // furnished to do so, subject to the following conditions: + // + // The above copyright notice and this permission notice shall be included in + // all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + // IN THE SOFTWARE. + if (!arg) { + // Need double quotation for empty argument + return '""'; + } + if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { + // No quotation needed + return arg; + } + if (!arg.includes('"') && !arg.includes('\\')) { + // No embedded double quotes or backslashes, so I can just wrap + // quote marks around the whole thing. + return `"${arg}"`; + } + // Expected input/output: + // input : hello"world + // output: "hello\"world" + // input : hello""world + // output: "hello\"\"world" + // input : hello\world + // output: hello\world + // input : hello\\world + // output: hello\\world + // input : hello\"world + // output: "hello\\\"world" + // input : hello\\"world + // output: "hello\\\\\"world" + // input : hello world\ + // output: "hello world\\" - note the comment in libuv actually reads "hello world\" + // but it appears the comment is wrong, it should be "hello world\\" + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + // walk the string in reverse + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === '\\') { + reverse += '\\'; + } + else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '\\'; + } + else { + quoteHit = false; + } + } + reverse += '"'; + return reverse + .split('') + .reverse() + .join(''); + } + _cloneExecOptions(options) { + options = options || {}; + const result = { + cwd: options.cwd || process.cwd(), + env: options.env || process.env, + silent: options.silent || false, + windowsVerbatimArguments: options.windowsVerbatimArguments || false, + failOnStdErr: options.failOnStdErr || false, + ignoreReturnCode: options.ignoreReturnCode || false, + delay: options.delay || 10000 + }; + result.outStream = options.outStream || process.stdout; + result.errStream = options.errStream || process.stderr; + return result; + } + _getSpawnOptions(options, toolPath) { + options = options || {}; + const result = {}; + result.cwd = options.cwd; + result.env = options.env; + result['windowsVerbatimArguments'] = + options.windowsVerbatimArguments || this._isCmdFile(); + if (options.windowsVerbatimArguments) { + result.argv0 = `"${toolPath}"`; + } + return result; + } + /** + * Exec a tool. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param tool path to tool to exec + * @param options optional exec options. See ExecOptions + * @returns number + */ + exec() { + return __awaiter(this, void 0, void 0, function* () { + // root the tool path if it is unrooted and contains relative pathing + if (!ioUtil.isRooted(this.toolPath) && + (this.toolPath.includes('/') || + (IS_WINDOWS && this.toolPath.includes('\\')))) { + // prefer options.cwd if it is specified, however options.cwd may also need to be rooted + this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + // if the tool is only a file name, then resolve it from the PATH + // otherwise verify it exists (add extension on Windows if necessary) + this.toolPath = yield io.which(this.toolPath, true); + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + this._debug(`exec tool: ${this.toolPath}`); + this._debug('arguments:'); + for (const arg of this.args) { + this._debug(` ${arg}`); + } + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); + } + const state = new ExecState(optionsNonNull, this.toolPath); + state.on('debug', (message) => { + this._debug(message); + }); + if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) { + return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`)); + } + const fileName = this._getSpawnFileName(); + const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); + let stdbuffer = ''; + if (cp.stdout) { + cp.stdout.on('data', (data) => { + if (this.options.listeners && this.options.listeners.stdout) { + this.options.listeners.stdout(data); + } + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(data); + } + stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => { + if (this.options.listeners && this.options.listeners.stdline) { + this.options.listeners.stdline(line); + } + }); + }); + } + let errbuffer = ''; + if (cp.stderr) { + cp.stderr.on('data', (data) => { + state.processStderr = true; + if (this.options.listeners && this.options.listeners.stderr) { + this.options.listeners.stderr(data); + } + if (!optionsNonNull.silent && + optionsNonNull.errStream && + optionsNonNull.outStream) { + const s = optionsNonNull.failOnStdErr + ? optionsNonNull.errStream + : optionsNonNull.outStream; + s.write(data); + } + errbuffer = this._processLineBuffer(data, errbuffer, (line) => { + if (this.options.listeners && this.options.listeners.errline) { + this.options.listeners.errline(line); + } + }); + }); + } + cp.on('error', (err) => { + state.processError = err.message; + state.processExited = true; + state.processClosed = true; + state.CheckComplete(); + }); + cp.on('exit', (code) => { + state.processExitCode = code; + state.processExited = true; + this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); + state.CheckComplete(); + }); + cp.on('close', (code) => { + state.processExitCode = code; + state.processExited = true; + state.processClosed = true; + this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); + state.CheckComplete(); + }); + state.on('done', (error, exitCode) => { + if (stdbuffer.length > 0) { + this.emit('stdline', stdbuffer); + } + if (errbuffer.length > 0) { + this.emit('errline', errbuffer); + } + cp.removeAllListeners(); + if (error) { + reject(error); + } + else { + resolve(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error('child process missing stdin'); + } + cp.stdin.end(this.options.input); + } + })); + }); + } +} +exports.ToolRunner = ToolRunner; +/** + * Convert an arg string to an array of args. Handles escaping + * + * @param argString string of arguments + * @returns string[] array of arguments + */ +function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ''; + function append(c) { + // we only escape double quotes. + if (escaped && c !== '"') { + arg += '\\'; + } + arg += c; + escaped = false; + } + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } + else { + append(c); + } + continue; + } + if (c === '\\' && escaped) { + append(c); + continue; + } + if (c === '\\' && inQuotes) { + escaped = true; + continue; + } + if (c === ' ' && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ''; + } + continue; + } + append(c); + } + if (arg.length > 0) { + args.push(arg.trim()); + } + return args; +} +exports.argStringToArray = argStringToArray; +class ExecState extends events.EventEmitter { + constructor(options, toolPath) { + super(); + this.processClosed = false; // tracks whether the process has exited and stdio is closed + this.processError = ''; + this.processExitCode = 0; + this.processExited = false; // tracks whether the process has exited + this.processStderr = false; // tracks whether stderr was written to + this.delay = 10000; // 10 seconds + this.done = false; + this.timeout = null; + if (!toolPath) { + throw new Error('toolPath must not be empty'); + } + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; + } + } + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } + else if (this.processExited) { + this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this); + } + } + _debug(message) { + this.emit('debug', message); + } + _setResult() { + // determine whether there is an error + let error; + if (this.processExited) { + if (this.processError) { + error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); + } + else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { + error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + } + else if (this.processStderr && this.options.failOnStdErr) { + error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + } + } + // clear the timeout + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; + } + this.done = true; + this.emit('done', error, this.processExitCode); + } + static HandleTimeout(state) { + if (state.done) { + return; + } + if (!state.processClosed && state.processExited) { + const message = `The STDIO streams did not close within ${state.delay / + 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; + state._debug(message); + } + state._setResult(); + } +} +//# sourceMappingURL=toolrunner.js.map + +/***/ }), + +/***/ 35526: +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0; +class BasicCredentialHandler { + constructor(username, password) { + this.username = username; + this.password = password; + } + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); + }); + } +} +exports.BasicCredentialHandler = BasicCredentialHandler; +class BearerCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Bearer ${this.token}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); + }); + } +} +exports.BearerCredentialHandler = BearerCredentialHandler; +class PersonalAccessTokenCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); + }); + } +} +exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; +//# sourceMappingURL=auth.js.map + +/***/ }), + +/***/ 96255: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* eslint-disable @typescript-eslint/no-explicit-any */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; +const http = __importStar(__nccwpck_require__(13685)); +const https = __importStar(__nccwpck_require__(95687)); +const pm = __importStar(__nccwpck_require__(19835)); +const tunnel = __importStar(__nccwpck_require__(74294)); +const undici_1 = __nccwpck_require__(41773); +var HttpCodes; +(function (HttpCodes) { + HttpCodes[HttpCodes["OK"] = 200] = "OK"; + HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; + HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; + HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; + HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; + HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; + HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; + HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; + HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; + HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; + HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; + HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; + HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; + HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; + HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; + HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; + HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; + HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; + HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; + HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; + HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; + HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; + HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; + HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; + HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; + HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; + HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; +})(HttpCodes || (exports.HttpCodes = HttpCodes = {})); +var Headers; +(function (Headers) { + Headers["Accept"] = "accept"; + Headers["ContentType"] = "content-type"; +})(Headers || (exports.Headers = Headers = {})); +var MediaTypes; +(function (MediaTypes) { + MediaTypes["ApplicationJson"] = "application/json"; +})(MediaTypes || (exports.MediaTypes = MediaTypes = {})); +/** + * Returns the proxy URL, depending upon the supplied url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ +function getProxyUrl(serverUrl) { + const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); + return proxyUrl ? proxyUrl.href : ''; +} +exports.getProxyUrl = getProxyUrl; +const HttpRedirectCodes = [ + HttpCodes.MovedPermanently, + HttpCodes.ResourceMoved, + HttpCodes.SeeOther, + HttpCodes.TemporaryRedirect, + HttpCodes.PermanentRedirect +]; +const HttpResponseRetryCodes = [ + HttpCodes.BadGateway, + HttpCodes.ServiceUnavailable, + HttpCodes.GatewayTimeout +]; +const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; +const ExponentialBackoffCeiling = 10; +const ExponentialBackoffTimeSlice = 5; +class HttpClientError extends Error { + constructor(message, statusCode) { + super(message); + this.name = 'HttpClientError'; + this.statusCode = statusCode; + Object.setPrototypeOf(this, HttpClientError.prototype); + } +} +exports.HttpClientError = HttpClientError; +class HttpClientResponse { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { + let output = Buffer.alloc(0); + this.message.on('data', (chunk) => { + output = Buffer.concat([output, chunk]); + }); + this.message.on('end', () => { + resolve(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { + const chunks = []; + this.message.on('data', (chunk) => { + chunks.push(chunk); + }); + this.message.on('end', () => { + resolve(Buffer.concat(chunks)); + }); + })); + }); + } +} +exports.HttpClientResponse = HttpClientResponse; +function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === 'https:'; +} +exports.isHttps = isHttps; +class HttpClient { + constructor(userAgent, handlers, requestOptions) { + this._ignoreSslError = false; + this._allowRedirects = true; + this._allowRedirectDowngrade = false; + this._maxRedirects = 50; + this._allowRetries = false; + this._maxRetries = 1; + this._keepAlive = false; + this._disposed = false; + this.userAgent = userAgent; + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; + } + this._socketTimeout = requestOptions.socketTimeout; + if (requestOptions.allowRedirects != null) { + this._allowRedirects = requestOptions.allowRedirects; + } + if (requestOptions.allowRedirectDowngrade != null) { + this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; + } + if (requestOptions.maxRedirects != null) { + this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + } + if (requestOptions.keepAlive != null) { + this._keepAlive = requestOptions.keepAlive; + } + if (requestOptions.allowRetries != null) { + this._allowRetries = requestOptions.allowRetries; + } + if (requestOptions.maxRetries != null) { + this._maxRetries = requestOptions.maxRetries; + } + } + } + options(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); + }); + } + get(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('GET', requestUrl, null, additionalHeaders || {}); + }); + } + del(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('DELETE', requestUrl, null, additionalHeaders || {}); + }); + } + post(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('POST', requestUrl, data, additionalHeaders || {}); + }); + } + patch(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('PATCH', requestUrl, data, additionalHeaders || {}); + }); + } + put(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('PUT', requestUrl, data, additionalHeaders || {}); + }); + } + head(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('HEAD', requestUrl, null, additionalHeaders || {}); + }); + } + sendStream(verb, requestUrl, stream, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, additionalHeaders); + }); + } + /** + * Gets a typed object from an endpoint + * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise + */ + getJson(requestUrl, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + const res = yield this.get(requestUrl, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + postJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.post(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + putJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.put(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + patchJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.patch(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + /** + * Makes a raw http request. + * All other methods such as get, post, patch, and request ultimately call this. + * Prefer get, del, post and patch + */ + request(verb, requestUrl, data, headers) { + return __awaiter(this, void 0, void 0, function* () { + if (this._disposed) { + throw new Error('Client has already been disposed.'); + } + const parsedUrl = new URL(requestUrl); + let info = this._prepareRequest(verb, parsedUrl, headers); + // Only perform retries on reads since writes may not be idempotent. + const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) + ? this._maxRetries + 1 + : 1; + let numTries = 0; + let response; + do { + response = yield this.requestRaw(info, data); + // Check if it's an authentication challenge + if (response && + response.message && + response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info, data); + } + else { + // We have received an unauthorized response but have no handlers to handle it. + // Let the response return to the caller. + return response; + } + } + let redirectsRemaining = this._maxRedirects; + while (response.message.statusCode && + HttpRedirectCodes.includes(response.message.statusCode) && + this._allowRedirects && + redirectsRemaining > 0) { + const redirectUrl = response.message.headers['location']; + if (!redirectUrl) { + // if there's no location to redirect to, we won't + break; + } + const parsedRedirectUrl = new URL(redirectUrl); + if (parsedUrl.protocol === 'https:' && + parsedUrl.protocol !== parsedRedirectUrl.protocol && + !this._allowRedirectDowngrade) { + throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); + } + // we need to finish reading the response before reassigning response + // which will leak the open socket. + yield response.readBody(); + // strip authorization header if redirected to a different hostname + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (const header in headers) { + // header names are case insensitive + if (header.toLowerCase() === 'authorization') { + delete headers[header]; + } + } + } + // let's make the request with the new redirectUrl + info = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info, data); + redirectsRemaining--; + } + if (!response.message.statusCode || + !HttpResponseRetryCodes.includes(response.message.statusCode)) { + // If not a retry code, return immediately instead of retrying + return response; + } + numTries += 1; + if (numTries < maxTries) { + yield response.readBody(); + yield this._performExponentialBackoff(numTries); + } + } while (numTries < maxTries); + return response; + }); + } + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); + } + this._disposed = true; + } + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info, data) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } + else if (!res) { + // If `err` is not passed, then `res` must be passed. + reject(new Error('Unknown error')); + } + else { + resolve(res); + } + } + this.requestRawWithCallback(info, data, callbackForResult); + }); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info, data, onResult) { + if (typeof data === 'string') { + if (!info.options.headers) { + info.options.headers = {}; + } + info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info.httpModule.request(info.options, (msg) => { + const res = new HttpClientResponse(msg); + handleResult(undefined, res); + }); + let socket; + req.on('socket', sock => { + socket = sock; + }); + // If we ever get disconnected, we want the socket to timeout eventually + req.setTimeout(this._socketTimeout || 3 * 60000, () => { + if (socket) { + socket.end(); + } + handleResult(new Error(`Request timeout: ${info.options.path}`)); + }); + req.on('error', function (err) { + // err has statusCode property + // res should have headers + handleResult(err); + }); + if (data && typeof data === 'string') { + req.write(data, 'utf8'); + } + if (data && typeof data !== 'string') { + data.on('close', function () { + req.end(); + }); + data.pipe(req); + } + else { + req.end(); + } + } + /** + * Gets an http agent. This function is useful when you need an http agent that handles + * routing through a proxy server - depending upon the url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ + getAgent(serverUrl) { + const parsedUrl = new URL(serverUrl); + return this._getAgent(parsedUrl); + } + getAgentDispatcher(serverUrl) { + const parsedUrl = new URL(serverUrl); + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (!useProxy) { + return; + } + return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); + } + _prepareRequest(method, requestUrl, headers) { + const info = {}; + info.parsedUrl = requestUrl; + const usingSsl = info.parsedUrl.protocol === 'https:'; + info.httpModule = usingSsl ? https : http; + const defaultPort = usingSsl ? 443 : 80; + info.options = {}; + info.options.host = info.parsedUrl.hostname; + info.options.port = info.parsedUrl.port + ? parseInt(info.parsedUrl.port) + : defaultPort; + info.options.path = + (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); + info.options.method = method; + info.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info.options.headers['user-agent'] = this.userAgent; + } + info.options.agent = this._getAgent(info.parsedUrl); + // gives handlers an opportunity to participate + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info.options); + } + } + return info; + } + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default; + } + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; + } + if (this._keepAlive && !useProxy) { + agent = this._agent; + } + // if agent is already assigned use that agent. + if (agent) { + return agent; + } + const usingSsl = parsedUrl.protocol === 'https:'; + let maxSockets = 100; + if (this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + } + // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis. + if (proxyUrl && proxyUrl.hostname) { + const agentOptions = { + maxSockets, + keepAlive: this._keepAlive, + proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && { + proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` + })), { host: proxyUrl.hostname, port: proxyUrl.port }) + }; + let tunnelAgent; + const overHttps = proxyUrl.protocol === 'https:'; + if (usingSsl) { + tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; + } + else { + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; + } + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + // if reusing agent across request and tunneling agent isn't assigned create a new agent + if (this._keepAlive && !agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https.Agent(options) : new http.Agent(options); + this._agent = agent; + } + // if not using private agent and tunnel agent isn't setup then use global agent + if (!agent) { + agent = usingSsl ? https.globalAgent : http.globalAgent; + } + if (usingSsl && this._ignoreSslError) { + // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process + // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options + // we have to cast it to any and change it directly + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false + }); + } + return agent; + } + _getProxyAgentDispatcher(parsedUrl, proxyUrl) { + let proxyAgent; + if (this._keepAlive) { + proxyAgent = this._proxyAgentDispatcher; + } + // if agent is already assigned use that agent. + if (proxyAgent) { + return proxyAgent; + } + const usingSsl = parsedUrl.protocol === 'https:'; + proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && { + token: `${proxyUrl.username}:${proxyUrl.password}` + }))); + this._proxyAgentDispatcher = proxyAgent; + if (usingSsl && this._ignoreSslError) { + // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process + // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options + // we have to cast it to any and change it directly + proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, { + rejectUnauthorized: false + }); + } + return proxyAgent; + } + _performExponentialBackoff(retryNumber) { + return __awaiter(this, void 0, void 0, function* () { + retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); + const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); + return new Promise(resolve => setTimeout(() => resolve(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + // not found leads to null obj returned + if (statusCode === HttpCodes.NotFound) { + resolve(response); + } + // get the result from the body + function dateTimeDeserializer(key, value) { + if (typeof value === 'string') { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; + } + let obj; + let contents; + try { + contents = yield res.readBody(); + if (contents && contents.length > 0) { + if (options && options.deserializeDates) { + obj = JSON.parse(contents, dateTimeDeserializer); + } + else { + obj = JSON.parse(contents); + } + response.result = obj; + } + response.headers = res.message.headers; + } + catch (err) { + // Invalid resource (contents not json); leaving result obj null + } + // note that 3xx redirects are handled by the http layer. + if (statusCode > 299) { + let msg; + // if exception/error in body, attempt to get better error + if (obj && obj.message) { + msg = obj.message; + } + else if (contents && contents.length > 0) { + // it may be the case that the exception is in the body message as string + msg = contents; + } + else { + msg = `Failed request: (${statusCode})`; + } + const err = new HttpClientError(msg, statusCode); + err.result = response.result; + reject(err); + } + else { + resolve(response); + } + })); + }); + } +} +exports.HttpClient = HttpClient; +const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 19835: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.checkBypass = exports.getProxyUrl = void 0; +function getProxyUrl(reqUrl) { + const usingSsl = reqUrl.protocol === 'https:'; + if (checkBypass(reqUrl)) { + return undefined; + } + const proxyVar = (() => { + if (usingSsl) { + return process.env['https_proxy'] || process.env['HTTPS_PROXY']; + } + else { + return process.env['http_proxy'] || process.env['HTTP_PROXY']; + } + })(); + if (proxyVar) { + try { + return new URL(proxyVar); + } + catch (_a) { + if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) + return new URL(`http://${proxyVar}`); + } + } + else { + return undefined; + } +} +exports.getProxyUrl = getProxyUrl; +function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; + } + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; + } + const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; + if (!noProxy) { + return false; + } + // Determine the request port + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } + else if (reqUrl.protocol === 'http:') { + reqPort = 80; + } + else if (reqUrl.protocol === 'https:') { + reqPort = 443; + } + // Format the request hostname and hostname with port + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === 'number') { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + } + // Compare request host against noproxy + for (const upperNoProxyItem of noProxy + .split(',') + .map(x => x.trim().toUpperCase()) + .filter(x => x)) { + if (upperNoProxyItem === '*' || + upperReqHosts.some(x => x === upperNoProxyItem || + x.endsWith(`.${upperNoProxyItem}`) || + (upperNoProxyItem.startsWith('.') && + x.endsWith(`${upperNoProxyItem}`)))) { + return true; + } + } + return false; +} +exports.checkBypass = checkBypass; +function isLoopbackAddress(host) { + const hostLower = host.toLowerCase(); + return (hostLower === 'localhost' || + hostLower.startsWith('127.') || + hostLower.startsWith('[::1]') || + hostLower.startsWith('[0:0:0:0:0:0:0:1]')); +} +//# sourceMappingURL=proxy.js.map + +/***/ }), + +/***/ 81962: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var _a; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; +const fs = __importStar(__nccwpck_require__(57147)); +const path = __importStar(__nccwpck_require__(71017)); +_a = fs.promises +// export const {open} = 'fs' +, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; +// export const {open} = 'fs' +exports.IS_WINDOWS = process.platform === 'win32'; +// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691 +exports.UV_FS_O_EXLOCK = 0x10000000; +exports.READONLY = fs.constants.O_RDONLY; +function exists(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + try { + yield exports.stat(fsPath); + } + catch (err) { + if (err.code === 'ENOENT') { + return false; + } + throw err; + } + return true; + }); +} +exports.exists = exists; +function isDirectory(fsPath, useStat = false) { + return __awaiter(this, void 0, void 0, function* () { + const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath); + return stats.isDirectory(); + }); +} +exports.isDirectory = isDirectory; +/** + * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: + * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). + */ +function isRooted(p) { + p = normalizeSeparators(p); + if (!p) { + throw new Error('isRooted() parameter "p" cannot be empty'); + } + if (exports.IS_WINDOWS) { + return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello + ); // e.g. C: or C:\hello + } + return p.startsWith('/'); +} +exports.isRooted = isRooted; +/** + * Best effort attempt to determine whether a file exists and is executable. + * @param filePath file path to check + * @param extensions additional file extensions to try + * @return if file exists and is executable, returns the file path. otherwise empty string. + */ +function tryGetExecutablePath(filePath, extensions) { + return __awaiter(this, void 0, void 0, function* () { + let stats = undefined; + try { + // test file exists + stats = yield exports.stat(filePath); + } + catch (err) { + if (err.code !== 'ENOENT') { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } + } + if (stats && stats.isFile()) { + if (exports.IS_WINDOWS) { + // on Windows, test for valid extension + const upperExt = path.extname(filePath).toUpperCase(); + if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) { + return filePath; + } + } + else { + if (isUnixExecutable(stats)) { + return filePath; + } + } + } + // try each extension + const originalFilePath = filePath; + for (const extension of extensions) { + filePath = originalFilePath + extension; + stats = undefined; + try { + stats = yield exports.stat(filePath); + } + catch (err) { + if (err.code !== 'ENOENT') { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } + } + if (stats && stats.isFile()) { + if (exports.IS_WINDOWS) { + // preserve the case of the actual file (since an extension was appended) + try { + const directory = path.dirname(filePath); + const upperName = path.basename(filePath).toUpperCase(); + for (const actualName of yield exports.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path.join(directory, actualName); + break; + } + } + } + catch (err) { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); + } + return filePath; + } + else { + if (isUnixExecutable(stats)) { + return filePath; + } + } + } + } + return ''; + }); +} +exports.tryGetExecutablePath = tryGetExecutablePath; +function normalizeSeparators(p) { + p = p || ''; + if (exports.IS_WINDOWS) { + // convert slashes on Windows + p = p.replace(/\//g, '\\'); + // remove redundant slashes + return p.replace(/\\\\+/g, '\\'); + } + // remove redundant slashes + return p.replace(/\/\/+/g, '/'); +} +// on Mac/Linux, test the execute bit +// R W X R W X R W X +// 256 128 64 32 16 8 4 2 1 +function isUnixExecutable(stats) { + return ((stats.mode & 1) > 0 || + ((stats.mode & 8) > 0 && stats.gid === process.getgid()) || + ((stats.mode & 64) > 0 && stats.uid === process.getuid())); +} +// Get the path of cmd.exe in windows +function getCmdPath() { + var _a; + return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`; +} +exports.getCmdPath = getCmdPath; +//# sourceMappingURL=io-util.js.map + +/***/ }), + +/***/ 47351: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; +const assert_1 = __nccwpck_require__(39491); +const path = __importStar(__nccwpck_require__(71017)); +const ioUtil = __importStar(__nccwpck_require__(81962)); +/** + * Copies a file or folder. + * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js + * + * @param source source path + * @param dest destination path + * @param options optional. See CopyOptions. + */ +function cp(source, dest, options = {}) { + return __awaiter(this, void 0, void 0, function* () { + const { force, recursive, copySourceDirectory } = readCopyOptions(options); + const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; + // Dest is an existing file, but not forcing + if (destStat && destStat.isFile() && !force) { + return; + } + // If dest is an existing directory, should copy inside. + const newDest = destStat && destStat.isDirectory() && copySourceDirectory + ? path.join(dest, path.basename(source)) + : dest; + if (!(yield ioUtil.exists(source))) { + throw new Error(`no such file or directory: ${source}`); + } + const sourceStat = yield ioUtil.stat(source); + if (sourceStat.isDirectory()) { + if (!recursive) { + throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); + } + else { + yield cpDirRecursive(source, newDest, 0, force); + } + } + else { + if (path.relative(source, newDest) === '') { + // a file cannot be copied to itself + throw new Error(`'${newDest}' and '${source}' are the same file`); + } + yield copyFile(source, newDest, force); + } + }); +} +exports.cp = cp; +/** + * Moves a path. + * + * @param source source path + * @param dest destination path + * @param options optional. See MoveOptions. + */ +function mv(source, dest, options = {}) { + return __awaiter(this, void 0, void 0, function* () { + if (yield ioUtil.exists(dest)) { + let destExists = true; + if (yield ioUtil.isDirectory(dest)) { + // If dest is directory copy src into dest + dest = path.join(dest, path.basename(source)); + destExists = yield ioUtil.exists(dest); + } + if (destExists) { + if (options.force == null || options.force) { + yield rmRF(dest); + } + else { + throw new Error('Destination already exists'); + } + } + } + yield mkdirP(path.dirname(dest)); + yield ioUtil.rename(source, dest); + }); +} +exports.mv = mv; +/** + * Remove a path recursively with force + * + * @param inputPath path to remove + */ +function rmRF(inputPath) { + return __awaiter(this, void 0, void 0, function* () { + if (ioUtil.IS_WINDOWS) { + // Check for invalid characters + // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file + if (/[*"<>|]/.test(inputPath)) { + throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); + } + } + try { + // note if path does not exist, error is silent + yield ioUtil.rm(inputPath, { + force: true, + maxRetries: 3, + recursive: true, + retryDelay: 300 + }); + } + catch (err) { + throw new Error(`File was unable to be removed ${err}`); + } + }); +} +exports.rmRF = rmRF; +/** + * Make a directory. Creates the full path with folders in between + * Will throw if it fails + * + * @param fsPath path to create + * @returns Promise + */ +function mkdirP(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + assert_1.ok(fsPath, 'a path argument must be provided'); + yield ioUtil.mkdir(fsPath, { recursive: true }); + }); +} +exports.mkdirP = mkdirP; +/** + * Returns path of a tool had the tool actually been invoked. Resolves via paths. + * If you check and the tool does not exist, it will throw. + * + * @param tool name of the tool + * @param check whether to check if tool exists + * @returns Promise path to tool + */ +function which(tool, check) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + // recursive when check=true + if (check) { + const result = yield which(tool, false); + if (!result) { + if (ioUtil.IS_WINDOWS) { + throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); + } + else { + throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); + } + } + return result; + } + const matches = yield findInPath(tool); + if (matches && matches.length > 0) { + return matches[0]; + } + return ''; + }); +} +exports.which = which; +/** + * Returns a list of all occurrences of the given tool on the system path. + * + * @returns Promise the paths of the tool + */ +function findInPath(tool) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + // build the list of extensions to try + const extensions = []; + if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) { + for (const extension of process.env['PATHEXT'].split(path.delimiter)) { + if (extension) { + extensions.push(extension); + } + } + } + // if it's rooted, return it if exists. otherwise return empty. + if (ioUtil.isRooted(tool)) { + const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); + if (filePath) { + return [filePath]; + } + return []; + } + // if any path separators, return empty + if (tool.includes(path.sep)) { + return []; + } + // build the list of directories + // + // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, + // it feels like we should not do this. Checking the current directory seems like more of a use + // case of a shell, and the which() function exposed by the toolkit should strive for consistency + // across platforms. + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path.delimiter)) { + if (p) { + directories.push(p); + } + } + } + // find all matches + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); + } + } + return matches; + }); +} +exports.findInPath = findInPath; +function readCopyOptions(options) { + const force = options.force == null ? true : options.force; + const recursive = Boolean(options.recursive); + const copySourceDirectory = options.copySourceDirectory == null + ? true + : Boolean(options.copySourceDirectory); + return { force, recursive, copySourceDirectory }; +} +function cpDirRecursive(sourceDir, destDir, currentDepth, force) { + return __awaiter(this, void 0, void 0, function* () { + // Ensure there is not a run away recursive copy + if (currentDepth >= 255) + return; + currentDepth++; + yield mkdirP(destDir); + const files = yield ioUtil.readdir(sourceDir); + for (const fileName of files) { + const srcFile = `${sourceDir}/${fileName}`; + const destFile = `${destDir}/${fileName}`; + const srcFileStat = yield ioUtil.lstat(srcFile); + if (srcFileStat.isDirectory()) { + // Recurse + yield cpDirRecursive(srcFile, destFile, currentDepth, force); + } + else { + yield copyFile(srcFile, destFile, force); + } + } + // Change the mode for the newly created directory + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); +} +// Buffered file copy +function copyFile(srcFile, destFile, force) { + return __awaiter(this, void 0, void 0, function* () { + if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { + // unlink/re-link it + try { + yield ioUtil.lstat(destFile); + yield ioUtil.unlink(destFile); + } + catch (e) { + // Try to override file permission + if (e.code === 'EPERM') { + yield ioUtil.chmod(destFile, '0666'); + yield ioUtil.unlink(destFile); + } + // other errors = it doesn't exist, no work to do + } + // Copy over symlink + const symlinkFull = yield ioUtil.readlink(srcFile); + yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null); + } + else if (!(yield ioUtil.exists(destFile)) || force) { + yield ioUtil.copyFile(srcFile, destFile); + } + }); +} +//# sourceMappingURL=io.js.map + +/***/ }), + +/***/ 2856: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const WritableStream = (__nccwpck_require__(84492).Writable) +const inherits = (__nccwpck_require__(47261).inherits) + +const StreamSearch = __nccwpck_require__(88534) + +const PartStream = __nccwpck_require__(38710) +const HeaderParser = __nccwpck_require__(90333) + +const DASH = 45 +const B_ONEDASH = Buffer.from('-') +const B_CRLF = Buffer.from('\r\n') +const EMPTY_FN = function () {} + +function Dicer (cfg) { + if (!(this instanceof Dicer)) { return new Dicer(cfg) } + WritableStream.call(this, cfg) + + if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') } + + if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined } + + this._headerFirst = cfg.headerFirst + + this._dashes = 0 + this._parts = 0 + this._finished = false + this._realFinish = false + this._isPreamble = true + this._justMatched = false + this._firstWrite = true + this._inHeader = true + this._part = undefined + this._cb = undefined + this._ignoreData = false + this._partOpts = { highWaterMark: cfg.partHwm } + this._pause = false + + const self = this + this._hparser = new HeaderParser(cfg) + this._hparser.on('header', function (header) { + self._inHeader = false + self._part.emit('header', header) + }) +} +inherits(Dicer, WritableStream) + +Dicer.prototype.emit = function (ev) { + if (ev === 'finish' && !this._realFinish) { + if (!this._finished) { + const self = this + process.nextTick(function () { + self.emit('error', new Error('Unexpected end of multipart data')) + if (self._part && !self._ignoreData) { + const type = (self._isPreamble ? 'Preamble' : 'Part') + self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data')) + self._part.push(null) + process.nextTick(function () { + self._realFinish = true + self.emit('finish') + self._realFinish = false + }) + return + } + self._realFinish = true + self.emit('finish') + self._realFinish = false + }) + } + } else { WritableStream.prototype.emit.apply(this, arguments) } +} + +Dicer.prototype._write = function (data, encoding, cb) { + // ignore unexpected data (e.g. extra trailer data after finished) + if (!this._hparser && !this._bparser) { return cb() } + + if (this._headerFirst && this._isPreamble) { + if (!this._part) { + this._part = new PartStream(this._partOpts) + if (this._events.preamble) { this.emit('preamble', this._part) } else { this._ignore() } + } + const r = this._hparser.push(data) + if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() } + } + + // allows for "easier" testing + if (this._firstWrite) { + this._bparser.push(B_CRLF) + this._firstWrite = false + } + + this._bparser.push(data) + + if (this._pause) { this._cb = cb } else { cb() } +} + +Dicer.prototype.reset = function () { + this._part = undefined + this._bparser = undefined + this._hparser = undefined +} + +Dicer.prototype.setBoundary = function (boundary) { + const self = this + this._bparser = new StreamSearch('\r\n--' + boundary) + this._bparser.on('info', function (isMatch, data, start, end) { + self._oninfo(isMatch, data, start, end) + }) +} + +Dicer.prototype._ignore = function () { + if (this._part && !this._ignoreData) { + this._ignoreData = true + this._part.on('error', EMPTY_FN) + // we must perform some kind of read on the stream even though we are + // ignoring the data, otherwise node's Readable stream will not emit 'end' + // after pushing null to the stream + this._part.resume() + } +} + +Dicer.prototype._oninfo = function (isMatch, data, start, end) { + let buf; const self = this; let i = 0; let r; let shouldWriteMore = true + + if (!this._part && this._justMatched && data) { + while (this._dashes < 2 && (start + i) < end) { + if (data[start + i] === DASH) { + ++i + ++this._dashes + } else { + if (this._dashes) { buf = B_ONEDASH } + this._dashes = 0 + break + } + } + if (this._dashes === 2) { + if ((start + i) < end && this._events.trailer) { this.emit('trailer', data.slice(start + i, end)) } + this.reset() + this._finished = true + // no more parts will be added + if (self._parts === 0) { + self._realFinish = true + self.emit('finish') + self._realFinish = false + } + } + if (this._dashes) { return } + } + if (this._justMatched) { this._justMatched = false } + if (!this._part) { + this._part = new PartStream(this._partOpts) + this._part._read = function (n) { + self._unpause() + } + if (this._isPreamble && this._events.preamble) { this.emit('preamble', this._part) } else if (this._isPreamble !== true && this._events.part) { this.emit('part', this._part) } else { this._ignore() } + if (!this._isPreamble) { this._inHeader = true } + } + if (data && start < end && !this._ignoreData) { + if (this._isPreamble || !this._inHeader) { + if (buf) { shouldWriteMore = this._part.push(buf) } + shouldWriteMore = this._part.push(data.slice(start, end)) + if (!shouldWriteMore) { this._pause = true } + } else if (!this._isPreamble && this._inHeader) { + if (buf) { this._hparser.push(buf) } + r = this._hparser.push(data.slice(start, end)) + if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) } + } + } + if (isMatch) { + this._hparser.reset() + if (this._isPreamble) { this._isPreamble = false } else { + if (start !== end) { + ++this._parts + this._part.on('end', function () { + if (--self._parts === 0) { + if (self._finished) { + self._realFinish = true + self.emit('finish') + self._realFinish = false + } else { + self._unpause() + } + } + }) + } + } + this._part.push(null) + this._part = undefined + this._ignoreData = false + this._justMatched = true + this._dashes = 0 + } +} + +Dicer.prototype._unpause = function () { + if (!this._pause) { return } + + this._pause = false + if (this._cb) { + const cb = this._cb + this._cb = undefined + cb() + } +} + +module.exports = Dicer + + +/***/ }), + +/***/ 90333: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const EventEmitter = (__nccwpck_require__(15673).EventEmitter) +const inherits = (__nccwpck_require__(47261).inherits) +const getLimit = __nccwpck_require__(49692) + +const StreamSearch = __nccwpck_require__(88534) + +const B_DCRLF = Buffer.from('\r\n\r\n') +const RE_CRLF = /\r\n/g +const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex + +function HeaderParser (cfg) { + EventEmitter.call(this) + + cfg = cfg || {} + const self = this + this.nread = 0 + this.maxed = false + this.npairs = 0 + this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000) + this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024) + this.buffer = '' + this.header = {} + this.finished = false + this.ss = new StreamSearch(B_DCRLF) + this.ss.on('info', function (isMatch, data, start, end) { + if (data && !self.maxed) { + if (self.nread + end - start >= self.maxHeaderSize) { + end = self.maxHeaderSize - self.nread + start + self.nread = self.maxHeaderSize + self.maxed = true + } else { self.nread += (end - start) } + + self.buffer += data.toString('binary', start, end) + } + if (isMatch) { self._finish() } + }) +} +inherits(HeaderParser, EventEmitter) + +HeaderParser.prototype.push = function (data) { + const r = this.ss.push(data) + if (this.finished) { return r } +} + +HeaderParser.prototype.reset = function () { + this.finished = false + this.buffer = '' + this.header = {} + this.ss.reset() +} + +HeaderParser.prototype._finish = function () { + if (this.buffer) { this._parseHeader() } + this.ss.matches = this.ss.maxMatches + const header = this.header + this.header = {} + this.buffer = '' + this.finished = true + this.nread = this.npairs = 0 + this.maxed = false + this.emit('header', header) +} + +HeaderParser.prototype._parseHeader = function () { + if (this.npairs === this.maxHeaderPairs) { return } + + const lines = this.buffer.split(RE_CRLF) + const len = lines.length + let m, h + + for (var i = 0; i < len; ++i) { // eslint-disable-line no-var + if (lines[i].length === 0) { continue } + if (lines[i][0] === '\t' || lines[i][0] === ' ') { + // folded header content + // RFC2822 says to just remove the CRLF and not the whitespace following + // it, so we follow the RFC and include the leading whitespace ... + if (h) { + this.header[h][this.header[h].length - 1] += lines[i] + continue + } + } + + const posColon = lines[i].indexOf(':') + if ( + posColon === -1 || + posColon === 0 + ) { + return + } + m = RE_HDR.exec(lines[i]) + h = m[1].toLowerCase() + this.header[h] = this.header[h] || [] + this.header[h].push((m[2] || '')) + if (++this.npairs === this.maxHeaderPairs) { break } + } +} + +module.exports = HeaderParser + + +/***/ }), + +/***/ 38710: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const inherits = (__nccwpck_require__(47261).inherits) +const ReadableStream = (__nccwpck_require__(84492).Readable) + +function PartStream (opts) { + ReadableStream.call(this, opts) +} +inherits(PartStream, ReadableStream) + +PartStream.prototype._read = function (n) {} + +module.exports = PartStream + + +/***/ }), + +/***/ 88534: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +/** + * Copyright Brian White. All rights reserved. + * + * @see https://github.com/mscdex/streamsearch + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation + * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool + */ +const EventEmitter = (__nccwpck_require__(15673).EventEmitter) +const inherits = (__nccwpck_require__(47261).inherits) + +function SBMH (needle) { + if (typeof needle === 'string') { + needle = Buffer.from(needle) + } + + if (!Buffer.isBuffer(needle)) { + throw new TypeError('The needle has to be a String or a Buffer.') + } + + const needleLength = needle.length + + if (needleLength === 0) { + throw new Error('The needle cannot be an empty String/Buffer.') + } + + if (needleLength > 256) { + throw new Error('The needle cannot have a length bigger than 256.') + } + + this.maxMatches = Infinity + this.matches = 0 + + this._occ = new Array(256) + .fill(needleLength) // Initialize occurrence table. + this._lookbehind_size = 0 + this._needle = needle + this._bufpos = 0 + + this._lookbehind = Buffer.alloc(needleLength) + + // Populate occurrence table with analysis of the needle, + // ignoring last letter. + for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var + this._occ[needle[i]] = needleLength - 1 - i + } +} +inherits(SBMH, EventEmitter) + +SBMH.prototype.reset = function () { + this._lookbehind_size = 0 + this.matches = 0 + this._bufpos = 0 +} + +SBMH.prototype.push = function (chunk, pos) { + if (!Buffer.isBuffer(chunk)) { + chunk = Buffer.from(chunk, 'binary') + } + const chlen = chunk.length + this._bufpos = pos || 0 + let r + while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) } + return r +} + +SBMH.prototype._sbmh_feed = function (data) { + const len = data.length + const needle = this._needle + const needleLength = needle.length + const lastNeedleChar = needle[needleLength - 1] + + // Positive: points to a position in `data` + // pos == 3 points to data[3] + // Negative: points to a position in the lookbehind buffer + // pos == -2 points to lookbehind[lookbehind_size - 2] + let pos = -this._lookbehind_size + let ch + + if (pos < 0) { + // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool + // search with character lookup code that considers both the + // lookbehind buffer and the current round's haystack data. + // + // Loop until + // there is a match. + // or until + // we've moved past the position that requires the + // lookbehind buffer. In this case we switch to the + // optimized loop. + // or until + // the character to look at lies outside the haystack. + while (pos < 0 && pos <= len - needleLength) { + ch = this._sbmh_lookup_char(data, pos + needleLength - 1) + + if ( + ch === lastNeedleChar && + this._sbmh_memcmp(data, pos, needleLength - 1) + ) { + this._lookbehind_size = 0 + ++this.matches + this.emit('info', true) + + return (this._bufpos = pos + needleLength) + } + pos += this._occ[ch] + } + + // No match. + + if (pos < 0) { + // There's too few data for Boyer-Moore-Horspool to run, + // so let's use a different algorithm to skip as much as + // we can. + // Forward pos until + // the trailing part of lookbehind + data + // looks like the beginning of the needle + // or until + // pos == 0 + while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos } + } + + if (pos >= 0) { + // Discard lookbehind buffer. + this.emit('info', false, this._lookbehind, 0, this._lookbehind_size) + this._lookbehind_size = 0 + } else { + // Cut off part of the lookbehind buffer that has + // been processed and append the entire haystack + // into it. + const bytesToCutOff = this._lookbehind_size + pos + if (bytesToCutOff > 0) { + // The cut off data is guaranteed not to contain the needle. + this.emit('info', false, this._lookbehind, 0, bytesToCutOff) + } + + this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff, + this._lookbehind_size - bytesToCutOff) + this._lookbehind_size -= bytesToCutOff + + data.copy(this._lookbehind, this._lookbehind_size) + this._lookbehind_size += len + + this._bufpos = len + return len + } + } + + pos += (pos >= 0) * this._bufpos + + // Lookbehind buffer is now empty. We only need to check if the + // needle is in the haystack. + if (data.indexOf(needle, pos) !== -1) { + pos = data.indexOf(needle, pos) + ++this.matches + if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) } + + return (this._bufpos = pos + needleLength) + } else { + pos = len - needleLength + } + + // There was no match. If there's trailing haystack data that we cannot + // match yet using the Boyer-Moore-Horspool algorithm (because the trailing + // data is less than the needle size) then match using a modified + // algorithm that starts matching from the beginning instead of the end. + // Whatever trailing data is left after running this algorithm is added to + // the lookbehind buffer. + while ( + pos < len && + ( + data[pos] !== needle[0] || + ( + (Buffer.compare( + data.subarray(pos, pos + len - pos), + needle.subarray(0, len - pos) + ) !== 0) + ) + ) + ) { + ++pos + } + if (pos < len) { + data.copy(this._lookbehind, 0, pos, pos + (len - pos)) + this._lookbehind_size = len - pos + } + + // Everything until pos is guaranteed not to contain needle data. + if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) } + + this._bufpos = len + return len +} + +SBMH.prototype._sbmh_lookup_char = function (data, pos) { + return (pos < 0) + ? this._lookbehind[this._lookbehind_size + pos] + : data[pos] +} + +SBMH.prototype._sbmh_memcmp = function (data, pos, len) { + for (var i = 0; i < len; ++i) { // eslint-disable-line no-var + if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false } + } + return true +} + +module.exports = SBMH + + +/***/ }), + +/***/ 33438: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const WritableStream = (__nccwpck_require__(84492).Writable) +const { inherits } = __nccwpck_require__(47261) +const Dicer = __nccwpck_require__(2856) + +const MultipartParser = __nccwpck_require__(90415) +const UrlencodedParser = __nccwpck_require__(16780) +const parseParams = __nccwpck_require__(34426) + +function Busboy (opts) { + if (!(this instanceof Busboy)) { return new Busboy(opts) } + + if (typeof opts !== 'object') { + throw new TypeError('Busboy expected an options-Object.') + } + if (typeof opts.headers !== 'object') { + throw new TypeError('Busboy expected an options-Object with headers-attribute.') + } + if (typeof opts.headers['content-type'] !== 'string') { + throw new TypeError('Missing Content-Type-header.') + } + + const { + headers, + ...streamOptions + } = opts + + this.opts = { + autoDestroy: false, + ...streamOptions + } + WritableStream.call(this, this.opts) + + this._done = false + this._parser = this.getParserByHeaders(headers) + this._finished = false +} +inherits(Busboy, WritableStream) + +Busboy.prototype.emit = function (ev) { + if (ev === 'finish') { + if (!this._done) { + this._parser?.end() + return + } else if (this._finished) { + return + } + this._finished = true + } + WritableStream.prototype.emit.apply(this, arguments) +} + +Busboy.prototype.getParserByHeaders = function (headers) { + const parsed = parseParams(headers['content-type']) + + const cfg = { + defCharset: this.opts.defCharset, + fileHwm: this.opts.fileHwm, + headers, + highWaterMark: this.opts.highWaterMark, + isPartAFile: this.opts.isPartAFile, + limits: this.opts.limits, + parsedConType: parsed, + preservePath: this.opts.preservePath + } + + if (MultipartParser.detect.test(parsed[0])) { + return new MultipartParser(this, cfg) + } + if (UrlencodedParser.detect.test(parsed[0])) { + return new UrlencodedParser(this, cfg) + } + throw new Error('Unsupported Content-Type.') +} + +Busboy.prototype._write = function (chunk, encoding, cb) { + this._parser.write(chunk, cb) +} + +module.exports = Busboy +module.exports["default"] = Busboy +module.exports.Busboy = Busboy + +module.exports.Dicer = Dicer + + +/***/ }), + +/***/ 90415: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +// TODO: +// * support 1 nested multipart level +// (see second multipart example here: +// http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data) +// * support limits.fieldNameSize +// -- this will require modifications to utils.parseParams + +const { Readable } = __nccwpck_require__(84492) +const { inherits } = __nccwpck_require__(47261) + +const Dicer = __nccwpck_require__(2856) + +const parseParams = __nccwpck_require__(34426) +const decodeText = __nccwpck_require__(99136) +const basename = __nccwpck_require__(60496) +const getLimit = __nccwpck_require__(49692) + +const RE_BOUNDARY = /^boundary$/i +const RE_FIELD = /^form-data$/i +const RE_CHARSET = /^charset$/i +const RE_FILENAME = /^filename$/i +const RE_NAME = /^name$/i + +Multipart.detect = /^multipart\/form-data/i +function Multipart (boy, cfg) { + let i + let len + const self = this + let boundary + const limits = cfg.limits + const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined)) + const parsedConType = cfg.parsedConType || [] + const defCharset = cfg.defCharset || 'utf8' + const preservePath = cfg.preservePath + const fileOpts = { highWaterMark: cfg.fileHwm } + + for (i = 0, len = parsedConType.length; i < len; ++i) { + if (Array.isArray(parsedConType[i]) && + RE_BOUNDARY.test(parsedConType[i][0])) { + boundary = parsedConType[i][1] + break + } + } + + function checkFinished () { + if (nends === 0 && finished && !boy._done) { + finished = false + self.end() + } + } + + if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') } + + const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024) + const fileSizeLimit = getLimit(limits, 'fileSize', Infinity) + const filesLimit = getLimit(limits, 'files', Infinity) + const fieldsLimit = getLimit(limits, 'fields', Infinity) + const partsLimit = getLimit(limits, 'parts', Infinity) + const headerPairsLimit = getLimit(limits, 'headerPairs', 2000) + const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024) + + let nfiles = 0 + let nfields = 0 + let nends = 0 + let curFile + let curField + let finished = false + + this._needDrain = false + this._pause = false + this._cb = undefined + this._nparts = 0 + this._boy = boy + + const parserCfg = { + boundary, + maxHeaderPairs: headerPairsLimit, + maxHeaderSize: headerSizeLimit, + partHwm: fileOpts.highWaterMark, + highWaterMark: cfg.highWaterMark + } + + this.parser = new Dicer(parserCfg) + this.parser.on('drain', function () { + self._needDrain = false + if (self._cb && !self._pause) { + const cb = self._cb + self._cb = undefined + cb() + } + }).on('part', function onPart (part) { + if (++self._nparts > partsLimit) { + self.parser.removeListener('part', onPart) + self.parser.on('part', skipPart) + boy.hitPartsLimit = true + boy.emit('partsLimit') + return skipPart(part) + } + + // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let + // us emit 'end' early since we know the part has ended if we are already + // seeing the next part + if (curField) { + const field = curField + field.emit('end') + field.removeAllListeners('end') + } + + part.on('header', function (header) { + let contype + let fieldname + let parsed + let charset + let encoding + let filename + let nsize = 0 + + if (header['content-type']) { + parsed = parseParams(header['content-type'][0]) + if (parsed[0]) { + contype = parsed[0].toLowerCase() + for (i = 0, len = parsed.length; i < len; ++i) { + if (RE_CHARSET.test(parsed[i][0])) { + charset = parsed[i][1].toLowerCase() + break + } + } + } + } + + if (contype === undefined) { contype = 'text/plain' } + if (charset === undefined) { charset = defCharset } + + if (header['content-disposition']) { + parsed = parseParams(header['content-disposition'][0]) + if (!RE_FIELD.test(parsed[0])) { return skipPart(part) } + for (i = 0, len = parsed.length; i < len; ++i) { + if (RE_NAME.test(parsed[i][0])) { + fieldname = parsed[i][1] + } else if (RE_FILENAME.test(parsed[i][0])) { + filename = parsed[i][1] + if (!preservePath) { filename = basename(filename) } + } + } + } else { return skipPart(part) } + + if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' } + + let onData, + onEnd + + if (isPartAFile(fieldname, contype, filename)) { + // file/binary field + if (nfiles === filesLimit) { + if (!boy.hitFilesLimit) { + boy.hitFilesLimit = true + boy.emit('filesLimit') + } + return skipPart(part) + } + + ++nfiles + + if (!boy._events.file) { + self.parser._ignore() + return + } + + ++nends + const file = new FileStream(fileOpts) + curFile = file + file.on('end', function () { + --nends + self._pause = false + checkFinished() + if (self._cb && !self._needDrain) { + const cb = self._cb + self._cb = undefined + cb() + } + }) + file._read = function (n) { + if (!self._pause) { return } + self._pause = false + if (self._cb && !self._needDrain) { + const cb = self._cb + self._cb = undefined + cb() + } + } + boy.emit('file', fieldname, file, filename, encoding, contype) + + onData = function (data) { + if ((nsize += data.length) > fileSizeLimit) { + const extralen = fileSizeLimit - nsize + data.length + if (extralen > 0) { file.push(data.slice(0, extralen)) } + file.truncated = true + file.bytesRead = fileSizeLimit + part.removeAllListeners('data') + file.emit('limit') + return + } else if (!file.push(data)) { self._pause = true } + + file.bytesRead = nsize + } + + onEnd = function () { + curFile = undefined + file.push(null) + } + } else { + // non-file field + if (nfields === fieldsLimit) { + if (!boy.hitFieldsLimit) { + boy.hitFieldsLimit = true + boy.emit('fieldsLimit') + } + return skipPart(part) + } + + ++nfields + ++nends + let buffer = '' + let truncated = false + curField = part + + onData = function (data) { + if ((nsize += data.length) > fieldSizeLimit) { + const extralen = (fieldSizeLimit - (nsize - data.length)) + buffer += data.toString('binary', 0, extralen) + truncated = true + part.removeAllListeners('data') + } else { buffer += data.toString('binary') } + } + + onEnd = function () { + curField = undefined + if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) } + boy.emit('field', fieldname, buffer, false, truncated, encoding, contype) + --nends + checkFinished() + } + } + + /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become + broken. Streams2/streams3 is a huge black box of confusion, but + somehow overriding the sync state seems to fix things again (and still + seems to work for previous node versions). + */ + part._readableState.sync = false + + part.on('data', onData) + part.on('end', onEnd) + }).on('error', function (err) { + if (curFile) { curFile.emit('error', err) } + }) + }).on('error', function (err) { + boy.emit('error', err) + }).on('finish', function () { + finished = true + checkFinished() + }) +} + +Multipart.prototype.write = function (chunk, cb) { + const r = this.parser.write(chunk) + if (r && !this._pause) { + cb() + } else { + this._needDrain = !r + this._cb = cb + } +} + +Multipart.prototype.end = function () { + const self = this + + if (self.parser.writable) { + self.parser.end() + } else if (!self._boy._done) { + process.nextTick(function () { + self._boy._done = true + self._boy.emit('finish') + }) + } +} + +function skipPart (part) { + part.resume() +} + +function FileStream (opts) { + Readable.call(this, opts) + + this.bytesRead = 0 + + this.truncated = false +} + +inherits(FileStream, Readable) + +FileStream.prototype._read = function (n) {} + +module.exports = Multipart + + +/***/ }), + +/***/ 16780: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const Decoder = __nccwpck_require__(89730) +const decodeText = __nccwpck_require__(99136) +const getLimit = __nccwpck_require__(49692) + +const RE_CHARSET = /^charset$/i + +UrlEncoded.detect = /^application\/x-www-form-urlencoded/i +function UrlEncoded (boy, cfg) { + const limits = cfg.limits + const parsedConType = cfg.parsedConType + this.boy = boy + + this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024) + this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100) + this.fieldsLimit = getLimit(limits, 'fields', Infinity) + + let charset + for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var + if (Array.isArray(parsedConType[i]) && + RE_CHARSET.test(parsedConType[i][0])) { + charset = parsedConType[i][1].toLowerCase() + break + } + } + + if (charset === undefined) { charset = cfg.defCharset || 'utf8' } + + this.decoder = new Decoder() + this.charset = charset + this._fields = 0 + this._state = 'key' + this._checkingBytes = true + this._bytesKey = 0 + this._bytesVal = 0 + this._key = '' + this._val = '' + this._keyTrunc = false + this._valTrunc = false + this._hitLimit = false +} + +UrlEncoded.prototype.write = function (data, cb) { + if (this._fields === this.fieldsLimit) { + if (!this.boy.hitFieldsLimit) { + this.boy.hitFieldsLimit = true + this.boy.emit('fieldsLimit') + } + return cb() + } + + let idxeq; let idxamp; let i; let p = 0; const len = data.length + + while (p < len) { + if (this._state === 'key') { + idxeq = idxamp = undefined + for (i = p; i < len; ++i) { + if (!this._checkingBytes) { ++p } + if (data[i] === 0x3D/* = */) { + idxeq = i + break + } else if (data[i] === 0x26/* & */) { + idxamp = i + break + } + if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) { + this._hitLimit = true + break + } else if (this._checkingBytes) { ++this._bytesKey } + } + + if (idxeq !== undefined) { + // key with assignment + if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) } + this._state = 'val' + + this._hitLimit = false + this._checkingBytes = true + this._val = '' + this._bytesVal = 0 + this._valTrunc = false + this.decoder.reset() + + p = idxeq + 1 + } else if (idxamp !== undefined) { + // key with no assignment + ++this._fields + let key; const keyTrunc = this._keyTrunc + if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key } + + this._hitLimit = false + this._checkingBytes = true + this._key = '' + this._bytesKey = 0 + this._keyTrunc = false + this.decoder.reset() + + if (key.length) { + this.boy.emit('field', decodeText(key, 'binary', this.charset), + '', + keyTrunc, + false) + } + + p = idxamp + 1 + if (this._fields === this.fieldsLimit) { return cb() } + } else if (this._hitLimit) { + // we may not have hit the actual limit if there are encoded bytes... + if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) } + p = i + if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) { + // yep, we actually did hit the limit + this._checkingBytes = false + this._keyTrunc = true + } + } else { + if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) } + p = len + } + } else { + idxamp = undefined + for (i = p; i < len; ++i) { + if (!this._checkingBytes) { ++p } + if (data[i] === 0x26/* & */) { + idxamp = i + break + } + if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) { + this._hitLimit = true + break + } else if (this._checkingBytes) { ++this._bytesVal } + } + + if (idxamp !== undefined) { + ++this._fields + if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) } + this.boy.emit('field', decodeText(this._key, 'binary', this.charset), + decodeText(this._val, 'binary', this.charset), + this._keyTrunc, + this._valTrunc) + this._state = 'key' + + this._hitLimit = false + this._checkingBytes = true + this._key = '' + this._bytesKey = 0 + this._keyTrunc = false + this.decoder.reset() + + p = idxamp + 1 + if (this._fields === this.fieldsLimit) { return cb() } + } else if (this._hitLimit) { + // we may not have hit the actual limit if there are encoded bytes... + if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) } + p = i + if ((this._val === '' && this.fieldSizeLimit === 0) || + (this._bytesVal = this._val.length) === this.fieldSizeLimit) { + // yep, we actually did hit the limit + this._checkingBytes = false + this._valTrunc = true + } + } else { + if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) } + p = len + } + } + } + cb() +} + +UrlEncoded.prototype.end = function () { + if (this.boy._done) { return } + + if (this._state === 'key' && this._key.length > 0) { + this.boy.emit('field', decodeText(this._key, 'binary', this.charset), + '', + this._keyTrunc, + false) + } else if (this._state === 'val') { + this.boy.emit('field', decodeText(this._key, 'binary', this.charset), + decodeText(this._val, 'binary', this.charset), + this._keyTrunc, + this._valTrunc) + } + this.boy._done = true + this.boy.emit('finish') +} + +module.exports = UrlEncoded + + +/***/ }), + +/***/ 89730: +/***/ ((module) => { + +"use strict"; + + +const RE_PLUS = /\+/g + +const HEX = [ + 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, 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, 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, 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, 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 +] + +function Decoder () { + this.buffer = undefined +} +Decoder.prototype.write = function (str) { + // Replace '+' with ' ' before decoding + str = str.replace(RE_PLUS, ' ') + let res = '' + let i = 0; let p = 0; const len = str.length + for (; i < len; ++i) { + if (this.buffer !== undefined) { + if (!HEX[str.charCodeAt(i)]) { + res += '%' + this.buffer + this.buffer = undefined + --i // retry character + } else { + this.buffer += str[i] + ++p + if (this.buffer.length === 2) { + res += String.fromCharCode(parseInt(this.buffer, 16)) + this.buffer = undefined + } + } + } else if (str[i] === '%') { + if (i > p) { + res += str.substring(p, i) + p = i + } + this.buffer = '' + ++p + } + } + if (p < len && this.buffer === undefined) { res += str.substring(p) } + return res +} +Decoder.prototype.reset = function () { + this.buffer = undefined +} + +module.exports = Decoder + + +/***/ }), + +/***/ 60496: +/***/ ((module) => { + +"use strict"; + + +module.exports = function basename (path) { + if (typeof path !== 'string') { return '' } + for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var + switch (path.charCodeAt(i)) { + case 0x2F: // '/' + case 0x5C: // '\' + path = path.slice(i + 1) + return (path === '..' || path === '.' ? '' : path) + } + } + return (path === '..' || path === '.' ? '' : path) +} + + +/***/ }), + +/***/ 99136: +/***/ ((module) => { + +"use strict"; + + +// Node has always utf-8 +const utf8Decoder = new TextDecoder('utf-8') +const textDecoders = new Map([ + ['utf-8', utf8Decoder], + ['utf8', utf8Decoder] +]) + +function decodeText (text, textEncoding, destEncoding) { + if (text) { + if (textDecoders.has(destEncoding)) { + try { + return textDecoders.get(destEncoding).decode(Buffer.from(text, textEncoding)) + } catch (e) { } + } else { + try { + textDecoders.set(destEncoding, new TextDecoder(destEncoding)) + return textDecoders.get(destEncoding).decode(Buffer.from(text, textEncoding)) + } catch (e) { } + } + } + return text +} + +module.exports = decodeText + + +/***/ }), + +/***/ 49692: +/***/ ((module) => { + +"use strict"; + + +module.exports = function getLimit (limits, name, defaultLimit) { + if ( + !limits || + limits[name] === undefined || + limits[name] === null + ) { return defaultLimit } + + if ( + typeof limits[name] !== 'number' || + isNaN(limits[name]) + ) { throw new TypeError('Limit ' + name + ' is not a valid number') } + + return limits[name] +} + + +/***/ }), + +/***/ 34426: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const decodeText = __nccwpck_require__(99136) + +const RE_ENCODED = /%([a-fA-F0-9]{2})/g + +function encodedReplacer (match, byte) { + return String.fromCharCode(parseInt(byte, 16)) +} + +function parseParams (str) { + const res = [] + let state = 'key' + let charset = '' + let inquote = false + let escaping = false + let p = 0 + let tmp = '' + + for (var i = 0, len = str.length; i < len; ++i) { // eslint-disable-line no-var + const char = str[i] + if (char === '\\' && inquote) { + if (escaping) { escaping = false } else { + escaping = true + continue + } + } else if (char === '"') { + if (!escaping) { + if (inquote) { + inquote = false + state = 'key' + } else { inquote = true } + continue + } else { escaping = false } + } else { + if (escaping && inquote) { tmp += '\\' } + escaping = false + if ((state === 'charset' || state === 'lang') && char === "'") { + if (state === 'charset') { + state = 'lang' + charset = tmp.substring(1) + } else { state = 'value' } + tmp = '' + continue + } else if (state === 'key' && + (char === '*' || char === '=') && + res.length) { + if (char === '*') { state = 'charset' } else { state = 'value' } + res[p] = [tmp, undefined] + tmp = '' + continue + } else if (!inquote && char === ';') { + state = 'key' + if (charset) { + if (tmp.length) { + tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer), + 'binary', + charset) + } + charset = '' + } else if (tmp.length) { + tmp = decodeText(tmp, 'binary', 'utf8') + } + if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp } + tmp = '' + ++p + continue + } else if (!inquote && (char === ' ' || char === '\t')) { continue } + } + tmp += char + } + if (charset && tmp.length) { + tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer), + 'binary', + charset) + } else if (tmp) { + tmp = decodeText(tmp, 'binary', 'utf8') + } + + if (res[p] === undefined) { + if (tmp) { res[p] = tmp } + } else { res[p][1] = tmp } + + return res +} + +module.exports = parseParams + + +/***/ }), + +/***/ 81771: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NOOP_LOGGER = exports.NoopLogger = void 0; +class NoopLogger { + emit(_logRecord) { } +} +exports.NoopLogger = NoopLogger; +exports.NOOP_LOGGER = new NoopLogger(); +//# sourceMappingURL=NoopLogger.js.map + +/***/ }), + +/***/ 13070: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NOOP_LOGGER_PROVIDER = exports.NoopLoggerProvider = void 0; +const NoopLogger_1 = __nccwpck_require__(81771); +class NoopLoggerProvider { + getLogger(_name, _version, _options) { + return new NoopLogger_1.NoopLogger(); + } +} +exports.NoopLoggerProvider = NoopLoggerProvider; +exports.NOOP_LOGGER_PROVIDER = new NoopLoggerProvider(); +//# sourceMappingURL=NoopLoggerProvider.js.map + +/***/ }), + +/***/ 59538: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ProxyLogger = void 0; +const NoopLogger_1 = __nccwpck_require__(81771); +class ProxyLogger { + constructor(_provider, name, version, options) { + this._provider = _provider; + this.name = name; + this.version = version; + this.options = options; + } + /** + * Emit a log record. This method should only be used by log appenders. + * + * @param logRecord + */ + emit(logRecord) { + this._getLogger().emit(logRecord); + } + /** + * Try to get a logger from the proxy logger provider. + * If the proxy logger provider has no delegate, return a noop logger. + */ + _getLogger() { + if (this._delegate) { + return this._delegate; + } + const logger = this._provider.getDelegateLogger(this.name, this.version, this.options); + if (!logger) { + return NoopLogger_1.NOOP_LOGGER; + } + this._delegate = logger; + return this._delegate; + } +} +exports.ProxyLogger = ProxyLogger; +//# sourceMappingURL=ProxyLogger.js.map + +/***/ }), + +/***/ 66927: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ProxyLoggerProvider = void 0; +const NoopLoggerProvider_1 = __nccwpck_require__(13070); +const ProxyLogger_1 = __nccwpck_require__(59538); +class ProxyLoggerProvider { + getLogger(name, version, options) { + var _a; + return ((_a = this.getDelegateLogger(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyLogger_1.ProxyLogger(this, name, version, options)); + } + getDelegate() { + var _a; + return (_a = this._delegate) !== null && _a !== void 0 ? _a : NoopLoggerProvider_1.NOOP_LOGGER_PROVIDER; + } + /** + * Set the delegate logger provider + */ + setDelegate(delegate) { + this._delegate = delegate; + } + getDelegateLogger(name, version, options) { + var _a; + return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getLogger(name, version, options); + } +} +exports.ProxyLoggerProvider = ProxyLoggerProvider; +//# sourceMappingURL=ProxyLoggerProvider.js.map + +/***/ }), + +/***/ 93091: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.LogsAPI = void 0; +const global_utils_1 = __nccwpck_require__(39295); +const NoopLoggerProvider_1 = __nccwpck_require__(13070); +const ProxyLoggerProvider_1 = __nccwpck_require__(66927); +class LogsAPI { + constructor() { + this._proxyLoggerProvider = new ProxyLoggerProvider_1.ProxyLoggerProvider(); + } + static getInstance() { + if (!this._instance) { + this._instance = new LogsAPI(); + } + return this._instance; + } + setGlobalLoggerProvider(provider) { + if (global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY]) { + return this.getLoggerProvider(); + } + global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY] = (0, global_utils_1.makeGetter)(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, provider, NoopLoggerProvider_1.NOOP_LOGGER_PROVIDER); + this._proxyLoggerProvider.setDelegate(provider); + return provider; + } + /** + * Returns the global logger provider. + * + * @returns LoggerProvider + */ + getLoggerProvider() { + var _a, _b; + return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : this._proxyLoggerProvider); + } + /** + * Returns a logger from the global logger provider. + * + * @returns Logger + */ + getLogger(name, version, options) { + return this.getLoggerProvider().getLogger(name, version, options); + } + /** Remove the global logger provider */ + disable() { + delete global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY]; + this._proxyLoggerProvider = new ProxyLoggerProvider_1.ProxyLoggerProvider(); + } +} +exports.LogsAPI = LogsAPI; +//# sourceMappingURL=logs.js.map + +/***/ }), + +/***/ 32832: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.logs = exports.ProxyLoggerProvider = exports.ProxyLogger = exports.NoopLoggerProvider = exports.NOOP_LOGGER_PROVIDER = exports.NoopLogger = exports.NOOP_LOGGER = exports.SeverityNumber = void 0; +var LogRecord_1 = __nccwpck_require__(57440); +Object.defineProperty(exports, "SeverityNumber", ({ enumerable: true, get: function () { return LogRecord_1.SeverityNumber; } })); +var NoopLogger_1 = __nccwpck_require__(81771); +Object.defineProperty(exports, "NOOP_LOGGER", ({ enumerable: true, get: function () { return NoopLogger_1.NOOP_LOGGER; } })); +Object.defineProperty(exports, "NoopLogger", ({ enumerable: true, get: function () { return NoopLogger_1.NoopLogger; } })); +var NoopLoggerProvider_1 = __nccwpck_require__(13070); +Object.defineProperty(exports, "NOOP_LOGGER_PROVIDER", ({ enumerable: true, get: function () { return NoopLoggerProvider_1.NOOP_LOGGER_PROVIDER; } })); +Object.defineProperty(exports, "NoopLoggerProvider", ({ enumerable: true, get: function () { return NoopLoggerProvider_1.NoopLoggerProvider; } })); +var ProxyLogger_1 = __nccwpck_require__(59538); +Object.defineProperty(exports, "ProxyLogger", ({ enumerable: true, get: function () { return ProxyLogger_1.ProxyLogger; } })); +var ProxyLoggerProvider_1 = __nccwpck_require__(66927); +Object.defineProperty(exports, "ProxyLoggerProvider", ({ enumerable: true, get: function () { return ProxyLoggerProvider_1.ProxyLoggerProvider; } })); +const logs_1 = __nccwpck_require__(93091); +exports.logs = logs_1.LogsAPI.getInstance(); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 39295: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.API_BACKWARDS_COMPATIBILITY_VERSION = exports.makeGetter = exports._global = exports.GLOBAL_LOGS_API_KEY = void 0; +const platform_1 = __nccwpck_require__(40909); +exports.GLOBAL_LOGS_API_KEY = Symbol.for('io.opentelemetry.js.api.logs'); +exports._global = platform_1._globalThis; +/** + * Make a function which accepts a version integer and returns the instance of an API if the version + * is compatible, or a fallback version (usually NOOP) if it is not. + * + * @param requiredVersion Backwards compatibility version which is required to return the instance + * @param instance Instance which should be returned if the required version is compatible + * @param fallback Fallback instance, usually NOOP, which will be returned if the required version is not compatible + */ +function makeGetter(requiredVersion, instance, fallback) { + return (version) => version === requiredVersion ? instance : fallback; +} +exports.makeGetter = makeGetter; +/** + * A number which should be incremented each time a backwards incompatible + * change is made to the API. This number is used when an API package + * attempts to access the global API to ensure it is getting a compatible + * version. If the global API is not compatible with the API package + * attempting to get it, a NOOP API implementation will be returned. + */ +exports.API_BACKWARDS_COMPATIBILITY_VERSION = 1; +//# sourceMappingURL=global-utils.js.map + +/***/ }), + +/***/ 40909: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._globalThis = void 0; +var node_1 = __nccwpck_require__(64460); +Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return node_1._globalThis; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 20459: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._globalThis = void 0; +/** only globals that common to node and browsers are allowed */ +// eslint-disable-next-line node/no-unsupported-features/es-builtins +exports._globalThis = typeof globalThis === 'object' ? globalThis : global; +//# sourceMappingURL=globalThis.js.map + +/***/ }), + +/***/ 64460: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._globalThis = void 0; +var globalThis_1 = __nccwpck_require__(20459); +Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return globalThis_1._globalThis; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 57440: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SeverityNumber = void 0; +var SeverityNumber; +(function (SeverityNumber) { + SeverityNumber[SeverityNumber["UNSPECIFIED"] = 0] = "UNSPECIFIED"; + SeverityNumber[SeverityNumber["TRACE"] = 1] = "TRACE"; + SeverityNumber[SeverityNumber["TRACE2"] = 2] = "TRACE2"; + SeverityNumber[SeverityNumber["TRACE3"] = 3] = "TRACE3"; + SeverityNumber[SeverityNumber["TRACE4"] = 4] = "TRACE4"; + SeverityNumber[SeverityNumber["DEBUG"] = 5] = "DEBUG"; + SeverityNumber[SeverityNumber["DEBUG2"] = 6] = "DEBUG2"; + SeverityNumber[SeverityNumber["DEBUG3"] = 7] = "DEBUG3"; + SeverityNumber[SeverityNumber["DEBUG4"] = 8] = "DEBUG4"; + SeverityNumber[SeverityNumber["INFO"] = 9] = "INFO"; + SeverityNumber[SeverityNumber["INFO2"] = 10] = "INFO2"; + SeverityNumber[SeverityNumber["INFO3"] = 11] = "INFO3"; + SeverityNumber[SeverityNumber["INFO4"] = 12] = "INFO4"; + SeverityNumber[SeverityNumber["WARN"] = 13] = "WARN"; + SeverityNumber[SeverityNumber["WARN2"] = 14] = "WARN2"; + SeverityNumber[SeverityNumber["WARN3"] = 15] = "WARN3"; + SeverityNumber[SeverityNumber["WARN4"] = 16] = "WARN4"; + SeverityNumber[SeverityNumber["ERROR"] = 17] = "ERROR"; + SeverityNumber[SeverityNumber["ERROR2"] = 18] = "ERROR2"; + SeverityNumber[SeverityNumber["ERROR3"] = 19] = "ERROR3"; + SeverityNumber[SeverityNumber["ERROR4"] = 20] = "ERROR4"; + SeverityNumber[SeverityNumber["FATAL"] = 21] = "FATAL"; + SeverityNumber[SeverityNumber["FATAL2"] = 22] = "FATAL2"; + SeverityNumber[SeverityNumber["FATAL3"] = 23] = "FATAL3"; + SeverityNumber[SeverityNumber["FATAL4"] = 24] = "FATAL4"; +})(SeverityNumber = exports.SeverityNumber || (exports.SeverityNumber = {})); +//# sourceMappingURL=LogRecord.js.map + +/***/ }), + +/***/ 57171: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ContextAPI = void 0; +const NoopContextManager_1 = __nccwpck_require__(54118); +const global_utils_1 = __nccwpck_require__(85135); +const diag_1 = __nccwpck_require__(11877); +const API_NAME = 'context'; +const NOOP_CONTEXT_MANAGER = new NoopContextManager_1.NoopContextManager(); +/** + * Singleton object which represents the entry point to the OpenTelemetry Context API + */ +class ContextAPI { + /** Empty private constructor prevents end users from constructing a new instance of the API */ + constructor() { } + /** Get the singleton instance of the Context API */ + static getInstance() { + if (!this._instance) { + this._instance = new ContextAPI(); + } + return this._instance; + } + /** + * Set the current context manager. + * + * @returns true if the context manager was successfully registered, else false + */ + setGlobalContextManager(contextManager) { + return (0, global_utils_1.registerGlobal)(API_NAME, contextManager, diag_1.DiagAPI.instance()); + } + /** + * Get the currently active context + */ + active() { + return this._getContextManager().active(); + } + /** + * Execute a function with an active context + * + * @param context context to be active during function execution + * @param fn function to execute in a context + * @param thisArg optional receiver to be used for calling fn + * @param args optional arguments forwarded to fn + */ + with(context, fn, thisArg, ...args) { + return this._getContextManager().with(context, fn, thisArg, ...args); + } + /** + * Bind a context to a target function or event emitter + * + * @param context context to bind to the event emitter or function. Defaults to the currently active context + * @param target function or event emitter to bind + */ + bind(context, target) { + return this._getContextManager().bind(context, target); + } + _getContextManager() { + return (0, global_utils_1.getGlobal)(API_NAME) || NOOP_CONTEXT_MANAGER; + } + /** Disable and remove the global context manager */ + disable() { + this._getContextManager().disable(); + (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance()); + } +} +exports.ContextAPI = ContextAPI; +//# sourceMappingURL=context.js.map + +/***/ }), + +/***/ 11877: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DiagAPI = void 0; +const ComponentLogger_1 = __nccwpck_require__(17978); +const logLevelLogger_1 = __nccwpck_require__(99639); +const types_1 = __nccwpck_require__(78077); +const global_utils_1 = __nccwpck_require__(85135); +const API_NAME = 'diag'; +/** + * Singleton object which represents the entry point to the OpenTelemetry internal + * diagnostic API + */ +class DiagAPI { + /** + * Private internal constructor + * @private + */ + constructor() { + function _logProxy(funcName) { + return function (...args) { + const logger = (0, global_utils_1.getGlobal)('diag'); + // shortcut if logger not set + if (!logger) + return; + return logger[funcName](...args); + }; + } + // Using self local variable for minification purposes as 'this' cannot be minified + const self = this; + // DiagAPI specific functions + const setLogger = (logger, optionsOrLogLevel = { logLevel: types_1.DiagLogLevel.INFO }) => { + var _a, _b, _c; + if (logger === self) { + // There isn't much we can do here. + // Logging to the console might break the user application. + // Try to log to self. If a logger was previously registered it will receive the log. + const err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation'); + self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message); + return false; + } + if (typeof optionsOrLogLevel === 'number') { + optionsOrLogLevel = { + logLevel: optionsOrLogLevel, + }; + } + const oldLogger = (0, global_utils_1.getGlobal)('diag'); + const newLogger = (0, logLevelLogger_1.createLogLevelDiagLogger)((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : types_1.DiagLogLevel.INFO, logger); + // There already is an logger registered. We'll let it know before overwriting it. + if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) { + const stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : ''; + oldLogger.warn(`Current logger will be overwritten from ${stack}`); + newLogger.warn(`Current logger will overwrite one already registered from ${stack}`); + } + return (0, global_utils_1.registerGlobal)('diag', newLogger, self, true); + }; + self.setLogger = setLogger; + self.disable = () => { + (0, global_utils_1.unregisterGlobal)(API_NAME, self); + }; + self.createComponentLogger = (options) => { + return new ComponentLogger_1.DiagComponentLogger(options); + }; + self.verbose = _logProxy('verbose'); + self.debug = _logProxy('debug'); + self.info = _logProxy('info'); + self.warn = _logProxy('warn'); + self.error = _logProxy('error'); + } + /** Get the singleton instance of the DiagAPI API */ + static instance() { + if (!this._instance) { + this._instance = new DiagAPI(); + } + return this._instance; + } +} +exports.DiagAPI = DiagAPI; +//# sourceMappingURL=diag.js.map + +/***/ }), + +/***/ 17696: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MetricsAPI = void 0; +const NoopMeterProvider_1 = __nccwpck_require__(72647); +const global_utils_1 = __nccwpck_require__(85135); +const diag_1 = __nccwpck_require__(11877); +const API_NAME = 'metrics'; +/** + * Singleton object which represents the entry point to the OpenTelemetry Metrics API + */ +class MetricsAPI { + /** Empty private constructor prevents end users from constructing a new instance of the API */ + constructor() { } + /** Get the singleton instance of the Metrics API */ + static getInstance() { + if (!this._instance) { + this._instance = new MetricsAPI(); + } + return this._instance; + } + /** + * Set the current global meter provider. + * Returns true if the meter provider was successfully registered, else false. + */ + setGlobalMeterProvider(provider) { + return (0, global_utils_1.registerGlobal)(API_NAME, provider, diag_1.DiagAPI.instance()); + } + /** + * Returns the global meter provider. + */ + getMeterProvider() { + return (0, global_utils_1.getGlobal)(API_NAME) || NoopMeterProvider_1.NOOP_METER_PROVIDER; + } + /** + * Returns a meter from the global meter provider. + */ + getMeter(name, version, options) { + return this.getMeterProvider().getMeter(name, version, options); + } + /** Remove the global meter provider */ + disable() { + (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance()); + } +} +exports.MetricsAPI = MetricsAPI; +//# sourceMappingURL=metrics.js.map + +/***/ }), + +/***/ 89909: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PropagationAPI = void 0; +const global_utils_1 = __nccwpck_require__(85135); +const NoopTextMapPropagator_1 = __nccwpck_require__(72368); +const TextMapPropagator_1 = __nccwpck_require__(80865); +const context_helpers_1 = __nccwpck_require__(37682); +const utils_1 = __nccwpck_require__(28136); +const diag_1 = __nccwpck_require__(11877); +const API_NAME = 'propagation'; +const NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator_1.NoopTextMapPropagator(); +/** + * Singleton object which represents the entry point to the OpenTelemetry Propagation API + */ +class PropagationAPI { + /** Empty private constructor prevents end users from constructing a new instance of the API */ + constructor() { + this.createBaggage = utils_1.createBaggage; + this.getBaggage = context_helpers_1.getBaggage; + this.getActiveBaggage = context_helpers_1.getActiveBaggage; + this.setBaggage = context_helpers_1.setBaggage; + this.deleteBaggage = context_helpers_1.deleteBaggage; + } + /** Get the singleton instance of the Propagator API */ + static getInstance() { + if (!this._instance) { + this._instance = new PropagationAPI(); + } + return this._instance; + } + /** + * Set the current propagator. + * + * @returns true if the propagator was successfully registered, else false + */ + setGlobalPropagator(propagator) { + return (0, global_utils_1.registerGlobal)(API_NAME, propagator, diag_1.DiagAPI.instance()); + } + /** + * Inject context into a carrier to be propagated inter-process + * + * @param context Context carrying tracing data to inject + * @param carrier carrier to inject context into + * @param setter Function used to set values on the carrier + */ + inject(context, carrier, setter = TextMapPropagator_1.defaultTextMapSetter) { + return this._getGlobalPropagator().inject(context, carrier, setter); + } + /** + * Extract context from a carrier + * + * @param context Context which the newly created context will inherit from + * @param carrier Carrier to extract context from + * @param getter Function used to extract keys from a carrier + */ + extract(context, carrier, getter = TextMapPropagator_1.defaultTextMapGetter) { + return this._getGlobalPropagator().extract(context, carrier, getter); + } + /** + * Return a list of all fields which may be used by the propagator. + */ + fields() { + return this._getGlobalPropagator().fields(); + } + /** Remove the global propagator */ + disable() { + (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance()); + } + _getGlobalPropagator() { + return (0, global_utils_1.getGlobal)(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR; + } +} +exports.PropagationAPI = PropagationAPI; +//# sourceMappingURL=propagation.js.map + +/***/ }), + +/***/ 81539: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TraceAPI = void 0; +const global_utils_1 = __nccwpck_require__(85135); +const ProxyTracerProvider_1 = __nccwpck_require__(2285); +const spancontext_utils_1 = __nccwpck_require__(49745); +const context_utils_1 = __nccwpck_require__(23326); +const diag_1 = __nccwpck_require__(11877); +const API_NAME = 'trace'; +/** + * Singleton object which represents the entry point to the OpenTelemetry Tracing API + */ +class TraceAPI { + /** Empty private constructor prevents end users from constructing a new instance of the API */ + constructor() { + this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider(); + this.wrapSpanContext = spancontext_utils_1.wrapSpanContext; + this.isSpanContextValid = spancontext_utils_1.isSpanContextValid; + this.deleteSpan = context_utils_1.deleteSpan; + this.getSpan = context_utils_1.getSpan; + this.getActiveSpan = context_utils_1.getActiveSpan; + this.getSpanContext = context_utils_1.getSpanContext; + this.setSpan = context_utils_1.setSpan; + this.setSpanContext = context_utils_1.setSpanContext; + } + /** Get the singleton instance of the Trace API */ + static getInstance() { + if (!this._instance) { + this._instance = new TraceAPI(); + } + return this._instance; + } + /** + * Set the current global tracer. + * + * @returns true if the tracer provider was successfully registered, else false + */ + setGlobalTracerProvider(provider) { + const success = (0, global_utils_1.registerGlobal)(API_NAME, this._proxyTracerProvider, diag_1.DiagAPI.instance()); + if (success) { + this._proxyTracerProvider.setDelegate(provider); + } + return success; + } + /** + * Returns the global tracer provider. + */ + getTracerProvider() { + return (0, global_utils_1.getGlobal)(API_NAME) || this._proxyTracerProvider; + } + /** + * Returns a tracer from the global tracer provider. + */ + getTracer(name, version) { + return this.getTracerProvider().getTracer(name, version); + } + /** Remove the global tracer provider */ + disable() { + (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance()); + this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider(); + } +} +exports.TraceAPI = TraceAPI; +//# sourceMappingURL=trace.js.map + +/***/ }), + +/***/ 37682: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.deleteBaggage = exports.setBaggage = exports.getActiveBaggage = exports.getBaggage = void 0; +const context_1 = __nccwpck_require__(57171); +const context_2 = __nccwpck_require__(78242); +/** + * Baggage key + */ +const BAGGAGE_KEY = (0, context_2.createContextKey)('OpenTelemetry Baggage Key'); +/** + * Retrieve the current baggage from the given context + * + * @param {Context} Context that manage all context values + * @returns {Baggage} Extracted baggage from the context + */ +function getBaggage(context) { + return context.getValue(BAGGAGE_KEY) || undefined; +} +exports.getBaggage = getBaggage; +/** + * Retrieve the current baggage from the active/current context + * + * @returns {Baggage} Extracted baggage from the context + */ +function getActiveBaggage() { + return getBaggage(context_1.ContextAPI.getInstance().active()); +} +exports.getActiveBaggage = getActiveBaggage; +/** + * Store a baggage in the given context + * + * @param {Context} Context that manage all context values + * @param {Baggage} baggage that will be set in the actual context + */ +function setBaggage(context, baggage) { + return context.setValue(BAGGAGE_KEY, baggage); +} +exports.setBaggage = setBaggage; +/** + * Delete the baggage stored in the given context + * + * @param {Context} Context that manage all context values + */ +function deleteBaggage(context) { + return context.deleteValue(BAGGAGE_KEY); +} +exports.deleteBaggage = deleteBaggage; +//# sourceMappingURL=context-helpers.js.map + +/***/ }), + +/***/ 84811: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BaggageImpl = void 0; +class BaggageImpl { + constructor(entries) { + this._entries = entries ? new Map(entries) : new Map(); + } + getEntry(key) { + const entry = this._entries.get(key); + if (!entry) { + return undefined; + } + return Object.assign({}, entry); + } + getAllEntries() { + return Array.from(this._entries.entries()).map(([k, v]) => [k, v]); + } + setEntry(key, entry) { + const newBaggage = new BaggageImpl(this._entries); + newBaggage._entries.set(key, entry); + return newBaggage; + } + removeEntry(key) { + const newBaggage = new BaggageImpl(this._entries); + newBaggage._entries.delete(key); + return newBaggage; + } + removeEntries(...keys) { + const newBaggage = new BaggageImpl(this._entries); + for (const key of keys) { + newBaggage._entries.delete(key); + } + return newBaggage; + } + clear() { + return new BaggageImpl(); + } +} +exports.BaggageImpl = BaggageImpl; +//# sourceMappingURL=baggage-impl.js.map + +/***/ }), + +/***/ 23542: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.baggageEntryMetadataSymbol = void 0; +/** + * Symbol used to make BaggageEntryMetadata an opaque type + */ +exports.baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata'); +//# sourceMappingURL=symbol.js.map + +/***/ }), + +/***/ 28136: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.baggageEntryMetadataFromString = exports.createBaggage = void 0; +const diag_1 = __nccwpck_require__(11877); +const baggage_impl_1 = __nccwpck_require__(84811); +const symbol_1 = __nccwpck_require__(23542); +const diag = diag_1.DiagAPI.instance(); +/** + * Create a new Baggage with optional entries + * + * @param entries An array of baggage entries the new baggage should contain + */ +function createBaggage(entries = {}) { + return new baggage_impl_1.BaggageImpl(new Map(Object.entries(entries))); +} +exports.createBaggage = createBaggage; +/** + * Create a serializable BaggageEntryMetadata object from a string. + * + * @param str string metadata. Format is currently not defined by the spec and has no special meaning. + * + */ +function baggageEntryMetadataFromString(str) { + if (typeof str !== 'string') { + diag.error(`Cannot create baggage metadata from unknown type: ${typeof str}`); + str = ''; + } + return { + __TYPE__: symbol_1.baggageEntryMetadataSymbol, + toString() { + return str; + }, + }; +} +exports.baggageEntryMetadataFromString = baggageEntryMetadataFromString; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 7393: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.context = void 0; +// Split module-level variable definition into separate files to allow +// tree-shaking on each api instance. +const context_1 = __nccwpck_require__(57171); +/** Entrypoint for context API */ +exports.context = context_1.ContextAPI.getInstance(); +//# sourceMappingURL=context-api.js.map + +/***/ }), + +/***/ 54118: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NoopContextManager = void 0; +const context_1 = __nccwpck_require__(78242); +class NoopContextManager { + active() { + return context_1.ROOT_CONTEXT; + } + with(_context, fn, thisArg, ...args) { + return fn.call(thisArg, ...args); + } + bind(_context, target) { + return target; + } + enable() { + return this; + } + disable() { + return this; + } +} +exports.NoopContextManager = NoopContextManager; +//# sourceMappingURL=NoopContextManager.js.map + +/***/ }), + +/***/ 78242: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ROOT_CONTEXT = exports.createContextKey = void 0; +/** Get a key to uniquely identify a context value */ +function createContextKey(description) { + // The specification states that for the same input, multiple calls should + // return different keys. Due to the nature of the JS dependency management + // system, this creates problems where multiple versions of some package + // could hold different keys for the same property. + // + // Therefore, we use Symbol.for which returns the same key for the same input. + return Symbol.for(description); +} +exports.createContextKey = createContextKey; +class BaseContext { + /** + * Construct a new context which inherits values from an optional parent context. + * + * @param parentContext a context from which to inherit values + */ + constructor(parentContext) { + // for minification + const self = this; + self._currentContext = parentContext ? new Map(parentContext) : new Map(); + self.getValue = (key) => self._currentContext.get(key); + self.setValue = (key, value) => { + const context = new BaseContext(self._currentContext); + context._currentContext.set(key, value); + return context; + }; + self.deleteValue = (key) => { + const context = new BaseContext(self._currentContext); + context._currentContext.delete(key); + return context; + }; + } +} +/** The root context is used as the default parent context when there is no active context */ +exports.ROOT_CONTEXT = new BaseContext(); +//# sourceMappingURL=context.js.map + +/***/ }), + +/***/ 39721: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.diag = void 0; +// Split module-level variable definition into separate files to allow +// tree-shaking on each api instance. +const diag_1 = __nccwpck_require__(11877); +/** + * Entrypoint for Diag API. + * Defines Diagnostic handler used for internal diagnostic logging operations. + * The default provides a Noop DiagLogger implementation which may be changed via the + * diag.setLogger(logger: DiagLogger) function. + */ +exports.diag = diag_1.DiagAPI.instance(); +//# sourceMappingURL=diag-api.js.map + +/***/ }), + +/***/ 17978: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DiagComponentLogger = void 0; +const global_utils_1 = __nccwpck_require__(85135); +/** + * Component Logger which is meant to be used as part of any component which + * will add automatically additional namespace in front of the log message. + * It will then forward all message to global diag logger + * @example + * const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' }); + * cLogger.debug('test'); + * // @opentelemetry/instrumentation-http test + */ +class DiagComponentLogger { + constructor(props) { + this._namespace = props.namespace || 'DiagComponentLogger'; + } + debug(...args) { + return logProxy('debug', this._namespace, args); + } + error(...args) { + return logProxy('error', this._namespace, args); + } + info(...args) { + return logProxy('info', this._namespace, args); + } + warn(...args) { + return logProxy('warn', this._namespace, args); + } + verbose(...args) { + return logProxy('verbose', this._namespace, args); + } +} +exports.DiagComponentLogger = DiagComponentLogger; +function logProxy(funcName, namespace, args) { + const logger = (0, global_utils_1.getGlobal)('diag'); + // shortcut if logger not set + if (!logger) { + return; + } + args.unshift(namespace); + return logger[funcName](...args); +} +//# sourceMappingURL=ComponentLogger.js.map + +/***/ }), + +/***/ 3041: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DiagConsoleLogger = void 0; +const consoleMap = [ + { n: 'error', c: 'error' }, + { n: 'warn', c: 'warn' }, + { n: 'info', c: 'info' }, + { n: 'debug', c: 'debug' }, + { n: 'verbose', c: 'trace' }, +]; +/** + * A simple Immutable Console based diagnostic logger which will output any messages to the Console. + * If you want to limit the amount of logging to a specific level or lower use the + * {@link createLogLevelDiagLogger} + */ +class DiagConsoleLogger { + constructor() { + function _consoleFunc(funcName) { + return function (...args) { + if (console) { + // Some environments only expose the console when the F12 developer console is open + // eslint-disable-next-line no-console + let theFunc = console[funcName]; + if (typeof theFunc !== 'function') { + // Not all environments support all functions + // eslint-disable-next-line no-console + theFunc = console.log; + } + // One last final check + if (typeof theFunc === 'function') { + return theFunc.apply(console, args); + } + } + }; + } + for (let i = 0; i < consoleMap.length; i++) { + this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c); + } + } +} +exports.DiagConsoleLogger = DiagConsoleLogger; +//# sourceMappingURL=consoleLogger.js.map + +/***/ }), + +/***/ 99639: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createLogLevelDiagLogger = void 0; +const types_1 = __nccwpck_require__(78077); +function createLogLevelDiagLogger(maxLevel, logger) { + if (maxLevel < types_1.DiagLogLevel.NONE) { + maxLevel = types_1.DiagLogLevel.NONE; + } + else if (maxLevel > types_1.DiagLogLevel.ALL) { + maxLevel = types_1.DiagLogLevel.ALL; + } + // In case the logger is null or undefined + logger = logger || {}; + function _filterFunc(funcName, theLevel) { + const theFunc = logger[funcName]; + if (typeof theFunc === 'function' && maxLevel >= theLevel) { + return theFunc.bind(logger); + } + return function () { }; + } + return { + error: _filterFunc('error', types_1.DiagLogLevel.ERROR), + warn: _filterFunc('warn', types_1.DiagLogLevel.WARN), + info: _filterFunc('info', types_1.DiagLogLevel.INFO), + debug: _filterFunc('debug', types_1.DiagLogLevel.DEBUG), + verbose: _filterFunc('verbose', types_1.DiagLogLevel.VERBOSE), + }; +} +exports.createLogLevelDiagLogger = createLogLevelDiagLogger; +//# sourceMappingURL=logLevelLogger.js.map + +/***/ }), + +/***/ 78077: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DiagLogLevel = void 0; +/** + * Defines the available internal logging levels for the diagnostic logger, the numeric values + * of the levels are defined to match the original values from the initial LogLevel to avoid + * compatibility/migration issues for any implementation that assume the numeric ordering. + */ +var DiagLogLevel; +(function (DiagLogLevel) { + /** Diagnostic Logging level setting to disable all logging (except and forced logs) */ + DiagLogLevel[DiagLogLevel["NONE"] = 0] = "NONE"; + /** Identifies an error scenario */ + DiagLogLevel[DiagLogLevel["ERROR"] = 30] = "ERROR"; + /** Identifies a warning scenario */ + DiagLogLevel[DiagLogLevel["WARN"] = 50] = "WARN"; + /** General informational log message */ + DiagLogLevel[DiagLogLevel["INFO"] = 60] = "INFO"; + /** General debug log message */ + DiagLogLevel[DiagLogLevel["DEBUG"] = 70] = "DEBUG"; + /** + * Detailed trace level logging should only be used for development, should only be set + * in a development environment. + */ + DiagLogLevel[DiagLogLevel["VERBOSE"] = 80] = "VERBOSE"; + /** Used to set the logging level to include all logging */ + DiagLogLevel[DiagLogLevel["ALL"] = 9999] = "ALL"; +})(DiagLogLevel = exports.DiagLogLevel || (exports.DiagLogLevel = {})); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 65163: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.trace = exports.propagation = exports.metrics = exports.diag = exports.context = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.createTraceState = exports.TraceFlags = exports.SpanStatusCode = exports.SpanKind = exports.SamplingDecision = exports.ProxyTracerProvider = exports.ProxyTracer = exports.defaultTextMapSetter = exports.defaultTextMapGetter = exports.ValueType = exports.createNoopMeter = exports.DiagLogLevel = exports.DiagConsoleLogger = exports.ROOT_CONTEXT = exports.createContextKey = exports.baggageEntryMetadataFromString = void 0; +var utils_1 = __nccwpck_require__(28136); +Object.defineProperty(exports, "baggageEntryMetadataFromString", ({ enumerable: true, get: function () { return utils_1.baggageEntryMetadataFromString; } })); +// Context APIs +var context_1 = __nccwpck_require__(78242); +Object.defineProperty(exports, "createContextKey", ({ enumerable: true, get: function () { return context_1.createContextKey; } })); +Object.defineProperty(exports, "ROOT_CONTEXT", ({ enumerable: true, get: function () { return context_1.ROOT_CONTEXT; } })); +// Diag APIs +var consoleLogger_1 = __nccwpck_require__(3041); +Object.defineProperty(exports, "DiagConsoleLogger", ({ enumerable: true, get: function () { return consoleLogger_1.DiagConsoleLogger; } })); +var types_1 = __nccwpck_require__(78077); +Object.defineProperty(exports, "DiagLogLevel", ({ enumerable: true, get: function () { return types_1.DiagLogLevel; } })); +// Metrics APIs +var NoopMeter_1 = __nccwpck_require__(4837); +Object.defineProperty(exports, "createNoopMeter", ({ enumerable: true, get: function () { return NoopMeter_1.createNoopMeter; } })); +var Metric_1 = __nccwpck_require__(89999); +Object.defineProperty(exports, "ValueType", ({ enumerable: true, get: function () { return Metric_1.ValueType; } })); +// Propagation APIs +var TextMapPropagator_1 = __nccwpck_require__(80865); +Object.defineProperty(exports, "defaultTextMapGetter", ({ enumerable: true, get: function () { return TextMapPropagator_1.defaultTextMapGetter; } })); +Object.defineProperty(exports, "defaultTextMapSetter", ({ enumerable: true, get: function () { return TextMapPropagator_1.defaultTextMapSetter; } })); +var ProxyTracer_1 = __nccwpck_require__(43503); +Object.defineProperty(exports, "ProxyTracer", ({ enumerable: true, get: function () { return ProxyTracer_1.ProxyTracer; } })); +var ProxyTracerProvider_1 = __nccwpck_require__(2285); +Object.defineProperty(exports, "ProxyTracerProvider", ({ enumerable: true, get: function () { return ProxyTracerProvider_1.ProxyTracerProvider; } })); +var SamplingResult_1 = __nccwpck_require__(33209); +Object.defineProperty(exports, "SamplingDecision", ({ enumerable: true, get: function () { return SamplingResult_1.SamplingDecision; } })); +var span_kind_1 = __nccwpck_require__(31424); +Object.defineProperty(exports, "SpanKind", ({ enumerable: true, get: function () { return span_kind_1.SpanKind; } })); +var status_1 = __nccwpck_require__(48845); +Object.defineProperty(exports, "SpanStatusCode", ({ enumerable: true, get: function () { return status_1.SpanStatusCode; } })); +var trace_flags_1 = __nccwpck_require__(26905); +Object.defineProperty(exports, "TraceFlags", ({ enumerable: true, get: function () { return trace_flags_1.TraceFlags; } })); +var utils_2 = __nccwpck_require__(32615); +Object.defineProperty(exports, "createTraceState", ({ enumerable: true, get: function () { return utils_2.createTraceState; } })); +var spancontext_utils_1 = __nccwpck_require__(49745); +Object.defineProperty(exports, "isSpanContextValid", ({ enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } })); +Object.defineProperty(exports, "isValidTraceId", ({ enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } })); +Object.defineProperty(exports, "isValidSpanId", ({ enumerable: true, get: function () { return spancontext_utils_1.isValidSpanId; } })); +var invalid_span_constants_1 = __nccwpck_require__(91760); +Object.defineProperty(exports, "INVALID_SPANID", ({ enumerable: true, get: function () { return invalid_span_constants_1.INVALID_SPANID; } })); +Object.defineProperty(exports, "INVALID_TRACEID", ({ enumerable: true, get: function () { return invalid_span_constants_1.INVALID_TRACEID; } })); +Object.defineProperty(exports, "INVALID_SPAN_CONTEXT", ({ enumerable: true, get: function () { return invalid_span_constants_1.INVALID_SPAN_CONTEXT; } })); +// Split module-level variable definition into separate files to allow +// tree-shaking on each api instance. +const context_api_1 = __nccwpck_require__(7393); +Object.defineProperty(exports, "context", ({ enumerable: true, get: function () { return context_api_1.context; } })); +const diag_api_1 = __nccwpck_require__(39721); +Object.defineProperty(exports, "diag", ({ enumerable: true, get: function () { return diag_api_1.diag; } })); +const metrics_api_1 = __nccwpck_require__(72601); +Object.defineProperty(exports, "metrics", ({ enumerable: true, get: function () { return metrics_api_1.metrics; } })); +const propagation_api_1 = __nccwpck_require__(17591); +Object.defineProperty(exports, "propagation", ({ enumerable: true, get: function () { return propagation_api_1.propagation; } })); +const trace_api_1 = __nccwpck_require__(98989); +Object.defineProperty(exports, "trace", ({ enumerable: true, get: function () { return trace_api_1.trace; } })); +// Default export. +exports["default"] = { + context: context_api_1.context, + diag: diag_api_1.diag, + metrics: metrics_api_1.metrics, + propagation: propagation_api_1.propagation, + trace: trace_api_1.trace, +}; +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 85135: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.unregisterGlobal = exports.getGlobal = exports.registerGlobal = void 0; +const platform_1 = __nccwpck_require__(99957); +const version_1 = __nccwpck_require__(98996); +const semver_1 = __nccwpck_require__(81522); +const major = version_1.VERSION.split('.')[0]; +const GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(`opentelemetry.js.api.${major}`); +const _global = platform_1._globalThis; +function registerGlobal(type, instance, diag, allowOverride = false) { + var _a; + const api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : { + version: version_1.VERSION, + }); + if (!allowOverride && api[type]) { + // already registered an API of this type + const err = new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${type}`); + diag.error(err.stack || err.message); + return false; + } + if (api.version !== version_1.VERSION) { + // All registered APIs must be of the same version exactly + const err = new Error(`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${version_1.VERSION}`); + diag.error(err.stack || err.message); + return false; + } + api[type] = instance; + diag.debug(`@opentelemetry/api: Registered a global for ${type} v${version_1.VERSION}.`); + return true; +} +exports.registerGlobal = registerGlobal; +function getGlobal(type) { + var _a, _b; + const globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version; + if (!globalVersion || !(0, semver_1.isCompatible)(globalVersion)) { + return; + } + return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type]; +} +exports.getGlobal = getGlobal; +function unregisterGlobal(type, diag) { + diag.debug(`@opentelemetry/api: Unregistering a global for ${type} v${version_1.VERSION}.`); + const api = _global[GLOBAL_OPENTELEMETRY_API_KEY]; + if (api) { + delete api[type]; + } +} +exports.unregisterGlobal = unregisterGlobal; +//# sourceMappingURL=global-utils.js.map + +/***/ }), + +/***/ 81522: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isCompatible = exports._makeCompatibilityCheck = void 0; +const version_1 = __nccwpck_require__(98996); +const re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/; +/** + * Create a function to test an API version to see if it is compatible with the provided ownVersion. + * + * The returned function has the following semantics: + * - Exact match is always compatible + * - Major versions must match exactly + * - 1.x package cannot use global 2.x package + * - 2.x package cannot use global 1.x package + * - 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 + * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects + * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3 + * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor + * - Patch and build tag differences are not considered at this time + * + * @param ownVersion version which should be checked against + */ +function _makeCompatibilityCheck(ownVersion) { + const acceptedVersions = new Set([ownVersion]); + const rejectedVersions = new Set(); + const myVersionMatch = ownVersion.match(re); + if (!myVersionMatch) { + // we cannot guarantee compatibility so we always return noop + return () => false; + } + const ownVersionParsed = { + major: +myVersionMatch[1], + minor: +myVersionMatch[2], + patch: +myVersionMatch[3], + prerelease: myVersionMatch[4], + }; + // if ownVersion has a prerelease tag, versions must match exactly + if (ownVersionParsed.prerelease != null) { + return function isExactmatch(globalVersion) { + return globalVersion === ownVersion; + }; + } + function _reject(v) { + rejectedVersions.add(v); + return false; + } + function _accept(v) { + acceptedVersions.add(v); + return true; + } + return function isCompatible(globalVersion) { + if (acceptedVersions.has(globalVersion)) { + return true; + } + if (rejectedVersions.has(globalVersion)) { + return false; + } + const globalVersionMatch = globalVersion.match(re); + if (!globalVersionMatch) { + // cannot parse other version + // we cannot guarantee compatibility so we always noop + return _reject(globalVersion); + } + const globalVersionParsed = { + major: +globalVersionMatch[1], + minor: +globalVersionMatch[2], + patch: +globalVersionMatch[3], + prerelease: globalVersionMatch[4], + }; + // if globalVersion has a prerelease tag, versions must match exactly + if (globalVersionParsed.prerelease != null) { + return _reject(globalVersion); + } + // major versions must match + if (ownVersionParsed.major !== globalVersionParsed.major) { + return _reject(globalVersion); + } + if (ownVersionParsed.major === 0) { + if (ownVersionParsed.minor === globalVersionParsed.minor && + ownVersionParsed.patch <= globalVersionParsed.patch) { + return _accept(globalVersion); + } + return _reject(globalVersion); + } + if (ownVersionParsed.minor <= globalVersionParsed.minor) { + return _accept(globalVersion); + } + return _reject(globalVersion); + }; +} +exports._makeCompatibilityCheck = _makeCompatibilityCheck; +/** + * Test an API version to see if it is compatible with this API. + * + * - Exact match is always compatible + * - Major versions must match exactly + * - 1.x package cannot use global 2.x package + * - 2.x package cannot use global 1.x package + * - 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 + * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects + * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3 + * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor + * - Patch and build tag differences are not considered at this time + * + * @param version version of the API requesting an instance of the global API + */ +exports.isCompatible = _makeCompatibilityCheck(version_1.VERSION); +//# sourceMappingURL=semver.js.map + +/***/ }), + +/***/ 72601: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.metrics = void 0; +// Split module-level variable definition into separate files to allow +// tree-shaking on each api instance. +const metrics_1 = __nccwpck_require__(17696); +/** Entrypoint for metrics API */ +exports.metrics = metrics_1.MetricsAPI.getInstance(); +//# sourceMappingURL=metrics-api.js.map + +/***/ }), + +/***/ 89999: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ValueType = void 0; +/** The Type of value. It describes how the data is reported. */ +var ValueType; +(function (ValueType) { + ValueType[ValueType["INT"] = 0] = "INT"; + ValueType[ValueType["DOUBLE"] = 1] = "DOUBLE"; +})(ValueType = exports.ValueType || (exports.ValueType = {})); +//# sourceMappingURL=Metric.js.map + +/***/ }), + +/***/ 4837: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createNoopMeter = exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = exports.NOOP_OBSERVABLE_GAUGE_METRIC = exports.NOOP_OBSERVABLE_COUNTER_METRIC = exports.NOOP_UP_DOWN_COUNTER_METRIC = exports.NOOP_HISTOGRAM_METRIC = exports.NOOP_GAUGE_METRIC = exports.NOOP_COUNTER_METRIC = exports.NOOP_METER = exports.NoopObservableUpDownCounterMetric = exports.NoopObservableGaugeMetric = exports.NoopObservableCounterMetric = exports.NoopObservableMetric = exports.NoopHistogramMetric = exports.NoopGaugeMetric = exports.NoopUpDownCounterMetric = exports.NoopCounterMetric = exports.NoopMetric = exports.NoopMeter = void 0; +/** + * NoopMeter is a noop implementation of the {@link Meter} interface. It reuses + * constant NoopMetrics for all of its methods. + */ +class NoopMeter { + constructor() { } + /** + * @see {@link Meter.createGauge} + */ + createGauge(_name, _options) { + return exports.NOOP_GAUGE_METRIC; + } + /** + * @see {@link Meter.createHistogram} + */ + createHistogram(_name, _options) { + return exports.NOOP_HISTOGRAM_METRIC; + } + /** + * @see {@link Meter.createCounter} + */ + createCounter(_name, _options) { + return exports.NOOP_COUNTER_METRIC; + } + /** + * @see {@link Meter.createUpDownCounter} + */ + createUpDownCounter(_name, _options) { + return exports.NOOP_UP_DOWN_COUNTER_METRIC; + } + /** + * @see {@link Meter.createObservableGauge} + */ + createObservableGauge(_name, _options) { + return exports.NOOP_OBSERVABLE_GAUGE_METRIC; + } + /** + * @see {@link Meter.createObservableCounter} + */ + createObservableCounter(_name, _options) { + return exports.NOOP_OBSERVABLE_COUNTER_METRIC; + } + /** + * @see {@link Meter.createObservableUpDownCounter} + */ + createObservableUpDownCounter(_name, _options) { + return exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC; + } + /** + * @see {@link Meter.addBatchObservableCallback} + */ + addBatchObservableCallback(_callback, _observables) { } + /** + * @see {@link Meter.removeBatchObservableCallback} + */ + removeBatchObservableCallback(_callback) { } +} +exports.NoopMeter = NoopMeter; +class NoopMetric { +} +exports.NoopMetric = NoopMetric; +class NoopCounterMetric extends NoopMetric { + add(_value, _attributes) { } +} +exports.NoopCounterMetric = NoopCounterMetric; +class NoopUpDownCounterMetric extends NoopMetric { + add(_value, _attributes) { } +} +exports.NoopUpDownCounterMetric = NoopUpDownCounterMetric; +class NoopGaugeMetric extends NoopMetric { + record(_value, _attributes) { } +} +exports.NoopGaugeMetric = NoopGaugeMetric; +class NoopHistogramMetric extends NoopMetric { + record(_value, _attributes) { } +} +exports.NoopHistogramMetric = NoopHistogramMetric; +class NoopObservableMetric { + addCallback(_callback) { } + removeCallback(_callback) { } +} +exports.NoopObservableMetric = NoopObservableMetric; +class NoopObservableCounterMetric extends NoopObservableMetric { +} +exports.NoopObservableCounterMetric = NoopObservableCounterMetric; +class NoopObservableGaugeMetric extends NoopObservableMetric { +} +exports.NoopObservableGaugeMetric = NoopObservableGaugeMetric; +class NoopObservableUpDownCounterMetric extends NoopObservableMetric { +} +exports.NoopObservableUpDownCounterMetric = NoopObservableUpDownCounterMetric; +exports.NOOP_METER = new NoopMeter(); +// Synchronous instruments +exports.NOOP_COUNTER_METRIC = new NoopCounterMetric(); +exports.NOOP_GAUGE_METRIC = new NoopGaugeMetric(); +exports.NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric(); +exports.NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric(); +// Asynchronous instruments +exports.NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric(); +exports.NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric(); +exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric(); +/** + * Create a no-op Meter + */ +function createNoopMeter() { + return exports.NOOP_METER; +} +exports.createNoopMeter = createNoopMeter; +//# sourceMappingURL=NoopMeter.js.map + +/***/ }), + +/***/ 72647: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NOOP_METER_PROVIDER = exports.NoopMeterProvider = void 0; +const NoopMeter_1 = __nccwpck_require__(4837); +/** + * An implementation of the {@link MeterProvider} which returns an impotent Meter + * for all calls to `getMeter` + */ +class NoopMeterProvider { + getMeter(_name, _version, _options) { + return NoopMeter_1.NOOP_METER; + } +} +exports.NoopMeterProvider = NoopMeterProvider; +exports.NOOP_METER_PROVIDER = new NoopMeterProvider(); +//# sourceMappingURL=NoopMeterProvider.js.map + +/***/ }), + +/***/ 99957: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(87200), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 89406: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._globalThis = void 0; +/** only globals that common to node and browsers are allowed */ +// eslint-disable-next-line node/no-unsupported-features/es-builtins +exports._globalThis = typeof globalThis === 'object' ? globalThis : global; +//# sourceMappingURL=globalThis.js.map + +/***/ }), + +/***/ 87200: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(89406), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 17591: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.propagation = void 0; +// Split module-level variable definition into separate files to allow +// tree-shaking on each api instance. +const propagation_1 = __nccwpck_require__(89909); +/** Entrypoint for propagation API */ +exports.propagation = propagation_1.PropagationAPI.getInstance(); +//# sourceMappingURL=propagation-api.js.map + +/***/ }), + +/***/ 72368: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NoopTextMapPropagator = void 0; +/** + * No-op implementations of {@link TextMapPropagator}. + */ +class NoopTextMapPropagator { + /** Noop inject function does nothing */ + inject(_context, _carrier) { } + /** Noop extract function does nothing and returns the input context */ + extract(context, _carrier) { + return context; + } + fields() { + return []; + } +} +exports.NoopTextMapPropagator = NoopTextMapPropagator; +//# sourceMappingURL=NoopTextMapPropagator.js.map + +/***/ }), + +/***/ 80865: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.defaultTextMapSetter = exports.defaultTextMapGetter = void 0; +exports.defaultTextMapGetter = { + get(carrier, key) { + if (carrier == null) { + return undefined; + } + return carrier[key]; + }, + keys(carrier) { + if (carrier == null) { + return []; + } + return Object.keys(carrier); + }, +}; +exports.defaultTextMapSetter = { + set(carrier, key, value) { + if (carrier == null) { + return; + } + carrier[key] = value; + }, +}; +//# sourceMappingURL=TextMapPropagator.js.map + +/***/ }), + +/***/ 98989: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.trace = void 0; +// Split module-level variable definition into separate files to allow +// tree-shaking on each api instance. +const trace_1 = __nccwpck_require__(81539); +/** Entrypoint for trace API */ +exports.trace = trace_1.TraceAPI.getInstance(); +//# sourceMappingURL=trace-api.js.map + +/***/ }), + +/***/ 81462: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NonRecordingSpan = void 0; +const invalid_span_constants_1 = __nccwpck_require__(91760); +/** + * The NonRecordingSpan is the default {@link Span} that is used when no Span + * implementation is available. All operations are no-op including context + * propagation. + */ +class NonRecordingSpan { + constructor(_spanContext = invalid_span_constants_1.INVALID_SPAN_CONTEXT) { + this._spanContext = _spanContext; + } + // Returns a SpanContext. + spanContext() { + return this._spanContext; + } + // By default does nothing + setAttribute(_key, _value) { + return this; + } + // By default does nothing + setAttributes(_attributes) { + return this; + } + // By default does nothing + addEvent(_name, _attributes) { + return this; + } + addLink(_link) { + return this; + } + addLinks(_links) { + return this; + } + // By default does nothing + setStatus(_status) { + return this; + } + // By default does nothing + updateName(_name) { + return this; + } + // By default does nothing + end(_endTime) { } + // isRecording always returns false for NonRecordingSpan. + isRecording() { + return false; + } + // By default does nothing + recordException(_exception, _time) { } +} +exports.NonRecordingSpan = NonRecordingSpan; +//# sourceMappingURL=NonRecordingSpan.js.map + +/***/ }), + +/***/ 17606: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NoopTracer = void 0; +const context_1 = __nccwpck_require__(57171); +const context_utils_1 = __nccwpck_require__(23326); +const NonRecordingSpan_1 = __nccwpck_require__(81462); +const spancontext_utils_1 = __nccwpck_require__(49745); +const contextApi = context_1.ContextAPI.getInstance(); +/** + * No-op implementations of {@link Tracer}. + */ +class NoopTracer { + // startSpan starts a noop span. + startSpan(name, options, context = contextApi.active()) { + const root = Boolean(options === null || options === void 0 ? void 0 : options.root); + if (root) { + return new NonRecordingSpan_1.NonRecordingSpan(); + } + const parentFromContext = context && (0, context_utils_1.getSpanContext)(context); + if (isSpanContext(parentFromContext) && + (0, spancontext_utils_1.isSpanContextValid)(parentFromContext)) { + return new NonRecordingSpan_1.NonRecordingSpan(parentFromContext); + } + else { + return new NonRecordingSpan_1.NonRecordingSpan(); + } + } + startActiveSpan(name, arg2, arg3, arg4) { + let opts; + let ctx; + let fn; + if (arguments.length < 2) { + return; + } + else if (arguments.length === 2) { + fn = arg2; + } + else if (arguments.length === 3) { + opts = arg2; + fn = arg3; + } + else { + opts = arg2; + ctx = arg3; + fn = arg4; + } + const parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active(); + const span = this.startSpan(name, opts, parentContext); + const contextWithSpanSet = (0, context_utils_1.setSpan)(parentContext, span); + return contextApi.with(contextWithSpanSet, fn, undefined, span); + } +} +exports.NoopTracer = NoopTracer; +function isSpanContext(spanContext) { + return (typeof spanContext === 'object' && + typeof spanContext['spanId'] === 'string' && + typeof spanContext['traceId'] === 'string' && + typeof spanContext['traceFlags'] === 'number'); +} +//# sourceMappingURL=NoopTracer.js.map + +/***/ }), + +/***/ 23259: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NoopTracerProvider = void 0; +const NoopTracer_1 = __nccwpck_require__(17606); +/** + * An implementation of the {@link TracerProvider} which returns an impotent + * Tracer for all calls to `getTracer`. + * + * All operations are no-op. + */ +class NoopTracerProvider { + getTracer(_name, _version, _options) { + return new NoopTracer_1.NoopTracer(); + } +} +exports.NoopTracerProvider = NoopTracerProvider; +//# sourceMappingURL=NoopTracerProvider.js.map + +/***/ }), + +/***/ 43503: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ProxyTracer = void 0; +const NoopTracer_1 = __nccwpck_require__(17606); +const NOOP_TRACER = new NoopTracer_1.NoopTracer(); +/** + * Proxy tracer provided by the proxy tracer provider + */ +class ProxyTracer { + constructor(_provider, name, version, options) { + this._provider = _provider; + this.name = name; + this.version = version; + this.options = options; + } + startSpan(name, options, context) { + return this._getTracer().startSpan(name, options, context); + } + startActiveSpan(_name, _options, _context, _fn) { + const tracer = this._getTracer(); + return Reflect.apply(tracer.startActiveSpan, tracer, arguments); + } + /** + * Try to get a tracer from the proxy tracer provider. + * If the proxy tracer provider has no delegate, return a noop tracer. + */ + _getTracer() { + if (this._delegate) { + return this._delegate; + } + const tracer = this._provider.getDelegateTracer(this.name, this.version, this.options); + if (!tracer) { + return NOOP_TRACER; + } + this._delegate = tracer; + return this._delegate; + } +} +exports.ProxyTracer = ProxyTracer; +//# sourceMappingURL=ProxyTracer.js.map + +/***/ }), + +/***/ 2285: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ProxyTracerProvider = void 0; +const ProxyTracer_1 = __nccwpck_require__(43503); +const NoopTracerProvider_1 = __nccwpck_require__(23259); +const NOOP_TRACER_PROVIDER = new NoopTracerProvider_1.NoopTracerProvider(); +/** + * Tracer provider which provides {@link ProxyTracer}s. + * + * Before a delegate is set, tracers provided are NoOp. + * When a delegate is set, traces are provided from the delegate. + * When a delegate is set after tracers have already been provided, + * all tracers already provided will use the provided delegate implementation. + */ +class ProxyTracerProvider { + /** + * Get a {@link ProxyTracer} + */ + getTracer(name, version, options) { + var _a; + return ((_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer_1.ProxyTracer(this, name, version, options)); + } + getDelegate() { + var _a; + return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER; + } + /** + * Set the delegate tracer provider + */ + setDelegate(delegate) { + this._delegate = delegate; + } + getDelegateTracer(name, version, options) { + var _a; + return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options); + } +} +exports.ProxyTracerProvider = ProxyTracerProvider; +//# sourceMappingURL=ProxyTracerProvider.js.map + +/***/ }), + +/***/ 33209: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SamplingDecision = void 0; +/** + * @deprecated use the one declared in @opentelemetry/sdk-trace-base instead. + * A sampling decision that determines how a {@link Span} will be recorded + * and collected. + */ +var SamplingDecision; +(function (SamplingDecision) { + /** + * `Span.isRecording() === false`, span will not be recorded and all events + * and attributes will be dropped. + */ + SamplingDecision[SamplingDecision["NOT_RECORD"] = 0] = "NOT_RECORD"; + /** + * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags} + * MUST NOT be set. + */ + SamplingDecision[SamplingDecision["RECORD"] = 1] = "RECORD"; + /** + * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags} + * MUST be set. + */ + SamplingDecision[SamplingDecision["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; +})(SamplingDecision = exports.SamplingDecision || (exports.SamplingDecision = {})); +//# sourceMappingURL=SamplingResult.js.map + +/***/ }), + +/***/ 23326: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getSpanContext = exports.setSpanContext = exports.deleteSpan = exports.setSpan = exports.getActiveSpan = exports.getSpan = void 0; +const context_1 = __nccwpck_require__(78242); +const NonRecordingSpan_1 = __nccwpck_require__(81462); +const context_2 = __nccwpck_require__(57171); +/** + * span key + */ +const SPAN_KEY = (0, context_1.createContextKey)('OpenTelemetry Context Key SPAN'); +/** + * Return the span if one exists + * + * @param context context to get span from + */ +function getSpan(context) { + return context.getValue(SPAN_KEY) || undefined; +} +exports.getSpan = getSpan; +/** + * Gets the span from the current context, if one exists. + */ +function getActiveSpan() { + return getSpan(context_2.ContextAPI.getInstance().active()); +} +exports.getActiveSpan = getActiveSpan; +/** + * Set the span on a context + * + * @param context context to use as parent + * @param span span to set active + */ +function setSpan(context, span) { + return context.setValue(SPAN_KEY, span); +} +exports.setSpan = setSpan; +/** + * Remove current span stored in the context + * + * @param context context to delete span from + */ +function deleteSpan(context) { + return context.deleteValue(SPAN_KEY); +} +exports.deleteSpan = deleteSpan; +/** + * Wrap span context in a NoopSpan and set as span in a new + * context + * + * @param context context to set active span on + * @param spanContext span context to be wrapped + */ +function setSpanContext(context, spanContext) { + return setSpan(context, new NonRecordingSpan_1.NonRecordingSpan(spanContext)); +} +exports.setSpanContext = setSpanContext; +/** + * Get the span context of the span if it exists. + * + * @param context context to get values from + */ +function getSpanContext(context) { + var _a; + return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.spanContext(); +} +exports.getSpanContext = getSpanContext; +//# sourceMappingURL=context-utils.js.map + +/***/ }), + +/***/ 62110: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TraceStateImpl = void 0; +const tracestate_validators_1 = __nccwpck_require__(54864); +const MAX_TRACE_STATE_ITEMS = 32; +const MAX_TRACE_STATE_LEN = 512; +const LIST_MEMBERS_SEPARATOR = ','; +const LIST_MEMBER_KEY_VALUE_SPLITTER = '='; +/** + * TraceState must be a class and not a simple object type because of the spec + * requirement (https://www.w3.org/TR/trace-context/#tracestate-field). + * + * Here is the list of allowed mutations: + * - New key-value pair should be added into the beginning of the list + * - The value of any key can be updated. Modified keys MUST be moved to the + * beginning of the list. + */ +class TraceStateImpl { + constructor(rawTraceState) { + this._internalState = new Map(); + if (rawTraceState) + this._parse(rawTraceState); + } + set(key, value) { + // TODO: Benchmark the different approaches(map vs list) and + // use the faster one. + const traceState = this._clone(); + if (traceState._internalState.has(key)) { + traceState._internalState.delete(key); + } + traceState._internalState.set(key, value); + return traceState; + } + unset(key) { + const traceState = this._clone(); + traceState._internalState.delete(key); + return traceState; + } + get(key) { + return this._internalState.get(key); + } + serialize() { + return this._keys() + .reduce((agg, key) => { + agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key)); + return agg; + }, []) + .join(LIST_MEMBERS_SEPARATOR); + } + _parse(rawTraceState) { + if (rawTraceState.length > MAX_TRACE_STATE_LEN) + return; + this._internalState = rawTraceState + .split(LIST_MEMBERS_SEPARATOR) + .reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning + .reduce((agg, part) => { + const listMember = part.trim(); // Optional Whitespace (OWS) handling + const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); + if (i !== -1) { + const key = listMember.slice(0, i); + const value = listMember.slice(i + 1, part.length); + if ((0, tracestate_validators_1.validateKey)(key) && (0, tracestate_validators_1.validateValue)(value)) { + agg.set(key, value); + } + else { + // TODO: Consider to add warning log + } + } + return agg; + }, new Map()); + // Because of the reverse() requirement, trunc must be done after map is created + if (this._internalState.size > MAX_TRACE_STATE_ITEMS) { + this._internalState = new Map(Array.from(this._internalState.entries()) + .reverse() // Use reverse same as original tracestate parse chain + .slice(0, MAX_TRACE_STATE_ITEMS)); + } + } + _keys() { + return Array.from(this._internalState.keys()).reverse(); + } + _clone() { + const traceState = new TraceStateImpl(); + traceState._internalState = new Map(this._internalState); + return traceState; + } +} +exports.TraceStateImpl = TraceStateImpl; +//# sourceMappingURL=tracestate-impl.js.map + +/***/ }), + +/***/ 54864: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.validateValue = exports.validateKey = void 0; +const VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]'; +const VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; +const VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; +const VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); +const VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; +const INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; +/** + * Key is opaque string up to 256 characters printable. It MUST begin with a + * lowercase letter, and can only contain lowercase letters a-z, digits 0-9, + * underscores _, dashes -, asterisks *, and forward slashes /. + * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the + * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key. + * see https://www.w3.org/TR/trace-context/#key + */ +function validateKey(key) { + return VALID_KEY_REGEX.test(key); +} +exports.validateKey = validateKey; +/** + * Value is opaque string up to 256 characters printable ASCII RFC0020 + * characters (i.e., the range 0x20 to 0x7E) except comma , and =. + */ +function validateValue(value) { + return (VALID_VALUE_BASE_REGEX.test(value) && + !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value)); +} +exports.validateValue = validateValue; +//# sourceMappingURL=tracestate-validators.js.map + +/***/ }), + +/***/ 32615: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createTraceState = void 0; +const tracestate_impl_1 = __nccwpck_require__(62110); +function createTraceState(rawTraceState) { + return new tracestate_impl_1.TraceStateImpl(rawTraceState); +} +exports.createTraceState = createTraceState; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 91760: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = void 0; +const trace_flags_1 = __nccwpck_require__(26905); +exports.INVALID_SPANID = '0000000000000000'; +exports.INVALID_TRACEID = '00000000000000000000000000000000'; +exports.INVALID_SPAN_CONTEXT = { + traceId: exports.INVALID_TRACEID, + spanId: exports.INVALID_SPANID, + traceFlags: trace_flags_1.TraceFlags.NONE, +}; +//# sourceMappingURL=invalid-span-constants.js.map + +/***/ }), + +/***/ 31424: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SpanKind = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var SpanKind; +(function (SpanKind) { + /** Default value. Indicates that the span is used internally. */ + SpanKind[SpanKind["INTERNAL"] = 0] = "INTERNAL"; + /** + * Indicates that the span covers server-side handling of an RPC or other + * remote request. + */ + SpanKind[SpanKind["SERVER"] = 1] = "SERVER"; + /** + * Indicates that the span covers the client-side wrapper around an RPC or + * other remote request. + */ + SpanKind[SpanKind["CLIENT"] = 2] = "CLIENT"; + /** + * Indicates that the span describes producer sending a message to a + * broker. Unlike client and server, there is no direct critical path latency + * relationship between producer and consumer spans. + */ + SpanKind[SpanKind["PRODUCER"] = 3] = "PRODUCER"; + /** + * Indicates that the span describes consumer receiving a message from a + * broker. Unlike client and server, there is no direct critical path latency + * relationship between producer and consumer spans. + */ + SpanKind[SpanKind["CONSUMER"] = 4] = "CONSUMER"; +})(SpanKind = exports.SpanKind || (exports.SpanKind = {})); +//# sourceMappingURL=span_kind.js.map + +/***/ }), + +/***/ 49745: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.wrapSpanContext = exports.isSpanContextValid = exports.isValidSpanId = exports.isValidTraceId = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const invalid_span_constants_1 = __nccwpck_require__(91760); +const NonRecordingSpan_1 = __nccwpck_require__(81462); +const VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i; +const VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i; +function isValidTraceId(traceId) { + return VALID_TRACEID_REGEX.test(traceId) && traceId !== invalid_span_constants_1.INVALID_TRACEID; +} +exports.isValidTraceId = isValidTraceId; +function isValidSpanId(spanId) { + return VALID_SPANID_REGEX.test(spanId) && spanId !== invalid_span_constants_1.INVALID_SPANID; +} +exports.isValidSpanId = isValidSpanId; +/** + * Returns true if this {@link SpanContext} is valid. + * @return true if this {@link SpanContext} is valid. + */ +function isSpanContextValid(spanContext) { + return (isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId)); +} +exports.isSpanContextValid = isSpanContextValid; +/** + * Wrap the given {@link SpanContext} in a new non-recording {@link Span} + * + * @param spanContext span context to be wrapped + * @returns a new non-recording {@link Span} with the provided context + */ +function wrapSpanContext(spanContext) { + return new NonRecordingSpan_1.NonRecordingSpan(spanContext); +} +exports.wrapSpanContext = wrapSpanContext; +//# sourceMappingURL=spancontext-utils.js.map + +/***/ }), + +/***/ 48845: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SpanStatusCode = void 0; +/** + * An enumeration of status codes. + */ +var SpanStatusCode; +(function (SpanStatusCode) { + /** + * The default status. + */ + SpanStatusCode[SpanStatusCode["UNSET"] = 0] = "UNSET"; + /** + * The operation has been validated by an Application developer or + * Operator to have completed successfully. + */ + SpanStatusCode[SpanStatusCode["OK"] = 1] = "OK"; + /** + * The operation contains an error. + */ + SpanStatusCode[SpanStatusCode["ERROR"] = 2] = "ERROR"; +})(SpanStatusCode = exports.SpanStatusCode || (exports.SpanStatusCode = {})); +//# sourceMappingURL=status.js.map + +/***/ }), + +/***/ 26905: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TraceFlags = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var TraceFlags; +(function (TraceFlags) { + /** Represents no flag set. */ + TraceFlags[TraceFlags["NONE"] = 0] = "NONE"; + /** Bit to represent whether trace is sampled in trace flags. */ + TraceFlags[TraceFlags["SAMPLED"] = 1] = "SAMPLED"; +})(TraceFlags = exports.TraceFlags || (exports.TraceFlags = {})); +//# sourceMappingURL=trace_flags.js.map + +/***/ }), + +/***/ 98996: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.VERSION = '1.9.0'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 85788: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AbstractAsyncHooksContextManager = void 0; +const events_1 = __nccwpck_require__(82361); +const ADD_LISTENER_METHODS = [ + 'addListener', + 'on', + 'once', + 'prependListener', + 'prependOnceListener', +]; +class AbstractAsyncHooksContextManager { + constructor() { + this._kOtListeners = Symbol('OtListeners'); + this._wrapped = false; + } + /** + * Binds a the certain context or the active one to the target function and then returns the target + * @param context A context (span) to be bind to target + * @param target a function or event emitter. When target or one of its callbacks is called, + * the provided context will be used as the active context for the duration of the call. + */ + bind(context, target) { + if (target instanceof events_1.EventEmitter) { + return this._bindEventEmitter(context, target); + } + if (typeof target === 'function') { + return this._bindFunction(context, target); + } + return target; + } + _bindFunction(context, target) { + const manager = this; + const contextWrapper = function (...args) { + return manager.with(context, () => target.apply(this, args)); + }; + Object.defineProperty(contextWrapper, 'length', { + enumerable: false, + configurable: true, + writable: false, + value: target.length, + }); + /** + * It isn't possible to tell Typescript that contextWrapper is the same as T + * so we forced to cast as any here. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return contextWrapper; + } + /** + * By default, EventEmitter call their callback with their context, which we do + * not want, instead we will bind a specific context to all callbacks that + * go through it. + * @param context the context we want to bind + * @param ee EventEmitter an instance of EventEmitter to patch + */ + _bindEventEmitter(context, ee) { + const map = this._getPatchMap(ee); + if (map !== undefined) + return ee; + this._createPatchMap(ee); + // patch methods that add a listener to propagate context + ADD_LISTENER_METHODS.forEach(methodName => { + if (ee[methodName] === undefined) + return; + ee[methodName] = this._patchAddListener(ee, ee[methodName], context); + }); + // patch methods that remove a listener + if (typeof ee.removeListener === 'function') { + ee.removeListener = this._patchRemoveListener(ee, ee.removeListener); + } + if (typeof ee.off === 'function') { + ee.off = this._patchRemoveListener(ee, ee.off); + } + // patch method that remove all listeners + if (typeof ee.removeAllListeners === 'function') { + ee.removeAllListeners = this._patchRemoveAllListeners(ee, ee.removeAllListeners); + } + return ee; + } + /** + * Patch methods that remove a given listener so that we match the "patched" + * version of that listener (the one that propagate context). + * @param ee EventEmitter instance + * @param original reference to the patched method + */ + _patchRemoveListener(ee, original) { + const contextManager = this; + return function (event, listener) { + var _a; + const events = (_a = contextManager._getPatchMap(ee)) === null || _a === void 0 ? void 0 : _a[event]; + if (events === undefined) { + return original.call(this, event, listener); + } + const patchedListener = events.get(listener); + return original.call(this, event, patchedListener || listener); + }; + } + /** + * Patch methods that remove all listeners so we remove our + * internal references for a given event. + * @param ee EventEmitter instance + * @param original reference to the patched method + */ + _patchRemoveAllListeners(ee, original) { + const contextManager = this; + return function (event) { + const map = contextManager._getPatchMap(ee); + if (map !== undefined) { + if (arguments.length === 0) { + contextManager._createPatchMap(ee); + } + else if (map[event] !== undefined) { + delete map[event]; + } + } + return original.apply(this, arguments); + }; + } + /** + * Patch methods on an event emitter instance that can add listeners so we + * can force them to propagate a given context. + * @param ee EventEmitter instance + * @param original reference to the patched method + * @param [context] context to propagate when calling listeners + */ + _patchAddListener(ee, original, context) { + const contextManager = this; + return function (event, listener) { + /** + * This check is required to prevent double-wrapping the listener. + * The implementation for ee.once wraps the listener and calls ee.on. + * Without this check, we would wrap that wrapped listener. + * This causes an issue because ee.removeListener depends on the onceWrapper + * to properly remove the listener. If we wrap their wrapper, we break + * that detection. + */ + if (contextManager._wrapped) { + return original.call(this, event, listener); + } + let map = contextManager._getPatchMap(ee); + if (map === undefined) { + map = contextManager._createPatchMap(ee); + } + let listeners = map[event]; + if (listeners === undefined) { + listeners = new WeakMap(); + map[event] = listeners; + } + const patchedListener = contextManager.bind(context, listener); + // store a weak reference of the user listener to ours + listeners.set(listener, patchedListener); + /** + * See comment at the start of this function for the explanation of this property. + */ + contextManager._wrapped = true; + try { + return original.call(this, event, patchedListener); + } + finally { + contextManager._wrapped = false; + } + }; + } + _createPatchMap(ee) { + const map = Object.create(null); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ee[this._kOtListeners] = map; + return map; + } + _getPatchMap(ee) { + return ee[this._kOtListeners]; + } +} +exports.AbstractAsyncHooksContextManager = AbstractAsyncHooksContextManager; +//# sourceMappingURL=AbstractAsyncHooksContextManager.js.map + +/***/ }), + +/***/ 14096: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AsyncHooksContextManager = void 0; +const api_1 = __nccwpck_require__(65163); +const asyncHooks = __nccwpck_require__(50852); +const AbstractAsyncHooksContextManager_1 = __nccwpck_require__(85788); +class AsyncHooksContextManager extends AbstractAsyncHooksContextManager_1.AbstractAsyncHooksContextManager { + constructor() { + super(); + this._contexts = new Map(); + this._stack = []; + this._asyncHook = asyncHooks.createHook({ + init: this._init.bind(this), + before: this._before.bind(this), + after: this._after.bind(this), + destroy: this._destroy.bind(this), + promiseResolve: this._destroy.bind(this), + }); + } + active() { + var _a; + return (_a = this._stack[this._stack.length - 1]) !== null && _a !== void 0 ? _a : api_1.ROOT_CONTEXT; + } + with(context, fn, thisArg, ...args) { + this._enterContext(context); + try { + return fn.call(thisArg, ...args); + } + finally { + this._exitContext(); + } + } + enable() { + this._asyncHook.enable(); + return this; + } + disable() { + this._asyncHook.disable(); + this._contexts.clear(); + this._stack = []; + return this; + } + /** + * Init hook will be called when userland create a async context, setting the + * context as the current one if it exist. + * @param uid id of the async context + * @param type the resource type + */ + _init(uid, type) { + // ignore TIMERWRAP as they combine timers with same timeout which can lead to + // false context propagation. TIMERWRAP has been removed in node 11 + // every timer has it's own `Timeout` resource anyway which is used to propagate + // context. + if (type === 'TIMERWRAP') + return; + const context = this._stack[this._stack.length - 1]; + if (context !== undefined) { + this._contexts.set(uid, context); + } + } + /** + * Destroy hook will be called when a given context is no longer used so we can + * remove its attached context. + * @param uid uid of the async context + */ + _destroy(uid) { + this._contexts.delete(uid); + } + /** + * Before hook is called just before executing a async context. + * @param uid uid of the async context + */ + _before(uid) { + const context = this._contexts.get(uid); + if (context !== undefined) { + this._enterContext(context); + } + } + /** + * After hook is called just after completing the execution of a async context. + */ + _after() { + this._exitContext(); + } + /** + * Set the given context as active + */ + _enterContext(context) { + this._stack.push(context); + } + /** + * Remove the context at the root of the stack + */ + _exitContext() { + this._stack.pop(); + } +} +exports.AsyncHooksContextManager = AsyncHooksContextManager; +//# sourceMappingURL=AsyncHooksContextManager.js.map + +/***/ }), + +/***/ 20551: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AsyncLocalStorageContextManager = void 0; +const api_1 = __nccwpck_require__(65163); +const async_hooks_1 = __nccwpck_require__(50852); +const AbstractAsyncHooksContextManager_1 = __nccwpck_require__(85788); +class AsyncLocalStorageContextManager extends AbstractAsyncHooksContextManager_1.AbstractAsyncHooksContextManager { + constructor() { + super(); + this._asyncLocalStorage = new async_hooks_1.AsyncLocalStorage(); + } + active() { + var _a; + return (_a = this._asyncLocalStorage.getStore()) !== null && _a !== void 0 ? _a : api_1.ROOT_CONTEXT; + } + with(context, fn, thisArg, ...args) { + const cb = thisArg == null ? fn : fn.bind(thisArg); + return this._asyncLocalStorage.run(context, cb, ...args); + } + enable() { + return this; + } + disable() { + this._asyncLocalStorage.disable(); + return this; + } +} +exports.AsyncLocalStorageContextManager = AsyncLocalStorageContextManager; +//# sourceMappingURL=AsyncLocalStorageContextManager.js.map + +/***/ }), + +/***/ 81616: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AsyncLocalStorageContextManager = exports.AsyncHooksContextManager = void 0; +var AsyncHooksContextManager_1 = __nccwpck_require__(14096); +Object.defineProperty(exports, "AsyncHooksContextManager", ({ enumerable: true, get: function () { return AsyncHooksContextManager_1.AsyncHooksContextManager; } })); +var AsyncLocalStorageContextManager_1 = __nccwpck_require__(20551); +Object.defineProperty(exports, "AsyncLocalStorageContextManager", ({ enumerable: true, get: function () { return AsyncLocalStorageContextManager_1.AsyncLocalStorageContextManager; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 67959: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ExportResultCode = void 0; +var ExportResultCode; +(function (ExportResultCode) { + ExportResultCode[ExportResultCode["SUCCESS"] = 0] = "SUCCESS"; + ExportResultCode[ExportResultCode["FAILED"] = 1] = "FAILED"; +})(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {})); +//# sourceMappingURL=ExportResult.js.map + +/***/ }), + +/***/ 36178: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = void 0; +exports.BAGGAGE_KEY_PAIR_SEPARATOR = '='; +exports.BAGGAGE_PROPERTIES_SEPARATOR = ';'; +exports.BAGGAGE_ITEMS_SEPARATOR = ','; +// Name of the http header used to propagate the baggage +exports.BAGGAGE_HEADER = 'baggage'; +// Maximum number of name-value pairs allowed by w3c spec +exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; +// Maximum number of bytes per a single name-value pair allowed by w3c spec +exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; +// Maximum total length of all name-value pairs allowed by w3c spec +exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; +//# sourceMappingURL=constants.js.map + +/***/ }), + +/***/ 61476: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.W3CBaggagePropagator = void 0; +const api_1 = __nccwpck_require__(65163); +const suppress_tracing_1 = __nccwpck_require__(54463); +const constants_1 = __nccwpck_require__(36178); +const utils_1 = __nccwpck_require__(49884); +/** + * Propagates {@link Baggage} through Context format propagation. + * + * Based on the Baggage specification: + * https://w3c.github.io/baggage/ + */ +class W3CBaggagePropagator { + inject(context, carrier, setter) { + const baggage = api_1.propagation.getBaggage(context); + if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context)) + return; + const keyPairs = (0, utils_1.getKeyPairs)(baggage) + .filter((pair) => { + return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; + }) + .slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); + const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); + if (headerValue.length > 0) { + setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); + } + } + extract(context, carrier, getter) { + const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); + const baggageString = Array.isArray(headerValue) + ? headerValue.join(constants_1.BAGGAGE_ITEMS_SEPARATOR) + : headerValue; + if (!baggageString) + return context; + const baggage = {}; + if (baggageString.length === 0) { + return context; + } + const pairs = baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR); + pairs.forEach(entry => { + const keyPair = (0, utils_1.parsePairKeyValue)(entry); + if (keyPair) { + const baggageEntry = { value: keyPair.value }; + if (keyPair.metadata) { + baggageEntry.metadata = keyPair.metadata; + } + baggage[keyPair.key] = baggageEntry; + } + }); + if (Object.entries(baggage).length === 0) { + return context; + } + return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage)); + } + fields() { + return [constants_1.BAGGAGE_HEADER]; + } +} +exports.W3CBaggagePropagator = W3CBaggagePropagator; +//# sourceMappingURL=W3CBaggagePropagator.js.map + +/***/ }), + +/***/ 49884: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const api_1 = __nccwpck_require__(65163); +const constants_1 = __nccwpck_require__(36178); +function serializeKeyPairs(keyPairs) { + return keyPairs.reduce((hValue, current) => { + const value = `${hValue}${hValue !== '' ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ''}${current}`; + return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value; + }, ''); +} +exports.serializeKeyPairs = serializeKeyPairs; +function getKeyPairs(baggage) { + return baggage.getAllEntries().map(([key, value]) => { + let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`; + // include opaque metadata if provided + // NOTE: we intentionally don't URI-encode the metadata - that responsibility falls on the metadata implementation + if (value.metadata !== undefined) { + entry += constants_1.BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString(); + } + return entry; + }); +} +exports.getKeyPairs = getKeyPairs; +function parsePairKeyValue(entry) { + const valueProps = entry.split(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); + if (valueProps.length <= 0) + return; + const keyPairPart = valueProps.shift(); + if (!keyPairPart) + return; + const separatorIndex = keyPairPart.indexOf(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); + if (separatorIndex <= 0) + return; + const key = decodeURIComponent(keyPairPart.substring(0, separatorIndex).trim()); + const value = decodeURIComponent(keyPairPart.substring(separatorIndex + 1).trim()); + let metadata; + if (valueProps.length > 0) { + metadata = (0, api_1.baggageEntryMetadataFromString)(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR)); + } + return { key, value, metadata }; +} +exports.parsePairKeyValue = parsePairKeyValue; +/** + * Parse a string serialized in the baggage HTTP Format (without metadata): + * https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT.md + */ +function parseKeyPairsIntoRecord(value) { + if (typeof value !== 'string' || value.length === 0) + return {}; + return value + .split(constants_1.BAGGAGE_ITEMS_SEPARATOR) + .map(entry => { + return parsePairKeyValue(entry); + }) + .filter(keyPair => keyPair !== undefined && keyPair.value.length > 0) + .reduce((headers, keyPair) => { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + headers[keyPair.key] = keyPair.value; + return headers; + }, {}); +} +exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 54848: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AnchoredClock = void 0; +/** + * A utility for returning wall times anchored to a given point in time. Wall time measurements will + * not be taken from the system, but instead are computed by adding a monotonic clock time + * to the anchor point. + * + * This is needed because the system time can change and result in unexpected situations like + * spans ending before they are started. Creating an anchored clock for each local root span + * ensures that span timings and durations are accurate while preventing span times from drifting + * too far from the system clock. + * + * Only creating an anchored clock once per local trace ensures span times are correct relative + * to each other. For example, a child span will never have a start time before its parent even + * if the system clock is corrected during the local trace. + * + * Heavily inspired by the OTel Java anchored clock + * https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/AnchoredClock.java + */ +class AnchoredClock { + /** + * Create a new AnchoredClock anchored to the current time returned by systemClock. + * + * @param systemClock should be a clock that returns the number of milliseconds since January 1 1970 such as Date + * @param monotonicClock should be a clock that counts milliseconds monotonically such as window.performance or perf_hooks.performance + */ + constructor(systemClock, monotonicClock) { + this._monotonicClock = monotonicClock; + this._epochMillis = systemClock.now(); + this._performanceMillis = monotonicClock.now(); + } + /** + * Returns the current time by adding the number of milliseconds since the + * AnchoredClock was created to the creation epoch time + */ + now() { + const delta = this._monotonicClock.now() - this._performanceMillis; + return this._epochMillis + delta; + } +} +exports.AnchoredClock = AnchoredClock; +//# sourceMappingURL=anchored-clock.js.map + +/***/ }), + +/***/ 82807: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = void 0; +const api_1 = __nccwpck_require__(65163); +function sanitizeAttributes(attributes) { + const out = {}; + if (typeof attributes !== 'object' || attributes == null) { + return out; + } + for (const [key, val] of Object.entries(attributes)) { + if (!isAttributeKey(key)) { + api_1.diag.warn(`Invalid attribute key: ${key}`); + continue; + } + if (!isAttributeValue(val)) { + api_1.diag.warn(`Invalid attribute value set for key: ${key}`); + continue; + } + if (Array.isArray(val)) { + out[key] = val.slice(); + } + else { + out[key] = val; + } + } + return out; +} +exports.sanitizeAttributes = sanitizeAttributes; +function isAttributeKey(key) { + return typeof key === 'string' && key.length > 0; +} +exports.isAttributeKey = isAttributeKey; +function isAttributeValue(val) { + if (val == null) { + return true; + } + if (Array.isArray(val)) { + return isHomogeneousAttributeValueArray(val); + } + return isValidPrimitiveAttributeValue(val); +} +exports.isAttributeValue = isAttributeValue; +function isHomogeneousAttributeValueArray(arr) { + let type; + for (const element of arr) { + // null/undefined elements are allowed + if (element == null) + continue; + if (!type) { + if (isValidPrimitiveAttributeValue(element)) { + type = typeof element; + continue; + } + // encountered an invalid primitive + return false; + } + if (typeof element === type) { + continue; + } + return false; + } + return true; +} +function isValidPrimitiveAttributeValue(val) { + switch (typeof val) { + case 'number': + case 'boolean': + case 'string': + return true; + } + return false; +} +//# sourceMappingURL=attributes.js.map + +/***/ }), + +/***/ 69246: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.globalErrorHandler = exports.setGlobalErrorHandler = void 0; +const logging_error_handler_1 = __nccwpck_require__(32882); +/** The global error handler delegate */ +let delegateHandler = (0, logging_error_handler_1.loggingErrorHandler)(); +/** + * Set the global error handler + * @param {ErrorHandler} handler + */ +function setGlobalErrorHandler(handler) { + delegateHandler = handler; +} +exports.setGlobalErrorHandler = setGlobalErrorHandler; +/** + * Return the global error handler + * @param {Exception} ex + */ +function globalErrorHandler(ex) { + try { + delegateHandler(ex); + } + catch (_a) { } // eslint-disable-line no-empty +} +exports.globalErrorHandler = globalErrorHandler; +//# sourceMappingURL=global-error-handler.js.map + +/***/ }), + +/***/ 54986: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.hexToBinary = void 0; +function intValue(charCode) { + // 0-9 + if (charCode >= 48 && charCode <= 57) { + return charCode - 48; + } + // a-f + if (charCode >= 97 && charCode <= 102) { + return charCode - 87; + } + // A-F + return charCode - 55; +} +function hexToBinary(hexStr) { + const buf = new Uint8Array(hexStr.length / 2); + let offset = 0; + for (let i = 0; i < hexStr.length; i += 2) { + const hi = intValue(hexStr.charCodeAt(i)); + const lo = intValue(hexStr.charCodeAt(i + 1)); + buf[offset++] = (hi << 4) | lo; + } + return buf; +} +exports.hexToBinary = hexToBinary; +//# sourceMappingURL=hex-to-binary.js.map + +/***/ }), + +/***/ 32882: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.loggingErrorHandler = void 0; +const api_1 = __nccwpck_require__(65163); +/** + * Returns a function that logs an error using the provided logger, or a + * console logger if one was not provided. + */ +function loggingErrorHandler() { + return (ex) => { + api_1.diag.error(stringifyException(ex)); + }; +} +exports.loggingErrorHandler = loggingErrorHandler; +/** + * Converts an exception into a string representation + * @param {Exception} ex + */ +function stringifyException(ex) { + if (typeof ex === 'string') { + return ex; + } + else { + return JSON.stringify(flattenException(ex)); + } +} +/** + * Flattens an exception into key-value pairs by traversing the prototype chain + * and coercing values to strings. Duplicate properties will not be overwritten; + * the first insert wins. + */ +function flattenException(ex) { + const result = {}; + let current = ex; + while (current !== null) { + Object.getOwnPropertyNames(current).forEach(propertyName => { + if (result[propertyName]) + return; + const value = current[propertyName]; + if (value) { + result[propertyName] = String(value); + } + }); + current = Object.getPrototypeOf(current); + } + return result; +} +//# sourceMappingURL=logging-error-handler.js.map + +/***/ }), + +/***/ 86161: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.addHrTimes = exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = exports.getTimeOrigin = exports.millisToHrTime = void 0; +const platform_1 = __nccwpck_require__(6730); +const NANOSECOND_DIGITS = 9; +const NANOSECOND_DIGITS_IN_MILLIS = 6; +const MILLISECONDS_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS); +const SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); +/** + * Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]). + * @param epochMillis + */ +function millisToHrTime(epochMillis) { + const epochSeconds = epochMillis / 1000; + // Decimals only. + const seconds = Math.trunc(epochSeconds); + // Round sub-nanosecond accuracy to nanosecond. + const nanos = Math.round((epochMillis % 1000) * MILLISECONDS_TO_NANOSECONDS); + return [seconds, nanos]; +} +exports.millisToHrTime = millisToHrTime; +function getTimeOrigin() { + let timeOrigin = platform_1.otperformance.timeOrigin; + if (typeof timeOrigin !== 'number') { + const perf = platform_1.otperformance; + timeOrigin = perf.timing && perf.timing.fetchStart; + } + return timeOrigin; +} +exports.getTimeOrigin = getTimeOrigin; +/** + * Returns an hrtime calculated via performance component. + * @param performanceNow + */ +function hrTime(performanceNow) { + const timeOrigin = millisToHrTime(getTimeOrigin()); + const now = millisToHrTime(typeof performanceNow === 'number' ? performanceNow : platform_1.otperformance.now()); + return addHrTimes(timeOrigin, now); +} +exports.hrTime = hrTime; +/** + * + * Converts a TimeInput to an HrTime, defaults to _hrtime(). + * @param time + */ +function timeInputToHrTime(time) { + // process.hrtime + if (isTimeInputHrTime(time)) { + return time; + } + else if (typeof time === 'number') { + // Must be a performance.now() if it's smaller than process start time. + if (time < getTimeOrigin()) { + return hrTime(time); + } + else { + // epoch milliseconds or performance.timeOrigin + return millisToHrTime(time); + } + } + else if (time instanceof Date) { + return millisToHrTime(time.getTime()); + } + else { + throw TypeError('Invalid input type'); + } +} +exports.timeInputToHrTime = timeInputToHrTime; +/** + * Returns a duration of two hrTime. + * @param startTime + * @param endTime + */ +function hrTimeDuration(startTime, endTime) { + let seconds = endTime[0] - startTime[0]; + let nanos = endTime[1] - startTime[1]; + // overflow + if (nanos < 0) { + seconds -= 1; + // negate + nanos += SECOND_TO_NANOSECONDS; + } + return [seconds, nanos]; +} +exports.hrTimeDuration = hrTimeDuration; +/** + * Convert hrTime to timestamp, for example "2019-05-14T17:00:00.000123456Z" + * @param time + */ +function hrTimeToTimeStamp(time) { + const precision = NANOSECOND_DIGITS; + const tmp = `${'0'.repeat(precision)}${time[1]}Z`; + const nanoString = tmp.substring(tmp.length - precision - 1); + const date = new Date(time[0] * 1000).toISOString(); + return date.replace('000Z', nanoString); +} +exports.hrTimeToTimeStamp = hrTimeToTimeStamp; +/** + * Convert hrTime to nanoseconds. + * @param time + */ +function hrTimeToNanoseconds(time) { + return time[0] * SECOND_TO_NANOSECONDS + time[1]; +} +exports.hrTimeToNanoseconds = hrTimeToNanoseconds; +/** + * Convert hrTime to milliseconds. + * @param time + */ +function hrTimeToMilliseconds(time) { + return time[0] * 1e3 + time[1] / 1e6; +} +exports.hrTimeToMilliseconds = hrTimeToMilliseconds; +/** + * Convert hrTime to microseconds. + * @param time + */ +function hrTimeToMicroseconds(time) { + return time[0] * 1e6 + time[1] / 1e3; +} +exports.hrTimeToMicroseconds = hrTimeToMicroseconds; +/** + * check if time is HrTime + * @param value + */ +function isTimeInputHrTime(value) { + return (Array.isArray(value) && + value.length === 2 && + typeof value[0] === 'number' && + typeof value[1] === 'number'); +} +exports.isTimeInputHrTime = isTimeInputHrTime; +/** + * check if input value is a correct types.TimeInput + * @param value + */ +function isTimeInput(value) { + return (isTimeInputHrTime(value) || + typeof value === 'number' || + value instanceof Date); +} +exports.isTimeInput = isTimeInput; +/** + * Given 2 HrTime formatted times, return their sum as an HrTime. + */ +function addHrTimes(time1, time2) { + const out = [time1[0] + time2[0], time1[1] + time2[1]]; + // Nanoseconds + if (out[1] >= SECOND_TO_NANOSECONDS) { + out[1] -= SECOND_TO_NANOSECONDS; + out[0] += 1; + } + return out; +} +exports.addHrTimes = addHrTimes; +//# sourceMappingURL=time.js.map + +/***/ }), + +/***/ 89736: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.unrefTimer = exports.otperformance = exports.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = exports.baggageUtils = exports.ExportResultCode = exports.hexToBinary = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.isAttributeKey = exports.AnchoredClock = exports.W3CBaggagePropagator = void 0; +exports.internal = exports.VERSION = exports.BindOnceFuture = exports.isWrapped = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.TracesSamplerValues = exports.merge = exports.parseEnvironment = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ENVIRONMENT = void 0; +var W3CBaggagePropagator_1 = __nccwpck_require__(61476); +Object.defineProperty(exports, "W3CBaggagePropagator", ({ enumerable: true, get: function () { return W3CBaggagePropagator_1.W3CBaggagePropagator; } })); +var anchored_clock_1 = __nccwpck_require__(54848); +Object.defineProperty(exports, "AnchoredClock", ({ enumerable: true, get: function () { return anchored_clock_1.AnchoredClock; } })); +var attributes_1 = __nccwpck_require__(82807); +Object.defineProperty(exports, "isAttributeKey", ({ enumerable: true, get: function () { return attributes_1.isAttributeKey; } })); +Object.defineProperty(exports, "isAttributeValue", ({ enumerable: true, get: function () { return attributes_1.isAttributeValue; } })); +Object.defineProperty(exports, "sanitizeAttributes", ({ enumerable: true, get: function () { return attributes_1.sanitizeAttributes; } })); +var global_error_handler_1 = __nccwpck_require__(69246); +Object.defineProperty(exports, "globalErrorHandler", ({ enumerable: true, get: function () { return global_error_handler_1.globalErrorHandler; } })); +Object.defineProperty(exports, "setGlobalErrorHandler", ({ enumerable: true, get: function () { return global_error_handler_1.setGlobalErrorHandler; } })); +var logging_error_handler_1 = __nccwpck_require__(32882); +Object.defineProperty(exports, "loggingErrorHandler", ({ enumerable: true, get: function () { return logging_error_handler_1.loggingErrorHandler; } })); +var time_1 = __nccwpck_require__(86161); +Object.defineProperty(exports, "addHrTimes", ({ enumerable: true, get: function () { return time_1.addHrTimes; } })); +Object.defineProperty(exports, "getTimeOrigin", ({ enumerable: true, get: function () { return time_1.getTimeOrigin; } })); +Object.defineProperty(exports, "hrTime", ({ enumerable: true, get: function () { return time_1.hrTime; } })); +Object.defineProperty(exports, "hrTimeDuration", ({ enumerable: true, get: function () { return time_1.hrTimeDuration; } })); +Object.defineProperty(exports, "hrTimeToMicroseconds", ({ enumerable: true, get: function () { return time_1.hrTimeToMicroseconds; } })); +Object.defineProperty(exports, "hrTimeToMilliseconds", ({ enumerable: true, get: function () { return time_1.hrTimeToMilliseconds; } })); +Object.defineProperty(exports, "hrTimeToNanoseconds", ({ enumerable: true, get: function () { return time_1.hrTimeToNanoseconds; } })); +Object.defineProperty(exports, "hrTimeToTimeStamp", ({ enumerable: true, get: function () { return time_1.hrTimeToTimeStamp; } })); +Object.defineProperty(exports, "isTimeInput", ({ enumerable: true, get: function () { return time_1.isTimeInput; } })); +Object.defineProperty(exports, "isTimeInputHrTime", ({ enumerable: true, get: function () { return time_1.isTimeInputHrTime; } })); +Object.defineProperty(exports, "millisToHrTime", ({ enumerable: true, get: function () { return time_1.millisToHrTime; } })); +Object.defineProperty(exports, "timeInputToHrTime", ({ enumerable: true, get: function () { return time_1.timeInputToHrTime; } })); +var hex_to_binary_1 = __nccwpck_require__(54986); +Object.defineProperty(exports, "hexToBinary", ({ enumerable: true, get: function () { return hex_to_binary_1.hexToBinary; } })); +var ExportResult_1 = __nccwpck_require__(67959); +Object.defineProperty(exports, "ExportResultCode", ({ enumerable: true, get: function () { return ExportResult_1.ExportResultCode; } })); +const utils_1 = __nccwpck_require__(49884); +exports.baggageUtils = { + getKeyPairs: utils_1.getKeyPairs, + serializeKeyPairs: utils_1.serializeKeyPairs, + parseKeyPairsIntoRecord: utils_1.parseKeyPairsIntoRecord, + parsePairKeyValue: utils_1.parsePairKeyValue, +}; +var platform_1 = __nccwpck_require__(6730); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return platform_1.RandomIdGenerator; } })); +Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return platform_1.SDK_INFO; } })); +Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return platform_1._globalThis; } })); +Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return platform_1.getEnv; } })); +Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return platform_1.getEnvWithoutDefaults; } })); +Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return platform_1.hexToBase64; } })); +Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return platform_1.otperformance; } })); +Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return platform_1.unrefTimer; } })); +var composite_1 = __nccwpck_require__(57785); +Object.defineProperty(exports, "CompositePropagator", ({ enumerable: true, get: function () { return composite_1.CompositePropagator; } })); +var W3CTraceContextPropagator_1 = __nccwpck_require__(61463); +Object.defineProperty(exports, "TRACE_PARENT_HEADER", ({ enumerable: true, get: function () { return W3CTraceContextPropagator_1.TRACE_PARENT_HEADER; } })); +Object.defineProperty(exports, "TRACE_STATE_HEADER", ({ enumerable: true, get: function () { return W3CTraceContextPropagator_1.TRACE_STATE_HEADER; } })); +Object.defineProperty(exports, "W3CTraceContextPropagator", ({ enumerable: true, get: function () { return W3CTraceContextPropagator_1.W3CTraceContextPropagator; } })); +Object.defineProperty(exports, "parseTraceParent", ({ enumerable: true, get: function () { return W3CTraceContextPropagator_1.parseTraceParent; } })); +var rpc_metadata_1 = __nccwpck_require__(52992); +Object.defineProperty(exports, "RPCType", ({ enumerable: true, get: function () { return rpc_metadata_1.RPCType; } })); +Object.defineProperty(exports, "deleteRPCMetadata", ({ enumerable: true, get: function () { return rpc_metadata_1.deleteRPCMetadata; } })); +Object.defineProperty(exports, "getRPCMetadata", ({ enumerable: true, get: function () { return rpc_metadata_1.getRPCMetadata; } })); +Object.defineProperty(exports, "setRPCMetadata", ({ enumerable: true, get: function () { return rpc_metadata_1.setRPCMetadata; } })); +var AlwaysOffSampler_1 = __nccwpck_require__(16478); +Object.defineProperty(exports, "AlwaysOffSampler", ({ enumerable: true, get: function () { return AlwaysOffSampler_1.AlwaysOffSampler; } })); +var AlwaysOnSampler_1 = __nccwpck_require__(88317); +Object.defineProperty(exports, "AlwaysOnSampler", ({ enumerable: true, get: function () { return AlwaysOnSampler_1.AlwaysOnSampler; } })); +var ParentBasedSampler_1 = __nccwpck_require__(15136); +Object.defineProperty(exports, "ParentBasedSampler", ({ enumerable: true, get: function () { return ParentBasedSampler_1.ParentBasedSampler; } })); +var TraceIdRatioBasedSampler_1 = __nccwpck_require__(69326); +Object.defineProperty(exports, "TraceIdRatioBasedSampler", ({ enumerable: true, get: function () { return TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler; } })); +var suppress_tracing_1 = __nccwpck_require__(54463); +Object.defineProperty(exports, "isTracingSuppressed", ({ enumerable: true, get: function () { return suppress_tracing_1.isTracingSuppressed; } })); +Object.defineProperty(exports, "suppressTracing", ({ enumerable: true, get: function () { return suppress_tracing_1.suppressTracing; } })); +Object.defineProperty(exports, "unsuppressTracing", ({ enumerable: true, get: function () { return suppress_tracing_1.unsuppressTracing; } })); +var TraceState_1 = __nccwpck_require__(1914); +Object.defineProperty(exports, "TraceState", ({ enumerable: true, get: function () { return TraceState_1.TraceState; } })); +var environment_1 = __nccwpck_require__(7238); +Object.defineProperty(exports, "DEFAULT_ATTRIBUTE_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ATTRIBUTE_COUNT_LIMIT; } })); +Object.defineProperty(exports, "DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; } })); +Object.defineProperty(exports, "DEFAULT_ENVIRONMENT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ENVIRONMENT; } })); +Object.defineProperty(exports, "DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT; } })); +Object.defineProperty(exports, "DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT; } })); +Object.defineProperty(exports, "parseEnvironment", ({ enumerable: true, get: function () { return environment_1.parseEnvironment; } })); +var merge_1 = __nccwpck_require__(65387); +Object.defineProperty(exports, "merge", ({ enumerable: true, get: function () { return merge_1.merge; } })); +var sampling_1 = __nccwpck_require__(28289); +Object.defineProperty(exports, "TracesSamplerValues", ({ enumerable: true, get: function () { return sampling_1.TracesSamplerValues; } })); +var timeout_1 = __nccwpck_require__(48400); +Object.defineProperty(exports, "TimeoutError", ({ enumerable: true, get: function () { return timeout_1.TimeoutError; } })); +Object.defineProperty(exports, "callWithTimeout", ({ enumerable: true, get: function () { return timeout_1.callWithTimeout; } })); +var url_1 = __nccwpck_require__(90839); +Object.defineProperty(exports, "isUrlIgnored", ({ enumerable: true, get: function () { return url_1.isUrlIgnored; } })); +Object.defineProperty(exports, "urlMatches", ({ enumerable: true, get: function () { return url_1.urlMatches; } })); +var wrap_1 = __nccwpck_require__(67226); +Object.defineProperty(exports, "isWrapped", ({ enumerable: true, get: function () { return wrap_1.isWrapped; } })); +var callback_1 = __nccwpck_require__(12408); +Object.defineProperty(exports, "BindOnceFuture", ({ enumerable: true, get: function () { return callback_1.BindOnceFuture; } })); +var version_1 = __nccwpck_require__(55687); +Object.defineProperty(exports, "VERSION", ({ enumerable: true, get: function () { return version_1.VERSION; } })); +const exporter_1 = __nccwpck_require__(87795); +exports.internal = { + _export: exporter_1._export, +}; +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 87795: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._export = void 0; +const api_1 = __nccwpck_require__(65163); +const suppress_tracing_1 = __nccwpck_require__(54463); +/** + * @internal + * Shared functionality used by Exporters while exporting data, including suppression of Traces. + */ +function _export(exporter, arg) { + return new Promise(resolve => { + // prevent downstream exporter calls from generating spans + api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { + exporter.export(arg, (result) => { + resolve(result); + }); + }); + }); +} +exports._export = _export; +//# sourceMappingURL=exporter.js.map + +/***/ }), + +/***/ 96242: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.validateValue = exports.validateKey = void 0; +const VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]'; +const VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; +const VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; +const VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); +const VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; +const INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; +/** + * Key is opaque string up to 256 characters printable. It MUST begin with a + * lowercase letter, and can only contain lowercase letters a-z, digits 0-9, + * underscores _, dashes -, asterisks *, and forward slashes /. + * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the + * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key. + * see https://www.w3.org/TR/trace-context/#key + */ +function validateKey(key) { + return VALID_KEY_REGEX.test(key); +} +exports.validateKey = validateKey; +/** + * Value is opaque string up to 256 characters printable ASCII RFC0020 + * characters (i.e., the range 0x20 to 0x7E) except comma , and =. + */ +function validateValue(value) { + return (VALID_VALUE_BASE_REGEX.test(value) && + !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value)); +} +exports.validateValue = validateValue; +//# sourceMappingURL=validators.js.map + +/***/ }), + +/***/ 6730: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.unrefTimer = exports.otperformance = exports.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var node_1 = __nccwpck_require__(9340); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return node_1.RandomIdGenerator; } })); +Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return node_1.SDK_INFO; } })); +Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return node_1._globalThis; } })); +Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return node_1.getEnv; } })); +Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return node_1.getEnvWithoutDefaults; } })); +Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return node_1.hexToBase64; } })); +Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return node_1.otperformance; } })); +Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return node_1.unrefTimer; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 25476: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RandomIdGenerator = void 0; +const SPAN_ID_BYTES = 8; +const TRACE_ID_BYTES = 16; +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + */ +class RandomIdGenerator { + constructor() { + /** + * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex + * characters corresponding to 128 bits. + */ + this.generateTraceId = getIdGenerator(TRACE_ID_BYTES); + /** + * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex + * characters corresponding to 64 bits. + */ + this.generateSpanId = getIdGenerator(SPAN_ID_BYTES); + } +} +exports.RandomIdGenerator = RandomIdGenerator; +const SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES); +function getIdGenerator(bytes) { + return function generateId() { + for (let i = 0; i < bytes / 4; i++) { + // unsigned right shift drops decimal part of the number + // it is required because if a number between 2**32 and 2**32 - 1 is generated, an out of range error is thrown by writeUInt32BE + SHARED_BUFFER.writeUInt32BE((Math.random() * 2 ** 32) >>> 0, i * 4); + } + // If buffer is all 0, set the last byte to 1 to guarantee a valid w3c id is generated + for (let i = 0; i < bytes; i++) { + if (SHARED_BUFFER[i] > 0) { + break; + } + else if (i === bytes - 1) { + SHARED_BUFFER[bytes - 1] = 1; + } + } + return SHARED_BUFFER.toString('hex', 0, bytes); + }; +} +//# sourceMappingURL=RandomIdGenerator.js.map + +/***/ }), + +/***/ 76494: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getEnvWithoutDefaults = exports.getEnv = void 0; +const environment_1 = __nccwpck_require__(7238); +/** + * Gets the environment variables + */ +function getEnv() { + const processEnv = (0, environment_1.parseEnvironment)(process.env); + return Object.assign({}, environment_1.DEFAULT_ENVIRONMENT, processEnv); +} +exports.getEnv = getEnv; +function getEnvWithoutDefaults() { + return (0, environment_1.parseEnvironment)(process.env); +} +exports.getEnvWithoutDefaults = getEnvWithoutDefaults; +//# sourceMappingURL=environment.js.map + +/***/ }), + +/***/ 57196: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._globalThis = void 0; +/** only globals that common to node and browsers are allowed */ +// eslint-disable-next-line node/no-unsupported-features/es-builtins +exports._globalThis = typeof globalThis === 'object' ? globalThis : global; +//# sourceMappingURL=globalThis.js.map + +/***/ }), + +/***/ 75004: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.hexToBase64 = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const hex_to_binary_1 = __nccwpck_require__(54986); +function hexToBase64(hexStr) { + return Buffer.from((0, hex_to_binary_1.hexToBinary)(hexStr)).toString('base64'); +} +exports.hexToBase64 = hexToBase64; +//# sourceMappingURL=hex-to-base64.js.map + +/***/ }), + +/***/ 9340: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.unrefTimer = exports.SDK_INFO = exports.otperformance = exports.RandomIdGenerator = exports.hexToBase64 = exports._globalThis = exports.getEnv = exports.getEnvWithoutDefaults = void 0; +var environment_1 = __nccwpck_require__(76494); +Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return environment_1.getEnvWithoutDefaults; } })); +Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return environment_1.getEnv; } })); +var globalThis_1 = __nccwpck_require__(57196); +Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return globalThis_1._globalThis; } })); +var hex_to_base64_1 = __nccwpck_require__(75004); +Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return hex_to_base64_1.hexToBase64; } })); +var RandomIdGenerator_1 = __nccwpck_require__(25476); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return RandomIdGenerator_1.RandomIdGenerator; } })); +var performance_1 = __nccwpck_require__(39338); +Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return performance_1.otperformance; } })); +var sdk_info_1 = __nccwpck_require__(10265); +Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return sdk_info_1.SDK_INFO; } })); +var timer_util_1 = __nccwpck_require__(51027); +Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return timer_util_1.unrefTimer; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 39338: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.otperformance = void 0; +const perf_hooks_1 = __nccwpck_require__(4074); +exports.otperformance = perf_hooks_1.performance; +//# sourceMappingURL=performance.js.map + +/***/ }), + +/***/ 10265: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SDK_INFO = void 0; +const version_1 = __nccwpck_require__(55687); +const semantic_conventions_1 = __nccwpck_require__(67275); +/** Constants describing the SDK in use */ +exports.SDK_INFO = { + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME]: 'opentelemetry', + [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'node', + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRYSDKLANGUAGEVALUES_NODEJS, + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_VERSION]: version_1.VERSION, +}; +//# sourceMappingURL=sdk-info.js.map + +/***/ }), + +/***/ 51027: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.unrefTimer = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +function unrefTimer(timer) { + timer.unref(); +} +exports.unrefTimer = unrefTimer; +//# sourceMappingURL=timer-util.js.map + +/***/ }), + +/***/ 57785: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.CompositePropagator = void 0; +const api_1 = __nccwpck_require__(65163); +/** Combines multiple propagators into a single propagator. */ +class CompositePropagator { + /** + * Construct a composite propagator from a list of propagators. + * + * @param [config] Configuration object for composite propagator + */ + constructor(config = {}) { + var _a; + this._propagators = (_a = config.propagators) !== null && _a !== void 0 ? _a : []; + this._fields = Array.from(new Set(this._propagators + // older propagators may not have fields function, null check to be sure + .map(p => (typeof p.fields === 'function' ? p.fields() : [])) + .reduce((x, y) => x.concat(y), []))); + } + /** + * Run each of the configured propagators with the given context and carrier. + * Propagators are run in the order they are configured, so if multiple + * propagators write the same carrier key, the propagator later in the list + * will "win". + * + * @param context Context to inject + * @param carrier Carrier into which context will be injected + */ + inject(context, carrier, setter) { + for (const propagator of this._propagators) { + try { + propagator.inject(context, carrier, setter); + } + catch (err) { + api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); + } + } + } + /** + * Run each of the configured propagators with the given context and carrier. + * Propagators are run in the order they are configured, so if multiple + * propagators write the same context key, the propagator later in the list + * will "win". + * + * @param context Context to add values to + * @param carrier Carrier from which to extract context + */ + extract(context, carrier, getter) { + return this._propagators.reduce((ctx, propagator) => { + try { + return propagator.extract(ctx, carrier, getter); + } + catch (err) { + api_1.diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`); + } + return ctx; + }, context); + } + fields() { + // return a new array so our fields cannot be modified + return this._fields.slice(); + } +} +exports.CompositePropagator = CompositePropagator; +//# sourceMappingURL=composite.js.map + +/***/ }), + +/***/ 1914: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TraceState = void 0; +const validators_1 = __nccwpck_require__(96242); +const MAX_TRACE_STATE_ITEMS = 32; +const MAX_TRACE_STATE_LEN = 512; +const LIST_MEMBERS_SEPARATOR = ','; +const LIST_MEMBER_KEY_VALUE_SPLITTER = '='; +/** + * TraceState must be a class and not a simple object type because of the spec + * requirement (https://www.w3.org/TR/trace-context/#tracestate-field). + * + * Here is the list of allowed mutations: + * - New key-value pair should be added into the beginning of the list + * - The value of any key can be updated. Modified keys MUST be moved to the + * beginning of the list. + */ +class TraceState { + constructor(rawTraceState) { + this._internalState = new Map(); + if (rawTraceState) + this._parse(rawTraceState); + } + set(key, value) { + // TODO: Benchmark the different approaches(map vs list) and + // use the faster one. + const traceState = this._clone(); + if (traceState._internalState.has(key)) { + traceState._internalState.delete(key); + } + traceState._internalState.set(key, value); + return traceState; + } + unset(key) { + const traceState = this._clone(); + traceState._internalState.delete(key); + return traceState; + } + get(key) { + return this._internalState.get(key); + } + serialize() { + return this._keys() + .reduce((agg, key) => { + agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key)); + return agg; + }, []) + .join(LIST_MEMBERS_SEPARATOR); + } + _parse(rawTraceState) { + if (rawTraceState.length > MAX_TRACE_STATE_LEN) + return; + this._internalState = rawTraceState + .split(LIST_MEMBERS_SEPARATOR) + .reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning + .reduce((agg, part) => { + const listMember = part.trim(); // Optional Whitespace (OWS) handling + const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); + if (i !== -1) { + const key = listMember.slice(0, i); + const value = listMember.slice(i + 1, part.length); + if ((0, validators_1.validateKey)(key) && (0, validators_1.validateValue)(value)) { + agg.set(key, value); + } + else { + // TODO: Consider to add warning log + } + } + return agg; + }, new Map()); + // Because of the reverse() requirement, trunc must be done after map is created + if (this._internalState.size > MAX_TRACE_STATE_ITEMS) { + this._internalState = new Map(Array.from(this._internalState.entries()) + .reverse() // Use reverse same as original tracestate parse chain + .slice(0, MAX_TRACE_STATE_ITEMS)); + } + } + _keys() { + return Array.from(this._internalState.keys()).reverse(); + } + _clone() { + const traceState = new TraceState(); + traceState._internalState = new Map(this._internalState); + return traceState; + } +} +exports.TraceState = TraceState; +//# sourceMappingURL=TraceState.js.map + +/***/ }), + +/***/ 61463: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0; +const api_1 = __nccwpck_require__(65163); +const suppress_tracing_1 = __nccwpck_require__(54463); +const TraceState_1 = __nccwpck_require__(1914); +exports.TRACE_PARENT_HEADER = 'traceparent'; +exports.TRACE_STATE_HEADER = 'tracestate'; +const VERSION = '00'; +const VERSION_PART = '(?!ff)[\\da-f]{2}'; +const TRACE_ID_PART = '(?![0]{32})[\\da-f]{32}'; +const PARENT_ID_PART = '(?![0]{16})[\\da-f]{16}'; +const FLAGS_PART = '[\\da-f]{2}'; +const TRACE_PARENT_REGEX = new RegExp(`^\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\s?$`); +/** + * Parses information from the [traceparent] span tag and converts it into {@link SpanContext} + * @param traceParent - A meta property that comes from server. + * It should be dynamically generated server side to have the server's request trace Id, + * a parent span Id that was set on the server's request span, + * and the trace flags to indicate the server's sampling decision + * (01 = sampled, 00 = not sampled). + * for example: '{version}-{traceId}-{spanId}-{sampleDecision}' + * For more information see {@link https://www.w3.org/TR/trace-context/} + */ +function parseTraceParent(traceParent) { + const match = TRACE_PARENT_REGEX.exec(traceParent); + if (!match) + return null; + // According to the specification the implementation should be compatible + // with future versions. If there are more parts, we only reject it if it's using version 00 + // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent + if (match[1] === '00' && match[5]) + return null; + return { + traceId: match[2], + spanId: match[3], + traceFlags: parseInt(match[4], 16), + }; +} +exports.parseTraceParent = parseTraceParent; +/** + * Propagates {@link SpanContext} through Trace Context format propagation. + * + * Based on the Trace Context specification: + * https://www.w3.org/TR/trace-context/ + */ +class W3CTraceContextPropagator { + inject(context, carrier, setter) { + const spanContext = api_1.trace.getSpanContext(context); + if (!spanContext || + (0, suppress_tracing_1.isTracingSuppressed)(context) || + !(0, api_1.isSpanContextValid)(spanContext)) + return; + const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; + setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); + if (spanContext.traceState) { + setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); + } + } + extract(context, carrier, getter) { + const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); + if (!traceParentHeader) + return context; + const traceParent = Array.isArray(traceParentHeader) + ? traceParentHeader[0] + : traceParentHeader; + if (typeof traceParent !== 'string') + return context; + const spanContext = parseTraceParent(traceParent); + if (!spanContext) + return context; + spanContext.isRemote = true; + const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); + if (traceStateHeader) { + // If more than one `tracestate` header is found, we merge them into a + // single header. + const state = Array.isArray(traceStateHeader) + ? traceStateHeader.join(',') + : traceStateHeader; + spanContext.traceState = new TraceState_1.TraceState(typeof state === 'string' ? state : undefined); + } + return api_1.trace.setSpanContext(context, spanContext); + } + fields() { + return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; + } +} +exports.W3CTraceContextPropagator = W3CTraceContextPropagator; +//# sourceMappingURL=W3CTraceContextPropagator.js.map + +/***/ }), + +/***/ 52992: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0; +const api_1 = __nccwpck_require__(65163); +const RPC_METADATA_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key RPC_METADATA'); +var RPCType; +(function (RPCType) { + RPCType["HTTP"] = "http"; +})(RPCType = exports.RPCType || (exports.RPCType = {})); +function setRPCMetadata(context, meta) { + return context.setValue(RPC_METADATA_KEY, meta); +} +exports.setRPCMetadata = setRPCMetadata; +function deleteRPCMetadata(context) { + return context.deleteValue(RPC_METADATA_KEY); +} +exports.deleteRPCMetadata = deleteRPCMetadata; +function getRPCMetadata(context) { + return context.getValue(RPC_METADATA_KEY); +} +exports.getRPCMetadata = getRPCMetadata; +//# sourceMappingURL=rpc-metadata.js.map + +/***/ }), + +/***/ 16478: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AlwaysOffSampler = void 0; +const api_1 = __nccwpck_require__(65163); +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + * Sampler that samples no traces. + */ +class AlwaysOffSampler { + shouldSample() { + return { + decision: api_1.SamplingDecision.NOT_RECORD, + }; + } + toString() { + return 'AlwaysOffSampler'; + } +} +exports.AlwaysOffSampler = AlwaysOffSampler; +//# sourceMappingURL=AlwaysOffSampler.js.map + +/***/ }), + +/***/ 88317: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AlwaysOnSampler = void 0; +const api_1 = __nccwpck_require__(65163); +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + * Sampler that samples all traces. + */ +class AlwaysOnSampler { + shouldSample() { + return { + decision: api_1.SamplingDecision.RECORD_AND_SAMPLED, + }; + } + toString() { + return 'AlwaysOnSampler'; + } +} +exports.AlwaysOnSampler = AlwaysOnSampler; +//# sourceMappingURL=AlwaysOnSampler.js.map + +/***/ }), + +/***/ 15136: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ParentBasedSampler = void 0; +const api_1 = __nccwpck_require__(65163); +const global_error_handler_1 = __nccwpck_require__(69246); +const AlwaysOffSampler_1 = __nccwpck_require__(16478); +const AlwaysOnSampler_1 = __nccwpck_require__(88317); +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + * A composite sampler that either respects the parent span's sampling decision + * or delegates to `delegateSampler` for root spans. + */ +class ParentBasedSampler { + constructor(config) { + var _a, _b, _c, _d; + this._root = config.root; + if (!this._root) { + (0, global_error_handler_1.globalErrorHandler)(new Error('ParentBasedSampler must have a root sampler configured')); + this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); + } + this._remoteParentSampled = + (_a = config.remoteParentSampled) !== null && _a !== void 0 ? _a : new AlwaysOnSampler_1.AlwaysOnSampler(); + this._remoteParentNotSampled = + (_b = config.remoteParentNotSampled) !== null && _b !== void 0 ? _b : new AlwaysOffSampler_1.AlwaysOffSampler(); + this._localParentSampled = + (_c = config.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler_1.AlwaysOnSampler(); + this._localParentNotSampled = + (_d = config.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler_1.AlwaysOffSampler(); + } + shouldSample(context, traceId, spanName, spanKind, attributes, links) { + const parentContext = api_1.trace.getSpanContext(context); + if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) { + return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.isRemote) { + if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { + return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { + return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + toString() { + return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; + } +} +exports.ParentBasedSampler = ParentBasedSampler; +//# sourceMappingURL=ParentBasedSampler.js.map + +/***/ }), + +/***/ 69326: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TraceIdRatioBasedSampler = void 0; +const api_1 = __nccwpck_require__(65163); +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + * Sampler that samples a given fraction of traces based of trace id deterministically. + */ +class TraceIdRatioBasedSampler { + constructor(_ratio = 0) { + this._ratio = _ratio; + this._ratio = this._normalize(_ratio); + this._upperBound = Math.floor(this._ratio * 0xffffffff); + } + shouldSample(context, traceId) { + return { + decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound + ? api_1.SamplingDecision.RECORD_AND_SAMPLED + : api_1.SamplingDecision.NOT_RECORD, + }; + } + toString() { + return `TraceIdRatioBased{${this._ratio}}`; + } + _normalize(ratio) { + if (typeof ratio !== 'number' || isNaN(ratio)) + return 0; + return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio; + } + _accumulate(traceId) { + let accumulation = 0; + for (let i = 0; i < traceId.length / 8; i++) { + const pos = i * 8; + const part = parseInt(traceId.slice(pos, pos + 8), 16); + accumulation = (accumulation ^ part) >>> 0; + } + return accumulation; + } +} +exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; +//# sourceMappingURL=TraceIdRatioBasedSampler.js.map + +/***/ }), + +/***/ 54463: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0; +const api_1 = __nccwpck_require__(65163); +const SUPPRESS_TRACING_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key SUPPRESS_TRACING'); +function suppressTracing(context) { + return context.setValue(SUPPRESS_TRACING_KEY, true); +} +exports.suppressTracing = suppressTracing; +function unsuppressTracing(context) { + return context.deleteValue(SUPPRESS_TRACING_KEY); +} +exports.unsuppressTracing = unsuppressTracing; +function isTracingSuppressed(context) { + return context.getValue(SUPPRESS_TRACING_KEY) === true; +} +exports.isTracingSuppressed = isTracingSuppressed; +//# sourceMappingURL=suppress-tracing.js.map + +/***/ }), + +/***/ 12408: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BindOnceFuture = void 0; +const promise_1 = __nccwpck_require__(28329); +/** + * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked. + */ +class BindOnceFuture { + constructor(_callback, _that) { + this._callback = _callback; + this._that = _that; + this._isCalled = false; + this._deferred = new promise_1.Deferred(); + } + get isCalled() { + return this._isCalled; + } + get promise() { + return this._deferred.promise; + } + call(...args) { + if (!this._isCalled) { + this._isCalled = true; + try { + Promise.resolve(this._callback.call(this._that, ...args)).then(val => this._deferred.resolve(val), err => this._deferred.reject(err)); + } + catch (err) { + this._deferred.reject(err); + } + } + return this._deferred.promise; + } +} +exports.BindOnceFuture = BindOnceFuture; +//# sourceMappingURL=callback.js.map + +/***/ }), + +/***/ 7238: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseEnvironment = exports.DEFAULT_ENVIRONMENT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = void 0; +const api_1 = __nccwpck_require__(65163); +const sampling_1 = __nccwpck_require__(28289); +const DEFAULT_LIST_SEPARATOR = ','; +/** + * Environment interface to define all names + */ +const ENVIRONMENT_BOOLEAN_KEYS = ['OTEL_SDK_DISABLED']; +function isEnvVarABoolean(key) { + return (ENVIRONMENT_BOOLEAN_KEYS.indexOf(key) > -1); +} +const ENVIRONMENT_NUMBERS_KEYS = [ + 'OTEL_BSP_EXPORT_TIMEOUT', + 'OTEL_BSP_MAX_EXPORT_BATCH_SIZE', + 'OTEL_BSP_MAX_QUEUE_SIZE', + 'OTEL_BSP_SCHEDULE_DELAY', + 'OTEL_BLRP_EXPORT_TIMEOUT', + 'OTEL_BLRP_MAX_EXPORT_BATCH_SIZE', + 'OTEL_BLRP_MAX_QUEUE_SIZE', + 'OTEL_BLRP_SCHEDULE_DELAY', + 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT', + 'OTEL_ATTRIBUTE_COUNT_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT', + 'OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT', + 'OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT', + 'OTEL_SPAN_EVENT_COUNT_LIMIT', + 'OTEL_SPAN_LINK_COUNT_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT', + 'OTEL_EXPORTER_OTLP_TIMEOUT', + 'OTEL_EXPORTER_OTLP_TRACES_TIMEOUT', + 'OTEL_EXPORTER_OTLP_METRICS_TIMEOUT', + 'OTEL_EXPORTER_OTLP_LOGS_TIMEOUT', + 'OTEL_EXPORTER_JAEGER_AGENT_PORT', +]; +function isEnvVarANumber(key) { + return (ENVIRONMENT_NUMBERS_KEYS.indexOf(key) > -1); +} +const ENVIRONMENT_LISTS_KEYS = [ + 'OTEL_NO_PATCH_MODULES', + 'OTEL_PROPAGATORS', + 'OTEL_SEMCONV_STABILITY_OPT_IN', +]; +function isEnvVarAList(key) { + return ENVIRONMENT_LISTS_KEYS.indexOf(key) > -1; +} +exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity; +exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128; +exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = 128; +exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = 128; +/** + * Default environment variables + */ +exports.DEFAULT_ENVIRONMENT = { + OTEL_SDK_DISABLED: false, + CONTAINER_NAME: '', + ECS_CONTAINER_METADATA_URI_V4: '', + ECS_CONTAINER_METADATA_URI: '', + HOSTNAME: '', + KUBERNETES_SERVICE_HOST: '', + NAMESPACE: '', + OTEL_BSP_EXPORT_TIMEOUT: 30000, + OTEL_BSP_MAX_EXPORT_BATCH_SIZE: 512, + OTEL_BSP_MAX_QUEUE_SIZE: 2048, + OTEL_BSP_SCHEDULE_DELAY: 5000, + OTEL_BLRP_EXPORT_TIMEOUT: 30000, + OTEL_BLRP_MAX_EXPORT_BATCH_SIZE: 512, + OTEL_BLRP_MAX_QUEUE_SIZE: 2048, + OTEL_BLRP_SCHEDULE_DELAY: 5000, + OTEL_EXPORTER_JAEGER_AGENT_HOST: '', + OTEL_EXPORTER_JAEGER_AGENT_PORT: 6832, + OTEL_EXPORTER_JAEGER_ENDPOINT: '', + OTEL_EXPORTER_JAEGER_PASSWORD: '', + OTEL_EXPORTER_JAEGER_USER: '', + OTEL_EXPORTER_OTLP_ENDPOINT: '', + OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: '', + OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '', + OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: '', + OTEL_EXPORTER_OTLP_HEADERS: '', + OTEL_EXPORTER_OTLP_TRACES_HEADERS: '', + OTEL_EXPORTER_OTLP_METRICS_HEADERS: '', + OTEL_EXPORTER_OTLP_LOGS_HEADERS: '', + OTEL_EXPORTER_OTLP_TIMEOUT: 10000, + OTEL_EXPORTER_OTLP_TRACES_TIMEOUT: 10000, + OTEL_EXPORTER_OTLP_METRICS_TIMEOUT: 10000, + OTEL_EXPORTER_OTLP_LOGS_TIMEOUT: 10000, + OTEL_EXPORTER_ZIPKIN_ENDPOINT: 'http://localhost:9411/api/v2/spans', + OTEL_LOG_LEVEL: api_1.DiagLogLevel.INFO, + OTEL_NO_PATCH_MODULES: [], + OTEL_PROPAGATORS: ['tracecontext', 'baggage'], + OTEL_RESOURCE_ATTRIBUTES: '', + OTEL_SERVICE_NAME: '', + OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, + OTEL_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, + OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, + OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, + OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, + OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, + OTEL_SPAN_EVENT_COUNT_LIMIT: 128, + OTEL_SPAN_LINK_COUNT_LIMIT: 128, + OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT: exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, + OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT: exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT, + OTEL_TRACES_EXPORTER: '', + OTEL_TRACES_SAMPLER: sampling_1.TracesSamplerValues.ParentBasedAlwaysOn, + OTEL_TRACES_SAMPLER_ARG: '', + OTEL_LOGS_EXPORTER: '', + OTEL_EXPORTER_OTLP_INSECURE: '', + OTEL_EXPORTER_OTLP_TRACES_INSECURE: '', + OTEL_EXPORTER_OTLP_METRICS_INSECURE: '', + OTEL_EXPORTER_OTLP_LOGS_INSECURE: '', + OTEL_EXPORTER_OTLP_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_COMPRESSION: '', + OTEL_EXPORTER_OTLP_TRACES_COMPRESSION: '', + OTEL_EXPORTER_OTLP_METRICS_COMPRESSION: '', + OTEL_EXPORTER_OTLP_LOGS_COMPRESSION: '', + OTEL_EXPORTER_OTLP_CLIENT_KEY: '', + OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY: '', + OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY: '', + OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY: '', + OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_PROTOCOL: 'http/protobuf', + OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: 'http/protobuf', + OTEL_EXPORTER_OTLP_METRICS_PROTOCOL: 'http/protobuf', + OTEL_EXPORTER_OTLP_LOGS_PROTOCOL: 'http/protobuf', + OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE: 'cumulative', + OTEL_SEMCONV_STABILITY_OPT_IN: [], +}; +/** + * @param key + * @param environment + * @param values + */ +function parseBoolean(key, environment, values) { + if (typeof values[key] === 'undefined') { + return; + } + const value = String(values[key]); + // support case-insensitive "true" + environment[key] = value.toLowerCase() === 'true'; +} +/** + * Parses a variable as number with number validation + * @param name + * @param environment + * @param values + * @param min + * @param max + */ +function parseNumber(name, environment, values, min = -Infinity, max = Infinity) { + if (typeof values[name] !== 'undefined') { + const value = Number(values[name]); + if (!isNaN(value)) { + if (value < min) { + environment[name] = min; + } + else if (value > max) { + environment[name] = max; + } + else { + environment[name] = value; + } + } + } +} +/** + * Parses list-like strings from input into output. + * @param name + * @param environment + * @param values + * @param separator + */ +function parseStringList(name, output, input, separator = DEFAULT_LIST_SEPARATOR) { + const givenValue = input[name]; + if (typeof givenValue === 'string') { + output[name] = givenValue.split(separator).map(v => v.trim()); + } +} +// The support string -> DiagLogLevel mappings +const logLevelMap = { + ALL: api_1.DiagLogLevel.ALL, + VERBOSE: api_1.DiagLogLevel.VERBOSE, + DEBUG: api_1.DiagLogLevel.DEBUG, + INFO: api_1.DiagLogLevel.INFO, + WARN: api_1.DiagLogLevel.WARN, + ERROR: api_1.DiagLogLevel.ERROR, + NONE: api_1.DiagLogLevel.NONE, +}; +/** + * Environmentally sets log level if valid log level string is provided + * @param key + * @param environment + * @param values + */ +function setLogLevelFromEnv(key, environment, values) { + const value = values[key]; + if (typeof value === 'string') { + const theLevel = logLevelMap[value.toUpperCase()]; + if (theLevel != null) { + environment[key] = theLevel; + } + } +} +/** + * Parses environment values + * @param values + */ +function parseEnvironment(values) { + const environment = {}; + for (const env in exports.DEFAULT_ENVIRONMENT) { + const key = env; + switch (key) { + case 'OTEL_LOG_LEVEL': + setLogLevelFromEnv(key, environment, values); + break; + default: + if (isEnvVarABoolean(key)) { + parseBoolean(key, environment, values); + } + else if (isEnvVarANumber(key)) { + parseNumber(key, environment, values); + } + else if (isEnvVarAList(key)) { + parseStringList(key, environment, values); + } + else { + const value = values[key]; + if (typeof value !== 'undefined' && value !== null) { + environment[key] = String(value); + } + } + } + } + return environment; +} +exports.parseEnvironment = parseEnvironment; +//# sourceMappingURL=environment.js.map + +/***/ }), + +/***/ 71780: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isPlainObject = void 0; +/* eslint-disable @typescript-eslint/no-explicit-any */ +/** + * based on lodash in order to support esm builds without esModuleInterop. + * lodash is using MIT License. + **/ +const objectTag = '[object Object]'; +const nullTag = '[object Null]'; +const undefinedTag = '[object Undefined]'; +const funcProto = Function.prototype; +const funcToString = funcProto.toString; +const objectCtorString = funcToString.call(Object); +const getPrototype = overArg(Object.getPrototypeOf, Object); +const objectProto = Object.prototype; +const hasOwnProperty = objectProto.hasOwnProperty; +const symToStringTag = Symbol ? Symbol.toStringTag : undefined; +const nativeObjectToString = objectProto.toString; +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function (arg) { + return func(transform(arg)); + }; +} +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) !== objectTag) { + return false; + } + const proto = getPrototype(value); + if (proto === null) { + return true; + } + const Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return (typeof Ctor == 'function' && + Ctor instanceof Ctor && + funcToString.call(Ctor) === objectCtorString); +} +exports.isPlainObject = isPlainObject; +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return symToStringTag && symToStringTag in Object(value) + ? getRawTag(value) + : objectToString(value); +} +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; + let unmasked = false; + try { + value[symToStringTag] = undefined; + unmasked = true; + } + catch (e) { + // silence + } + const result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } + else { + delete value[symToStringTag]; + } + } + return result; +} +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} +//# sourceMappingURL=lodash.merge.js.map + +/***/ }), + +/***/ 65387: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.merge = void 0; +/* eslint-disable @typescript-eslint/no-explicit-any */ +const lodash_merge_1 = __nccwpck_require__(71780); +const MAX_LEVEL = 20; +/** + * Merges objects together + * @param args - objects / values to be merged + */ +function merge(...args) { + let result = args.shift(); + const objects = new WeakMap(); + while (args.length > 0) { + result = mergeTwoObjects(result, args.shift(), 0, objects); + } + return result; +} +exports.merge = merge; +function takeValue(value) { + if (isArray(value)) { + return value.slice(); + } + return value; +} +/** + * Merges two objects + * @param one - first object + * @param two - second object + * @param level - current deep level + * @param objects - objects holder that has been already referenced - to prevent + * cyclic dependency + */ +function mergeTwoObjects(one, two, level = 0, objects) { + let result; + if (level > MAX_LEVEL) { + return undefined; + } + level++; + if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) { + result = takeValue(two); + } + else if (isArray(one)) { + result = one.slice(); + if (isArray(two)) { + for (let i = 0, j = two.length; i < j; i++) { + result.push(takeValue(two[i])); + } + } + else if (isObject(two)) { + const keys = Object.keys(two); + for (let i = 0, j = keys.length; i < j; i++) { + const key = keys[i]; + result[key] = takeValue(two[key]); + } + } + } + else if (isObject(one)) { + if (isObject(two)) { + if (!shouldMerge(one, two)) { + return two; + } + result = Object.assign({}, one); + const keys = Object.keys(two); + for (let i = 0, j = keys.length; i < j; i++) { + const key = keys[i]; + const twoValue = two[key]; + if (isPrimitive(twoValue)) { + if (typeof twoValue === 'undefined') { + delete result[key]; + } + else { + // result[key] = takeValue(twoValue); + result[key] = twoValue; + } + } + else { + const obj1 = result[key]; + const obj2 = twoValue; + if (wasObjectReferenced(one, key, objects) || + wasObjectReferenced(two, key, objects)) { + delete result[key]; + } + else { + if (isObject(obj1) && isObject(obj2)) { + const arr1 = objects.get(obj1) || []; + const arr2 = objects.get(obj2) || []; + arr1.push({ obj: one, key }); + arr2.push({ obj: two, key }); + objects.set(obj1, arr1); + objects.set(obj2, arr2); + } + result[key] = mergeTwoObjects(result[key], twoValue, level, objects); + } + } + } + } + else { + result = two; + } + } + return result; +} +/** + * Function to check if object has been already reference + * @param obj + * @param key + * @param objects + */ +function wasObjectReferenced(obj, key, objects) { + const arr = objects.get(obj[key]) || []; + for (let i = 0, j = arr.length; i < j; i++) { + const info = arr[i]; + if (info.key === key && info.obj === obj) { + return true; + } + } + return false; +} +function isArray(value) { + return Array.isArray(value); +} +function isFunction(value) { + return typeof value === 'function'; +} +function isObject(value) { + return (!isPrimitive(value) && + !isArray(value) && + !isFunction(value) && + typeof value === 'object'); +} +function isPrimitive(value) { + return (typeof value === 'string' || + typeof value === 'number' || + typeof value === 'boolean' || + typeof value === 'undefined' || + value instanceof Date || + value instanceof RegExp || + value === null); +} +function shouldMerge(one, two) { + if (!(0, lodash_merge_1.isPlainObject)(one) || !(0, lodash_merge_1.isPlainObject)(two)) { + return false; + } + return true; +} +//# sourceMappingURL=merge.js.map + +/***/ }), + +/***/ 28329: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Deferred = void 0; +class Deferred { + constructor() { + this._promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + }); + } + get promise() { + return this._promise; + } + resolve(val) { + this._resolve(val); + } + reject(err) { + this._reject(err); + } +} +exports.Deferred = Deferred; +//# sourceMappingURL=promise.js.map + +/***/ }), + +/***/ 28289: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TracesSamplerValues = void 0; +var TracesSamplerValues; +(function (TracesSamplerValues) { + TracesSamplerValues["AlwaysOff"] = "always_off"; + TracesSamplerValues["AlwaysOn"] = "always_on"; + TracesSamplerValues["ParentBasedAlwaysOff"] = "parentbased_always_off"; + TracesSamplerValues["ParentBasedAlwaysOn"] = "parentbased_always_on"; + TracesSamplerValues["ParentBasedTraceIdRatio"] = "parentbased_traceidratio"; + TracesSamplerValues["TraceIdRatio"] = "traceidratio"; +})(TracesSamplerValues = exports.TracesSamplerValues || (exports.TracesSamplerValues = {})); +//# sourceMappingURL=sampling.js.map + +/***/ }), + +/***/ 48400: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.callWithTimeout = exports.TimeoutError = void 0; +/** + * Error that is thrown on timeouts. + */ +class TimeoutError extends Error { + constructor(message) { + super(message); + // manually adjust prototype to retain `instanceof` functionality when targeting ES5, see: + // https://github.com/Microsoft/TypeScript-wiki/blob/main/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work + Object.setPrototypeOf(this, TimeoutError.prototype); + } +} +exports.TimeoutError = TimeoutError; +/** + * Adds a timeout to a promise and rejects if the specified timeout has elapsed. Also rejects if the specified promise + * rejects, and resolves if the specified promise resolves. + * + *

NOTE: this operation will continue even after it throws a {@link TimeoutError}. + * + * @param promise promise to use with timeout. + * @param timeout the timeout in milliseconds until the returned promise is rejected. + */ +function callWithTimeout(promise, timeout) { + let timeoutHandle; + const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { + timeoutHandle = setTimeout(function timeoutHandler() { + reject(new TimeoutError('Operation timed out.')); + }, timeout); + }); + return Promise.race([promise, timeoutPromise]).then(result => { + clearTimeout(timeoutHandle); + return result; + }, reason => { + clearTimeout(timeoutHandle); + throw reason; + }); +} +exports.callWithTimeout = callWithTimeout; +//# sourceMappingURL=timeout.js.map + +/***/ }), + +/***/ 90839: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isUrlIgnored = exports.urlMatches = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +function urlMatches(url, urlToMatch) { + if (typeof urlToMatch === 'string') { + return url === urlToMatch; + } + else { + return !!url.match(urlToMatch); + } +} +exports.urlMatches = urlMatches; +/** + * Check if {@param url} should be ignored when comparing against {@param ignoredUrls} + * @param url + * @param ignoredUrls + */ +function isUrlIgnored(url, ignoredUrls) { + if (!ignoredUrls) { + return false; + } + for (const ignoreUrl of ignoredUrls) { + if (urlMatches(url, ignoreUrl)) { + return true; + } + } + return false; +} +exports.isUrlIgnored = isUrlIgnored; +//# sourceMappingURL=url.js.map + +/***/ }), + +/***/ 67226: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isWrapped = void 0; +/** + * Checks if certain function has been already wrapped + * @param func + */ +function isWrapped(func) { + return (typeof func === 'function' && + typeof func.__original === 'function' && + typeof func.__unwrap === 'function' && + func.__wrapped === true); +} +exports.isWrapped = isWrapped; +//# sourceMappingURL=wrap.js.map + +/***/ }), + +/***/ 55687: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.VERSION = '1.30.0'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 4197: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AmqplibInstrumentation = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(89736); +const instrumentation_1 = __nccwpck_require__(65584); +const semantic_conventions_1 = __nccwpck_require__(67275); +const types_1 = __nccwpck_require__(19540); +const utils_1 = __nccwpck_require__(65281); +/** @knipignore */ +const version_1 = __nccwpck_require__(73704); +const supportedVersions = ['>=0.5.5 <1']; +class AmqplibInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, Object.assign(Object.assign({}, types_1.DEFAULT_CONFIG), config)); + } + setConfig(config = {}) { + super.setConfig(Object.assign(Object.assign({}, types_1.DEFAULT_CONFIG), config)); + } + init() { + const channelModelModuleFile = new instrumentation_1.InstrumentationNodeModuleFile('amqplib/lib/channel_model.js', supportedVersions, this.patchChannelModel.bind(this), this.unpatchChannelModel.bind(this)); + const callbackModelModuleFile = new instrumentation_1.InstrumentationNodeModuleFile('amqplib/lib/callback_model.js', supportedVersions, this.patchChannelModel.bind(this), this.unpatchChannelModel.bind(this)); + const connectModuleFile = new instrumentation_1.InstrumentationNodeModuleFile('amqplib/lib/connect.js', supportedVersions, this.patchConnect.bind(this), this.unpatchConnect.bind(this)); + const module = new instrumentation_1.InstrumentationNodeModuleDefinition('amqplib', supportedVersions, undefined, undefined, [channelModelModuleFile, connectModuleFile, callbackModelModuleFile]); + return module; + } + patchConnect(moduleExports) { + moduleExports = this.unpatchConnect(moduleExports); + if (!(0, instrumentation_1.isWrapped)(moduleExports.connect)) { + this._wrap(moduleExports, 'connect', this.getConnectPatch.bind(this)); + } + return moduleExports; + } + unpatchConnect(moduleExports) { + if ((0, instrumentation_1.isWrapped)(moduleExports.connect)) { + this._unwrap(moduleExports, 'connect'); + } + return moduleExports; + } + patchChannelModel(moduleExports, moduleVersion) { + if (!(0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.publish)) { + this._wrap(moduleExports.Channel.prototype, 'publish', this.getPublishPatch.bind(this, moduleVersion)); + } + if (!(0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.consume)) { + this._wrap(moduleExports.Channel.prototype, 'consume', this.getConsumePatch.bind(this, moduleVersion)); + } + if (!(0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.ack)) { + this._wrap(moduleExports.Channel.prototype, 'ack', this.getAckPatch.bind(this, false, types_1.EndOperation.Ack)); + } + if (!(0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.nack)) { + this._wrap(moduleExports.Channel.prototype, 'nack', this.getAckPatch.bind(this, true, types_1.EndOperation.Nack)); + } + if (!(0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.reject)) { + this._wrap(moduleExports.Channel.prototype, 'reject', this.getAckPatch.bind(this, true, types_1.EndOperation.Reject)); + } + if (!(0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.ackAll)) { + this._wrap(moduleExports.Channel.prototype, 'ackAll', this.getAckAllPatch.bind(this, false, types_1.EndOperation.AckAll)); + } + if (!(0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.nackAll)) { + this._wrap(moduleExports.Channel.prototype, 'nackAll', this.getAckAllPatch.bind(this, true, types_1.EndOperation.NackAll)); + } + if (!(0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.emit)) { + this._wrap(moduleExports.Channel.prototype, 'emit', this.getChannelEmitPatch.bind(this)); + } + if (!(0, instrumentation_1.isWrapped)(moduleExports.ConfirmChannel.prototype.publish)) { + this._wrap(moduleExports.ConfirmChannel.prototype, 'publish', this.getConfirmedPublishPatch.bind(this, moduleVersion)); + } + return moduleExports; + } + unpatchChannelModel(moduleExports) { + if ((0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.publish)) { + this._unwrap(moduleExports.Channel.prototype, 'publish'); + } + if ((0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.consume)) { + this._unwrap(moduleExports.Channel.prototype, 'consume'); + } + if ((0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.ack)) { + this._unwrap(moduleExports.Channel.prototype, 'ack'); + } + if ((0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.nack)) { + this._unwrap(moduleExports.Channel.prototype, 'nack'); + } + if ((0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.reject)) { + this._unwrap(moduleExports.Channel.prototype, 'reject'); + } + if ((0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.ackAll)) { + this._unwrap(moduleExports.Channel.prototype, 'ackAll'); + } + if ((0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.nackAll)) { + this._unwrap(moduleExports.Channel.prototype, 'nackAll'); + } + if ((0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.emit)) { + this._unwrap(moduleExports.Channel.prototype, 'emit'); + } + if ((0, instrumentation_1.isWrapped)(moduleExports.ConfirmChannel.prototype.publish)) { + this._unwrap(moduleExports.ConfirmChannel.prototype, 'publish'); + } + return moduleExports; + } + getConnectPatch(original) { + return function patchedConnect(url, socketOptions, openCallback) { + return original.call(this, url, socketOptions, function (err, conn) { + if (err == null) { + const urlAttributes = (0, utils_1.getConnectionAttributesFromUrl)(url); + // the type of conn in @types/amqplib is amqp.Connection, but in practice the library send the + // `serverProperties` on the `conn` and not in a property `connection`. + // I don't have capacity to debug it currently but it should probably be fixed in @types or + // in the package itself + // currently setting as any to calm typescript + const serverAttributes = (0, utils_1.getConnectionAttributesFromServer)(conn); + conn[utils_1.CONNECTION_ATTRIBUTES] = Object.assign(Object.assign({}, urlAttributes), serverAttributes); + } + openCallback.apply(this, arguments); + }); + }; + } + getChannelEmitPatch(original) { + const self = this; + return function emit(eventName) { + if (eventName === 'close') { + self.endAllSpansOnChannel(this, true, types_1.EndOperation.ChannelClosed, undefined); + const activeTimer = this[utils_1.CHANNEL_CONSUME_TIMEOUT_TIMER]; + if (activeTimer) { + clearInterval(activeTimer); + } + this[utils_1.CHANNEL_CONSUME_TIMEOUT_TIMER] = undefined; + } + else if (eventName === 'error') { + self.endAllSpansOnChannel(this, true, types_1.EndOperation.ChannelError, undefined); + } + return original.apply(this, arguments); + }; + } + getAckAllPatch(isRejected, endOperation, original) { + const self = this; + return function ackAll(requeueOrEmpty) { + self.endAllSpansOnChannel(this, isRejected, endOperation, requeueOrEmpty); + return original.apply(this, arguments); + }; + } + getAckPatch(isRejected, endOperation, original) { + const self = this; + return function ack(message, allUpToOrRequeue, requeue) { + var _a; + const channel = this; + // we use this patch in reject function as well, but it has different signature + const requeueResolved = endOperation === types_1.EndOperation.Reject ? allUpToOrRequeue : requeue; + const spansNotEnded = (_a = channel[utils_1.CHANNEL_SPANS_NOT_ENDED]) !== null && _a !== void 0 ? _a : []; + const msgIndex = spansNotEnded.findIndex(msgDetails => msgDetails.msg === message); + if (msgIndex < 0) { + // should not happen in happy flow + // but possible if user is calling the api function ack twice with same message + self.endConsumerSpan(message, isRejected, endOperation, requeueResolved); + } + else if (endOperation !== types_1.EndOperation.Reject && allUpToOrRequeue) { + for (let i = 0; i <= msgIndex; i++) { + self.endConsumerSpan(spansNotEnded[i].msg, isRejected, endOperation, requeueResolved); + } + spansNotEnded.splice(0, msgIndex + 1); + } + else { + self.endConsumerSpan(message, isRejected, endOperation, requeueResolved); + spansNotEnded.splice(msgIndex, 1); + } + return original.apply(this, arguments); + }; + } + getConsumePatch(moduleVersion, original) { + const self = this; + return function consume(queue, onMessage, options) { + const channel = this; + if (!Object.prototype.hasOwnProperty.call(channel, utils_1.CHANNEL_SPANS_NOT_ENDED)) { + const { consumeTimeoutMs } = self.getConfig(); + if (consumeTimeoutMs) { + const timer = setInterval(() => { + self.checkConsumeTimeoutOnChannel(channel); + }, consumeTimeoutMs); + timer.unref(); + channel[utils_1.CHANNEL_CONSUME_TIMEOUT_TIMER] = timer; + } + channel[utils_1.CHANNEL_SPANS_NOT_ENDED] = []; + } + const patchedOnMessage = function (msg) { + var _a, _b, _c, _d, _e; + // msg is expected to be null for signaling consumer cancel notification + // https://www.rabbitmq.com/consumer-cancel.html + // in this case, we do not start a span, as this is not a real message. + if (!msg) { + return onMessage.call(this, msg); + } + const headers = (_a = msg.properties.headers) !== null && _a !== void 0 ? _a : {}; + let parentContext = api_1.propagation.extract(api_1.ROOT_CONTEXT, headers); + const exchange = (_b = msg.fields) === null || _b === void 0 ? void 0 : _b.exchange; + let links; + if (self._config.useLinksForConsume) { + const parentSpanContext = parentContext + ? (_c = api_1.trace.getSpan(parentContext)) === null || _c === void 0 ? void 0 : _c.spanContext() + : undefined; + parentContext = undefined; + if (parentSpanContext) { + links = [ + { + context: parentSpanContext, + }, + ]; + } + } + const span = self.tracer.startSpan(`${queue} process`, { + kind: api_1.SpanKind.CONSUMER, + attributes: Object.assign(Object.assign({}, (_d = channel === null || channel === void 0 ? void 0 : channel.connection) === null || _d === void 0 ? void 0 : _d[utils_1.CONNECTION_ATTRIBUTES]), { [semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION]: exchange, [semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION_KIND]: semantic_conventions_1.MESSAGINGDESTINATIONKINDVALUES_TOPIC, [semantic_conventions_1.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY]: (_e = msg.fields) === null || _e === void 0 ? void 0 : _e.routingKey, [semantic_conventions_1.SEMATTRS_MESSAGING_OPERATION]: semantic_conventions_1.MESSAGINGOPERATIONVALUES_PROCESS, [semantic_conventions_1.SEMATTRS_MESSAGING_MESSAGE_ID]: msg === null || msg === void 0 ? void 0 : msg.properties.messageId, [semantic_conventions_1.SEMATTRS_MESSAGING_CONVERSATION_ID]: msg === null || msg === void 0 ? void 0 : msg.properties.correlationId }), + links, + }, parentContext); + const { consumeHook } = self.getConfig(); + if (consumeHook) { + (0, instrumentation_1.safeExecuteInTheMiddle)(() => consumeHook(span, { moduleVersion, msg }), e => { + if (e) { + api_1.diag.error('amqplib instrumentation: consumerHook error', e); + } + }, true); + } + if (!(options === null || options === void 0 ? void 0 : options.noAck)) { + // store the message on the channel so we can close the span on ackAll etc + channel[utils_1.CHANNEL_SPANS_NOT_ENDED].push({ + msg, + timeOfConsume: (0, core_1.hrTime)(), + }); + // store the span on the message, so we can end it when user call 'ack' on it + msg[utils_1.MESSAGE_STORED_SPAN] = span; + } + const setContext = parentContext + ? parentContext + : api_1.ROOT_CONTEXT; + api_1.context.with(api_1.trace.setSpan(setContext, span), () => { + onMessage.call(this, msg); + }); + if (options === null || options === void 0 ? void 0 : options.noAck) { + self.callConsumeEndHook(span, msg, false, types_1.EndOperation.AutoAck); + span.end(); + } + }; + arguments[1] = patchedOnMessage; + return original.apply(this, arguments); + }; + } + getConfirmedPublishPatch(moduleVersion, original) { + const self = this; + return function confirmedPublish(exchange, routingKey, content, options, callback) { + const channel = this; + const { span, modifiedOptions } = self.createPublishSpan(self, exchange, routingKey, channel, options); + const { publishHook } = self.getConfig(); + if (publishHook) { + (0, instrumentation_1.safeExecuteInTheMiddle)(() => publishHook(span, { + moduleVersion, + exchange, + routingKey, + content, + options: modifiedOptions, + isConfirmChannel: true, + }), e => { + if (e) { + api_1.diag.error('amqplib instrumentation: publishHook error', e); + } + }, true); + } + const patchedOnConfirm = function (err, ok) { + try { + callback === null || callback === void 0 ? void 0 : callback.call(this, err, ok); + } + finally { + const { publishConfirmHook } = self.getConfig(); + if (publishConfirmHook) { + (0, instrumentation_1.safeExecuteInTheMiddle)(() => publishConfirmHook(span, { + moduleVersion, + exchange, + routingKey, + content, + options, + isConfirmChannel: true, + confirmError: err, + }), e => { + if (e) { + api_1.diag.error('amqplib instrumentation: publishConfirmHook error', e); + } + }, true); + } + if (err) { + span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: "message confirmation has been nack'ed", + }); + } + span.end(); + } + }; + // calling confirm channel publish function is storing the message in queue and registering the callback for broker confirm. + // span ends in the patched callback. + const markedContext = (0, utils_1.markConfirmChannelTracing)(api_1.context.active()); + const argumentsCopy = [...arguments]; + argumentsCopy[3] = modifiedOptions; + argumentsCopy[4] = api_1.context.bind((0, utils_1.unmarkConfirmChannelTracing)(api_1.trace.setSpan(markedContext, span)), patchedOnConfirm); + return api_1.context.with(markedContext, original.bind(this, ...argumentsCopy)); + }; + } + getPublishPatch(moduleVersion, original) { + const self = this; + return function publish(exchange, routingKey, content, options) { + if ((0, utils_1.isConfirmChannelTracing)(api_1.context.active())) { + // work already done + return original.apply(this, arguments); + } + else { + const channel = this; + const { span, modifiedOptions } = self.createPublishSpan(self, exchange, routingKey, channel, options); + const { publishHook } = self.getConfig(); + if (publishHook) { + (0, instrumentation_1.safeExecuteInTheMiddle)(() => publishHook(span, { + moduleVersion, + exchange, + routingKey, + content, + options: modifiedOptions, + isConfirmChannel: false, + }), e => { + if (e) { + api_1.diag.error('amqplib instrumentation: publishHook error', e); + } + }, true); + } + // calling normal channel publish function is only storing the message in queue. + // it does not send it and waits for an ack, so the span duration is expected to be very short. + const argumentsCopy = [...arguments]; + argumentsCopy[3] = modifiedOptions; + const originalRes = original.apply(this, argumentsCopy); + span.end(); + return originalRes; + } + }; + } + createPublishSpan(self, exchange, routingKey, channel, options) { + var _a; + const normalizedExchange = (0, utils_1.normalizeExchange)(exchange); + const span = self.tracer.startSpan(`publish ${normalizedExchange}`, { + kind: api_1.SpanKind.PRODUCER, + attributes: Object.assign(Object.assign({}, channel.connection[utils_1.CONNECTION_ATTRIBUTES]), { [semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION]: exchange, [semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION_KIND]: semantic_conventions_1.MESSAGINGDESTINATIONKINDVALUES_TOPIC, [semantic_conventions_1.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY]: routingKey, [semantic_conventions_1.SEMATTRS_MESSAGING_MESSAGE_ID]: options === null || options === void 0 ? void 0 : options.messageId, [semantic_conventions_1.SEMATTRS_MESSAGING_CONVERSATION_ID]: options === null || options === void 0 ? void 0 : options.correlationId }), + }); + const modifiedOptions = options !== null && options !== void 0 ? options : {}; + modifiedOptions.headers = (_a = modifiedOptions.headers) !== null && _a !== void 0 ? _a : {}; + api_1.propagation.inject(api_1.trace.setSpan(api_1.context.active(), span), modifiedOptions.headers); + return { span, modifiedOptions }; + } + endConsumerSpan(message, isRejected, operation, requeue) { + const storedSpan = message[utils_1.MESSAGE_STORED_SPAN]; + if (!storedSpan) + return; + if (isRejected !== false) { + storedSpan.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: operation !== types_1.EndOperation.ChannelClosed && + operation !== types_1.EndOperation.ChannelError + ? `${operation} called on message${requeue === true + ? ' with requeue' + : requeue === false + ? ' without requeue' + : ''}` + : operation, + }); + } + this.callConsumeEndHook(storedSpan, message, isRejected, operation); + storedSpan.end(); + message[utils_1.MESSAGE_STORED_SPAN] = undefined; + } + endAllSpansOnChannel(channel, isRejected, operation, requeue) { + var _a; + const spansNotEnded = (_a = channel[utils_1.CHANNEL_SPANS_NOT_ENDED]) !== null && _a !== void 0 ? _a : []; + spansNotEnded.forEach(msgDetails => { + this.endConsumerSpan(msgDetails.msg, isRejected, operation, requeue); + }); + channel[utils_1.CHANNEL_SPANS_NOT_ENDED] = []; + } + callConsumeEndHook(span, msg, rejected, endOperation) { + const { consumeEndHook } = this.getConfig(); + if (!consumeEndHook) + return; + (0, instrumentation_1.safeExecuteInTheMiddle)(() => consumeEndHook(span, { msg, rejected, endOperation }), e => { + if (e) { + api_1.diag.error('amqplib instrumentation: consumerEndHook error', e); + } + }, true); + } + checkConsumeTimeoutOnChannel(channel) { + var _a; + const currentTime = (0, core_1.hrTime)(); + const spansNotEnded = (_a = channel[utils_1.CHANNEL_SPANS_NOT_ENDED]) !== null && _a !== void 0 ? _a : []; + let i; + const { consumeTimeoutMs } = this.getConfig(); + for (i = 0; i < spansNotEnded.length; i++) { + const currMessage = spansNotEnded[i]; + const timeFromConsume = (0, core_1.hrTimeDuration)(currMessage.timeOfConsume, currentTime); + if ((0, core_1.hrTimeToMilliseconds)(timeFromConsume) < consumeTimeoutMs) { + break; + } + this.endConsumerSpan(currMessage.msg, null, types_1.EndOperation.InstrumentationTimeout, true); + } + spansNotEnded.splice(0, i); + } +} +exports.AmqplibInstrumentation = AmqplibInstrumentation; +//# sourceMappingURL=amqplib.js.map + +/***/ }), + +/***/ 46524: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +__exportStar(__nccwpck_require__(4197), exports); +__exportStar(__nccwpck_require__(19540), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 19540: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DEFAULT_CONFIG = exports.EndOperation = void 0; +var EndOperation; +(function (EndOperation) { + EndOperation["AutoAck"] = "auto ack"; + EndOperation["Ack"] = "ack"; + EndOperation["AckAll"] = "ackAll"; + EndOperation["Reject"] = "reject"; + EndOperation["Nack"] = "nack"; + EndOperation["NackAll"] = "nackAll"; + EndOperation["ChannelClosed"] = "channel closed"; + EndOperation["ChannelError"] = "channel error"; + EndOperation["InstrumentationTimeout"] = "instrumentation timeout"; +})(EndOperation = exports.EndOperation || (exports.EndOperation = {})); +exports.DEFAULT_CONFIG = { + consumeTimeoutMs: 1000 * 60, + useLinksForConsume: false, +}; +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 65281: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isConfirmChannelTracing = exports.unmarkConfirmChannelTracing = exports.markConfirmChannelTracing = exports.getConnectionAttributesFromUrl = exports.getConnectionAttributesFromServer = exports.normalizeExchange = exports.CONNECTION_ATTRIBUTES = exports.CHANNEL_CONSUME_TIMEOUT_TIMER = exports.CHANNEL_SPANS_NOT_ENDED = exports.MESSAGE_STORED_SPAN = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const api_1 = __nccwpck_require__(65163); +const semantic_conventions_1 = __nccwpck_require__(67275); +exports.MESSAGE_STORED_SPAN = Symbol('opentelemetry.amqplib.message.stored-span'); +exports.CHANNEL_SPANS_NOT_ENDED = Symbol('opentelemetry.amqplib.channel.spans-not-ended'); +exports.CHANNEL_CONSUME_TIMEOUT_TIMER = Symbol('opentelemetry.amqplib.channel.consumer-timeout-timer'); +exports.CONNECTION_ATTRIBUTES = Symbol('opentelemetry.amqplib.connection.attributes'); +const IS_CONFIRM_CHANNEL_CONTEXT_KEY = (0, api_1.createContextKey)('opentelemetry.amqplib.channel.is-confirm-channel'); +const normalizeExchange = (exchangeName) => exchangeName !== '' ? exchangeName : ''; +exports.normalizeExchange = normalizeExchange; +const censorPassword = (url) => { + return url.replace(/:[^:@/]*@/, ':***@'); +}; +const getPort = (portFromUrl, resolvedProtocol) => { + // we are using the resolved protocol which is upper case + // this code mimic the behavior of the amqplib which is used to set connection params + return portFromUrl || (resolvedProtocol === 'AMQP' ? 5672 : 5671); +}; +const getProtocol = (protocolFromUrl) => { + const resolvedProtocol = protocolFromUrl || 'amqp'; + // the substring removed the ':' part of the protocol ('amqp:' -> 'amqp') + const noEndingColon = resolvedProtocol.endsWith(':') + ? resolvedProtocol.substring(0, resolvedProtocol.length - 1) + : resolvedProtocol; + // upper cases to match spec + return noEndingColon.toUpperCase(); +}; +const getHostname = (hostnameFromUrl) => { + // if user supplies empty hostname, it gets forwarded to 'net' package which default it to localhost. + // https://nodejs.org/docs/latest-v12.x/api/net.html#net_socket_connect_options_connectlistener + return hostnameFromUrl || 'localhost'; +}; +const extractConnectionAttributeOrLog = (url, attributeKey, attributeValue, nameForLog) => { + if (attributeValue) { + return { [attributeKey]: attributeValue }; + } + else { + api_1.diag.error(`amqplib instrumentation: could not extract connection attribute ${nameForLog} from user supplied url`, { + url, + }); + return {}; + } +}; +const getConnectionAttributesFromServer = (conn) => { + var _a, _b; + const product = (_b = (_a = conn.serverProperties.product) === null || _a === void 0 ? void 0 : _a.toLowerCase) === null || _b === void 0 ? void 0 : _b.call(_a); + if (product) { + return { + [semantic_conventions_1.SEMATTRS_MESSAGING_SYSTEM]: product, + }; + } + else { + return {}; + } +}; +exports.getConnectionAttributesFromServer = getConnectionAttributesFromServer; +const getConnectionAttributesFromUrl = (url) => { + const attributes = { + [semantic_conventions_1.SEMATTRS_MESSAGING_PROTOCOL_VERSION]: '0.9.1', // this is the only protocol supported by the instrumented library + }; + url = url || 'amqp://localhost'; + if (typeof url === 'object') { + const connectOptions = url; + const protocol = getProtocol(connectOptions === null || connectOptions === void 0 ? void 0 : connectOptions.protocol); + Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(url, semantic_conventions_1.SEMATTRS_MESSAGING_PROTOCOL, protocol, 'protocol'))); + const hostname = getHostname(connectOptions === null || connectOptions === void 0 ? void 0 : connectOptions.hostname); + Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(url, semantic_conventions_1.SEMATTRS_NET_PEER_NAME, hostname, 'hostname'))); + const port = getPort(connectOptions.port, protocol); + Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(url, semantic_conventions_1.SEMATTRS_NET_PEER_PORT, port, 'port'))); + } + else { + const censoredUrl = censorPassword(url); + attributes[semantic_conventions_1.SEMATTRS_MESSAGING_URL] = censoredUrl; + try { + const urlParts = new URL(censoredUrl); + const protocol = getProtocol(urlParts.protocol); + Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(censoredUrl, semantic_conventions_1.SEMATTRS_MESSAGING_PROTOCOL, protocol, 'protocol'))); + const hostname = getHostname(urlParts.hostname); + Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(censoredUrl, semantic_conventions_1.SEMATTRS_NET_PEER_NAME, hostname, 'hostname'))); + const port = getPort(urlParts.port ? parseInt(urlParts.port) : undefined, protocol); + Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(censoredUrl, semantic_conventions_1.SEMATTRS_NET_PEER_PORT, port, 'port'))); + } + catch (err) { + api_1.diag.error('amqplib instrumentation: error while extracting connection details from connection url', { + censoredUrl, + err, + }); + } + } + return attributes; +}; +exports.getConnectionAttributesFromUrl = getConnectionAttributesFromUrl; +const markConfirmChannelTracing = (context) => { + return context.setValue(IS_CONFIRM_CHANNEL_CONTEXT_KEY, true); +}; +exports.markConfirmChannelTracing = markConfirmChannelTracing; +const unmarkConfirmChannelTracing = (context) => { + return context.deleteValue(IS_CONFIRM_CHANNEL_CONTEXT_KEY); +}; +exports.unmarkConfirmChannelTracing = unmarkConfirmChannelTracing; +const isConfirmChannelTracing = (context) => { + return context.getValue(IS_CONFIRM_CHANNEL_CONTEXT_KEY) === true; +}; +exports.isConfirmChannelTracing = isConfirmChannelTracing; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 73704: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.46.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-amqplib'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 42436: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ConnectNames = exports.ConnectTypes = exports.AttributeNames = void 0; +var AttributeNames; +(function (AttributeNames) { + AttributeNames["CONNECT_TYPE"] = "connect.type"; + AttributeNames["CONNECT_NAME"] = "connect.name"; +})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {})); +var ConnectTypes; +(function (ConnectTypes) { + ConnectTypes["MIDDLEWARE"] = "middleware"; + ConnectTypes["REQUEST_HANDLER"] = "request_handler"; +})(ConnectTypes = exports.ConnectTypes || (exports.ConnectTypes = {})); +var ConnectNames; +(function (ConnectNames) { + ConnectNames["MIDDLEWARE"] = "middleware"; + ConnectNames["REQUEST_HANDLER"] = "request handler"; +})(ConnectNames = exports.ConnectNames || (exports.ConnectNames = {})); +//# sourceMappingURL=AttributeNames.js.map + +/***/ }), + +/***/ 20575: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(42436), exports); +__exportStar(__nccwpck_require__(71119), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 71119: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ConnectInstrumentation = exports.ANONYMOUS_NAME = void 0; +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(89736); +const AttributeNames_1 = __nccwpck_require__(42436); +/** @knipignore */ +const version_1 = __nccwpck_require__(88729); +const instrumentation_1 = __nccwpck_require__(65584); +const semantic_conventions_1 = __nccwpck_require__(67275); +const utils_1 = __nccwpck_require__(33885); +exports.ANONYMOUS_NAME = 'anonymous'; +/** Connect instrumentation for OpenTelemetry */ +class ConnectInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); + } + init() { + return [ + new instrumentation_1.InstrumentationNodeModuleDefinition('connect', ['>=3.0.0 <4'], moduleExports => { + return this._patchConstructor(moduleExports); + }), + ]; + } + _patchApp(patchedApp) { + if (!(0, instrumentation_1.isWrapped)(patchedApp.use)) { + this._wrap(patchedApp, 'use', this._patchUse.bind(this)); + } + if (!(0, instrumentation_1.isWrapped)(patchedApp.handle)) { + this._wrap(patchedApp, 'handle', this._patchHandle.bind(this)); + } + } + _patchConstructor(original) { + const instrumentation = this; + return function (...args) { + const app = original.apply(this, args); + instrumentation._patchApp(app); + return app; + }; + } + _patchNext(next, finishSpan) { + return function nextFunction(err) { + const result = next.apply(this, [err]); + finishSpan(); + return result; + }; + } + _startSpan(routeName, middleWare) { + let connectType; + let connectName; + let connectTypeName; + if (routeName) { + connectType = AttributeNames_1.ConnectTypes.REQUEST_HANDLER; + connectTypeName = AttributeNames_1.ConnectNames.REQUEST_HANDLER; + connectName = routeName; + } + else { + connectType = AttributeNames_1.ConnectTypes.MIDDLEWARE; + connectTypeName = AttributeNames_1.ConnectNames.MIDDLEWARE; + connectName = middleWare.name || exports.ANONYMOUS_NAME; + } + const spanName = `${connectTypeName} - ${connectName}`; + const options = { + attributes: { + [semantic_conventions_1.SEMATTRS_HTTP_ROUTE]: routeName.length > 0 ? routeName : '/', + [AttributeNames_1.AttributeNames.CONNECT_TYPE]: connectType, + [AttributeNames_1.AttributeNames.CONNECT_NAME]: connectName, + }, + }; + return this.tracer.startSpan(spanName, options); + } + _patchMiddleware(routeName, middleWare) { + const instrumentation = this; + const isErrorMiddleware = middleWare.length === 4; + function patchedMiddleware() { + if (!instrumentation.isEnabled()) { + return middleWare.apply(this, arguments); + } + const [reqArgIdx, resArgIdx, nextArgIdx] = isErrorMiddleware + ? [1, 2, 3] + : [0, 1, 2]; + const req = arguments[reqArgIdx]; + const res = arguments[resArgIdx]; + const next = arguments[nextArgIdx]; + (0, utils_1.replaceCurrentStackRoute)(req, routeName); + const rpcMetadata = (0, core_1.getRPCMetadata)(api_1.context.active()); + if (routeName && (rpcMetadata === null || rpcMetadata === void 0 ? void 0 : rpcMetadata.type) === core_1.RPCType.HTTP) { + rpcMetadata.route = (0, utils_1.generateRoute)(req); + } + let spanName = ''; + if (routeName) { + spanName = `request handler - ${routeName}`; + } + else { + spanName = `middleware - ${middleWare.name || exports.ANONYMOUS_NAME}`; + } + const span = instrumentation._startSpan(routeName, middleWare); + instrumentation._diag.debug('start span', spanName); + let spanFinished = false; + function finishSpan() { + if (!spanFinished) { + spanFinished = true; + instrumentation._diag.debug(`finishing span ${span.name}`); + span.end(); + } + else { + instrumentation._diag.debug(`span ${span.name} - already finished`); + } + res.removeListener('close', finishSpan); + } + res.addListener('close', finishSpan); + arguments[nextArgIdx] = instrumentation._patchNext(next, finishSpan); + return middleWare.apply(this, arguments); + } + Object.defineProperty(patchedMiddleware, 'length', { + value: middleWare.length, + writable: false, + configurable: true, + }); + return patchedMiddleware; + } + _patchUse(original) { + const instrumentation = this; + return function (...args) { + const middleWare = args[args.length - 1]; + const routeName = (args[args.length - 2] || ''); + args[args.length - 1] = instrumentation._patchMiddleware(routeName, middleWare); + return original.apply(this, args); + }; + } + _patchHandle(original) { + const instrumentation = this; + return function () { + const [reqIdx, outIdx] = [0, 2]; + const req = arguments[reqIdx]; + const out = arguments[outIdx]; + const completeStack = (0, utils_1.addNewStackLayer)(req); + if (typeof out === 'function') { + arguments[outIdx] = instrumentation._patchOut(out, completeStack); + } + return original.apply(this, arguments); + }; + } + _patchOut(out, completeStack) { + return function nextFunction(...args) { + completeStack(); + return Reflect.apply(out, this, args); + }; + } +} +exports.ConnectInstrumentation = ConnectInstrumentation; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 44750: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._LAYERS_STORE_PROPERTY = void 0; +exports._LAYERS_STORE_PROPERTY = Symbol('opentelemetry.instrumentation-connect.request-route-stack'); +//# sourceMappingURL=internal-types.js.map + +/***/ }), + +/***/ 33885: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.generateRoute = exports.replaceCurrentStackRoute = exports.addNewStackLayer = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const api_1 = __nccwpck_require__(65163); +const internal_types_1 = __nccwpck_require__(44750); +const addNewStackLayer = (request) => { + if (Array.isArray(request[internal_types_1._LAYERS_STORE_PROPERTY]) === false) { + Object.defineProperty(request, internal_types_1._LAYERS_STORE_PROPERTY, { + enumerable: false, + value: [], + }); + } + request[internal_types_1._LAYERS_STORE_PROPERTY].push('/'); + const stackLength = request[internal_types_1._LAYERS_STORE_PROPERTY].length; + return () => { + if (stackLength === request[internal_types_1._LAYERS_STORE_PROPERTY].length) { + request[internal_types_1._LAYERS_STORE_PROPERTY].pop(); + } + else { + api_1.diag.warn('Connect: Trying to pop the stack multiple time'); + } + }; +}; +exports.addNewStackLayer = addNewStackLayer; +const replaceCurrentStackRoute = (request, newRoute) => { + if (newRoute) { + request[internal_types_1._LAYERS_STORE_PROPERTY].splice(-1, 1, newRoute); + } +}; +exports.replaceCurrentStackRoute = replaceCurrentStackRoute; +// generate route from existing stack on request object. +// splash between stack layer will be deduped +// ["/first/", "/second", "/third/"] => /first/second/third/ +const generateRoute = (request) => { + return request[internal_types_1._LAYERS_STORE_PROPERTY].reduce((acc, sub) => acc.replace(/\/+$/, '') + sub); +}; +exports.generateRoute = generateRoute; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 88729: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.43.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-connect'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 20698: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(70808), exports); +__exportStar(__nccwpck_require__(86726), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 86726: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DataloaderInstrumentation = void 0; +const instrumentation_1 = __nccwpck_require__(65584); +const api_1 = __nccwpck_require__(65163); +/** @knipignore */ +const version_1 = __nccwpck_require__(68218); +const MODULE_NAME = 'dataloader'; +class DataloaderInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); + } + init() { + return [ + new instrumentation_1.InstrumentationNodeModuleDefinition(MODULE_NAME, ['>=2.0.0 <3'], dataloader => { + this._patchLoad(dataloader.prototype); + this._patchLoadMany(dataloader.prototype); + return this._getPatchedConstructor(dataloader); + }, dataloader => { + if ((0, instrumentation_1.isWrapped)(dataloader.prototype.load)) { + this._unwrap(dataloader.prototype, 'load'); + } + if ((0, instrumentation_1.isWrapped)(dataloader.prototype.loadMany)) { + this._unwrap(dataloader.prototype, 'loadMany'); + } + }), + ]; + } + shouldCreateSpans() { + const config = this.getConfig(); + const hasParentSpan = api_1.trace.getSpan(api_1.context.active()) !== undefined; + return hasParentSpan || !config.requireParentSpan; + } + getSpanName(dataloader, operation) { + const dataloaderName = dataloader.name; + if (dataloaderName === undefined || dataloaderName === null) { + return `${MODULE_NAME}.${operation}`; + } + return `${MODULE_NAME}.${operation} ${dataloaderName}`; + } + _getPatchedConstructor(constructor) { + const prototype = constructor.prototype; + const instrumentation = this; + function PatchedDataloader(...args) { + const inst = new constructor(...args); + if (!instrumentation.isEnabled()) { + return inst; + } + if ((0, instrumentation_1.isWrapped)(inst._batchLoadFn)) { + instrumentation._unwrap(inst, '_batchLoadFn'); + } + instrumentation._wrap(inst, '_batchLoadFn', original => { + return function patchedBatchLoadFn(...args) { + var _a; + if (!instrumentation.isEnabled() || + !instrumentation.shouldCreateSpans()) { + return original.call(this, ...args); + } + const parent = api_1.context.active(); + const span = instrumentation.tracer.startSpan(instrumentation.getSpanName(inst, 'batch'), { links: (_a = this._batch) === null || _a === void 0 ? void 0 : _a.spanLinks }, parent); + return api_1.context.with(api_1.trace.setSpan(parent, span), () => { + return original.apply(this, args) + .then(value => { + span.end(); + return value; + }) + .catch(err => { + span.recordException(err); + span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: err.message, + }); + span.end(); + throw err; + }); + }); + }; + }); + return inst; + } + PatchedDataloader.prototype = prototype; + return PatchedDataloader; + } + _patchLoad(proto) { + if ((0, instrumentation_1.isWrapped)(proto.load)) { + this._unwrap(proto, 'load'); + } + this._wrap(proto, 'load', this._getPatchedLoad.bind(this)); + } + _getPatchedLoad(original) { + const instrumentation = this; + return function patchedLoad(...args) { + if (!instrumentation.shouldCreateSpans()) { + return original.call(this, ...args); + } + const parent = api_1.context.active(); + const span = instrumentation.tracer.startSpan(instrumentation.getSpanName(this, 'load'), { kind: api_1.SpanKind.CLIENT }, parent); + return api_1.context.with(api_1.trace.setSpan(parent, span), () => { + const result = original + .call(this, ...args) + .then(value => { + span.end(); + return value; + }) + .catch(err => { + span.recordException(err); + span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: err.message, + }); + span.end(); + throw err; + }); + const loader = this; + if (loader._batch) { + if (!loader._batch.spanLinks) { + loader._batch.spanLinks = []; + } + loader._batch.spanLinks.push({ context: span.spanContext() }); + } + return result; + }); + }; + } + _patchLoadMany(proto) { + if ((0, instrumentation_1.isWrapped)(proto.loadMany)) { + this._unwrap(proto, 'loadMany'); + } + this._wrap(proto, 'loadMany', this._getPatchedLoadMany.bind(this)); + } + _getPatchedLoadMany(original) { + const instrumentation = this; + return function patchedLoadMany(...args) { + if (!instrumentation.shouldCreateSpans()) { + return original.call(this, ...args); + } + const parent = api_1.context.active(); + const span = instrumentation.tracer.startSpan(instrumentation.getSpanName(this, 'loadMany'), { kind: api_1.SpanKind.CLIENT }, parent); + return api_1.context.with(api_1.trace.setSpan(parent, span), () => { + // .loadMany never rejects, as errors from internal .load + // calls are caught by dataloader lib + return original.call(this, ...args).then(value => { + span.end(); + return value; + }); + }); + }; + } +} +exports.DataloaderInstrumentation = DataloaderInstrumentation; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 70808: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 68218: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.16.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-dataloader'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 96060: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AttributeNames = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var AttributeNames; +(function (AttributeNames) { + AttributeNames["EXPRESS_TYPE"] = "express.type"; + AttributeNames["EXPRESS_NAME"] = "express.name"; +})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {})); +//# sourceMappingURL=AttributeNames.js.map + +/***/ }), + +/***/ 90148: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ExpressLayerType = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var ExpressLayerType; +(function (ExpressLayerType) { + ExpressLayerType["ROUTER"] = "router"; + ExpressLayerType["MIDDLEWARE"] = "middleware"; + ExpressLayerType["REQUEST_HANDLER"] = "request_handler"; +})(ExpressLayerType = exports.ExpressLayerType || (exports.ExpressLayerType = {})); +//# sourceMappingURL=ExpressLayerType.js.map + +/***/ }), + +/***/ 82267: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(70756), exports); +__exportStar(__nccwpck_require__(90148), exports); +__exportStar(__nccwpck_require__(96060), exports); +__exportStar(__nccwpck_require__(68719), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 70756: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ExpressInstrumentation = void 0; +const core_1 = __nccwpck_require__(89736); +const api_1 = __nccwpck_require__(65163); +const ExpressLayerType_1 = __nccwpck_require__(90148); +const AttributeNames_1 = __nccwpck_require__(96060); +const utils_1 = __nccwpck_require__(45279); +/** @knipignore */ +const version_1 = __nccwpck_require__(60647); +const instrumentation_1 = __nccwpck_require__(65584); +const semantic_conventions_1 = __nccwpck_require__(67275); +const internal_types_1 = __nccwpck_require__(80406); +/** Express instrumentation for OpenTelemetry */ +class ExpressInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); + } + init() { + return [ + new instrumentation_1.InstrumentationNodeModuleDefinition('express', ['>=4.0.0 <5'], moduleExports => { + const routerProto = moduleExports.Router; + // patch express.Router.route + if ((0, instrumentation_1.isWrapped)(routerProto.route)) { + this._unwrap(routerProto, 'route'); + } + this._wrap(routerProto, 'route', this._getRoutePatch()); + // patch express.Router.use + if ((0, instrumentation_1.isWrapped)(routerProto.use)) { + this._unwrap(routerProto, 'use'); + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + this._wrap(routerProto, 'use', this._getRouterUsePatch()); + // patch express.Application.use + if ((0, instrumentation_1.isWrapped)(moduleExports.application.use)) { + this._unwrap(moduleExports.application, 'use'); + } + this._wrap(moduleExports.application, 'use', + // eslint-disable-next-line @typescript-eslint/no-explicit-any + this._getAppUsePatch()); + return moduleExports; + }, moduleExports => { + if (moduleExports === undefined) + return; + const routerProto = moduleExports.Router; + this._unwrap(routerProto, 'route'); + this._unwrap(routerProto, 'use'); + this._unwrap(moduleExports.application, 'use'); + }), + ]; + } + /** + * Get the patch for Router.route function + */ + _getRoutePatch() { + const instrumentation = this; + return function (original) { + return function route_trace(...args) { + const route = original.apply(this, args); + const layer = this.stack[this.stack.length - 1]; + instrumentation._applyPatch(layer, (0, utils_1.getLayerPath)(args)); + return route; + }; + }; + } + /** + * Get the patch for Router.use function + */ + _getRouterUsePatch() { + const instrumentation = this; + return function (original) { + return function use(...args) { + const route = original.apply(this, args); + const layer = this.stack[this.stack.length - 1]; + instrumentation._applyPatch(layer, (0, utils_1.getLayerPath)(args)); + return route; + }; + }; + } + /** + * Get the patch for Application.use function + */ + _getAppUsePatch() { + const instrumentation = this; + return function (original) { + return function use(...args) { + const route = original.apply(this, args); + const layer = this._router.stack[this._router.stack.length - 1]; + instrumentation._applyPatch(layer, (0, utils_1.getLayerPath)(args)); + return route; + }; + }; + } + /** Patch each express layer to create span and propagate context */ + _applyPatch(layer, layerPath) { + const instrumentation = this; + // avoid patching multiple times the same layer + if (layer[internal_types_1.kLayerPatched] === true) + return; + layer[internal_types_1.kLayerPatched] = true; + this._wrap(layer, 'handle', original => { + // TODO: instrument error handlers + if (original.length === 4) + return original; + const patched = function (req, res) { + (0, utils_1.storeLayerPath)(req, layerPath); + const route = req[internal_types_1._LAYERS_STORE_PROPERTY] + .filter(path => path !== '/' && path !== '/*') + .join('') + // remove duplicate slashes to normalize route + .replace(/\/{2,}/g, '/'); + const attributes = { + [semantic_conventions_1.SEMATTRS_HTTP_ROUTE]: route.length > 0 ? route : '/', + }; + const metadata = (0, utils_1.getLayerMetadata)(route, layer, layerPath); + const type = metadata.attributes[AttributeNames_1.AttributeNames.EXPRESS_TYPE]; + const rpcMetadata = (0, core_1.getRPCMetadata)(api_1.context.active()); + if ((rpcMetadata === null || rpcMetadata === void 0 ? void 0 : rpcMetadata.type) === core_1.RPCType.HTTP) { + rpcMetadata.route = route || '/'; + } + // verify against the config if the layer should be ignored + if ((0, utils_1.isLayerIgnored)(metadata.name, type, instrumentation.getConfig())) { + if (type === ExpressLayerType_1.ExpressLayerType.MIDDLEWARE) { + req[internal_types_1._LAYERS_STORE_PROPERTY].pop(); + } + return original.apply(this, arguments); + } + if (api_1.trace.getSpan(api_1.context.active()) === undefined) { + return original.apply(this, arguments); + } + const spanName = instrumentation._getSpanName({ + request: req, + layerType: type, + route, + }, metadata.name); + const span = instrumentation.tracer.startSpan(spanName, { + attributes: Object.assign(attributes, metadata.attributes), + }); + const { requestHook } = instrumentation.getConfig(); + if (requestHook) { + (0, instrumentation_1.safeExecuteInTheMiddle)(() => requestHook(span, { + request: req, + layerType: type, + route, + }), e => { + if (e) { + api_1.diag.error('express instrumentation: request hook failed', e); + } + }, true); + } + let spanHasEnded = false; + if (metadata.attributes[AttributeNames_1.AttributeNames.EXPRESS_TYPE] !== + ExpressLayerType_1.ExpressLayerType.MIDDLEWARE) { + span.end(); + spanHasEnded = true; + } + // listener for response.on('finish') + const onResponseFinish = () => { + if (spanHasEnded === false) { + spanHasEnded = true; + span.end(); + } + }; + // verify we have a callback + const args = Array.from(arguments); + const callbackIdx = args.findIndex(arg => typeof arg === 'function'); + if (callbackIdx >= 0) { + arguments[callbackIdx] = function () { + var _a; + // express considers anything but an empty value, "route" or "router" + // passed to its callback to be an error + const maybeError = arguments[0]; + const isError = ![undefined, null, 'route', 'router'].includes(maybeError); + if (!spanHasEnded && isError) { + const [error, message] = (0, utils_1.asErrorAndMessage)(maybeError); + span.recordException(error); + span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message, + }); + } + if (spanHasEnded === false) { + spanHasEnded = true; + (_a = req.res) === null || _a === void 0 ? void 0 : _a.removeListener('finish', onResponseFinish); + span.end(); + } + if (!(req.route && isError)) { + req[internal_types_1._LAYERS_STORE_PROPERTY].pop(); + } + const callback = args[callbackIdx]; + return callback.apply(this, arguments); + }; + } + try { + return original.apply(this, arguments); + } + catch (anyError) { + const [error, message] = (0, utils_1.asErrorAndMessage)(anyError); + span.recordException(error); + span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message, + }); + throw anyError; + } + finally { + /** + * At this point if the callback wasn't called, that means either the + * layer is asynchronous (so it will call the callback later on) or that + * the layer directly end the http response, so we'll hook into the "finish" + * event to handle the later case. + */ + if (!spanHasEnded) { + res.once('finish', onResponseFinish); + } + } + }; + // `handle` isn't just a regular function in some cases. It also contains + // some properties holding metadata and state so we need to proxy them + // through through patched function + // ref: https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1950 + // Also some apps/libs do their own patching before OTEL and have these properties + // in the proptotype. So we use a `for...in` loop to get own properties and also + // any enumerable prop in the prototype chain + // ref: https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2271 + for (const key in original) { + Object.defineProperty(patched, key, { + get() { + return original[key]; + }, + set(value) { + original[key] = value; + }, + }); + } + return patched; + }); + } + _getSpanName(info, defaultName) { + var _a; + const { spanNameHook } = this.getConfig(); + if (!(spanNameHook instanceof Function)) { + return defaultName; + } + try { + return (_a = spanNameHook(info, defaultName)) !== null && _a !== void 0 ? _a : defaultName; + } + catch (err) { + api_1.diag.error('express instrumentation: error calling span name rewrite hook', err); + return defaultName; + } + } +} +exports.ExpressInstrumentation = ExpressInstrumentation; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 80406: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._LAYERS_STORE_PROPERTY = exports.kLayerPatched = void 0; +/** + * This symbol is used to mark express layer as being already instrumented + * since its possible to use a given layer multiple times (ex: middlewares) + */ +exports.kLayerPatched = Symbol('express-layer-patched'); +/** + * This const define where on the `request` object the Instrumentation will mount the + * current stack of express layer. + * + * It is necessary because express doesn't store the different layers + * (ie: middleware, router etc) that it called to get to the current layer. + * Given that, the only way to know the route of a given layer is to + * store the path of where each previous layer has been mounted. + * + * ex: bodyParser > auth middleware > /users router > get /:id + * in this case the stack would be: ["/users", "/:id"] + * + * ex2: bodyParser > /api router > /v1 router > /users router > get /:id + * stack: ["/api", "/v1", "/users", ":id"] + * + */ +exports._LAYERS_STORE_PROPERTY = '__ot_middlewares'; +//# sourceMappingURL=internal-types.js.map + +/***/ }), + +/***/ 68719: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 45279: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getLayerPath = exports.asErrorAndMessage = exports.isLayerIgnored = exports.getLayerMetadata = exports.getRouterPath = exports.storeLayerPath = void 0; +const ExpressLayerType_1 = __nccwpck_require__(90148); +const AttributeNames_1 = __nccwpck_require__(96060); +const internal_types_1 = __nccwpck_require__(80406); +/** + * Store layers path in the request to be able to construct route later + * @param request The request where + * @param [value] the value to push into the array + */ +const storeLayerPath = (request, value) => { + if (Array.isArray(request[internal_types_1._LAYERS_STORE_PROPERTY]) === false) { + Object.defineProperty(request, internal_types_1._LAYERS_STORE_PROPERTY, { + enumerable: false, + value: [], + }); + } + if (value === undefined) + return; + request[internal_types_1._LAYERS_STORE_PROPERTY].push(value); +}; +exports.storeLayerPath = storeLayerPath; +/** + * Recursively search the router path from layer stack + * @param path The path to reconstruct + * @param layer The layer to reconstruct from + * @returns The reconstructed path + */ +const getRouterPath = (path, layer) => { + var _a, _b, _c, _d; + const stackLayer = (_b = (_a = layer.handle) === null || _a === void 0 ? void 0 : _a.stack) === null || _b === void 0 ? void 0 : _b[0]; + if ((_c = stackLayer === null || stackLayer === void 0 ? void 0 : stackLayer.route) === null || _c === void 0 ? void 0 : _c.path) { + return `${path}${stackLayer.route.path}`; + } + if ((_d = stackLayer === null || stackLayer === void 0 ? void 0 : stackLayer.handle) === null || _d === void 0 ? void 0 : _d.stack) { + return (0, exports.getRouterPath)(path, stackLayer); + } + return path; +}; +exports.getRouterPath = getRouterPath; +/** + * Parse express layer context to retrieve a name and attributes. + * @param route The route of the layer + * @param layer Express layer + * @param [layerPath] if present, the path on which the layer has been mounted + */ +const getLayerMetadata = (route, layer, layerPath) => { + var _a; + if (layer.name === 'router') { + const maybeRouterPath = (0, exports.getRouterPath)('', layer); + const extractedRouterPath = maybeRouterPath + ? maybeRouterPath + : layerPath || route || '/'; + return { + attributes: { + [AttributeNames_1.AttributeNames.EXPRESS_NAME]: extractedRouterPath, + [AttributeNames_1.AttributeNames.EXPRESS_TYPE]: ExpressLayerType_1.ExpressLayerType.ROUTER, + }, + name: `router - ${extractedRouterPath}`, + }; + } + else if (layer.name === 'bound dispatch') { + return { + attributes: { + [AttributeNames_1.AttributeNames.EXPRESS_NAME]: (_a = (route || layerPath)) !== null && _a !== void 0 ? _a : 'request handler', + [AttributeNames_1.AttributeNames.EXPRESS_TYPE]: ExpressLayerType_1.ExpressLayerType.REQUEST_HANDLER, + }, + name: `request handler${layer.path ? ` - ${route || layerPath}` : ''}`, + }; + } + else { + return { + attributes: { + [AttributeNames_1.AttributeNames.EXPRESS_NAME]: layer.name, + [AttributeNames_1.AttributeNames.EXPRESS_TYPE]: ExpressLayerType_1.ExpressLayerType.MIDDLEWARE, + }, + name: `middleware - ${layer.name}`, + }; + } +}; +exports.getLayerMetadata = getLayerMetadata; +/** + * Check whether the given obj match pattern + * @param constant e.g URL of request + * @param obj obj to inspect + * @param pattern Match pattern + */ +const satisfiesPattern = (constant, pattern) => { + if (typeof pattern === 'string') { + return pattern === constant; + } + else if (pattern instanceof RegExp) { + return pattern.test(constant); + } + else if (typeof pattern === 'function') { + return pattern(constant); + } + else { + throw new TypeError('Pattern is in unsupported datatype'); + } +}; +/** + * Check whether the given request is ignored by configuration + * It will not re-throw exceptions from `list` provided by the client + * @param constant e.g URL of request + * @param [list] List of ignore patterns + * @param [onException] callback for doing something when an exception has + * occurred + */ +const isLayerIgnored = (name, type, config) => { + var _a; + if (Array.isArray(config === null || config === void 0 ? void 0 : config.ignoreLayersType) && + ((_a = config === null || config === void 0 ? void 0 : config.ignoreLayersType) === null || _a === void 0 ? void 0 : _a.includes(type))) { + return true; + } + if (Array.isArray(config === null || config === void 0 ? void 0 : config.ignoreLayers) === false) + return false; + try { + for (const pattern of config.ignoreLayers) { + if (satisfiesPattern(name, pattern)) { + return true; + } + } + } + catch (e) { + /* catch block*/ + } + return false; +}; +exports.isLayerIgnored = isLayerIgnored; +/** + * Converts a user-provided error value into an error and error message pair + * + * @param error - User-provided error value + * @returns Both an Error or string representation of the value and an error message + */ +const asErrorAndMessage = (error) => error instanceof Error + ? [error, error.message] + : [String(error), String(error)]; +exports.asErrorAndMessage = asErrorAndMessage; +/** + * Extracts the layer path from the route arguments + * + * @param args - Arguments of the route + * @returns The layer path + */ +const getLayerPath = (args) => { + const firstArg = args[0]; + if (Array.isArray(firstArg)) { + return firstArg.map(arg => extractLayerPathSegment(arg) || '').join(','); + } + return extractLayerPathSegment(firstArg); +}; +exports.getLayerPath = getLayerPath; +const extractLayerPathSegment = (arg) => { + if (typeof arg === 'string') { + return arg; + } + if (arg instanceof RegExp || typeof arg === 'number') { + return arg.toString(); + } + return; +}; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 60647: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.47.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-express'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 52458: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.hooksNamesToWrap = exports.spanRequestSymbol = void 0; +exports.spanRequestSymbol = Symbol('opentelemetry.instrumentation.fastify.request_active_span'); +// The instrumentation creates a span for invocations of lifecycle hook handlers +// that take `(request, reply, ...[, done])` arguments. Currently this is all +// lifecycle hooks except `onRequestAbort`. +// https://fastify.dev/docs/latest/Reference/Hooks +exports.hooksNamesToWrap = new Set([ + 'onTimeout', + 'onRequest', + 'preParsing', + 'preValidation', + 'preSerialization', + 'preHandler', + 'onSend', + 'onResponse', + 'onError', +]); +//# sourceMappingURL=constants.js.map + +/***/ }), + +/***/ 90845: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.FastifyNames = exports.FastifyTypes = exports.AttributeNames = void 0; +var AttributeNames; +(function (AttributeNames) { + AttributeNames["FASTIFY_NAME"] = "fastify.name"; + AttributeNames["FASTIFY_TYPE"] = "fastify.type"; + AttributeNames["HOOK_NAME"] = "hook.name"; + AttributeNames["PLUGIN_NAME"] = "plugin.name"; +})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {})); +var FastifyTypes; +(function (FastifyTypes) { + FastifyTypes["MIDDLEWARE"] = "middleware"; + FastifyTypes["REQUEST_HANDLER"] = "request_handler"; +})(FastifyTypes = exports.FastifyTypes || (exports.FastifyTypes = {})); +var FastifyNames; +(function (FastifyNames) { + FastifyNames["MIDDLEWARE"] = "middleware"; + FastifyNames["REQUEST_HANDLER"] = "request handler"; +})(FastifyNames = exports.FastifyNames || (exports.FastifyNames = {})); +//# sourceMappingURL=AttributeNames.js.map + +/***/ }), + +/***/ 62344: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(90845), exports); +__exportStar(__nccwpck_require__(32963), exports); +__exportStar(__nccwpck_require__(13332), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 13332: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.FastifyInstrumentation = exports.ANONYMOUS_NAME = void 0; +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(89736); +const instrumentation_1 = __nccwpck_require__(65584); +const semantic_conventions_1 = __nccwpck_require__(67275); +const constants_1 = __nccwpck_require__(52458); +const AttributeNames_1 = __nccwpck_require__(90845); +const utils_1 = __nccwpck_require__(62574); +/** @knipignore */ +const version_1 = __nccwpck_require__(44842); +exports.ANONYMOUS_NAME = 'anonymous'; +/** Fastify instrumentation for OpenTelemetry */ +class FastifyInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); + } + init() { + return [ + new instrumentation_1.InstrumentationNodeModuleDefinition('fastify', ['>=3.0.0 <6'], moduleExports => { + return this._patchConstructor(moduleExports); + }), + ]; + } + _hookOnRequest() { + const instrumentation = this; + return function onRequest(request, reply, done) { + if (!instrumentation.isEnabled()) { + return done(); + } + instrumentation._wrap(reply, 'send', instrumentation._patchSend()); + const anyRequest = request; + const rpcMetadata = (0, core_1.getRPCMetadata)(api_1.context.active()); + const routeName = anyRequest.routeOptions + ? anyRequest.routeOptions.url // since fastify@4.10.0 + : request.routerPath; + if (routeName && (rpcMetadata === null || rpcMetadata === void 0 ? void 0 : rpcMetadata.type) === core_1.RPCType.HTTP) { + rpcMetadata.route = routeName; + } + done(); + }; + } + _wrapHandler(pluginName, hookName, original, syncFunctionWithDone) { + const instrumentation = this; + this._diag.debug('Patching fastify route.handler function'); + return function (...args) { + if (!instrumentation.isEnabled()) { + return original.apply(this, args); + } + const name = original.name || pluginName || exports.ANONYMOUS_NAME; + const spanName = `${AttributeNames_1.FastifyNames.MIDDLEWARE} - ${name}`; + const reply = args[1]; + const span = (0, utils_1.startSpan)(reply, instrumentation.tracer, spanName, { + [AttributeNames_1.AttributeNames.FASTIFY_TYPE]: AttributeNames_1.FastifyTypes.MIDDLEWARE, + [AttributeNames_1.AttributeNames.PLUGIN_NAME]: pluginName, + [AttributeNames_1.AttributeNames.HOOK_NAME]: hookName, + }); + const origDone = syncFunctionWithDone && + args[args.length - 1]; + if (origDone) { + args[args.length - 1] = function (...doneArgs) { + (0, utils_1.endSpan)(reply); + origDone.apply(this, doneArgs); + }; + } + return api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { + return (0, utils_1.safeExecuteInTheMiddleMaybePromise)(() => { + return original.apply(this, args); + }, err => { + if (err instanceof Error) { + span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: err.message, + }); + span.recordException(err); + } + // async hooks should end the span as soon as the promise is resolved + if (!syncFunctionWithDone) { + (0, utils_1.endSpan)(reply); + } + }); + }); + }; + } + _wrapAddHook() { + const instrumentation = this; + this._diag.debug('Patching fastify server.addHook function'); + return function (original) { + return function wrappedAddHook(...args) { + const name = args[0]; + const handler = args[1]; + const pluginName = this.pluginName; + if (!constants_1.hooksNamesToWrap.has(name)) { + return original.apply(this, args); + } + const syncFunctionWithDone = typeof args[args.length - 1] === 'function' && + handler.constructor.name !== 'AsyncFunction'; + return original.apply(this, [ + name, + instrumentation._wrapHandler(pluginName, name, handler, syncFunctionWithDone), + ]); + }; + }; + } + _patchConstructor(moduleExports) { + const instrumentation = this; + function fastify(...args) { + const app = moduleExports.fastify.apply(this, args); + app.addHook('onRequest', instrumentation._hookOnRequest()); + app.addHook('preHandler', instrumentation._hookPreHandler()); + instrumentation._wrap(app, 'addHook', instrumentation._wrapAddHook()); + return app; + } + if (moduleExports.errorCodes !== undefined) { + fastify.errorCodes = moduleExports.errorCodes; + } + fastify.fastify = fastify; + fastify.default = fastify; + return fastify; + } + _patchSend() { + const instrumentation = this; + this._diag.debug('Patching fastify reply.send function'); + return function patchSend(original) { + return function send(...args) { + const maybeError = args[0]; + if (!instrumentation.isEnabled()) { + return original.apply(this, args); + } + return (0, instrumentation_1.safeExecuteInTheMiddle)(() => { + return original.apply(this, args); + }, err => { + if (!err && maybeError instanceof Error) { + err = maybeError; + } + (0, utils_1.endSpan)(this, err); + }); + }; + }; + } + _hookPreHandler() { + const instrumentation = this; + this._diag.debug('Patching fastify preHandler function'); + return function preHandler(request, reply, done) { + var _a, _b; + if (!instrumentation.isEnabled()) { + return done(); + } + const anyRequest = request; + const handler = ((_a = anyRequest.routeOptions) === null || _a === void 0 ? void 0 : _a.handler) || ((_b = anyRequest.context) === null || _b === void 0 ? void 0 : _b.handler); + const handlerName = (handler === null || handler === void 0 ? void 0 : handler.name.startsWith('bound ')) + ? handler.name.substring(6) + : handler === null || handler === void 0 ? void 0 : handler.name; + const spanName = `${AttributeNames_1.FastifyNames.REQUEST_HANDLER} - ${handlerName || this.pluginName || exports.ANONYMOUS_NAME}`; + const spanAttributes = { + [AttributeNames_1.AttributeNames.PLUGIN_NAME]: this.pluginName, + [AttributeNames_1.AttributeNames.FASTIFY_TYPE]: AttributeNames_1.FastifyTypes.REQUEST_HANDLER, + [semantic_conventions_1.SEMATTRS_HTTP_ROUTE]: anyRequest.routeOptions + ? anyRequest.routeOptions.url // since fastify@4.10.0 + : request.routerPath, + }; + if (handlerName) { + spanAttributes[AttributeNames_1.AttributeNames.FASTIFY_NAME] = handlerName; + } + const span = (0, utils_1.startSpan)(reply, instrumentation.tracer, spanName, spanAttributes); + const { requestHook } = instrumentation.getConfig(); + if (requestHook) { + (0, instrumentation_1.safeExecuteInTheMiddle)(() => requestHook(span, { request }), e => { + if (e) { + instrumentation._diag.error('request hook failed', e); + } + }, true); + } + return api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { + done(); + }); + }; + } +} +exports.FastifyInstrumentation = FastifyInstrumentation; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 32963: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 62574: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.safeExecuteInTheMiddleMaybePromise = exports.endSpan = exports.startSpan = void 0; +const api_1 = __nccwpck_require__(65163); +const constants_1 = __nccwpck_require__(52458); +/** + * Starts Span + * @param reply - reply function + * @param tracer - tracer + * @param spanName - span name + * @param spanAttributes - span attributes + */ +function startSpan(reply, tracer, spanName, spanAttributes = {}) { + const span = tracer.startSpan(spanName, { attributes: spanAttributes }); + const spans = reply[constants_1.spanRequestSymbol] || []; + spans.push(span); + // eslint-disable-next-line @typescript-eslint/no-floating-promises + Object.defineProperty(reply, constants_1.spanRequestSymbol, { + enumerable: false, + configurable: true, + value: spans, + }); + return span; +} +exports.startSpan = startSpan; +/** + * Ends span + * @param reply - reply function + * @param err - error + */ +function endSpan(reply, err) { + const spans = reply[constants_1.spanRequestSymbol] || []; + // there is no active span, or it has already ended + if (!spans.length) { + return; + } + spans.forEach(span => { + if (err) { + span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: err.message, + }); + span.recordException(err); + } + span.end(); + }); + delete reply[constants_1.spanRequestSymbol]; +} +exports.endSpan = endSpan; +function safeExecuteInTheMiddleMaybePromise(execute, onFinish, preventThrowingError) { + let error; + let result = undefined; + try { + result = execute(); + if (isPromise(result)) { + result.then(res => onFinish(undefined, res), err => onFinish(err)); + } + } + catch (e) { + error = e; + } + finally { + if (!isPromise(result)) { + onFinish(error, result); + if (error && !preventThrowingError) { + // eslint-disable-next-line no-unsafe-finally + throw error; + } + } + // eslint-disable-next-line no-unsafe-finally + return result; + } +} +exports.safeExecuteInTheMiddleMaybePromise = safeExecuteInTheMiddleMaybePromise; +function isPromise(val) { + var _a; + return ((typeof val === 'object' && + val && + typeof ((_a = Object.getOwnPropertyDescriptor(val, 'then')) === null || _a === void 0 ? void 0 : _a.value) === + 'function') || + false); +} +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 44842: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.44.1'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-fastify'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 9571: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SYNC_FUNCTIONS = exports.CALLBACK_FUNCTIONS = exports.PROMISE_FUNCTIONS = void 0; +exports.PROMISE_FUNCTIONS = [ + 'access', + 'appendFile', + 'chmod', + 'chown', + 'copyFile', + 'cp', + 'lchown', + 'link', + 'lstat', + 'lutimes', + 'mkdir', + 'mkdtemp', + 'open', + 'opendir', + 'readdir', + 'readFile', + 'readlink', + 'realpath', + 'rename', + 'rm', + 'rmdir', + 'stat', + 'symlink', + 'truncate', + 'unlink', + 'utimes', + 'writeFile', + // 'lchmod', // only implemented on macOS +]; +exports.CALLBACK_FUNCTIONS = [ + 'access', + 'appendFile', + 'chmod', + 'chown', + 'copyFile', + 'cp', + 'exists', + 'lchown', + 'link', + 'lstat', + 'lutimes', + 'mkdir', + 'mkdtemp', + 'open', + 'opendir', + 'readdir', + 'readFile', + 'readlink', + 'realpath', + 'realpath.native', + 'rename', + 'rm', + 'rmdir', + 'stat', + 'symlink', + 'truncate', + 'unlink', + 'utimes', + 'writeFile', + // 'close', // functions on file descriptor + // 'fchmod', // functions on file descriptor + // 'fchown', // functions on file descriptor + // 'fdatasync', // functions on file descriptor + // 'fstat', // functions on file descriptor + // 'fsync', // functions on file descriptor + // 'ftruncate', // functions on file descriptor + // 'futimes', // functions on file descriptor + // 'lchmod', // only implemented on macOS + // 'read', // functions on file descriptor + // 'readv', // functions on file descriptor + // 'write', // functions on file descriptor + // 'writev', // functions on file descriptor +]; +exports.SYNC_FUNCTIONS = [ + 'accessSync', + 'appendFileSync', + 'chmodSync', + 'chownSync', + 'copyFileSync', + 'cpSync', + 'existsSync', + 'lchownSync', + 'linkSync', + 'lstatSync', + 'lutimesSync', + 'mkdirSync', + 'mkdtempSync', + 'opendirSync', + 'openSync', + 'readdirSync', + 'readFileSync', + 'readlinkSync', + 'realpathSync', + 'realpathSync.native', + 'renameSync', + 'rmdirSync', + 'rmSync', + 'statSync', + 'symlinkSync', + 'truncateSync', + 'unlinkSync', + 'utimesSync', + 'writeFileSync', + // 'closeSync', // functions on file descriptor + // 'fchmodSync', // functions on file descriptor + // 'fchownSync', // functions on file descriptor + // 'fdatasyncSync', // functions on file descriptor + // 'fstatSync', // functions on file descriptor + // 'fsyncSync', // functions on file descriptor + // 'ftruncateSync', // functions on file descriptor + // 'futimesSync', // functions on file descriptor + // 'lchmodSync', // only implemented on macOS + // 'readSync', // functions on file descriptor + // 'readvSync', // functions on file descriptor + // 'writeSync', // functions on file descriptor + // 'writevSync', // functions on file descriptor +]; +//# sourceMappingURL=constants.js.map + +/***/ }), + +/***/ 99833: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(36462), exports); +__exportStar(__nccwpck_require__(79846), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 36462: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.FsInstrumentation = void 0; +const api = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(89736); +const instrumentation_1 = __nccwpck_require__(65584); +/** @knipignore */ +const version_1 = __nccwpck_require__(67586); +const constants_1 = __nccwpck_require__(9571); +const util_1 = __nccwpck_require__(73837); +const utils_1 = __nccwpck_require__(38488); +/** + * This is important for 2-level functions like `realpath.native` to retain the 2nd-level + * when patching the 1st-level. + */ +function patchedFunctionWithOriginalProperties(patchedFunction, original) { + return Object.assign(patchedFunction, original); +} +class FsInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); + } + init() { + return [ + new instrumentation_1.InstrumentationNodeModuleDefinition('fs', ['*'], (fs) => { + for (const fName of constants_1.SYNC_FUNCTIONS) { + const { objectToPatch, functionNameToPatch } = (0, utils_1.indexFs)(fs, fName); + if ((0, instrumentation_1.isWrapped)(objectToPatch[functionNameToPatch])) { + this._unwrap(objectToPatch, functionNameToPatch); + } + this._wrap(objectToPatch, functionNameToPatch, this._patchSyncFunction.bind(this, fName)); + } + for (const fName of constants_1.CALLBACK_FUNCTIONS) { + const { objectToPatch, functionNameToPatch } = (0, utils_1.indexFs)(fs, fName); + if ((0, instrumentation_1.isWrapped)(objectToPatch[functionNameToPatch])) { + this._unwrap(objectToPatch, functionNameToPatch); + } + if (fName === 'exists') { + // handling separately because of the inconsistent cb style: + // `exists` doesn't have error as the first argument, but the result + this._wrap(objectToPatch, functionNameToPatch, this._patchExistsCallbackFunction.bind(this, fName)); + continue; + } + this._wrap(objectToPatch, functionNameToPatch, this._patchCallbackFunction.bind(this, fName)); + } + for (const fName of constants_1.PROMISE_FUNCTIONS) { + if ((0, instrumentation_1.isWrapped)(fs.promises[fName])) { + this._unwrap(fs.promises, fName); + } + this._wrap(fs.promises, fName, this._patchPromiseFunction.bind(this, fName)); + } + return fs; + }, (fs) => { + if (fs === undefined) + return; + for (const fName of constants_1.SYNC_FUNCTIONS) { + const { objectToPatch, functionNameToPatch } = (0, utils_1.indexFs)(fs, fName); + if ((0, instrumentation_1.isWrapped)(objectToPatch[functionNameToPatch])) { + this._unwrap(objectToPatch, functionNameToPatch); + } + } + for (const fName of constants_1.CALLBACK_FUNCTIONS) { + const { objectToPatch, functionNameToPatch } = (0, utils_1.indexFs)(fs, fName); + if ((0, instrumentation_1.isWrapped)(objectToPatch[functionNameToPatch])) { + this._unwrap(objectToPatch, functionNameToPatch); + } + } + for (const fName of constants_1.PROMISE_FUNCTIONS) { + if ((0, instrumentation_1.isWrapped)(fs.promises[fName])) { + this._unwrap(fs.promises, fName); + } + } + }), + new instrumentation_1.InstrumentationNodeModuleDefinition('fs/promises', ['*'], (fsPromises) => { + for (const fName of constants_1.PROMISE_FUNCTIONS) { + if ((0, instrumentation_1.isWrapped)(fsPromises[fName])) { + this._unwrap(fsPromises, fName); + } + this._wrap(fsPromises, fName, this._patchPromiseFunction.bind(this, fName)); + } + return fsPromises; + }, (fsPromises) => { + if (fsPromises === undefined) + return; + for (const fName of constants_1.PROMISE_FUNCTIONS) { + if ((0, instrumentation_1.isWrapped)(fsPromises[fName])) { + this._unwrap(fsPromises, fName); + } + } + }), + ]; + } + _patchSyncFunction(functionName, original) { + const instrumentation = this; + const patchedFunction = function (...args) { + const activeContext = api.context.active(); + if (!instrumentation._shouldTrace(activeContext)) { + return original.apply(this, args); + } + if (instrumentation._runCreateHook(functionName, { + args: args, + }) === false) { + return api.context.with((0, core_1.suppressTracing)(activeContext), original, this, ...args); + } + const span = instrumentation.tracer.startSpan(`fs ${functionName}`); + try { + // Suppress tracing for internal fs calls + const res = api.context.with((0, core_1.suppressTracing)(api.trace.setSpan(activeContext, span)), original, this, ...args); + instrumentation._runEndHook(functionName, { args: args, span }); + return res; + } + catch (error) { + span.recordException(error); + span.setStatus({ + message: error.message, + code: api.SpanStatusCode.ERROR, + }); + instrumentation._runEndHook(functionName, { args: args, span, error }); + throw error; + } + finally { + span.end(); + } + }; + return patchedFunctionWithOriginalProperties(patchedFunction, original); + } + _patchCallbackFunction(functionName, original) { + const instrumentation = this; + const patchedFunction = function (...args) { + const activeContext = api.context.active(); + if (!instrumentation._shouldTrace(activeContext)) { + return original.apply(this, args); + } + if (instrumentation._runCreateHook(functionName, { + args: args, + }) === false) { + return api.context.with((0, core_1.suppressTracing)(activeContext), original, this, ...args); + } + const lastIdx = args.length - 1; + const cb = args[lastIdx]; + if (typeof cb === 'function') { + const span = instrumentation.tracer.startSpan(`fs ${functionName}`); + // Return to the context active during the call in the callback + args[lastIdx] = api.context.bind(activeContext, function (error) { + if (error) { + span.recordException(error); + span.setStatus({ + message: error.message, + code: api.SpanStatusCode.ERROR, + }); + } + instrumentation._runEndHook(functionName, { + args: args, + span, + error, + }); + span.end(); + return cb.apply(this, arguments); + }); + try { + // Suppress tracing for internal fs calls + return api.context.with((0, core_1.suppressTracing)(api.trace.setSpan(activeContext, span)), original, this, ...args); + } + catch (error) { + span.recordException(error); + span.setStatus({ + message: error.message, + code: api.SpanStatusCode.ERROR, + }); + instrumentation._runEndHook(functionName, { + args: args, + span, + error, + }); + span.end(); + throw error; + } + } + else { + // TODO: what to do if we are pretty sure it's going to throw + return original.apply(this, args); + } + }; + return patchedFunctionWithOriginalProperties(patchedFunction, original); + } + _patchExistsCallbackFunction(functionName, original) { + const instrumentation = this; + const patchedFunction = function (...args) { + const activeContext = api.context.active(); + if (!instrumentation._shouldTrace(activeContext)) { + return original.apply(this, args); + } + if (instrumentation._runCreateHook(functionName, { + args: args, + }) === false) { + return api.context.with((0, core_1.suppressTracing)(activeContext), original, this, ...args); + } + const lastIdx = args.length - 1; + const cb = args[lastIdx]; + if (typeof cb === 'function') { + const span = instrumentation.tracer.startSpan(`fs ${functionName}`); + // Return to the context active during the call in the callback + args[lastIdx] = api.context.bind(activeContext, function () { + // `exists` never calls the callback with an error + instrumentation._runEndHook(functionName, { + args: args, + span, + }); + span.end(); + return cb.apply(this, arguments); + }); + try { + // Suppress tracing for internal fs calls + return api.context.with((0, core_1.suppressTracing)(api.trace.setSpan(activeContext, span)), original, this, ...args); + } + catch (error) { + span.recordException(error); + span.setStatus({ + message: error.message, + code: api.SpanStatusCode.ERROR, + }); + instrumentation._runEndHook(functionName, { + args: args, + span, + error, + }); + span.end(); + throw error; + } + } + else { + return original.apply(this, args); + } + }; + const functionWithOriginalProperties = patchedFunctionWithOriginalProperties(patchedFunction, original); + // `exists` has a custom promisify function because of the inconsistent signature + // replicating that on the patched function + const promisified = function (path) { + return new Promise(resolve => functionWithOriginalProperties(path, resolve)); + }; + Object.defineProperty(promisified, 'name', { value: functionName }); + Object.defineProperty(functionWithOriginalProperties, util_1.promisify.custom, { + value: promisified, + }); + return functionWithOriginalProperties; + } + _patchPromiseFunction(functionName, original) { + const instrumentation = this; + const patchedFunction = async function (...args) { + const activeContext = api.context.active(); + if (!instrumentation._shouldTrace(activeContext)) { + return original.apply(this, args); + } + if (instrumentation._runCreateHook(functionName, { + args: args, + }) === false) { + return api.context.with((0, core_1.suppressTracing)(activeContext), original, this, ...args); + } + const span = instrumentation.tracer.startSpan(`fs ${functionName}`); + try { + // Suppress tracing for internal fs calls + const res = await api.context.with((0, core_1.suppressTracing)(api.trace.setSpan(activeContext, span)), original, this, ...args); + instrumentation._runEndHook(functionName, { args: args, span }); + return res; + } + catch (error) { + span.recordException(error); + span.setStatus({ + message: error.message, + code: api.SpanStatusCode.ERROR, + }); + instrumentation._runEndHook(functionName, { args: args, span, error }); + throw error; + } + finally { + span.end(); + } + }; + return patchedFunctionWithOriginalProperties(patchedFunction, original); + } + _runCreateHook(...args) { + const { createHook } = this.getConfig(); + if (typeof createHook === 'function') { + try { + return createHook(...args); + } + catch (e) { + this._diag.error('caught createHook error', e); + } + } + return true; + } + _runEndHook(...args) { + const { endHook } = this.getConfig(); + if (typeof endHook === 'function') { + try { + endHook(...args); + } + catch (e) { + this._diag.error('caught endHook error', e); + } + } + } + _shouldTrace(context) { + if ((0, core_1.isTracingSuppressed)(context)) { + // Performance optimization. Avoid creating additional contexts and spans + // if we already know that the tracing is being suppressed. + return false; + } + const { requireParentSpan } = this.getConfig(); + if (requireParentSpan) { + const parentSpan = api.trace.getSpan(context); + if (parentSpan == null) { + return false; + } + } + return true; + } +} +exports.FsInstrumentation = FsInstrumentation; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 79846: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 38488: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.indexFs = exports.splitTwoLevels = void 0; +function splitTwoLevels(functionName) { + const memberParts = functionName.split('.'); + if (memberParts.length > 1) { + if (memberParts.length !== 2) + throw Error(`Invalid member function name ${functionName}`); + return memberParts; + } + else { + return [functionName]; + } +} +exports.splitTwoLevels = splitTwoLevels; +function indexFs(fs, member) { + if (!member) + throw new Error(JSON.stringify({ member })); + const splitResult = splitTwoLevels(member); + const [functionName1, functionName2] = splitResult; + if (functionName2) { + return { + objectToPatch: fs[functionName1], + functionNameToPatch: functionName2, + }; + } + else { + return { + objectToPatch: fs, + functionNameToPatch: functionName1, + }; + } +} +exports.indexFs = indexFs; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 67586: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.19.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-fs'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 36933: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(58964), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 58964: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.GenericPoolInstrumentation = void 0; +const api = __nccwpck_require__(65163); +const instrumentation_1 = __nccwpck_require__(65584); +/** @knipignore */ +const version_1 = __nccwpck_require__(95531); +const MODULE_NAME = 'generic-pool'; +class GenericPoolInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); + // only used for v2 - v2.3) + this._isDisabled = false; + } + init() { + return [ + new instrumentation_1.InstrumentationNodeModuleDefinition(MODULE_NAME, ['>=3.0.0 <4'], moduleExports => { + const Pool = moduleExports.Pool; + if ((0, instrumentation_1.isWrapped)(Pool.prototype.acquire)) { + this._unwrap(Pool.prototype, 'acquire'); + } + this._wrap(Pool.prototype, 'acquire', this._acquirePatcher.bind(this)); + return moduleExports; + }, moduleExports => { + const Pool = moduleExports.Pool; + this._unwrap(Pool.prototype, 'acquire'); + return moduleExports; + }), + new instrumentation_1.InstrumentationNodeModuleDefinition(MODULE_NAME, ['>=2.4.0 <3'], moduleExports => { + const Pool = moduleExports.Pool; + if ((0, instrumentation_1.isWrapped)(Pool.prototype.acquire)) { + this._unwrap(Pool.prototype, 'acquire'); + } + this._wrap(Pool.prototype, 'acquire', this._acquireWithCallbacksPatcher.bind(this)); + return moduleExports; + }, moduleExports => { + const Pool = moduleExports.Pool; + this._unwrap(Pool.prototype, 'acquire'); + return moduleExports; + }), + new instrumentation_1.InstrumentationNodeModuleDefinition(MODULE_NAME, ['>=2.0.0 <2.4'], moduleExports => { + this._isDisabled = false; + if ((0, instrumentation_1.isWrapped)(moduleExports.Pool)) { + this._unwrap(moduleExports, 'Pool'); + } + this._wrap(moduleExports, 'Pool', this._poolWrapper.bind(this)); + return moduleExports; + }, moduleExports => { + // since the object is created on the fly every time, we need to use + // a boolean switch here to disable the instrumentation + this._isDisabled = true; + return moduleExports; + }), + ]; + } + _acquirePatcher(original) { + const instrumentation = this; + return function wrapped_acquire(...args) { + const parent = api.context.active(); + const span = instrumentation.tracer.startSpan('generic-pool.acquire', {}, parent); + return api.context.with(api.trace.setSpan(parent, span), () => { + return original.call(this, ...args).then(value => { + span.end(); + return value; + }, err => { + span.recordException(err); + span.end(); + throw err; + }); + }); + }; + } + _poolWrapper(original) { + const instrumentation = this; + return function wrapped_pool() { + const pool = original.apply(this, arguments); + instrumentation._wrap(pool, 'acquire', instrumentation._acquireWithCallbacksPatcher.bind(instrumentation)); + return pool; + }; + } + _acquireWithCallbacksPatcher(original) { + const instrumentation = this; + return function wrapped_acquire(cb, priority) { + // only used for v2 - v2.3 + if (instrumentation._isDisabled) { + return original.call(this, cb, priority); + } + const parent = api.context.active(); + const span = instrumentation.tracer.startSpan('generic-pool.acquire', {}, parent); + return api.context.with(api.trace.setSpan(parent, span), () => { + original.call(this, (err, client) => { + span.end(); + // Not checking whether cb is a function because + // the original code doesn't do that either. + if (cb) { + return cb(err, client); + } + }, priority); + }); + }; + } +} +exports.GenericPoolInstrumentation = GenericPoolInstrumentation; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 95531: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.43.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-generic-pool'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 876: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SpanNames = exports.TokenKind = exports.AllowedOperationTypes = void 0; +var AllowedOperationTypes; +(function (AllowedOperationTypes) { + AllowedOperationTypes["QUERY"] = "query"; + AllowedOperationTypes["MUTATION"] = "mutation"; + AllowedOperationTypes["SUBSCRIPTION"] = "subscription"; +})(AllowedOperationTypes = exports.AllowedOperationTypes || (exports.AllowedOperationTypes = {})); +var TokenKind; +(function (TokenKind) { + TokenKind["SOF"] = ""; + TokenKind["EOF"] = ""; + TokenKind["BANG"] = "!"; + TokenKind["DOLLAR"] = "$"; + TokenKind["AMP"] = "&"; + TokenKind["PAREN_L"] = "("; + TokenKind["PAREN_R"] = ")"; + TokenKind["SPREAD"] = "..."; + TokenKind["COLON"] = ":"; + TokenKind["EQUALS"] = "="; + TokenKind["AT"] = "@"; + TokenKind["BRACKET_L"] = "["; + TokenKind["BRACKET_R"] = "]"; + TokenKind["BRACE_L"] = "{"; + TokenKind["PIPE"] = "|"; + TokenKind["BRACE_R"] = "}"; + TokenKind["NAME"] = "Name"; + TokenKind["INT"] = "Int"; + TokenKind["FLOAT"] = "Float"; + TokenKind["STRING"] = "String"; + TokenKind["BLOCK_STRING"] = "BlockString"; + TokenKind["COMMENT"] = "Comment"; +})(TokenKind = exports.TokenKind || (exports.TokenKind = {})); +var SpanNames; +(function (SpanNames) { + SpanNames["EXECUTE"] = "graphql.execute"; + SpanNames["PARSE"] = "graphql.parse"; + SpanNames["RESOLVE"] = "graphql.resolve"; + SpanNames["VALIDATE"] = "graphql.validate"; + SpanNames["SCHEMA_VALIDATE"] = "graphql.validateSchema"; + SpanNames["SCHEMA_PARSE"] = "graphql.parseSchema"; +})(SpanNames = exports.SpanNames || (exports.SpanNames = {})); +//# sourceMappingURL=enum.js.map + +/***/ }), + +/***/ 34455: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AttributeNames = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var AttributeNames; +(function (AttributeNames) { + AttributeNames["SOURCE"] = "graphql.source"; + AttributeNames["FIELD_NAME"] = "graphql.field.name"; + AttributeNames["FIELD_PATH"] = "graphql.field.path"; + AttributeNames["FIELD_TYPE"] = "graphql.field.type"; + AttributeNames["OPERATION_TYPE"] = "graphql.operation.type"; + AttributeNames["OPERATION_NAME"] = "graphql.operation.name"; + AttributeNames["VARIABLES"] = "graphql.variables."; + AttributeNames["ERROR_VALIDATION_NAME"] = "graphql.validation.error"; +})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {})); +//# sourceMappingURL=AttributeNames.js.map + +/***/ }), + +/***/ 96794: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(83962), exports); +__exportStar(__nccwpck_require__(37380), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 83962: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.GraphQLInstrumentation = void 0; +const api_1 = __nccwpck_require__(65163); +const instrumentation_1 = __nccwpck_require__(65584); +const enum_1 = __nccwpck_require__(876); +const AttributeNames_1 = __nccwpck_require__(34455); +const symbols_1 = __nccwpck_require__(13573); +const internal_types_1 = __nccwpck_require__(68440); +const utils_1 = __nccwpck_require__(18627); +/** @knipignore */ +const version_1 = __nccwpck_require__(43945); +const DEFAULT_CONFIG = { + mergeItems: false, + depth: -1, + allowValues: false, + ignoreResolveSpans: false, +}; +const supportedVersions = ['>=14.0.0 <17']; +class GraphQLInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, Object.assign(Object.assign({}, DEFAULT_CONFIG), config)); + } + setConfig(config = {}) { + super.setConfig(Object.assign(Object.assign({}, DEFAULT_CONFIG), config)); + } + init() { + const module = new instrumentation_1.InstrumentationNodeModuleDefinition('graphql', supportedVersions); + module.files.push(this._addPatchingExecute()); + module.files.push(this._addPatchingParser()); + module.files.push(this._addPatchingValidate()); + return module; + } + _addPatchingExecute() { + return new instrumentation_1.InstrumentationNodeModuleFile('graphql/execution/execute.js', supportedVersions, + // cannot make it work with appropriate type as execute function has 2 + //types and/cannot import function but only types + (moduleExports) => { + if ((0, instrumentation_1.isWrapped)(moduleExports.execute)) { + this._unwrap(moduleExports, 'execute'); + } + this._wrap(moduleExports, 'execute', this._patchExecute(moduleExports.defaultFieldResolver)); + return moduleExports; + }, moduleExports => { + if (moduleExports) { + this._unwrap(moduleExports, 'execute'); + } + }); + } + _addPatchingParser() { + return new instrumentation_1.InstrumentationNodeModuleFile('graphql/language/parser.js', supportedVersions, (moduleExports) => { + if ((0, instrumentation_1.isWrapped)(moduleExports.parse)) { + this._unwrap(moduleExports, 'parse'); + } + this._wrap(moduleExports, 'parse', this._patchParse()); + return moduleExports; + }, (moduleExports) => { + if (moduleExports) { + this._unwrap(moduleExports, 'parse'); + } + }); + } + _addPatchingValidate() { + return new instrumentation_1.InstrumentationNodeModuleFile('graphql/validation/validate.js', supportedVersions, moduleExports => { + if ((0, instrumentation_1.isWrapped)(moduleExports.validate)) { + this._unwrap(moduleExports, 'validate'); + } + this._wrap(moduleExports, 'validate', this._patchValidate()); + return moduleExports; + }, moduleExports => { + if (moduleExports) { + this._unwrap(moduleExports, 'validate'); + } + }); + } + _patchExecute(defaultFieldResolved) { + const instrumentation = this; + return function execute(original) { + return function patchExecute() { + let processedArgs; + // case when apollo server is used for example + if (arguments.length >= 2) { + const args = arguments; + processedArgs = instrumentation._wrapExecuteArgs(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], defaultFieldResolved); + } + else { + const args = arguments[0]; + processedArgs = instrumentation._wrapExecuteArgs(args.schema, args.document, args.rootValue, args.contextValue, args.variableValues, args.operationName, args.fieldResolver, args.typeResolver, defaultFieldResolved); + } + const operation = (0, utils_1.getOperation)(processedArgs.document, processedArgs.operationName); + const span = instrumentation._createExecuteSpan(operation, processedArgs); + processedArgs.contextValue[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL] = { + source: processedArgs.document + ? processedArgs.document || + processedArgs.document[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL] + : undefined, + span, + fields: {}, + }; + return api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { + return (0, instrumentation_1.safeExecuteInTheMiddle)(() => { + return original.apply(this, [ + processedArgs, + ]); + }, (err, result) => { + instrumentation._handleExecutionResult(span, err, result); + }); + }); + }; + }; + } + _handleExecutionResult(span, err, result) { + const config = this.getConfig(); + if (result === undefined || err) { + (0, utils_1.endSpan)(span, err); + return; + } + if ((0, utils_1.isPromise)(result)) { + result.then(resultData => { + if (typeof config.responseHook !== 'function') { + (0, utils_1.endSpan)(span); + return; + } + this._executeResponseHook(span, resultData); + }, error => { + (0, utils_1.endSpan)(span, error); + }); + } + else { + if (typeof config.responseHook !== 'function') { + (0, utils_1.endSpan)(span); + return; + } + this._executeResponseHook(span, result); + } + } + _executeResponseHook(span, result) { + const { responseHook } = this.getConfig(); + if (!responseHook) { + return; + } + (0, instrumentation_1.safeExecuteInTheMiddle)(() => { + responseHook(span, result); + }, err => { + if (err) { + this._diag.error('Error running response hook', err); + } + (0, utils_1.endSpan)(span, undefined); + }, true); + } + _patchParse() { + const instrumentation = this; + return function parse(original) { + return function patchParse(source, options) { + return instrumentation._parse(this, original, source, options); + }; + }; + } + _patchValidate() { + const instrumentation = this; + return function validate(original) { + return function patchValidate(schema, documentAST, rules, options, typeInfo) { + return instrumentation._validate(this, original, schema, documentAST, rules, typeInfo, options); + }; + }; + } + _parse(obj, original, source, options) { + const config = this.getConfig(); + const span = this.tracer.startSpan(enum_1.SpanNames.PARSE); + return api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { + return (0, instrumentation_1.safeExecuteInTheMiddle)(() => { + return original.call(obj, source, options); + }, (err, result) => { + if (result) { + const operation = (0, utils_1.getOperation)(result); + if (!operation) { + span.updateName(enum_1.SpanNames.SCHEMA_PARSE); + } + else if (result.loc) { + (0, utils_1.addSpanSource)(span, result.loc, config.allowValues); + } + } + (0, utils_1.endSpan)(span, err); + }); + }); + } + _validate(obj, original, schema, documentAST, rules, typeInfo, options) { + const span = this.tracer.startSpan(enum_1.SpanNames.VALIDATE, {}); + return api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { + return (0, instrumentation_1.safeExecuteInTheMiddle)(() => { + return original.call(obj, schema, documentAST, rules, options, typeInfo); + }, (err, errors) => { + if (!documentAST.loc) { + span.updateName(enum_1.SpanNames.SCHEMA_VALIDATE); + } + if (errors && errors.length) { + span.recordException({ + name: AttributeNames_1.AttributeNames.ERROR_VALIDATION_NAME, + message: JSON.stringify(errors), + }); + } + (0, utils_1.endSpan)(span, err); + }); + }); + } + _createExecuteSpan(operation, processedArgs) { + var _a; + const config = this.getConfig(); + const span = this.tracer.startSpan(enum_1.SpanNames.EXECUTE, {}); + if (operation) { + const { operation: operationType, name: nameNode } = operation; + span.setAttribute(AttributeNames_1.AttributeNames.OPERATION_TYPE, operationType); + const operationName = nameNode === null || nameNode === void 0 ? void 0 : nameNode.value; + // https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/instrumentation/graphql/ + // > The span name MUST be of the format provided that graphql.operation.type and graphql.operation.name are available. + // > If graphql.operation.name is not available, the span SHOULD be named . + if (operationName) { + span.setAttribute(AttributeNames_1.AttributeNames.OPERATION_NAME, operationName); + span.updateName(`${operationType} ${operationName}`); + } + else { + span.updateName(operationType); + } + } + else { + let operationName = ' '; + if (processedArgs.operationName) { + operationName = ` "${processedArgs.operationName}" `; + } + operationName = internal_types_1.OPERATION_NOT_SUPPORTED.replace('$operationName$', operationName); + span.setAttribute(AttributeNames_1.AttributeNames.OPERATION_NAME, operationName); + } + if ((_a = processedArgs.document) === null || _a === void 0 ? void 0 : _a.loc) { + (0, utils_1.addSpanSource)(span, processedArgs.document.loc, config.allowValues); + } + if (processedArgs.variableValues && config.allowValues) { + (0, utils_1.addInputVariableAttributes)(span, processedArgs.variableValues); + } + return span; + } + _wrapExecuteArgs(schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver, defaultFieldResolved) { + if (!contextValue) { + contextValue = {}; + } + if (contextValue[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL] || + this.getConfig().ignoreResolveSpans) { + return { + schema, + document, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + typeResolver, + }; + } + const isUsingDefaultResolver = fieldResolver == null; + // follows graphql implementation here: + // https://github.com/graphql/graphql-js/blob/0b7daed9811731362c71900e12e5ea0d1ecc7f1f/src/execution/execute.ts#L494 + const fieldResolverForExecute = fieldResolver !== null && fieldResolver !== void 0 ? fieldResolver : defaultFieldResolved; + fieldResolver = (0, utils_1.wrapFieldResolver)(this.tracer, () => this.getConfig(), fieldResolverForExecute, isUsingDefaultResolver); + if (schema) { + (0, utils_1.wrapFields)(schema.getQueryType(), this.tracer, () => this.getConfig()); + (0, utils_1.wrapFields)(schema.getMutationType(), this.tracer, () => this.getConfig()); + } + return { + schema, + document, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + typeResolver, + }; + } +} +exports.GraphQLInstrumentation = GraphQLInstrumentation; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 68440: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.OPERATION_NOT_SUPPORTED = void 0; +const symbols_1 = __nccwpck_require__(13573); +exports.OPERATION_NOT_SUPPORTED = 'Operation$operationName$not' + ' supported'; +//# sourceMappingURL=internal-types.js.map + +/***/ }), + +/***/ 13573: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.OTEL_GRAPHQL_DATA_SYMBOL = exports.OTEL_PATCHED_SYMBOL = void 0; +exports.OTEL_PATCHED_SYMBOL = Symbol.for('opentelemetry.patched'); +exports.OTEL_GRAPHQL_DATA_SYMBOL = Symbol.for('opentelemetry.graphql_data'); +//# sourceMappingURL=symbols.js.map + +/***/ }), + +/***/ 37380: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 18627: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.wrapFieldResolver = exports.wrapFields = exports.getSourceFromLocation = exports.getOperation = exports.endSpan = exports.addSpanSource = exports.addInputVariableAttributes = exports.isPromise = void 0; +const api = __nccwpck_require__(65163); +const enum_1 = __nccwpck_require__(876); +const AttributeNames_1 = __nccwpck_require__(34455); +const symbols_1 = __nccwpck_require__(13573); +const OPERATION_VALUES = Object.values(enum_1.AllowedOperationTypes); +// https://github.com/graphql/graphql-js/blob/main/src/jsutils/isPromise.ts +const isPromise = (value) => { + return typeof (value === null || value === void 0 ? void 0 : value.then) === 'function'; +}; +exports.isPromise = isPromise; +// https://github.com/graphql/graphql-js/blob/main/src/jsutils/isObjectLike.ts +const isObjectLike = (value) => { + return typeof value == 'object' && value !== null; +}; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function addInputVariableAttribute(span, key, variable) { + if (Array.isArray(variable)) { + variable.forEach((value, idx) => { + addInputVariableAttribute(span, `${key}.${idx}`, value); + }); + } + else if (variable instanceof Object) { + Object.entries(variable).forEach(([nestedKey, value]) => { + addInputVariableAttribute(span, `${key}.${nestedKey}`, value); + }); + } + else { + span.setAttribute(`${AttributeNames_1.AttributeNames.VARIABLES}${String(key)}`, variable); + } +} +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function addInputVariableAttributes(span, variableValues) { + Object.entries(variableValues).forEach(([key, value]) => { + addInputVariableAttribute(span, key, value); + }); +} +exports.addInputVariableAttributes = addInputVariableAttributes; +function addSpanSource(span, loc, allowValues, start, end) { + const source = getSourceFromLocation(loc, allowValues, start, end); + span.setAttribute(AttributeNames_1.AttributeNames.SOURCE, source); +} +exports.addSpanSource = addSpanSource; +function createFieldIfNotExists(tracer, getConfig, contextValue, info, path) { + let field = getField(contextValue, path); + let spanAdded = false; + if (!field) { + spanAdded = true; + const parent = getParentField(contextValue, path); + field = { + parent, + span: createResolverSpan(tracer, getConfig, contextValue, info, path, parent.span), + error: null, + }; + addField(contextValue, path, field); + } + return { spanAdded, field }; +} +function createResolverSpan(tracer, getConfig, contextValue, info, path, parentSpan) { + var _a, _b; + const attributes = { + [AttributeNames_1.AttributeNames.FIELD_NAME]: info.fieldName, + [AttributeNames_1.AttributeNames.FIELD_PATH]: path.join('.'), + [AttributeNames_1.AttributeNames.FIELD_TYPE]: info.returnType.toString(), + }; + const span = tracer.startSpan(`${enum_1.SpanNames.RESOLVE} ${attributes[AttributeNames_1.AttributeNames.FIELD_PATH]}`, { + attributes, + }, parentSpan ? api.trace.setSpan(api.context.active(), parentSpan) : undefined); + const document = contextValue[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL].source; + const fieldNode = info.fieldNodes.find(fieldNode => fieldNode.kind === 'Field'); + if (fieldNode) { + addSpanSource(span, document.loc, getConfig().allowValues, (_a = fieldNode.loc) === null || _a === void 0 ? void 0 : _a.start, (_b = fieldNode.loc) === null || _b === void 0 ? void 0 : _b.end); + } + return span; +} +function endSpan(span, error) { + if (error) { + span.recordException(error); + } + span.end(); +} +exports.endSpan = endSpan; +function getOperation(document, operationName) { + if (!document || !Array.isArray(document.definitions)) { + return undefined; + } + if (operationName) { + return document.definitions + .filter(definition => { var _a; return OPERATION_VALUES.indexOf((_a = definition) === null || _a === void 0 ? void 0 : _a.operation) !== -1; }) + .find(definition => { var _a, _b; return operationName === ((_b = (_a = definition) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.value); }); + } + else { + return document.definitions.find(definition => { var _a; return OPERATION_VALUES.indexOf((_a = definition) === null || _a === void 0 ? void 0 : _a.operation) !== -1; }); + } +} +exports.getOperation = getOperation; +function addField(contextValue, path, field) { + return (contextValue[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL].fields[path.join('.')] = + field); +} +function getField(contextValue, path) { + return contextValue[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL].fields[path.join('.')]; +} +function getParentField(contextValue, path) { + for (let i = path.length - 1; i > 0; i--) { + const field = getField(contextValue, path.slice(0, i)); + if (field) { + return field; + } + } + return { + span: contextValue[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL].span, + }; +} +function pathToArray(mergeItems, path) { + const flattened = []; + let curr = path; + while (curr) { + let key = curr.key; + if (mergeItems && typeof key === 'number') { + key = '*'; + } + flattened.push(String(key)); + curr = curr.prev; + } + return flattened.reverse(); +} +function repeatBreak(i) { + return repeatChar('\n', i); +} +function repeatSpace(i) { + return repeatChar(' ', i); +} +function repeatChar(char, to) { + let text = ''; + for (let i = 0; i < to; i++) { + text += char; + } + return text; +} +const KindsToBeRemoved = [ + enum_1.TokenKind.FLOAT, + enum_1.TokenKind.STRING, + enum_1.TokenKind.INT, + enum_1.TokenKind.BLOCK_STRING, +]; +function getSourceFromLocation(loc, allowValues = false, inputStart, inputEnd) { + var _a, _b; + let source = ''; + if (loc === null || loc === void 0 ? void 0 : loc.startToken) { + const start = typeof inputStart === 'number' ? inputStart : loc.start; + const end = typeof inputEnd === 'number' ? inputEnd : loc.end; + let next = loc.startToken.next; + let previousLine = 1; + while (next) { + if (next.start < start) { + next = next.next; + previousLine = next === null || next === void 0 ? void 0 : next.line; + continue; + } + if (next.end > end) { + next = next.next; + previousLine = next === null || next === void 0 ? void 0 : next.line; + continue; + } + let value = next.value || next.kind; + let space = ''; + if (!allowValues && KindsToBeRemoved.indexOf(next.kind) >= 0) { + // value = repeatChar('*', value.length); + value = '*'; + } + if (next.kind === enum_1.TokenKind.STRING) { + value = `"${value}"`; + } + if (next.kind === enum_1.TokenKind.EOF) { + value = ''; + } + if (next.line > previousLine) { + source += repeatBreak(next.line - previousLine); + previousLine = next.line; + space = repeatSpace(next.column - 1); + } + else { + if (next.line === ((_a = next.prev) === null || _a === void 0 ? void 0 : _a.line)) { + space = repeatSpace(next.start - (((_b = next.prev) === null || _b === void 0 ? void 0 : _b.end) || 0)); + } + } + source += space + value; + if (next) { + next = next.next; + } + } + } + return source; +} +exports.getSourceFromLocation = getSourceFromLocation; +function wrapFields(type, tracer, getConfig) { + if (!type || + typeof type.getFields !== 'function' || + type[symbols_1.OTEL_PATCHED_SYMBOL]) { + return; + } + const fields = type.getFields(); + type[symbols_1.OTEL_PATCHED_SYMBOL] = true; + Object.keys(fields).forEach(key => { + const field = fields[key]; + if (!field) { + return; + } + if (field.resolve) { + field.resolve = wrapFieldResolver(tracer, getConfig, field.resolve); + } + if (field.type) { + let unwrappedType = field.type; + while (unwrappedType.ofType) { + unwrappedType = unwrappedType.ofType; + } + wrapFields(unwrappedType, tracer, getConfig); + } + }); +} +exports.wrapFields = wrapFields; +const handleResolveSpanError = (resolveSpan, err, shouldEndSpan) => { + if (!shouldEndSpan) { + return; + } + resolveSpan.recordException(err); + resolveSpan.setStatus({ + code: api.SpanStatusCode.ERROR, + message: err.message, + }); + resolveSpan.end(); +}; +const handleResolveSpanSuccess = (resolveSpan, shouldEndSpan) => { + if (!shouldEndSpan) { + return; + } + resolveSpan.end(); +}; +function wrapFieldResolver(tracer, getConfig, fieldResolver, isDefaultResolver = false) { + if (wrappedFieldResolver[symbols_1.OTEL_PATCHED_SYMBOL] || + typeof fieldResolver !== 'function') { + return fieldResolver; + } + function wrappedFieldResolver(source, args, contextValue, info) { + if (!fieldResolver) { + return undefined; + } + const config = getConfig(); + // follows what graphql is doing to decide if this is a trivial resolver + // for which we don't need to create a resolve span + if (config.ignoreTrivialResolveSpans && + isDefaultResolver && + (isObjectLike(source) || typeof source === 'function')) { + const property = source[info.fieldName]; + // a function execution is not trivial and should be recorder. + // property which is not a function is just a value and we don't want a "resolve" span for it + if (typeof property !== 'function') { + return fieldResolver.call(this, source, args, contextValue, info); + } + } + if (!contextValue[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL]) { + return fieldResolver.call(this, source, args, contextValue, info); + } + const path = pathToArray(config.mergeItems, info && info.path); + const depth = path.filter((item) => typeof item === 'string').length; + let field; + let shouldEndSpan = false; + if (config.depth >= 0 && config.depth < depth) { + field = getParentField(contextValue, path); + } + else { + const newField = createFieldIfNotExists(tracer, getConfig, contextValue, info, path); + field = newField.field; + shouldEndSpan = newField.spanAdded; + } + return api.context.with(api.trace.setSpan(api.context.active(), field.span), () => { + try { + const res = fieldResolver.call(this, source, args, contextValue, info); + if ((0, exports.isPromise)(res)) { + return res.then((r) => { + handleResolveSpanSuccess(field.span, shouldEndSpan); + return r; + }, (err) => { + handleResolveSpanError(field.span, err, shouldEndSpan); + throw err; + }); + } + else { + handleResolveSpanSuccess(field.span, shouldEndSpan); + return res; + } + } + catch (err) { + handleResolveSpanError(field.span, err, shouldEndSpan); + throw err; + } + }); + } + wrappedFieldResolver[symbols_1.OTEL_PATCHED_SYMBOL] = true; + return wrappedFieldResolver; +} +exports.wrapFieldResolver = wrapFieldResolver; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 43945: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.47.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-graphql'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 72357: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AttributeNames = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var AttributeNames; +(function (AttributeNames) { + AttributeNames["HAPI_TYPE"] = "hapi.type"; + AttributeNames["PLUGIN_NAME"] = "hapi.plugin.name"; + AttributeNames["EXT_TYPE"] = "server.ext.type"; +})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {})); +//# sourceMappingURL=AttributeNames.js.map + +/***/ }), + +/***/ 25435: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(60254), exports); +__exportStar(__nccwpck_require__(72357), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 60254: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.HapiInstrumentation = void 0; +const api = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(89736); +const instrumentation_1 = __nccwpck_require__(65584); +/** @knipignore */ +const version_1 = __nccwpck_require__(82796); +const internal_types_1 = __nccwpck_require__(62498); +const utils_1 = __nccwpck_require__(84417); +/** Hapi instrumentation for OpenTelemetry */ +class HapiInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); + } + init() { + return new instrumentation_1.InstrumentationNodeModuleDefinition(internal_types_1.HapiComponentName, ['>=17.0.0 <22'], (module) => { + const moduleExports = module[Symbol.toStringTag] === 'Module' ? module.default : module; + if (!(0, instrumentation_1.isWrapped)(moduleExports.server)) { + this._wrap(moduleExports, 'server', this._getServerPatch.bind(this)); + } + if (!(0, instrumentation_1.isWrapped)(moduleExports.Server)) { + this._wrap(moduleExports, 'Server', this._getServerPatch.bind(this)); + } + return moduleExports; + }, (module) => { + const moduleExports = module[Symbol.toStringTag] === 'Module' ? module.default : module; + this._massUnwrap([moduleExports], ['server', 'Server']); + }); + } + /** + * Patches the Hapi.server and Hapi.Server functions in order to instrument + * the server.route, server.ext, and server.register functions via calls to the + * @function _getServerRoutePatch, @function _getServerExtPatch, and + * @function _getServerRegisterPatch functions + * @param original - the original Hapi Server creation function + */ + _getServerPatch(original) { + const instrumentation = this; + const self = this; + return function server(opts) { + const newServer = original.apply(this, [opts]); + self._wrap(newServer, 'route', originalRouter => { + return instrumentation._getServerRoutePatch.bind(instrumentation)(originalRouter); + }); + // Casting as any is necessary here due to multiple overloads on the Hapi.ext + // function, which requires supporting a variety of different parameters + // as extension inputs + self._wrap(newServer, 'ext', originalExtHandler => { + return instrumentation._getServerExtPatch.bind(instrumentation)( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + originalExtHandler); + }); + // Casting as any is necessary here due to multiple overloads on the Hapi.Server.register + // function, which requires supporting a variety of different types of Plugin inputs + self._wrap(newServer, 'register', + // eslint-disable-next-line @typescript-eslint/no-explicit-any + instrumentation._getServerRegisterPatch.bind(instrumentation)); + return newServer; + }; + } + /** + * Patches the plugin register function used by the Hapi Server. This function + * goes through each plugin that is being registered and adds instrumentation + * via a call to the @function _wrapRegisterHandler function. + * @param {RegisterFunction} original - the original register function which + * registers each plugin on the server + */ + _getServerRegisterPatch(original) { + const instrumentation = this; + return function register(pluginInput, options) { + if (Array.isArray(pluginInput)) { + for (const pluginObj of pluginInput) { + const plugin = (0, utils_1.getPluginFromInput)(pluginObj); + instrumentation._wrapRegisterHandler(plugin); + } + } + else { + const plugin = (0, utils_1.getPluginFromInput)(pluginInput); + instrumentation._wrapRegisterHandler(plugin); + } + return original.apply(this, [pluginInput, options]); + }; + } + /** + * Patches the Server.ext function which adds extension methods to the specified + * point along the request lifecycle. This function accepts the full range of + * accepted input into the standard Hapi `server.ext` function. For each extension, + * it adds instrumentation to the handler via a call to the @function _wrapExtMethods + * function. + * @param original - the original ext function which adds the extension method to the server + * @param {string} [pluginName] - if present, represents the name of the plugin responsible + * for adding this server extension. Else, signifies that the extension was added directly + */ + _getServerExtPatch(original, pluginName) { + const instrumentation = this; + return function ext(...args) { + if (Array.isArray(args[0])) { + const eventsList = args[0]; + for (let i = 0; i < eventsList.length; i++) { + const eventObj = eventsList[i]; + if ((0, utils_1.isLifecycleExtType)(eventObj.type)) { + const lifecycleEventObj = eventObj; + const handler = instrumentation._wrapExtMethods(lifecycleEventObj.method, eventObj.type, pluginName); + lifecycleEventObj.method = handler; + eventsList[i] = lifecycleEventObj; + } + } + return original.apply(this, args); + } + else if ((0, utils_1.isDirectExtInput)(args)) { + const extInput = args; + const method = extInput[1]; + const handler = instrumentation._wrapExtMethods(method, extInput[0], pluginName); + return original.apply(this, [extInput[0], handler, extInput[2]]); + } + else if ((0, utils_1.isLifecycleExtEventObj)(args[0])) { + const lifecycleEventObj = args[0]; + const handler = instrumentation._wrapExtMethods(lifecycleEventObj.method, lifecycleEventObj.type, pluginName); + lifecycleEventObj.method = handler; + return original.call(this, lifecycleEventObj); + } + return original.apply(this, args); + }; + } + /** + * Patches the Server.route function. This function accepts either one or an array + * of Hapi.ServerRoute objects and adds instrumentation on each route via a call to + * the @function _wrapRouteHandler function. + * @param {HapiServerRouteInputMethod} original - the original route function which adds + * the route to the server + * @param {string} [pluginName] - if present, represents the name of the plugin responsible + * for adding this server route. Else, signifies that the route was added directly + */ + _getServerRoutePatch(original, pluginName) { + const instrumentation = this; + return function route(route) { + if (Array.isArray(route)) { + for (let i = 0; i < route.length; i++) { + const newRoute = instrumentation._wrapRouteHandler.call(instrumentation, route[i], pluginName); + route[i] = newRoute; + } + } + else { + route = instrumentation._wrapRouteHandler.call(instrumentation, route, pluginName); + } + return original.apply(this, [route]); + }; + } + /** + * Wraps newly registered plugins to add instrumentation to the plugin's clone of + * the original server. Specifically, wraps the server.route and server.ext functions + * via calls to @function _getServerRoutePatch and @function _getServerExtPatch + * @param {Hapi.Plugin} plugin - the new plugin which is being instrumented + */ + _wrapRegisterHandler(plugin) { + const instrumentation = this; + const pluginName = (0, utils_1.getPluginName)(plugin); + const oldRegister = plugin.register; + const self = this; + const newRegisterHandler = function (server, options) { + self._wrap(server, 'route', original => { + return instrumentation._getServerRoutePatch.bind(instrumentation)(original, pluginName); + }); + // Casting as any is necessary here due to multiple overloads on the Hapi.ext + // function, which requires supporting a variety of different parameters + // as extension inputs + self._wrap(server, 'ext', originalExtHandler => { + return instrumentation._getServerExtPatch.bind(instrumentation)( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + originalExtHandler, pluginName); + }); + return oldRegister.call(this, server, options); + }; + plugin.register = newRegisterHandler; + } + /** + * Wraps request extension methods to add instrumentation to each new extension handler. + * Patches each individual extension in order to create the + * span and propagate context. It does not create spans when there is no parent span. + * @param {PatchableExtMethod | PatchableExtMethod[]} method - the request extension + * handler which is being instrumented + * @param {Hapi.ServerRequestExtType} extPoint - the point in the Hapi request lifecycle + * which this extension targets + * @param {string} [pluginName] - if present, represents the name of the plugin responsible + * for adding this server route. Else, signifies that the route was added directly + */ + _wrapExtMethods(method, extPoint, pluginName) { + const instrumentation = this; + if (method instanceof Array) { + for (let i = 0; i < method.length; i++) { + method[i] = instrumentation._wrapExtMethods(method[i], extPoint); + } + return method; + } + else if ((0, utils_1.isPatchableExtMethod)(method)) { + if (method[internal_types_1.handlerPatched] === true) + return method; + method[internal_types_1.handlerPatched] = true; + const newHandler = async function (...params) { + if (api.trace.getSpan(api.context.active()) === undefined) { + return await method.apply(this, params); + } + const metadata = (0, utils_1.getExtMetadata)(extPoint, pluginName); + const span = instrumentation.tracer.startSpan(metadata.name, { + attributes: metadata.attributes, + }); + try { + return await api.context.with(api.trace.setSpan(api.context.active(), span), method, undefined, ...params); + } + catch (err) { + span.recordException(err); + span.setStatus({ + code: api.SpanStatusCode.ERROR, + message: err.message, + }); + throw err; + } + finally { + span.end(); + } + }; + return newHandler; + } + return method; + } + /** + * Patches each individual route handler method in order to create the + * span and propagate context. It does not create spans when there is no parent span. + * @param {PatchableServerRoute} route - the route handler which is being instrumented + * @param {string} [pluginName] - if present, represents the name of the plugin responsible + * for adding this server route. Else, signifies that the route was added directly + */ + _wrapRouteHandler(route, pluginName) { + var _a; + const instrumentation = this; + if (route[internal_types_1.handlerPatched] === true) + return route; + route[internal_types_1.handlerPatched] = true; + const wrapHandler = oldHandler => { + return async function (...params) { + if (api.trace.getSpan(api.context.active()) === undefined) { + return await oldHandler.call(this, ...params); + } + const rpcMetadata = (0, core_1.getRPCMetadata)(api.context.active()); + if ((rpcMetadata === null || rpcMetadata === void 0 ? void 0 : rpcMetadata.type) === core_1.RPCType.HTTP) { + rpcMetadata.route = route.path; + } + const metadata = (0, utils_1.getRouteMetadata)(route, pluginName); + const span = instrumentation.tracer.startSpan(metadata.name, { + attributes: metadata.attributes, + }); + try { + return await api.context.with(api.trace.setSpan(api.context.active(), span), () => oldHandler.call(this, ...params)); + } + catch (err) { + span.recordException(err); + span.setStatus({ + code: api.SpanStatusCode.ERROR, + message: err.message, + }); + throw err; + } + finally { + span.end(); + } + }; + }; + if (typeof route.handler === 'function') { + route.handler = wrapHandler(route.handler); + } + else if (typeof route.options === 'function') { + const oldOptions = route.options; + route.options = function (server) { + const options = oldOptions(server); + if (typeof options.handler === 'function') { + options.handler = wrapHandler(options.handler); + } + return options; + }; + } + else if (typeof ((_a = route.options) === null || _a === void 0 ? void 0 : _a.handler) === 'function') { + route.options.handler = wrapHandler(route.options.handler); + } + return route; + } +} +exports.HapiInstrumentation = HapiInstrumentation; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 62498: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.HapiLifecycleMethodNames = exports.HapiLayerType = exports.handlerPatched = exports.HapiComponentName = void 0; +exports.HapiComponentName = '@hapi/hapi'; +/** + * This symbol is used to mark a Hapi route handler or server extension handler as + * already patched, since its possible to use these handlers multiple times + * i.e. when allowing multiple versions of one plugin, or when registering a plugin + * multiple times on different servers. + */ +exports.handlerPatched = Symbol('hapi-handler-patched'); +exports.HapiLayerType = { + ROUTER: 'router', + PLUGIN: 'plugin', + EXT: 'server.ext', +}; +exports.HapiLifecycleMethodNames = new Set([ + 'onPreAuth', + 'onCredentials', + 'onPostAuth', + 'onPreHandler', + 'onPostHandler', + 'onPreResponse', + 'onRequest', +]); +//# sourceMappingURL=internal-types.js.map + +/***/ }), + +/***/ 84417: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getPluginFromInput = exports.getExtMetadata = exports.getRouteMetadata = exports.isPatchableExtMethod = exports.isDirectExtInput = exports.isLifecycleExtEventObj = exports.isLifecycleExtType = exports.getPluginName = void 0; +const semantic_conventions_1 = __nccwpck_require__(67275); +const internal_types_1 = __nccwpck_require__(62498); +const AttributeNames_1 = __nccwpck_require__(72357); +function getPluginName(plugin) { + if (plugin.name) { + return plugin.name; + } + else { + return plugin.pkg.name; + } +} +exports.getPluginName = getPluginName; +const isLifecycleExtType = (variableToCheck) => { + return (typeof variableToCheck === 'string' && + internal_types_1.HapiLifecycleMethodNames.has(variableToCheck)); +}; +exports.isLifecycleExtType = isLifecycleExtType; +const isLifecycleExtEventObj = (variableToCheck) => { + var _a; + const event = (_a = variableToCheck) === null || _a === void 0 ? void 0 : _a.type; + return event !== undefined && (0, exports.isLifecycleExtType)(event); +}; +exports.isLifecycleExtEventObj = isLifecycleExtEventObj; +const isDirectExtInput = (variableToCheck) => { + return (Array.isArray(variableToCheck) && + variableToCheck.length <= 3 && + (0, exports.isLifecycleExtType)(variableToCheck[0]) && + typeof variableToCheck[1] === 'function'); +}; +exports.isDirectExtInput = isDirectExtInput; +const isPatchableExtMethod = (variableToCheck) => { + return !Array.isArray(variableToCheck); +}; +exports.isPatchableExtMethod = isPatchableExtMethod; +const getRouteMetadata = (route, pluginName) => { + if (pluginName) { + return { + attributes: { + [semantic_conventions_1.SEMATTRS_HTTP_ROUTE]: route.path, + [semantic_conventions_1.SEMATTRS_HTTP_METHOD]: route.method, + [AttributeNames_1.AttributeNames.HAPI_TYPE]: internal_types_1.HapiLayerType.PLUGIN, + [AttributeNames_1.AttributeNames.PLUGIN_NAME]: pluginName, + }, + name: `${pluginName}: route - ${route.path}`, + }; + } + return { + attributes: { + [semantic_conventions_1.SEMATTRS_HTTP_ROUTE]: route.path, + [semantic_conventions_1.SEMATTRS_HTTP_METHOD]: route.method, + [AttributeNames_1.AttributeNames.HAPI_TYPE]: internal_types_1.HapiLayerType.ROUTER, + }, + name: `route - ${route.path}`, + }; +}; +exports.getRouteMetadata = getRouteMetadata; +const getExtMetadata = (extPoint, pluginName) => { + if (pluginName) { + return { + attributes: { + [AttributeNames_1.AttributeNames.EXT_TYPE]: extPoint, + [AttributeNames_1.AttributeNames.HAPI_TYPE]: internal_types_1.HapiLayerType.EXT, + [AttributeNames_1.AttributeNames.PLUGIN_NAME]: pluginName, + }, + name: `${pluginName}: ext - ${extPoint}`, + }; + } + return { + attributes: { + [AttributeNames_1.AttributeNames.EXT_TYPE]: extPoint, + [AttributeNames_1.AttributeNames.HAPI_TYPE]: internal_types_1.HapiLayerType.EXT, + }, + name: `ext - ${extPoint}`, + }; +}; +exports.getExtMetadata = getExtMetadata; +const getPluginFromInput = (pluginObj) => { + if ('plugin' in pluginObj) { + if ('plugin' in pluginObj.plugin) { + return pluginObj.plugin.plugin; + } + return pluginObj.plugin; + } + return pluginObj; +}; +exports.getPluginFromInput = getPluginFromInput; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 82796: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.45.1'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-hapi'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 66169: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AttributeNames = void 0; +/** + * https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/http.md + */ +var AttributeNames; +(function (AttributeNames) { + AttributeNames["HTTP_ERROR_NAME"] = "http.error_name"; + AttributeNames["HTTP_ERROR_MESSAGE"] = "http.error_message"; + AttributeNames["HTTP_STATUS_TEXT"] = "http.status_text"; +})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {})); +//# sourceMappingURL=AttributeNames.js.map + +/***/ }), + +/***/ 57719: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.HttpInstrumentation = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(37890); +const semver = __nccwpck_require__(50326); +const url = __nccwpck_require__(57310); +const version_1 = __nccwpck_require__(14963); +const instrumentation_1 = __nccwpck_require__(65584); +const core_2 = __nccwpck_require__(37890); +const events_1 = __nccwpck_require__(82361); +const semantic_conventions_1 = __nccwpck_require__(67275); +const utils_1 = __nccwpck_require__(82095); +/** + * `node:http` and `node:https` instrumentation for OpenTelemetry + */ +class HttpInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super('@opentelemetry/instrumentation-http', version_1.VERSION, config); + /** keep track on spans not ended */ + this._spanNotEnded = new WeakSet(); + this._semconvStability = 2 /* OLD */; + this._headerCapture = this._createHeaderCapture(); + for (const entry of (0, core_2.getEnv)().OTEL_SEMCONV_STABILITY_OPT_IN) { + if (entry.toLowerCase() === 'http/dup') { + // http/dup takes highest precedence. If it is found, there is no need to read the rest of the list + this._semconvStability = 3 /* DUPLICATE */; + break; + } + else if (entry.toLowerCase() === 'http') { + this._semconvStability = 1 /* STABLE */; + } + } + } + _updateMetricInstruments() { + this._oldHttpServerDurationHistogram = this.meter.createHistogram('http.server.duration', { + description: 'Measures the duration of inbound HTTP requests.', + unit: 'ms', + valueType: api_1.ValueType.DOUBLE, + }); + this._oldHttpClientDurationHistogram = this.meter.createHistogram('http.client.duration', { + description: 'Measures the duration of outbound HTTP requests.', + unit: 'ms', + valueType: api_1.ValueType.DOUBLE, + }); + this._stableHttpServerDurationHistogram = this.meter.createHistogram(semantic_conventions_1.METRIC_HTTP_SERVER_REQUEST_DURATION, { + description: 'Duration of HTTP server requests.', + unit: 's', + valueType: api_1.ValueType.DOUBLE, + advice: { + explicitBucketBoundaries: [ + 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, + 7.5, 10, + ], + }, + }); + this._stableHttpClientDurationHistogram = this.meter.createHistogram(semantic_conventions_1.METRIC_HTTP_CLIENT_REQUEST_DURATION, { + description: 'Duration of HTTP client requests.', + unit: 's', + valueType: api_1.ValueType.DOUBLE, + advice: { + explicitBucketBoundaries: [ + 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, + 7.5, 10, + ], + }, + }); + } + _recordServerDuration(durationMs, oldAttributes, stableAttributes) { + if ((this._semconvStability & 2 /* OLD */) === + 2 /* OLD */) { + // old histogram is counted in MS + this._oldHttpServerDurationHistogram.record(durationMs, oldAttributes); + } + if ((this._semconvStability & 1 /* STABLE */) === + 1 /* STABLE */) { + // stable histogram is counted in S + this._stableHttpServerDurationHistogram.record(durationMs / 1000, stableAttributes); + } + } + _recordClientDuration(durationMs, oldAttributes, stableAttributes) { + if ((this._semconvStability & 2 /* OLD */) === + 2 /* OLD */) { + // old histogram is counted in MS + this._oldHttpClientDurationHistogram.record(durationMs, oldAttributes); + } + if ((this._semconvStability & 1 /* STABLE */) === + 1 /* STABLE */) { + // stable histogram is counted in S + this._stableHttpClientDurationHistogram.record(durationMs / 1000, stableAttributes); + } + } + setConfig(config = {}) { + super.setConfig(config); + this._headerCapture = this._createHeaderCapture(); + } + init() { + return [this._getHttpsInstrumentation(), this._getHttpInstrumentation()]; + } + _getHttpInstrumentation() { + return new instrumentation_1.InstrumentationNodeModuleDefinition('http', ['*'], (moduleExports) => { + const isESM = moduleExports[Symbol.toStringTag] === 'Module'; + if (!this.getConfig().disableOutgoingRequestInstrumentation) { + const patchedRequest = this._wrap(moduleExports, 'request', this._getPatchOutgoingRequestFunction('http')); + const patchedGet = this._wrap(moduleExports, 'get', this._getPatchOutgoingGetFunction(patchedRequest)); + if (isESM) { + // To handle `import http from 'http'`, which returns the default + // export, we need to set `module.default.*`. + moduleExports.default.request = patchedRequest; + moduleExports.default.get = patchedGet; + } + } + if (!this.getConfig().disableIncomingRequestInstrumentation) { + this._wrap(moduleExports.Server.prototype, 'emit', this._getPatchIncomingRequestFunction('http')); + } + return moduleExports; + }, (moduleExports) => { + if (moduleExports === undefined) + return; + if (!this.getConfig().disableOutgoingRequestInstrumentation) { + this._unwrap(moduleExports, 'request'); + this._unwrap(moduleExports, 'get'); + } + if (!this.getConfig().disableIncomingRequestInstrumentation) { + this._unwrap(moduleExports.Server.prototype, 'emit'); + } + }); + } + _getHttpsInstrumentation() { + return new instrumentation_1.InstrumentationNodeModuleDefinition('https', ['*'], (moduleExports) => { + const isESM = moduleExports[Symbol.toStringTag] === 'Module'; + if (!this.getConfig().disableOutgoingRequestInstrumentation) { + const patchedRequest = this._wrap(moduleExports, 'request', this._getPatchHttpsOutgoingRequestFunction('https')); + const patchedGet = this._wrap(moduleExports, 'get', this._getPatchHttpsOutgoingGetFunction(patchedRequest)); + if (isESM) { + // To handle `import https from 'https'`, which returns the default + // export, we need to set `module.default.*`. + moduleExports.default.request = patchedRequest; + moduleExports.default.get = patchedGet; + } + } + if (!this.getConfig().disableIncomingRequestInstrumentation) { + this._wrap(moduleExports.Server.prototype, 'emit', this._getPatchIncomingRequestFunction('https')); + } + return moduleExports; + }, (moduleExports) => { + if (moduleExports === undefined) + return; + if (!this.getConfig().disableOutgoingRequestInstrumentation) { + this._unwrap(moduleExports, 'request'); + this._unwrap(moduleExports, 'get'); + } + if (!this.getConfig().disableIncomingRequestInstrumentation) { + this._unwrap(moduleExports.Server.prototype, 'emit'); + } + }); + } + /** + * Creates spans for incoming requests, restoring spans' context if applied. + */ + _getPatchIncomingRequestFunction(component) { + return (original) => { + return this._incomingRequestFunction(component, original); + }; + } + /** + * Creates spans for outgoing requests, sending spans' context for distributed + * tracing. + */ + _getPatchOutgoingRequestFunction(component) { + return (original) => { + return this._outgoingRequestFunction(component, original); + }; + } + _getPatchOutgoingGetFunction(clientRequest) { + return (_original) => { + // Re-implement http.get. This needs to be done (instead of using + // getPatchOutgoingRequestFunction to patch it) because we need to + // set the trace context header before the returned http.ClientRequest is + // ended. The Node.js docs state that the only differences between + // request and get are that (1) get defaults to the HTTP GET method and + // (2) the returned request object is ended immediately. The former is + // already true (at least in supported Node versions up to v10), so we + // simply follow the latter. Ref: + // https://nodejs.org/dist/latest/docs/api/http.html#http_http_get_options_callback + // https://github.com/googleapis/cloud-trace-nodejs/blob/master/src/instrumentations/instrumentation-http.ts#L198 + return function outgoingGetRequest(options, ...args) { + const req = clientRequest(options, ...args); + req.end(); + return req; + }; + }; + } + /** Patches HTTPS outgoing requests */ + _getPatchHttpsOutgoingRequestFunction(component) { + return (original) => { + const instrumentation = this; + return function httpsOutgoingRequest( + // eslint-disable-next-line node/no-unsupported-features/node-builtins + options, ...args) { + var _a; + // Makes sure options will have default HTTPS parameters + if (component === 'https' && + typeof options === 'object' && + ((_a = options === null || options === void 0 ? void 0 : options.constructor) === null || _a === void 0 ? void 0 : _a.name) !== 'URL') { + options = Object.assign({}, options); + instrumentation._setDefaultOptions(options); + } + return instrumentation._getPatchOutgoingRequestFunction(component)(original)(options, ...args); + }; + }; + } + _setDefaultOptions(options) { + options.protocol = options.protocol || 'https:'; + options.port = options.port || 443; + } + /** Patches HTTPS outgoing get requests */ + _getPatchHttpsOutgoingGetFunction(clientRequest) { + return (original) => { + const instrumentation = this; + return function httpsOutgoingRequest( + // eslint-disable-next-line node/no-unsupported-features/node-builtins + options, ...args) { + return instrumentation._getPatchOutgoingGetFunction(clientRequest)(original)(options, ...args); + }; + }; + } + /** + * Attach event listeners to a client request to end span and add span attributes. + * + * @param request The original request object. + * @param span representing the current operation + * @param startTime representing the start time of the request to calculate duration in Metric + * @param oldMetricAttributes metric attributes for old semantic conventions + * @param stableMetricAttributes metric attributes for new semantic conventions + */ + _traceClientRequest(request, span, startTime, oldMetricAttributes, stableMetricAttributes) { + if (this.getConfig().requestHook) { + this._callRequestHook(span, request); + } + /** + * Determines if the request has errored or the response has ended/errored. + */ + let responseFinished = false; + /* + * User 'response' event listeners can be added before our listener, + * force our listener to be the first, so response emitter is bound + * before any user listeners are added to it. + */ + request.prependListener('response', (response) => { + this._diag.debug('outgoingRequest on response()'); + if (request.listenerCount('response') <= 1) { + response.resume(); + } + const responseAttributes = (0, utils_1.getOutgoingRequestAttributesOnResponse)(response, this._semconvStability); + span.setAttributes(responseAttributes); + oldMetricAttributes = Object.assign(oldMetricAttributes, (0, utils_1.getOutgoingRequestMetricAttributesOnResponse)(responseAttributes)); + if (this.getConfig().responseHook) { + this._callResponseHook(span, response); + } + this._headerCapture.client.captureRequestHeaders(span, header => request.getHeader(header)); + this._headerCapture.client.captureResponseHeaders(span, header => response.headers[header]); + api_1.context.bind(api_1.context.active(), response); + const endHandler = () => { + this._diag.debug('outgoingRequest on end()'); + if (responseFinished) { + return; + } + responseFinished = true; + let status; + if (response.aborted && !response.complete) { + status = { code: api_1.SpanStatusCode.ERROR }; + } + else { + // behaves same for new and old semconv + status = { + code: (0, utils_1.parseResponseStatus)(api_1.SpanKind.CLIENT, response.statusCode), + }; + } + span.setStatus(status); + if (this.getConfig().applyCustomAttributesOnSpan) { + (0, instrumentation_1.safeExecuteInTheMiddle)(() => this.getConfig().applyCustomAttributesOnSpan(span, request, response), () => { }, true); + } + this._closeHttpSpan(span, api_1.SpanKind.CLIENT, startTime, oldMetricAttributes, stableMetricAttributes); + }; + response.on('end', endHandler); + // See https://github.com/open-telemetry/opentelemetry-js/pull/3625#issuecomment-1475673533 + if (semver.lt(process.version, '16.0.0')) { + response.on('close', endHandler); + } + response.on(events_1.errorMonitor, (error) => { + this._diag.debug('outgoingRequest on error()', error); + if (responseFinished) { + return; + } + responseFinished = true; + (0, utils_1.setSpanWithError)(span, error, this._semconvStability); + span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: error.message, + }); + this._closeHttpSpan(span, api_1.SpanKind.CLIENT, startTime, oldMetricAttributes, stableMetricAttributes); + }); + }); + request.on('close', () => { + this._diag.debug('outgoingRequest on request close()'); + if (request.aborted || responseFinished) { + return; + } + responseFinished = true; + this._closeHttpSpan(span, api_1.SpanKind.CLIENT, startTime, oldMetricAttributes, stableMetricAttributes); + }); + request.on(events_1.errorMonitor, (error) => { + this._diag.debug('outgoingRequest on request error()', error); + if (responseFinished) { + return; + } + responseFinished = true; + (0, utils_1.setSpanWithError)(span, error, this._semconvStability); + this._closeHttpSpan(span, api_1.SpanKind.CLIENT, startTime, oldMetricAttributes, stableMetricAttributes); + }); + this._diag.debug('http.ClientRequest return request'); + return request; + } + _incomingRequestFunction(component, original) { + const instrumentation = this; + return function incomingRequest(event, ...args) { + // Only traces request events + if (event !== 'request') { + return original.apply(this, [event, ...args]); + } + const request = args[0]; + const response = args[1]; + const method = request.method || 'GET'; + instrumentation._diag.debug(`${component} instrumentation incomingRequest`); + if ((0, instrumentation_1.safeExecuteInTheMiddle)(() => { var _a, _b; return (_b = (_a = instrumentation.getConfig()).ignoreIncomingRequestHook) === null || _b === void 0 ? void 0 : _b.call(_a, request); }, (e) => { + if (e != null) { + instrumentation._diag.error('caught ignoreIncomingRequestHook error: ', e); + } + }, true)) { + return api_1.context.with((0, core_1.suppressTracing)(api_1.context.active()), () => { + api_1.context.bind(api_1.context.active(), request); + api_1.context.bind(api_1.context.active(), response); + return original.apply(this, [event, ...args]); + }); + } + const headers = request.headers; + const spanAttributes = (0, utils_1.getIncomingRequestAttributes)(request, { + component: component, + serverName: instrumentation.getConfig().serverName, + hookAttributes: instrumentation._callStartSpanHook(request, instrumentation.getConfig().startIncomingSpanHook), + semconvStability: instrumentation._semconvStability, + }, instrumentation._diag); + const spanOptions = { + kind: api_1.SpanKind.SERVER, + attributes: spanAttributes, + }; + const startTime = (0, core_1.hrTime)(); + const oldMetricAttributes = (0, utils_1.getIncomingRequestMetricAttributes)(spanAttributes); + // request method and url.scheme are both required span attributes + const stableMetricAttributes = { + [semantic_conventions_1.ATTR_HTTP_REQUEST_METHOD]: spanAttributes[semantic_conventions_1.ATTR_HTTP_REQUEST_METHOD], + [semantic_conventions_1.ATTR_URL_SCHEME]: spanAttributes[semantic_conventions_1.ATTR_URL_SCHEME], + }; + // recommended if and only if one was sent, same as span recommendation + if (spanAttributes[semantic_conventions_1.ATTR_NETWORK_PROTOCOL_VERSION]) { + stableMetricAttributes[semantic_conventions_1.ATTR_NETWORK_PROTOCOL_VERSION] = + spanAttributes[semantic_conventions_1.ATTR_NETWORK_PROTOCOL_VERSION]; + } + const ctx = api_1.propagation.extract(api_1.ROOT_CONTEXT, headers); + const span = instrumentation._startHttpSpan(method, spanOptions, ctx); + const rpcMetadata = { + type: core_2.RPCType.HTTP, + span, + }; + return api_1.context.with((0, core_2.setRPCMetadata)(api_1.trace.setSpan(ctx, span), rpcMetadata), () => { + api_1.context.bind(api_1.context.active(), request); + api_1.context.bind(api_1.context.active(), response); + if (instrumentation.getConfig().requestHook) { + instrumentation._callRequestHook(span, request); + } + if (instrumentation.getConfig().responseHook) { + instrumentation._callResponseHook(span, response); + } + instrumentation._headerCapture.server.captureRequestHeaders(span, header => request.headers[header]); + // After 'error', no further events other than 'close' should be emitted. + let hasError = false; + response.on('close', () => { + if (hasError) { + return; + } + instrumentation._onServerResponseFinish(request, response, span, oldMetricAttributes, stableMetricAttributes, startTime); + }); + response.on(events_1.errorMonitor, (err) => { + hasError = true; + instrumentation._onServerResponseError(span, oldMetricAttributes, stableMetricAttributes, startTime, err); + }); + return (0, instrumentation_1.safeExecuteInTheMiddle)(() => original.apply(this, [event, ...args]), error => { + if (error) { + (0, utils_1.setSpanWithError)(span, error, instrumentation._semconvStability); + instrumentation._closeHttpSpan(span, api_1.SpanKind.SERVER, startTime, oldMetricAttributes, stableMetricAttributes); + throw error; + } + }); + }); + }; + } + _outgoingRequestFunction(component, original) { + const instrumentation = this; + return function outgoingRequest(options, ...args) { + if (!(0, utils_1.isValidOptionsType)(options)) { + return original.apply(this, [options, ...args]); + } + const extraOptions = typeof args[0] === 'object' && + (typeof options === 'string' || options instanceof url.URL) + ? args.shift() + : undefined; + const { method, invalidUrl, optionsParsed } = (0, utils_1.getRequestInfo)(instrumentation._diag, options, extraOptions); + /** + * Node 8's https module directly call the http one so to avoid creating + * 2 span for the same request we need to check that the protocol is correct + * See: https://github.com/nodejs/node/blob/v8.17.0/lib/https.js#L245 + */ + if (component === 'http' && + semver.lt(process.version, '9.0.0') && + optionsParsed.protocol === 'https:') { + return original.apply(this, [optionsParsed, ...args]); + } + if ((0, instrumentation_1.safeExecuteInTheMiddle)(() => { + var _a, _b; + return (_b = (_a = instrumentation + .getConfig()).ignoreOutgoingRequestHook) === null || _b === void 0 ? void 0 : _b.call(_a, optionsParsed); + }, (e) => { + if (e != null) { + instrumentation._diag.error('caught ignoreOutgoingRequestHook error: ', e); + } + }, true)) { + return original.apply(this, [optionsParsed, ...args]); + } + const { hostname, port } = (0, utils_1.extractHostnameAndPort)(optionsParsed); + const attributes = (0, utils_1.getOutgoingRequestAttributes)(optionsParsed, { + component, + port, + hostname, + hookAttributes: instrumentation._callStartSpanHook(optionsParsed, instrumentation.getConfig().startOutgoingSpanHook), + }, instrumentation._semconvStability); + const startTime = (0, core_1.hrTime)(); + const oldMetricAttributes = (0, utils_1.getOutgoingRequestMetricAttributes)(attributes); + // request method, server address, and server port are both required span attributes + const stableMetricAttributes = { + [semantic_conventions_1.ATTR_HTTP_REQUEST_METHOD]: attributes[semantic_conventions_1.ATTR_HTTP_REQUEST_METHOD], + [semantic_conventions_1.ATTR_SERVER_ADDRESS]: attributes[semantic_conventions_1.ATTR_SERVER_ADDRESS], + [semantic_conventions_1.ATTR_SERVER_PORT]: attributes[semantic_conventions_1.ATTR_SERVER_PORT], + }; + // required if and only if one was sent, same as span requirement + if (attributes[semantic_conventions_1.ATTR_HTTP_RESPONSE_STATUS_CODE]) { + stableMetricAttributes[semantic_conventions_1.ATTR_HTTP_RESPONSE_STATUS_CODE] = + attributes[semantic_conventions_1.ATTR_HTTP_RESPONSE_STATUS_CODE]; + } + // recommended if and only if one was sent, same as span recommendation + if (attributes[semantic_conventions_1.ATTR_NETWORK_PROTOCOL_VERSION]) { + stableMetricAttributes[semantic_conventions_1.ATTR_NETWORK_PROTOCOL_VERSION] = + attributes[semantic_conventions_1.ATTR_NETWORK_PROTOCOL_VERSION]; + } + const spanOptions = { + kind: api_1.SpanKind.CLIENT, + attributes, + }; + const span = instrumentation._startHttpSpan(method, spanOptions); + const parentContext = api_1.context.active(); + const requestContext = api_1.trace.setSpan(parentContext, span); + if (!optionsParsed.headers) { + optionsParsed.headers = {}; + } + else { + // Make a copy of the headers object to avoid mutating an object the + // caller might have a reference to. + optionsParsed.headers = Object.assign({}, optionsParsed.headers); + } + api_1.propagation.inject(requestContext, optionsParsed.headers); + return api_1.context.with(requestContext, () => { + /* + * The response callback is registered before ClientRequest is bound, + * thus it is needed to bind it before the function call. + */ + const cb = args[args.length - 1]; + if (typeof cb === 'function') { + args[args.length - 1] = api_1.context.bind(parentContext, cb); + } + const request = (0, instrumentation_1.safeExecuteInTheMiddle)(() => { + if (invalidUrl) { + // we know that the url is invalid, there's no point in injecting context as it will fail validation. + // Passing in what the user provided will give the user an error that matches what they'd see without + // the instrumentation. + return original.apply(this, [options, ...args]); + } + else { + return original.apply(this, [optionsParsed, ...args]); + } + }, error => { + if (error) { + (0, utils_1.setSpanWithError)(span, error, instrumentation._semconvStability); + instrumentation._closeHttpSpan(span, api_1.SpanKind.CLIENT, startTime, oldMetricAttributes, stableMetricAttributes); + throw error; + } + }); + instrumentation._diag.debug(`${component} instrumentation outgoingRequest`); + api_1.context.bind(parentContext, request); + return instrumentation._traceClientRequest(request, span, startTime, oldMetricAttributes, stableMetricAttributes); + }); + }; + } + _onServerResponseFinish(request, response, span, oldMetricAttributes, stableMetricAttributes, startTime) { + const attributes = (0, utils_1.getIncomingRequestAttributesOnResponse)(request, response, this._semconvStability); + oldMetricAttributes = Object.assign(oldMetricAttributes, (0, utils_1.getIncomingRequestMetricAttributesOnResponse)(attributes)); + stableMetricAttributes = Object.assign(stableMetricAttributes, (0, utils_1.getIncomingStableRequestMetricAttributesOnResponse)(attributes)); + this._headerCapture.server.captureResponseHeaders(span, header => response.getHeader(header)); + span.setAttributes(attributes).setStatus({ + code: (0, utils_1.parseResponseStatus)(api_1.SpanKind.SERVER, response.statusCode), + }); + const route = attributes[semantic_conventions_1.SEMATTRS_HTTP_ROUTE]; + if (route) { + span.updateName(`${request.method || 'GET'} ${route}`); + } + if (this.getConfig().applyCustomAttributesOnSpan) { + (0, instrumentation_1.safeExecuteInTheMiddle)(() => this.getConfig().applyCustomAttributesOnSpan(span, request, response), () => { }, true); + } + this._closeHttpSpan(span, api_1.SpanKind.SERVER, startTime, oldMetricAttributes, stableMetricAttributes); + } + _onServerResponseError(span, oldMetricAttributes, stableMetricAttributes, startTime, error) { + (0, utils_1.setSpanWithError)(span, error, this._semconvStability); + // TODO get error attributes for metrics + this._closeHttpSpan(span, api_1.SpanKind.SERVER, startTime, oldMetricAttributes, stableMetricAttributes); + } + _startHttpSpan(name, options, ctx = api_1.context.active()) { + /* + * If a parent is required but not present, we use a `NoopSpan` to still + * propagate context without recording it. + */ + const requireParent = options.kind === api_1.SpanKind.CLIENT + ? this.getConfig().requireParentforOutgoingSpans + : this.getConfig().requireParentforIncomingSpans; + let span; + const currentSpan = api_1.trace.getSpan(ctx); + if (requireParent === true && currentSpan === undefined) { + span = api_1.trace.wrapSpanContext(api_1.INVALID_SPAN_CONTEXT); + } + else if (requireParent === true && (currentSpan === null || currentSpan === void 0 ? void 0 : currentSpan.spanContext().isRemote)) { + span = currentSpan; + } + else { + span = this.tracer.startSpan(name, options, ctx); + } + this._spanNotEnded.add(span); + return span; + } + _closeHttpSpan(span, spanKind, startTime, oldMetricAttributes, stableMetricAttributes) { + if (!this._spanNotEnded.has(span)) { + return; + } + span.end(); + this._spanNotEnded.delete(span); + // Record metrics + const duration = (0, core_1.hrTimeToMilliseconds)((0, core_1.hrTimeDuration)(startTime, (0, core_1.hrTime)())); + if (spanKind === api_1.SpanKind.SERVER) { + this._recordServerDuration(duration, oldMetricAttributes, stableMetricAttributes); + } + else if (spanKind === api_1.SpanKind.CLIENT) { + this._recordClientDuration(duration, oldMetricAttributes, stableMetricAttributes); + } + } + _callResponseHook(span, response) { + (0, instrumentation_1.safeExecuteInTheMiddle)(() => this.getConfig().responseHook(span, response), () => { }, true); + } + _callRequestHook(span, request) { + (0, instrumentation_1.safeExecuteInTheMiddle)(() => this.getConfig().requestHook(span, request), () => { }, true); + } + _callStartSpanHook(request, hookFunc) { + if (typeof hookFunc === 'function') { + return (0, instrumentation_1.safeExecuteInTheMiddle)(() => hookFunc(request), () => { }, true); + } + } + _createHeaderCapture() { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; + const config = this.getConfig(); + return { + client: { + captureRequestHeaders: (0, utils_1.headerCapture)('request', (_c = (_b = (_a = config.headersToSpanAttributes) === null || _a === void 0 ? void 0 : _a.client) === null || _b === void 0 ? void 0 : _b.requestHeaders) !== null && _c !== void 0 ? _c : []), + captureResponseHeaders: (0, utils_1.headerCapture)('response', (_f = (_e = (_d = config.headersToSpanAttributes) === null || _d === void 0 ? void 0 : _d.client) === null || _e === void 0 ? void 0 : _e.responseHeaders) !== null && _f !== void 0 ? _f : []), + }, + server: { + captureRequestHeaders: (0, utils_1.headerCapture)('request', (_j = (_h = (_g = config.headersToSpanAttributes) === null || _g === void 0 ? void 0 : _g.server) === null || _h === void 0 ? void 0 : _h.requestHeaders) !== null && _j !== void 0 ? _j : []), + captureResponseHeaders: (0, utils_1.headerCapture)('response', (_m = (_l = (_k = config.headersToSpanAttributes) === null || _k === void 0 ? void 0 : _k.server) === null || _l === void 0 ? void 0 : _l.responseHeaders) !== null && _m !== void 0 ? _m : []), + }, + }; + } +} +exports.HttpInstrumentation = HttpInstrumentation; +//# sourceMappingURL=http.js.map + +/***/ }), + +/***/ 50611: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.HttpInstrumentation = void 0; +var http_1 = __nccwpck_require__(57719); +Object.defineProperty(exports, "HttpInstrumentation", ({ enumerable: true, get: function () { return http_1.HttpInstrumentation; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 82095: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.headerCapture = exports.getIncomingStableRequestMetricAttributesOnResponse = exports.getIncomingRequestMetricAttributesOnResponse = exports.getIncomingRequestAttributesOnResponse = exports.getIncomingRequestMetricAttributes = exports.getIncomingRequestAttributes = exports.getRemoteClientAddress = exports.getOutgoingRequestMetricAttributesOnResponse = exports.getOutgoingRequestAttributesOnResponse = exports.setAttributesFromHttpKind = exports.getOutgoingRequestMetricAttributes = exports.getOutgoingRequestAttributes = exports.extractHostnameAndPort = exports.isValidOptionsType = exports.getRequestInfo = exports.isCompressed = exports.setResponseContentLengthAttribute = exports.setRequestContentLengthAttribute = exports.setSpanWithError = exports.satisfiesPattern = exports.parseResponseStatus = exports.getAbsoluteUrl = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const api_1 = __nccwpck_require__(65163); +const semantic_conventions_1 = __nccwpck_require__(67275); +const core_1 = __nccwpck_require__(37890); +const url = __nccwpck_require__(57310); +const AttributeNames_1 = __nccwpck_require__(66169); +const forwardedParse = __nccwpck_require__(37289); +/** + * Get an absolute url + */ +const getAbsoluteUrl = (requestUrl, headers, fallbackProtocol = 'http:') => { + const reqUrlObject = requestUrl || {}; + const protocol = reqUrlObject.protocol || fallbackProtocol; + const port = (reqUrlObject.port || '').toString(); + const path = reqUrlObject.path || '/'; + let host = reqUrlObject.host || reqUrlObject.hostname || headers.host || 'localhost'; + // if there is no port in host and there is a port + // it should be displayed if it's not 80 and 443 (default ports) + if (host.indexOf(':') === -1 && + port && + port !== '80' && + port !== '443') { + host += `:${port}`; + } + return `${protocol}//${host}${path}`; +}; +exports.getAbsoluteUrl = getAbsoluteUrl; +/** + * Parse status code from HTTP response. [More details](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/data-http.md#status) + */ +const parseResponseStatus = (kind, statusCode) => { + const upperBound = kind === api_1.SpanKind.CLIENT ? 400 : 500; + // 1xx, 2xx, 3xx are OK on client and server + // 4xx is OK on server + if (statusCode && statusCode >= 100 && statusCode < upperBound) { + return api_1.SpanStatusCode.UNSET; + } + // All other codes are error + return api_1.SpanStatusCode.ERROR; +}; +exports.parseResponseStatus = parseResponseStatus; +/** + * Check whether the given obj match pattern + * @param constant e.g URL of request + * @param pattern Match pattern + */ +const satisfiesPattern = (constant, pattern) => { + if (typeof pattern === 'string') { + return pattern === constant; + } + else if (pattern instanceof RegExp) { + return pattern.test(constant); + } + else if (typeof pattern === 'function') { + return pattern(constant); + } + else { + throw new TypeError('Pattern is in unsupported datatype'); + } +}; +exports.satisfiesPattern = satisfiesPattern; +/** + * Sets the span with the error passed in params + * @param {Span} span the span that need to be set + * @param {Error} error error that will be set to span + * @param {SemconvStability} semconvStability determines which semconv version to use + */ +const setSpanWithError = (span, error, semconvStability) => { + const message = error.message; + if ((semconvStability & 2 /* OLD */) === 2 /* OLD */) { + span.setAttribute(AttributeNames_1.AttributeNames.HTTP_ERROR_NAME, error.name); + span.setAttribute(AttributeNames_1.AttributeNames.HTTP_ERROR_MESSAGE, message); + } + if ((semconvStability & 1 /* STABLE */) === + 1 /* STABLE */) { + span.setAttribute(semantic_conventions_1.ATTR_ERROR_TYPE, error.name); + } + span.setStatus({ code: api_1.SpanStatusCode.ERROR, message }); + span.recordException(error); +}; +exports.setSpanWithError = setSpanWithError; +/** + * Adds attributes for request content-length and content-encoding HTTP headers + * @param { IncomingMessage } Request object whose headers will be analyzed + * @param { Attributes } Attributes object to be modified + */ +const setRequestContentLengthAttribute = (request, attributes) => { + const length = getContentLength(request.headers); + if (length === null) + return; + if ((0, exports.isCompressed)(request.headers)) { + attributes[semantic_conventions_1.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH] = length; + } + else { + attributes[semantic_conventions_1.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED] = length; + } +}; +exports.setRequestContentLengthAttribute = setRequestContentLengthAttribute; +/** + * Adds attributes for response content-length and content-encoding HTTP headers + * @param { IncomingMessage } Response object whose headers will be analyzed + * @param { Attributes } Attributes object to be modified + * + * @deprecated this is for an older version of semconv. It is retained for compatibility using OTEL_SEMCONV_STABILITY_OPT_IN + */ +const setResponseContentLengthAttribute = (response, attributes) => { + const length = getContentLength(response.headers); + if (length === null) + return; + if ((0, exports.isCompressed)(response.headers)) { + attributes[semantic_conventions_1.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH] = length; + } + else { + attributes[semantic_conventions_1.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED] = length; + } +}; +exports.setResponseContentLengthAttribute = setResponseContentLengthAttribute; +function getContentLength(headers) { + const contentLengthHeader = headers['content-length']; + if (contentLengthHeader === undefined) + return null; + const contentLength = parseInt(contentLengthHeader, 10); + if (isNaN(contentLength)) + return null; + return contentLength; +} +const isCompressed = (headers) => { + const encoding = headers['content-encoding']; + return !!encoding && encoding !== 'identity'; +}; +exports.isCompressed = isCompressed; +/** + * Mimics Node.js conversion of URL strings to RequestOptions expected by + * `http.request` and `https.request` APIs. + * + * See https://github.com/nodejs/node/blob/2505e217bba05fc581b572c685c5cf280a16c5a3/lib/internal/url.js#L1415-L1437 + * + * @param stringUrl + * @throws TypeError if the URL is not valid. + */ +function stringUrlToHttpOptions(stringUrl) { + // This is heavily inspired by Node.js handling of the same situation, trying + // to follow it as closely as possible while keeping in mind that we only + // deal with string URLs, not URL objects. + const { hostname, pathname, port, username, password, search, protocol, hash, href, origin, host, } = new URL(stringUrl); + const options = { + protocol: protocol, + hostname: hostname && hostname[0] === '[' ? hostname.slice(1, -1) : hostname, + hash: hash, + search: search, + pathname: pathname, + path: `${pathname || ''}${search || ''}`, + href: href, + origin: origin, + host: host, + }; + if (port !== '') { + options.port = Number(port); + } + if (username || password) { + options.auth = `${decodeURIComponent(username)}:${decodeURIComponent(password)}`; + } + return options; +} +/** + * Makes sure options is an url object + * return an object with default value and parsed options + * @param logger component logger + * @param options original options for the request + * @param [extraOptions] additional options for the request + */ +const getRequestInfo = (logger, options, extraOptions) => { + let pathname; + let origin; + let optionsParsed; + let invalidUrl = false; + if (typeof options === 'string') { + try { + const convertedOptions = stringUrlToHttpOptions(options); + optionsParsed = convertedOptions; + pathname = convertedOptions.pathname || '/'; + } + catch (e) { + invalidUrl = true; + logger.verbose('Unable to parse URL provided to HTTP request, using fallback to determine path. Original error:', e); + // for backward compatibility with how url.parse() behaved. + optionsParsed = { + path: options, + }; + pathname = optionsParsed.path || '/'; + } + origin = `${optionsParsed.protocol || 'http:'}//${optionsParsed.host}`; + if (extraOptions !== undefined) { + Object.assign(optionsParsed, extraOptions); + } + } + else if (options instanceof url.URL) { + optionsParsed = { + protocol: options.protocol, + hostname: typeof options.hostname === 'string' && options.hostname.startsWith('[') + ? options.hostname.slice(1, -1) + : options.hostname, + path: `${options.pathname || ''}${options.search || ''}`, + }; + if (options.port !== '') { + optionsParsed.port = Number(options.port); + } + if (options.username || options.password) { + optionsParsed.auth = `${options.username}:${options.password}`; + } + pathname = options.pathname; + origin = options.origin; + if (extraOptions !== undefined) { + Object.assign(optionsParsed, extraOptions); + } + } + else { + optionsParsed = Object.assign({ protocol: options.host ? 'http:' : undefined }, options); + const hostname = optionsParsed.host || + (optionsParsed.port != null + ? `${optionsParsed.hostname}${optionsParsed.port}` + : optionsParsed.hostname); + origin = `${optionsParsed.protocol || 'http:'}//${hostname}`; + pathname = options.pathname; + if (!pathname && optionsParsed.path) { + try { + const parsedUrl = new URL(optionsParsed.path, origin); + pathname = parsedUrl.pathname || '/'; + } + catch (e) { + pathname = '/'; + } + } + } + // some packages return method in lowercase.. + // ensure upperCase for consistency + const method = optionsParsed.method + ? optionsParsed.method.toUpperCase() + : 'GET'; + return { origin, pathname, method, optionsParsed, invalidUrl }; +}; +exports.getRequestInfo = getRequestInfo; +/** + * Makes sure options is of type string or object + * @param options for the request + */ +const isValidOptionsType = (options) => { + if (!options) { + return false; + } + const type = typeof options; + return type === 'string' || (type === 'object' && !Array.isArray(options)); +}; +exports.isValidOptionsType = isValidOptionsType; +const extractHostnameAndPort = (requestOptions) => { + var _a; + if (requestOptions.hostname && requestOptions.port) { + return { hostname: requestOptions.hostname, port: requestOptions.port }; + } + const matches = ((_a = requestOptions.host) === null || _a === void 0 ? void 0 : _a.match(/^([^:/ ]+)(:\d{1,5})?/)) || null; + const hostname = requestOptions.hostname || (matches === null ? 'localhost' : matches[1]); + let port = requestOptions.port; + if (!port) { + if (matches && matches[2]) { + // remove the leading ":". The extracted port would be something like ":8080" + port = matches[2].substring(1); + } + else { + port = requestOptions.protocol === 'https:' ? '443' : '80'; + } + } + return { hostname, port }; +}; +exports.extractHostnameAndPort = extractHostnameAndPort; +/** + * Returns outgoing request attributes scoped to the options passed to the request + * @param {ParsedRequestOptions} requestOptions the same options used to make the request + * @param {{ component: string, hostname: string, hookAttributes?: Attributes }} options used to pass data needed to create attributes + * @param {SemconvStability} semconvStability determines which semconv version to use + */ +const getOutgoingRequestAttributes = (requestOptions, options, semconvStability) => { + var _a, _b; + const hostname = options.hostname; + const port = options.port; + const method = (_a = requestOptions.method) !== null && _a !== void 0 ? _a : 'GET'; + const normalizedMethod = normalizeMethod(method); + const headers = requestOptions.headers || {}; + const userAgent = headers['user-agent']; + const urlFull = (0, exports.getAbsoluteUrl)(requestOptions, headers, `${options.component}:`); + const oldAttributes = { + [semantic_conventions_1.SEMATTRS_HTTP_URL]: urlFull, + [semantic_conventions_1.SEMATTRS_HTTP_METHOD]: method, + [semantic_conventions_1.SEMATTRS_HTTP_TARGET]: requestOptions.path || '/', + [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: hostname, + [semantic_conventions_1.SEMATTRS_HTTP_HOST]: (_b = headers.host) !== null && _b !== void 0 ? _b : `${hostname}:${port}`, + }; + const newAttributes = { + // Required attributes + [semantic_conventions_1.ATTR_HTTP_REQUEST_METHOD]: normalizedMethod, + [semantic_conventions_1.ATTR_SERVER_ADDRESS]: hostname, + [semantic_conventions_1.ATTR_SERVER_PORT]: Number(port), + [semantic_conventions_1.ATTR_URL_FULL]: urlFull, + // leaving out protocol version, it is not yet negotiated + // leaving out protocol name, it is only required when protocol version is set + // retries and redirects not supported + // Opt-in attributes left off for now + }; + // conditionally required if request method required case normalization + if (method !== normalizedMethod) { + newAttributes[semantic_conventions_1.ATTR_HTTP_REQUEST_METHOD_ORIGINAL] = method; + } + if (userAgent !== undefined) { + oldAttributes[semantic_conventions_1.SEMATTRS_HTTP_USER_AGENT] = userAgent; + } + switch (semconvStability) { + case 1 /* STABLE */: + return Object.assign(newAttributes, options.hookAttributes); + case 2 /* OLD */: + return Object.assign(oldAttributes, options.hookAttributes); + } + return Object.assign(oldAttributes, newAttributes, options.hookAttributes); +}; +exports.getOutgoingRequestAttributes = getOutgoingRequestAttributes; +/** + * Returns outgoing request Metric attributes scoped to the request data + * @param {Attributes} spanAttributes the span attributes + */ +const getOutgoingRequestMetricAttributes = (spanAttributes) => { + const metricAttributes = {}; + metricAttributes[semantic_conventions_1.SEMATTRS_HTTP_METHOD] = spanAttributes[semantic_conventions_1.SEMATTRS_HTTP_METHOD]; + metricAttributes[semantic_conventions_1.SEMATTRS_NET_PEER_NAME] = + spanAttributes[semantic_conventions_1.SEMATTRS_NET_PEER_NAME]; + //TODO: http.url attribute, it should substitute any parameters to avoid high cardinality. + return metricAttributes; +}; +exports.getOutgoingRequestMetricAttributes = getOutgoingRequestMetricAttributes; +/** + * Returns attributes related to the kind of HTTP protocol used + * @param {string} [kind] Kind of HTTP protocol used: "1.0", "1.1", "2", "SPDY" or "QUIC". + */ +const setAttributesFromHttpKind = (kind, attributes) => { + if (kind) { + attributes[semantic_conventions_1.SEMATTRS_HTTP_FLAVOR] = kind; + if (kind.toUpperCase() !== 'QUIC') { + attributes[semantic_conventions_1.SEMATTRS_NET_TRANSPORT] = semantic_conventions_1.NETTRANSPORTVALUES_IP_TCP; + } + else { + attributes[semantic_conventions_1.SEMATTRS_NET_TRANSPORT] = semantic_conventions_1.NETTRANSPORTVALUES_IP_UDP; + } + } +}; +exports.setAttributesFromHttpKind = setAttributesFromHttpKind; +/** + * Returns outgoing request attributes scoped to the response data + * @param {IncomingMessage} response the response object + * @param {SemconvStability} semconvStability determines which semconv version to use + */ +const getOutgoingRequestAttributesOnResponse = (response, semconvStability) => { + const { statusCode, statusMessage, httpVersion, socket } = response; + const oldAttributes = {}; + const stableAttributes = {}; + if (statusCode != null) { + stableAttributes[semantic_conventions_1.ATTR_HTTP_RESPONSE_STATUS_CODE] = statusCode; + } + if (socket) { + const { remoteAddress, remotePort } = socket; + oldAttributes[semantic_conventions_1.SEMATTRS_NET_PEER_IP] = remoteAddress; + oldAttributes[semantic_conventions_1.SEMATTRS_NET_PEER_PORT] = remotePort; + // Recommended + stableAttributes[semantic_conventions_1.ATTR_NETWORK_PEER_ADDRESS] = remoteAddress; + stableAttributes[semantic_conventions_1.ATTR_NETWORK_PEER_PORT] = remotePort; + stableAttributes[semantic_conventions_1.ATTR_NETWORK_PROTOCOL_VERSION] = response.httpVersion; + } + (0, exports.setResponseContentLengthAttribute)(response, oldAttributes); + if (statusCode) { + oldAttributes[semantic_conventions_1.SEMATTRS_HTTP_STATUS_CODE] = statusCode; + oldAttributes[AttributeNames_1.AttributeNames.HTTP_STATUS_TEXT] = (statusMessage || '').toUpperCase(); + } + (0, exports.setAttributesFromHttpKind)(httpVersion, oldAttributes); + switch (semconvStability) { + case 1 /* STABLE */: + return stableAttributes; + case 2 /* OLD */: + return oldAttributes; + } + return Object.assign(oldAttributes, stableAttributes); +}; +exports.getOutgoingRequestAttributesOnResponse = getOutgoingRequestAttributesOnResponse; +/** + * Returns outgoing request Metric attributes scoped to the response data + * @param {Attributes} spanAttributes the span attributes + */ +const getOutgoingRequestMetricAttributesOnResponse = (spanAttributes) => { + const metricAttributes = {}; + metricAttributes[semantic_conventions_1.SEMATTRS_NET_PEER_PORT] = + spanAttributes[semantic_conventions_1.SEMATTRS_NET_PEER_PORT]; + metricAttributes[semantic_conventions_1.SEMATTRS_HTTP_STATUS_CODE] = + spanAttributes[semantic_conventions_1.SEMATTRS_HTTP_STATUS_CODE]; + metricAttributes[semantic_conventions_1.SEMATTRS_HTTP_FLAVOR] = spanAttributes[semantic_conventions_1.SEMATTRS_HTTP_FLAVOR]; + return metricAttributes; +}; +exports.getOutgoingRequestMetricAttributesOnResponse = getOutgoingRequestMetricAttributesOnResponse; +function parseHostHeader(hostHeader, proto) { + const parts = hostHeader.split(':'); + // no semicolon implies ipv4 dotted syntax or host name without port + // x.x.x.x + // example.com + if (parts.length === 1) { + if (proto === 'http') { + return { host: parts[0], port: '80' }; + } + if (proto === 'https') { + return { host: parts[0], port: '443' }; + } + return { host: parts[0] }; + } + // single semicolon implies ipv4 dotted syntax or host name with port + // x.x.x.x:yyyy + // example.com:yyyy + if (parts.length === 2) { + return { + host: parts[0], + port: parts[1], + }; + } + // more than 2 parts implies ipv6 syntax with multiple colons + // [x:x:x:x:x:x:x:x] + // [x:x:x:x:x:x:x:x]:yyyy + if (parts[0].startsWith('[')) { + if (parts[parts.length - 1].endsWith(']')) { + if (proto === 'http') { + return { host: hostHeader, port: '80' }; + } + if (proto === 'https') { + return { host: hostHeader, port: '443' }; + } + } + else if (parts[parts.length - 2].endsWith(']')) { + return { + host: parts.slice(0, -1).join(':'), + port: parts[parts.length - 1], + }; + } + } + // if nothing above matches just return the host header + return { host: hostHeader }; +} +/** + * Get server.address and port according to http semconv 1.27 + * https://github.com/open-telemetry/semantic-conventions/blob/bf0a2c1134f206f034408b201dbec37960ed60ec/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes + */ +function getServerAddress(request, component) { + const forwardedHeader = request.headers['forwarded']; + if (forwardedHeader) { + for (const entry of parseForwardedHeader(forwardedHeader)) { + if (entry.host) { + return parseHostHeader(entry.host, entry.proto); + } + } + } + const xForwardedHost = request.headers['x-forwarded-host']; + if (typeof xForwardedHost === 'string') { + if (typeof request.headers['x-forwarded-proto'] === 'string') { + return parseHostHeader(xForwardedHost, request.headers['x-forwarded-proto']); + } + if (Array.isArray(request.headers['x-forwarded-proto'])) { + return parseHostHeader(xForwardedHost, request.headers['x-forwarded-proto'][0]); + } + return parseHostHeader(xForwardedHost); + } + else if (Array.isArray(xForwardedHost) && + typeof xForwardedHost[0] === 'string' && + xForwardedHost[0].length > 0) { + if (typeof request.headers['x-forwarded-proto'] === 'string') { + return parseHostHeader(xForwardedHost[0], request.headers['x-forwarded-proto']); + } + if (Array.isArray(request.headers['x-forwarded-proto'])) { + return parseHostHeader(xForwardedHost[0], request.headers['x-forwarded-proto'][0]); + } + return parseHostHeader(xForwardedHost[0]); + } + const host = request.headers['host']; + if (typeof host === 'string' && host.length > 0) { + return parseHostHeader(host, component); + } + return null; +} +/** + * Get server.address and port according to http semconv 1.27 + * https://github.com/open-telemetry/semantic-conventions/blob/bf0a2c1134f206f034408b201dbec37960ed60ec/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes + */ +function getRemoteClientAddress(request) { + const forwardedHeader = request.headers['forwarded']; + if (forwardedHeader) { + for (const entry of parseForwardedHeader(forwardedHeader)) { + if (entry.for) { + return entry.for; + } + } + } + const xForwardedFor = request.headers['x-forwarded-for']; + if (typeof xForwardedFor === 'string') { + return xForwardedFor; + } + else if (Array.isArray(xForwardedFor)) { + return xForwardedFor[0]; + } + const remote = request.socket.remoteAddress; + if (remote) { + return remote; + } + return null; +} +exports.getRemoteClientAddress = getRemoteClientAddress; +function getInfoFromIncomingMessage(component, request, logger) { + var _a, _b; + try { + if (request.headers.host) { + return new URL((_a = request.url) !== null && _a !== void 0 ? _a : '/', `${component}://${request.headers.host}`); + } + else { + const unsafeParsedUrl = new URL((_b = request.url) !== null && _b !== void 0 ? _b : '/', + // using localhost as a workaround to still use the URL constructor for parsing + `${component}://localhost`); + // since we use localhost as a workaround, ensure we hide the rest of the properties to avoid + // our workaround leaking though. + return { + pathname: unsafeParsedUrl.pathname, + search: unsafeParsedUrl.search, + toString: function () { + // we cannot use the result of unsafeParsedUrl.toString as it's potentially wrong. + return unsafeParsedUrl.pathname + unsafeParsedUrl.search; + }, + }; + } + } + catch (e) { + // something is wrong, use undefined - this *should* never happen, logging + // for troubleshooting in case it does happen. + logger.verbose('Unable to get URL from request', e); + return {}; + } +} +/** + * Returns incoming request attributes scoped to the request data + * @param {IncomingMessage} request the request object + * @param {{ component: string, serverName?: string, hookAttributes?: Attributes }} options used to pass data needed to create attributes + * @param {SemconvStability} semconvStability determines which semconv version to use + */ +const getIncomingRequestAttributes = (request, options, logger) => { + const headers = request.headers; + const userAgent = headers['user-agent']; + const ips = headers['x-forwarded-for']; + const httpVersion = request.httpVersion; + const host = headers.host; + const hostname = (host === null || host === void 0 ? void 0 : host.replace(/^(.*)(:[0-9]{1,5})/, '$1')) || 'localhost'; + const method = request.method; + const normalizedMethod = normalizeMethod(method); + const serverAddress = getServerAddress(request, options.component); + const serverName = options.serverName; + const remoteClientAddress = getRemoteClientAddress(request); + const newAttributes = { + [semantic_conventions_1.ATTR_HTTP_REQUEST_METHOD]: normalizedMethod, + [semantic_conventions_1.ATTR_URL_SCHEME]: options.component, + [semantic_conventions_1.ATTR_SERVER_ADDRESS]: serverAddress === null || serverAddress === void 0 ? void 0 : serverAddress.host, + [semantic_conventions_1.ATTR_NETWORK_PEER_ADDRESS]: request.socket.remoteAddress, + [semantic_conventions_1.ATTR_NETWORK_PEER_PORT]: request.socket.remotePort, + [semantic_conventions_1.ATTR_NETWORK_PROTOCOL_VERSION]: request.httpVersion, + [semantic_conventions_1.ATTR_USER_AGENT_ORIGINAL]: userAgent, + }; + const parsedUrl = getInfoFromIncomingMessage(options.component, request, logger); + if ((parsedUrl === null || parsedUrl === void 0 ? void 0 : parsedUrl.pathname) != null) { + newAttributes[semantic_conventions_1.ATTR_URL_PATH] = parsedUrl.pathname; + } + if (remoteClientAddress != null) { + newAttributes[semantic_conventions_1.ATTR_CLIENT_ADDRESS] = remoteClientAddress; + } + if ((serverAddress === null || serverAddress === void 0 ? void 0 : serverAddress.port) != null) { + newAttributes[semantic_conventions_1.ATTR_SERVER_PORT] = Number(serverAddress.port); + } + // conditionally required if request method required case normalization + if (method !== normalizedMethod) { + newAttributes[semantic_conventions_1.ATTR_HTTP_REQUEST_METHOD_ORIGINAL] = method; + } + const oldAttributes = { + [semantic_conventions_1.SEMATTRS_HTTP_URL]: parsedUrl.toString(), + [semantic_conventions_1.SEMATTRS_HTTP_HOST]: host, + [semantic_conventions_1.SEMATTRS_NET_HOST_NAME]: hostname, + [semantic_conventions_1.SEMATTRS_HTTP_METHOD]: method, + [semantic_conventions_1.SEMATTRS_HTTP_SCHEME]: options.component, + }; + if (typeof ips === 'string') { + oldAttributes[semantic_conventions_1.SEMATTRS_HTTP_CLIENT_IP] = ips.split(',')[0]; + } + if (typeof serverName === 'string') { + oldAttributes[semantic_conventions_1.SEMATTRS_HTTP_SERVER_NAME] = serverName; + } + if (parsedUrl === null || parsedUrl === void 0 ? void 0 : parsedUrl.pathname) { + oldAttributes[semantic_conventions_1.SEMATTRS_HTTP_TARGET] = + (parsedUrl === null || parsedUrl === void 0 ? void 0 : parsedUrl.pathname) + (parsedUrl === null || parsedUrl === void 0 ? void 0 : parsedUrl.search) || '/'; + } + if (userAgent !== undefined) { + oldAttributes[semantic_conventions_1.SEMATTRS_HTTP_USER_AGENT] = userAgent; + } + (0, exports.setRequestContentLengthAttribute)(request, oldAttributes); + (0, exports.setAttributesFromHttpKind)(httpVersion, oldAttributes); + switch (options.semconvStability) { + case 1 /* STABLE */: + return Object.assign(newAttributes, options.hookAttributes); + case 2 /* OLD */: + return Object.assign(oldAttributes, options.hookAttributes); + } + return Object.assign(oldAttributes, newAttributes, options.hookAttributes); +}; +exports.getIncomingRequestAttributes = getIncomingRequestAttributes; +/** + * Returns incoming request Metric attributes scoped to the request data + * @param {Attributes} spanAttributes the span attributes + * @param {{ component: string }} options used to pass data needed to create attributes + */ +const getIncomingRequestMetricAttributes = (spanAttributes) => { + const metricAttributes = {}; + metricAttributes[semantic_conventions_1.SEMATTRS_HTTP_SCHEME] = spanAttributes[semantic_conventions_1.SEMATTRS_HTTP_SCHEME]; + metricAttributes[semantic_conventions_1.SEMATTRS_HTTP_METHOD] = spanAttributes[semantic_conventions_1.SEMATTRS_HTTP_METHOD]; + metricAttributes[semantic_conventions_1.SEMATTRS_NET_HOST_NAME] = + spanAttributes[semantic_conventions_1.SEMATTRS_NET_HOST_NAME]; + metricAttributes[semantic_conventions_1.SEMATTRS_HTTP_FLAVOR] = spanAttributes[semantic_conventions_1.SEMATTRS_HTTP_FLAVOR]; + //TODO: http.target attribute, it should substitute any parameters to avoid high cardinality. + return metricAttributes; +}; +exports.getIncomingRequestMetricAttributes = getIncomingRequestMetricAttributes; +/** + * Returns incoming request attributes scoped to the response data + * @param {(ServerResponse & { socket: Socket; })} response the response object + */ +const getIncomingRequestAttributesOnResponse = (request, response, semconvStability) => { + // take socket from the request, + // since it may be detached from the response object in keep-alive mode + const { socket } = request; + const { statusCode, statusMessage } = response; + const newAttributes = { + [semantic_conventions_1.ATTR_HTTP_RESPONSE_STATUS_CODE]: statusCode, + }; + const rpcMetadata = (0, core_1.getRPCMetadata)(api_1.context.active()); + const oldAttributes = {}; + if (socket) { + const { localAddress, localPort, remoteAddress, remotePort } = socket; + oldAttributes[semantic_conventions_1.SEMATTRS_NET_HOST_IP] = localAddress; + oldAttributes[semantic_conventions_1.SEMATTRS_NET_HOST_PORT] = localPort; + oldAttributes[semantic_conventions_1.SEMATTRS_NET_PEER_IP] = remoteAddress; + oldAttributes[semantic_conventions_1.SEMATTRS_NET_PEER_PORT] = remotePort; + } + oldAttributes[semantic_conventions_1.SEMATTRS_HTTP_STATUS_CODE] = statusCode; + oldAttributes[AttributeNames_1.AttributeNames.HTTP_STATUS_TEXT] = (statusMessage || '').toUpperCase(); + if ((rpcMetadata === null || rpcMetadata === void 0 ? void 0 : rpcMetadata.type) === core_1.RPCType.HTTP && rpcMetadata.route !== undefined) { + oldAttributes[semantic_conventions_1.SEMATTRS_HTTP_ROUTE] = rpcMetadata.route; + newAttributes[semantic_conventions_1.ATTR_HTTP_ROUTE] = rpcMetadata.route; + } + switch (semconvStability) { + case 1 /* STABLE */: + return newAttributes; + case 2 /* OLD */: + return oldAttributes; + } + return Object.assign(oldAttributes, newAttributes); +}; +exports.getIncomingRequestAttributesOnResponse = getIncomingRequestAttributesOnResponse; +/** + * Returns incoming request Metric attributes scoped to the request data + * @param {Attributes} spanAttributes the span attributes + */ +const getIncomingRequestMetricAttributesOnResponse = (spanAttributes) => { + const metricAttributes = {}; + metricAttributes[semantic_conventions_1.SEMATTRS_HTTP_STATUS_CODE] = + spanAttributes[semantic_conventions_1.SEMATTRS_HTTP_STATUS_CODE]; + metricAttributes[semantic_conventions_1.SEMATTRS_NET_HOST_PORT] = + spanAttributes[semantic_conventions_1.SEMATTRS_NET_HOST_PORT]; + if (spanAttributes[semantic_conventions_1.SEMATTRS_HTTP_ROUTE] !== undefined) { + metricAttributes[semantic_conventions_1.SEMATTRS_HTTP_ROUTE] = spanAttributes[semantic_conventions_1.SEMATTRS_HTTP_ROUTE]; + } + return metricAttributes; +}; +exports.getIncomingRequestMetricAttributesOnResponse = getIncomingRequestMetricAttributesOnResponse; +const getIncomingStableRequestMetricAttributesOnResponse = (spanAttributes) => { + const metricAttributes = {}; + if (spanAttributes[semantic_conventions_1.ATTR_HTTP_ROUTE] !== undefined) { + metricAttributes[semantic_conventions_1.ATTR_HTTP_ROUTE] = spanAttributes[semantic_conventions_1.SEMATTRS_HTTP_ROUTE]; + } + // required if and only if one was sent, same as span requirement + if (spanAttributes[semantic_conventions_1.ATTR_HTTP_RESPONSE_STATUS_CODE]) { + metricAttributes[semantic_conventions_1.ATTR_HTTP_RESPONSE_STATUS_CODE] = + spanAttributes[semantic_conventions_1.ATTR_HTTP_RESPONSE_STATUS_CODE]; + } + return metricAttributes; +}; +exports.getIncomingStableRequestMetricAttributesOnResponse = getIncomingStableRequestMetricAttributesOnResponse; +function headerCapture(type, headers) { + const normalizedHeaders = new Map(); + for (let i = 0, len = headers.length; i < len; i++) { + const capturedHeader = headers[i].toLowerCase(); + normalizedHeaders.set(capturedHeader, capturedHeader.replace(/-/g, '_')); + } + return (span, getHeader) => { + for (const capturedHeader of normalizedHeaders.keys()) { + const value = getHeader(capturedHeader); + if (value === undefined) { + continue; + } + const normalizedHeader = normalizedHeaders.get(capturedHeader); + const key = `http.${type}.header.${normalizedHeader}`; + if (typeof value === 'string') { + span.setAttribute(key, [value]); + } + else if (Array.isArray(value)) { + span.setAttribute(key, value); + } + else { + span.setAttribute(key, [value]); + } + } + }; +} +exports.headerCapture = headerCapture; +const KNOWN_METHODS = new Set([ + // methods from https://www.rfc-editor.org/rfc/rfc9110.html#name-methods + 'GET', + 'HEAD', + 'POST', + 'PUT', + 'DELETE', + 'CONNECT', + 'OPTIONS', + 'TRACE', + // PATCH from https://www.rfc-editor.org/rfc/rfc5789.html + 'PATCH', +]); +function normalizeMethod(method) { + if (method == null) { + return 'GET'; + } + const upper = method.toUpperCase(); + if (KNOWN_METHODS.has(upper)) { + return upper; + } + return '_OTHER'; +} +function parseForwardedHeader(header) { + try { + return forwardedParse(header); + } + catch (_a) { + return []; + } +} +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 14963: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.VERSION = '0.57.1'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 77319: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ExportResultCode = void 0; +var ExportResultCode; +(function (ExportResultCode) { + ExportResultCode[ExportResultCode["SUCCESS"] = 0] = "SUCCESS"; + ExportResultCode[ExportResultCode["FAILED"] = 1] = "FAILED"; +})(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {})); +//# sourceMappingURL=ExportResult.js.map + +/***/ }), + +/***/ 63661: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = void 0; +exports.BAGGAGE_KEY_PAIR_SEPARATOR = '='; +exports.BAGGAGE_PROPERTIES_SEPARATOR = ';'; +exports.BAGGAGE_ITEMS_SEPARATOR = ','; +// Name of the http header used to propagate the baggage +exports.BAGGAGE_HEADER = 'baggage'; +// Maximum number of name-value pairs allowed by w3c spec +exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; +// Maximum number of bytes per a single name-value pair allowed by w3c spec +exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; +// Maximum total length of all name-value pairs allowed by w3c spec +exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; +//# sourceMappingURL=constants.js.map + +/***/ }), + +/***/ 74208: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.W3CBaggagePropagator = void 0; +const api_1 = __nccwpck_require__(65163); +const suppress_tracing_1 = __nccwpck_require__(94367); +const constants_1 = __nccwpck_require__(63661); +const utils_1 = __nccwpck_require__(407); +/** + * Propagates {@link Baggage} through Context format propagation. + * + * Based on the Baggage specification: + * https://w3c.github.io/baggage/ + */ +class W3CBaggagePropagator { + inject(context, carrier, setter) { + const baggage = api_1.propagation.getBaggage(context); + if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context)) + return; + const keyPairs = (0, utils_1.getKeyPairs)(baggage) + .filter((pair) => { + return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; + }) + .slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); + const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); + if (headerValue.length > 0) { + setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); + } + } + extract(context, carrier, getter) { + const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); + const baggageString = Array.isArray(headerValue) + ? headerValue.join(constants_1.BAGGAGE_ITEMS_SEPARATOR) + : headerValue; + if (!baggageString) + return context; + const baggage = {}; + if (baggageString.length === 0) { + return context; + } + const pairs = baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR); + pairs.forEach(entry => { + const keyPair = (0, utils_1.parsePairKeyValue)(entry); + if (keyPair) { + const baggageEntry = { value: keyPair.value }; + if (keyPair.metadata) { + baggageEntry.metadata = keyPair.metadata; + } + baggage[keyPair.key] = baggageEntry; + } + }); + if (Object.entries(baggage).length === 0) { + return context; + } + return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage)); + } + fields() { + return [constants_1.BAGGAGE_HEADER]; + } +} +exports.W3CBaggagePropagator = W3CBaggagePropagator; +//# sourceMappingURL=W3CBaggagePropagator.js.map + +/***/ }), + +/***/ 407: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const api_1 = __nccwpck_require__(65163); +const constants_1 = __nccwpck_require__(63661); +function serializeKeyPairs(keyPairs) { + return keyPairs.reduce((hValue, current) => { + const value = `${hValue}${hValue !== '' ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ''}${current}`; + return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value; + }, ''); +} +exports.serializeKeyPairs = serializeKeyPairs; +function getKeyPairs(baggage) { + return baggage.getAllEntries().map(([key, value]) => { + let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`; + // include opaque metadata if provided + // NOTE: we intentionally don't URI-encode the metadata - that responsibility falls on the metadata implementation + if (value.metadata !== undefined) { + entry += constants_1.BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString(); + } + return entry; + }); +} +exports.getKeyPairs = getKeyPairs; +function parsePairKeyValue(entry) { + const valueProps = entry.split(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); + if (valueProps.length <= 0) + return; + const keyPairPart = valueProps.shift(); + if (!keyPairPart) + return; + const separatorIndex = keyPairPart.indexOf(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); + if (separatorIndex <= 0) + return; + const key = decodeURIComponent(keyPairPart.substring(0, separatorIndex).trim()); + const value = decodeURIComponent(keyPairPart.substring(separatorIndex + 1).trim()); + let metadata; + if (valueProps.length > 0) { + metadata = (0, api_1.baggageEntryMetadataFromString)(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR)); + } + return { key, value, metadata }; +} +exports.parsePairKeyValue = parsePairKeyValue; +/** + * Parse a string serialized in the baggage HTTP Format (without metadata): + * https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT.md + */ +function parseKeyPairsIntoRecord(value) { + if (typeof value !== 'string' || value.length === 0) + return {}; + return value + .split(constants_1.BAGGAGE_ITEMS_SEPARATOR) + .map(entry => { + return parsePairKeyValue(entry); + }) + .filter(keyPair => keyPair !== undefined && keyPair.value.length > 0) + .reduce((headers, keyPair) => { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + headers[keyPair.key] = keyPair.value; + return headers; + }, {}); +} +exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 83539: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AnchoredClock = void 0; +/** + * A utility for returning wall times anchored to a given point in time. Wall time measurements will + * not be taken from the system, but instead are computed by adding a monotonic clock time + * to the anchor point. + * + * This is needed because the system time can change and result in unexpected situations like + * spans ending before they are started. Creating an anchored clock for each local root span + * ensures that span timings and durations are accurate while preventing span times from drifting + * too far from the system clock. + * + * Only creating an anchored clock once per local trace ensures span times are correct relative + * to each other. For example, a child span will never have a start time before its parent even + * if the system clock is corrected during the local trace. + * + * Heavily inspired by the OTel Java anchored clock + * https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/AnchoredClock.java + */ +class AnchoredClock { + /** + * Create a new AnchoredClock anchored to the current time returned by systemClock. + * + * @param systemClock should be a clock that returns the number of milliseconds since January 1 1970 such as Date + * @param monotonicClock should be a clock that counts milliseconds monotonically such as window.performance or perf_hooks.performance + */ + constructor(systemClock, monotonicClock) { + this._monotonicClock = monotonicClock; + this._epochMillis = systemClock.now(); + this._performanceMillis = monotonicClock.now(); + } + /** + * Returns the current time by adding the number of milliseconds since the + * AnchoredClock was created to the creation epoch time + */ + now() { + const delta = this._monotonicClock.now() - this._performanceMillis; + return this._epochMillis + delta; + } +} +exports.AnchoredClock = AnchoredClock; +//# sourceMappingURL=anchored-clock.js.map + +/***/ }), + +/***/ 65038: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = void 0; +const api_1 = __nccwpck_require__(65163); +function sanitizeAttributes(attributes) { + const out = {}; + if (typeof attributes !== 'object' || attributes == null) { + return out; + } + for (const [key, val] of Object.entries(attributes)) { + if (!isAttributeKey(key)) { + api_1.diag.warn(`Invalid attribute key: ${key}`); + continue; + } + if (!isAttributeValue(val)) { + api_1.diag.warn(`Invalid attribute value set for key: ${key}`); + continue; + } + if (Array.isArray(val)) { + out[key] = val.slice(); + } + else { + out[key] = val; + } + } + return out; +} +exports.sanitizeAttributes = sanitizeAttributes; +function isAttributeKey(key) { + return typeof key === 'string' && key.length > 0; +} +exports.isAttributeKey = isAttributeKey; +function isAttributeValue(val) { + if (val == null) { + return true; + } + if (Array.isArray(val)) { + return isHomogeneousAttributeValueArray(val); + } + return isValidPrimitiveAttributeValue(val); +} +exports.isAttributeValue = isAttributeValue; +function isHomogeneousAttributeValueArray(arr) { + let type; + for (const element of arr) { + // null/undefined elements are allowed + if (element == null) + continue; + if (!type) { + if (isValidPrimitiveAttributeValue(element)) { + type = typeof element; + continue; + } + // encountered an invalid primitive + return false; + } + if (typeof element === type) { + continue; + } + return false; + } + return true; +} +function isValidPrimitiveAttributeValue(val) { + switch (typeof val) { + case 'number': + case 'boolean': + case 'string': + return true; + } + return false; +} +//# sourceMappingURL=attributes.js.map + +/***/ }), + +/***/ 22961: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.globalErrorHandler = exports.setGlobalErrorHandler = void 0; +const logging_error_handler_1 = __nccwpck_require__(35014); +/** The global error handler delegate */ +let delegateHandler = (0, logging_error_handler_1.loggingErrorHandler)(); +/** + * Set the global error handler + * @param {ErrorHandler} handler + */ +function setGlobalErrorHandler(handler) { + delegateHandler = handler; +} +exports.setGlobalErrorHandler = setGlobalErrorHandler; +/** + * Return the global error handler + * @param {Exception} ex + */ +function globalErrorHandler(ex) { + try { + delegateHandler(ex); + } + catch (_a) { } // eslint-disable-line no-empty +} +exports.globalErrorHandler = globalErrorHandler; +//# sourceMappingURL=global-error-handler.js.map + +/***/ }), + +/***/ 2859: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.hexToBinary = void 0; +function intValue(charCode) { + // 0-9 + if (charCode >= 48 && charCode <= 57) { + return charCode - 48; + } + // a-f + if (charCode >= 97 && charCode <= 102) { + return charCode - 87; + } + // A-F + return charCode - 55; +} +function hexToBinary(hexStr) { + const buf = new Uint8Array(hexStr.length / 2); + let offset = 0; + for (let i = 0; i < hexStr.length; i += 2) { + const hi = intValue(hexStr.charCodeAt(i)); + const lo = intValue(hexStr.charCodeAt(i + 1)); + buf[offset++] = (hi << 4) | lo; + } + return buf; +} +exports.hexToBinary = hexToBinary; +//# sourceMappingURL=hex-to-binary.js.map + +/***/ }), + +/***/ 35014: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.loggingErrorHandler = void 0; +const api_1 = __nccwpck_require__(65163); +/** + * Returns a function that logs an error using the provided logger, or a + * console logger if one was not provided. + */ +function loggingErrorHandler() { + return (ex) => { + api_1.diag.error(stringifyException(ex)); + }; +} +exports.loggingErrorHandler = loggingErrorHandler; +/** + * Converts an exception into a string representation + * @param {Exception} ex + */ +function stringifyException(ex) { + if (typeof ex === 'string') { + return ex; + } + else { + return JSON.stringify(flattenException(ex)); + } +} +/** + * Flattens an exception into key-value pairs by traversing the prototype chain + * and coercing values to strings. Duplicate properties will not be overwritten; + * the first insert wins. + */ +function flattenException(ex) { + const result = {}; + let current = ex; + while (current !== null) { + Object.getOwnPropertyNames(current).forEach(propertyName => { + if (result[propertyName]) + return; + const value = current[propertyName]; + if (value) { + result[propertyName] = String(value); + } + }); + current = Object.getPrototypeOf(current); + } + return result; +} +//# sourceMappingURL=logging-error-handler.js.map + +/***/ }), + +/***/ 56567: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.addHrTimes = exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = exports.getTimeOrigin = exports.millisToHrTime = void 0; +const platform_1 = __nccwpck_require__(49955); +const NANOSECOND_DIGITS = 9; +const NANOSECOND_DIGITS_IN_MILLIS = 6; +const MILLISECONDS_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS); +const SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); +/** + * Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]). + * @param epochMillis + */ +function millisToHrTime(epochMillis) { + const epochSeconds = epochMillis / 1000; + // Decimals only. + const seconds = Math.trunc(epochSeconds); + // Round sub-nanosecond accuracy to nanosecond. + const nanos = Math.round((epochMillis % 1000) * MILLISECONDS_TO_NANOSECONDS); + return [seconds, nanos]; +} +exports.millisToHrTime = millisToHrTime; +function getTimeOrigin() { + let timeOrigin = platform_1.otperformance.timeOrigin; + if (typeof timeOrigin !== 'number') { + const perf = platform_1.otperformance; + timeOrigin = perf.timing && perf.timing.fetchStart; + } + return timeOrigin; +} +exports.getTimeOrigin = getTimeOrigin; +/** + * Returns an hrtime calculated via performance component. + * @param performanceNow + */ +function hrTime(performanceNow) { + const timeOrigin = millisToHrTime(getTimeOrigin()); + const now = millisToHrTime(typeof performanceNow === 'number' ? performanceNow : platform_1.otperformance.now()); + return addHrTimes(timeOrigin, now); +} +exports.hrTime = hrTime; +/** + * + * Converts a TimeInput to an HrTime, defaults to _hrtime(). + * @param time + */ +function timeInputToHrTime(time) { + // process.hrtime + if (isTimeInputHrTime(time)) { + return time; + } + else if (typeof time === 'number') { + // Must be a performance.now() if it's smaller than process start time. + if (time < getTimeOrigin()) { + return hrTime(time); + } + else { + // epoch milliseconds or performance.timeOrigin + return millisToHrTime(time); + } + } + else if (time instanceof Date) { + return millisToHrTime(time.getTime()); + } + else { + throw TypeError('Invalid input type'); + } +} +exports.timeInputToHrTime = timeInputToHrTime; +/** + * Returns a duration of two hrTime. + * @param startTime + * @param endTime + */ +function hrTimeDuration(startTime, endTime) { + let seconds = endTime[0] - startTime[0]; + let nanos = endTime[1] - startTime[1]; + // overflow + if (nanos < 0) { + seconds -= 1; + // negate + nanos += SECOND_TO_NANOSECONDS; + } + return [seconds, nanos]; +} +exports.hrTimeDuration = hrTimeDuration; +/** + * Convert hrTime to timestamp, for example "2019-05-14T17:00:00.000123456Z" + * @param time + */ +function hrTimeToTimeStamp(time) { + const precision = NANOSECOND_DIGITS; + const tmp = `${'0'.repeat(precision)}${time[1]}Z`; + const nanoString = tmp.substring(tmp.length - precision - 1); + const date = new Date(time[0] * 1000).toISOString(); + return date.replace('000Z', nanoString); +} +exports.hrTimeToTimeStamp = hrTimeToTimeStamp; +/** + * Convert hrTime to nanoseconds. + * @param time + */ +function hrTimeToNanoseconds(time) { + return time[0] * SECOND_TO_NANOSECONDS + time[1]; +} +exports.hrTimeToNanoseconds = hrTimeToNanoseconds; +/** + * Convert hrTime to milliseconds. + * @param time + */ +function hrTimeToMilliseconds(time) { + return time[0] * 1e3 + time[1] / 1e6; +} +exports.hrTimeToMilliseconds = hrTimeToMilliseconds; +/** + * Convert hrTime to microseconds. + * @param time + */ +function hrTimeToMicroseconds(time) { + return time[0] * 1e6 + time[1] / 1e3; +} +exports.hrTimeToMicroseconds = hrTimeToMicroseconds; +/** + * check if time is HrTime + * @param value + */ +function isTimeInputHrTime(value) { + return (Array.isArray(value) && + value.length === 2 && + typeof value[0] === 'number' && + typeof value[1] === 'number'); +} +exports.isTimeInputHrTime = isTimeInputHrTime; +/** + * check if input value is a correct types.TimeInput + * @param value + */ +function isTimeInput(value) { + return (isTimeInputHrTime(value) || + typeof value === 'number' || + value instanceof Date); +} +exports.isTimeInput = isTimeInput; +/** + * Given 2 HrTime formatted times, return their sum as an HrTime. + */ +function addHrTimes(time1, time2) { + const out = [time1[0] + time2[0], time1[1] + time2[1]]; + // Nanoseconds + if (out[1] >= SECOND_TO_NANOSECONDS) { + out[1] -= SECOND_TO_NANOSECONDS; + out[0] += 1; + } + return out; +} +exports.addHrTimes = addHrTimes; +//# sourceMappingURL=time.js.map + +/***/ }), + +/***/ 37890: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.unrefTimer = exports.otperformance = exports.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = exports.baggageUtils = exports.ExportResultCode = exports.hexToBinary = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.isAttributeKey = exports.AnchoredClock = exports.W3CBaggagePropagator = void 0; +exports.internal = exports.VERSION = exports.BindOnceFuture = exports.isWrapped = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.TracesSamplerValues = exports.merge = exports.parseEnvironment = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ENVIRONMENT = void 0; +var W3CBaggagePropagator_1 = __nccwpck_require__(74208); +Object.defineProperty(exports, "W3CBaggagePropagator", ({ enumerable: true, get: function () { return W3CBaggagePropagator_1.W3CBaggagePropagator; } })); +var anchored_clock_1 = __nccwpck_require__(83539); +Object.defineProperty(exports, "AnchoredClock", ({ enumerable: true, get: function () { return anchored_clock_1.AnchoredClock; } })); +var attributes_1 = __nccwpck_require__(65038); +Object.defineProperty(exports, "isAttributeKey", ({ enumerable: true, get: function () { return attributes_1.isAttributeKey; } })); +Object.defineProperty(exports, "isAttributeValue", ({ enumerable: true, get: function () { return attributes_1.isAttributeValue; } })); +Object.defineProperty(exports, "sanitizeAttributes", ({ enumerable: true, get: function () { return attributes_1.sanitizeAttributes; } })); +var global_error_handler_1 = __nccwpck_require__(22961); +Object.defineProperty(exports, "globalErrorHandler", ({ enumerable: true, get: function () { return global_error_handler_1.globalErrorHandler; } })); +Object.defineProperty(exports, "setGlobalErrorHandler", ({ enumerable: true, get: function () { return global_error_handler_1.setGlobalErrorHandler; } })); +var logging_error_handler_1 = __nccwpck_require__(35014); +Object.defineProperty(exports, "loggingErrorHandler", ({ enumerable: true, get: function () { return logging_error_handler_1.loggingErrorHandler; } })); +var time_1 = __nccwpck_require__(56567); +Object.defineProperty(exports, "addHrTimes", ({ enumerable: true, get: function () { return time_1.addHrTimes; } })); +Object.defineProperty(exports, "getTimeOrigin", ({ enumerable: true, get: function () { return time_1.getTimeOrigin; } })); +Object.defineProperty(exports, "hrTime", ({ enumerable: true, get: function () { return time_1.hrTime; } })); +Object.defineProperty(exports, "hrTimeDuration", ({ enumerable: true, get: function () { return time_1.hrTimeDuration; } })); +Object.defineProperty(exports, "hrTimeToMicroseconds", ({ enumerable: true, get: function () { return time_1.hrTimeToMicroseconds; } })); +Object.defineProperty(exports, "hrTimeToMilliseconds", ({ enumerable: true, get: function () { return time_1.hrTimeToMilliseconds; } })); +Object.defineProperty(exports, "hrTimeToNanoseconds", ({ enumerable: true, get: function () { return time_1.hrTimeToNanoseconds; } })); +Object.defineProperty(exports, "hrTimeToTimeStamp", ({ enumerable: true, get: function () { return time_1.hrTimeToTimeStamp; } })); +Object.defineProperty(exports, "isTimeInput", ({ enumerable: true, get: function () { return time_1.isTimeInput; } })); +Object.defineProperty(exports, "isTimeInputHrTime", ({ enumerable: true, get: function () { return time_1.isTimeInputHrTime; } })); +Object.defineProperty(exports, "millisToHrTime", ({ enumerable: true, get: function () { return time_1.millisToHrTime; } })); +Object.defineProperty(exports, "timeInputToHrTime", ({ enumerable: true, get: function () { return time_1.timeInputToHrTime; } })); +var hex_to_binary_1 = __nccwpck_require__(2859); +Object.defineProperty(exports, "hexToBinary", ({ enumerable: true, get: function () { return hex_to_binary_1.hexToBinary; } })); +var ExportResult_1 = __nccwpck_require__(77319); +Object.defineProperty(exports, "ExportResultCode", ({ enumerable: true, get: function () { return ExportResult_1.ExportResultCode; } })); +const utils_1 = __nccwpck_require__(407); +exports.baggageUtils = { + getKeyPairs: utils_1.getKeyPairs, + serializeKeyPairs: utils_1.serializeKeyPairs, + parseKeyPairsIntoRecord: utils_1.parseKeyPairsIntoRecord, + parsePairKeyValue: utils_1.parsePairKeyValue, +}; +var platform_1 = __nccwpck_require__(49955); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return platform_1.RandomIdGenerator; } })); +Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return platform_1.SDK_INFO; } })); +Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return platform_1._globalThis; } })); +Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return platform_1.getEnv; } })); +Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return platform_1.getEnvWithoutDefaults; } })); +Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return platform_1.hexToBase64; } })); +Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return platform_1.otperformance; } })); +Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return platform_1.unrefTimer; } })); +var composite_1 = __nccwpck_require__(25512); +Object.defineProperty(exports, "CompositePropagator", ({ enumerable: true, get: function () { return composite_1.CompositePropagator; } })); +var W3CTraceContextPropagator_1 = __nccwpck_require__(3449); +Object.defineProperty(exports, "TRACE_PARENT_HEADER", ({ enumerable: true, get: function () { return W3CTraceContextPropagator_1.TRACE_PARENT_HEADER; } })); +Object.defineProperty(exports, "TRACE_STATE_HEADER", ({ enumerable: true, get: function () { return W3CTraceContextPropagator_1.TRACE_STATE_HEADER; } })); +Object.defineProperty(exports, "W3CTraceContextPropagator", ({ enumerable: true, get: function () { return W3CTraceContextPropagator_1.W3CTraceContextPropagator; } })); +Object.defineProperty(exports, "parseTraceParent", ({ enumerable: true, get: function () { return W3CTraceContextPropagator_1.parseTraceParent; } })); +var rpc_metadata_1 = __nccwpck_require__(79681); +Object.defineProperty(exports, "RPCType", ({ enumerable: true, get: function () { return rpc_metadata_1.RPCType; } })); +Object.defineProperty(exports, "deleteRPCMetadata", ({ enumerable: true, get: function () { return rpc_metadata_1.deleteRPCMetadata; } })); +Object.defineProperty(exports, "getRPCMetadata", ({ enumerable: true, get: function () { return rpc_metadata_1.getRPCMetadata; } })); +Object.defineProperty(exports, "setRPCMetadata", ({ enumerable: true, get: function () { return rpc_metadata_1.setRPCMetadata; } })); +var AlwaysOffSampler_1 = __nccwpck_require__(49184); +Object.defineProperty(exports, "AlwaysOffSampler", ({ enumerable: true, get: function () { return AlwaysOffSampler_1.AlwaysOffSampler; } })); +var AlwaysOnSampler_1 = __nccwpck_require__(48801); +Object.defineProperty(exports, "AlwaysOnSampler", ({ enumerable: true, get: function () { return AlwaysOnSampler_1.AlwaysOnSampler; } })); +var ParentBasedSampler_1 = __nccwpck_require__(44874); +Object.defineProperty(exports, "ParentBasedSampler", ({ enumerable: true, get: function () { return ParentBasedSampler_1.ParentBasedSampler; } })); +var TraceIdRatioBasedSampler_1 = __nccwpck_require__(76417); +Object.defineProperty(exports, "TraceIdRatioBasedSampler", ({ enumerable: true, get: function () { return TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler; } })); +var suppress_tracing_1 = __nccwpck_require__(94367); +Object.defineProperty(exports, "isTracingSuppressed", ({ enumerable: true, get: function () { return suppress_tracing_1.isTracingSuppressed; } })); +Object.defineProperty(exports, "suppressTracing", ({ enumerable: true, get: function () { return suppress_tracing_1.suppressTracing; } })); +Object.defineProperty(exports, "unsuppressTracing", ({ enumerable: true, get: function () { return suppress_tracing_1.unsuppressTracing; } })); +var TraceState_1 = __nccwpck_require__(19666); +Object.defineProperty(exports, "TraceState", ({ enumerable: true, get: function () { return TraceState_1.TraceState; } })); +var environment_1 = __nccwpck_require__(40789); +Object.defineProperty(exports, "DEFAULT_ATTRIBUTE_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ATTRIBUTE_COUNT_LIMIT; } })); +Object.defineProperty(exports, "DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; } })); +Object.defineProperty(exports, "DEFAULT_ENVIRONMENT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ENVIRONMENT; } })); +Object.defineProperty(exports, "DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT; } })); +Object.defineProperty(exports, "DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT; } })); +Object.defineProperty(exports, "parseEnvironment", ({ enumerable: true, get: function () { return environment_1.parseEnvironment; } })); +var merge_1 = __nccwpck_require__(97258); +Object.defineProperty(exports, "merge", ({ enumerable: true, get: function () { return merge_1.merge; } })); +var sampling_1 = __nccwpck_require__(87472); +Object.defineProperty(exports, "TracesSamplerValues", ({ enumerable: true, get: function () { return sampling_1.TracesSamplerValues; } })); +var timeout_1 = __nccwpck_require__(69537); +Object.defineProperty(exports, "TimeoutError", ({ enumerable: true, get: function () { return timeout_1.TimeoutError; } })); +Object.defineProperty(exports, "callWithTimeout", ({ enumerable: true, get: function () { return timeout_1.callWithTimeout; } })); +var url_1 = __nccwpck_require__(35641); +Object.defineProperty(exports, "isUrlIgnored", ({ enumerable: true, get: function () { return url_1.isUrlIgnored; } })); +Object.defineProperty(exports, "urlMatches", ({ enumerable: true, get: function () { return url_1.urlMatches; } })); +var wrap_1 = __nccwpck_require__(2246); +Object.defineProperty(exports, "isWrapped", ({ enumerable: true, get: function () { return wrap_1.isWrapped; } })); +var callback_1 = __nccwpck_require__(17917); +Object.defineProperty(exports, "BindOnceFuture", ({ enumerable: true, get: function () { return callback_1.BindOnceFuture; } })); +var version_1 = __nccwpck_require__(167); +Object.defineProperty(exports, "VERSION", ({ enumerable: true, get: function () { return version_1.VERSION; } })); +const exporter_1 = __nccwpck_require__(80850); +exports.internal = { + _export: exporter_1._export, +}; +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 80850: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._export = void 0; +const api_1 = __nccwpck_require__(65163); +const suppress_tracing_1 = __nccwpck_require__(94367); +/** + * @internal + * Shared functionality used by Exporters while exporting data, including suppression of Traces. + */ +function _export(exporter, arg) { + return new Promise(resolve => { + // prevent downstream exporter calls from generating spans + api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { + exporter.export(arg, (result) => { + resolve(result); + }); + }); + }); +} +exports._export = _export; +//# sourceMappingURL=exporter.js.map + +/***/ }), + +/***/ 61370: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.validateValue = exports.validateKey = void 0; +const VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]'; +const VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; +const VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; +const VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); +const VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; +const INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; +/** + * Key is opaque string up to 256 characters printable. It MUST begin with a + * lowercase letter, and can only contain lowercase letters a-z, digits 0-9, + * underscores _, dashes -, asterisks *, and forward slashes /. + * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the + * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key. + * see https://www.w3.org/TR/trace-context/#key + */ +function validateKey(key) { + return VALID_KEY_REGEX.test(key); +} +exports.validateKey = validateKey; +/** + * Value is opaque string up to 256 characters printable ASCII RFC0020 + * characters (i.e., the range 0x20 to 0x7E) except comma , and =. + */ +function validateValue(value) { + return (VALID_VALUE_BASE_REGEX.test(value) && + !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value)); +} +exports.validateValue = validateValue; +//# sourceMappingURL=validators.js.map + +/***/ }), + +/***/ 49955: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.unrefTimer = exports.otperformance = exports.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var node_1 = __nccwpck_require__(61189); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return node_1.RandomIdGenerator; } })); +Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return node_1.SDK_INFO; } })); +Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return node_1._globalThis; } })); +Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return node_1.getEnv; } })); +Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return node_1.getEnvWithoutDefaults; } })); +Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return node_1.hexToBase64; } })); +Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return node_1.otperformance; } })); +Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return node_1.unrefTimer; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 9845: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RandomIdGenerator = void 0; +const SPAN_ID_BYTES = 8; +const TRACE_ID_BYTES = 16; +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + */ +class RandomIdGenerator { + constructor() { + /** + * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex + * characters corresponding to 128 bits. + */ + this.generateTraceId = getIdGenerator(TRACE_ID_BYTES); + /** + * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex + * characters corresponding to 64 bits. + */ + this.generateSpanId = getIdGenerator(SPAN_ID_BYTES); + } +} +exports.RandomIdGenerator = RandomIdGenerator; +const SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES); +function getIdGenerator(bytes) { + return function generateId() { + for (let i = 0; i < bytes / 4; i++) { + // unsigned right shift drops decimal part of the number + // it is required because if a number between 2**32 and 2**32 - 1 is generated, an out of range error is thrown by writeUInt32BE + SHARED_BUFFER.writeUInt32BE((Math.random() * 2 ** 32) >>> 0, i * 4); + } + // If buffer is all 0, set the last byte to 1 to guarantee a valid w3c id is generated + for (let i = 0; i < bytes; i++) { + if (SHARED_BUFFER[i] > 0) { + break; + } + else if (i === bytes - 1) { + SHARED_BUFFER[bytes - 1] = 1; + } + } + return SHARED_BUFFER.toString('hex', 0, bytes); + }; +} +//# sourceMappingURL=RandomIdGenerator.js.map + +/***/ }), + +/***/ 28246: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getEnvWithoutDefaults = exports.getEnv = void 0; +const environment_1 = __nccwpck_require__(40789); +/** + * Gets the environment variables + */ +function getEnv() { + const processEnv = (0, environment_1.parseEnvironment)(process.env); + return Object.assign({}, environment_1.DEFAULT_ENVIRONMENT, processEnv); +} +exports.getEnv = getEnv; +function getEnvWithoutDefaults() { + return (0, environment_1.parseEnvironment)(process.env); +} +exports.getEnvWithoutDefaults = getEnvWithoutDefaults; +//# sourceMappingURL=environment.js.map + +/***/ }), + +/***/ 13829: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._globalThis = void 0; +/** only globals that common to node and browsers are allowed */ +// eslint-disable-next-line node/no-unsupported-features/es-builtins +exports._globalThis = typeof globalThis === 'object' ? globalThis : global; +//# sourceMappingURL=globalThis.js.map + +/***/ }), + +/***/ 77507: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.hexToBase64 = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const hex_to_binary_1 = __nccwpck_require__(2859); +function hexToBase64(hexStr) { + return Buffer.from((0, hex_to_binary_1.hexToBinary)(hexStr)).toString('base64'); +} +exports.hexToBase64 = hexToBase64; +//# sourceMappingURL=hex-to-base64.js.map + +/***/ }), + +/***/ 61189: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.unrefTimer = exports.SDK_INFO = exports.otperformance = exports.RandomIdGenerator = exports.hexToBase64 = exports._globalThis = exports.getEnv = exports.getEnvWithoutDefaults = void 0; +var environment_1 = __nccwpck_require__(28246); +Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return environment_1.getEnvWithoutDefaults; } })); +Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return environment_1.getEnv; } })); +var globalThis_1 = __nccwpck_require__(13829); +Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return globalThis_1._globalThis; } })); +var hex_to_base64_1 = __nccwpck_require__(77507); +Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return hex_to_base64_1.hexToBase64; } })); +var RandomIdGenerator_1 = __nccwpck_require__(9845); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return RandomIdGenerator_1.RandomIdGenerator; } })); +var performance_1 = __nccwpck_require__(65065); +Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return performance_1.otperformance; } })); +var sdk_info_1 = __nccwpck_require__(21740); +Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return sdk_info_1.SDK_INFO; } })); +var timer_util_1 = __nccwpck_require__(2689); +Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return timer_util_1.unrefTimer; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 65065: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.otperformance = void 0; +const perf_hooks_1 = __nccwpck_require__(4074); +exports.otperformance = perf_hooks_1.performance; +//# sourceMappingURL=performance.js.map + +/***/ }), + +/***/ 21740: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SDK_INFO = void 0; +const version_1 = __nccwpck_require__(167); +const semantic_conventions_1 = __nccwpck_require__(67275); +/** Constants describing the SDK in use */ +exports.SDK_INFO = { + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME]: 'opentelemetry', + [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'node', + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRYSDKLANGUAGEVALUES_NODEJS, + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_VERSION]: version_1.VERSION, +}; +//# sourceMappingURL=sdk-info.js.map + +/***/ }), + +/***/ 2689: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.unrefTimer = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +function unrefTimer(timer) { + timer.unref(); +} +exports.unrefTimer = unrefTimer; +//# sourceMappingURL=timer-util.js.map + +/***/ }), + +/***/ 25512: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.CompositePropagator = void 0; +const api_1 = __nccwpck_require__(65163); +/** Combines multiple propagators into a single propagator. */ +class CompositePropagator { + /** + * Construct a composite propagator from a list of propagators. + * + * @param [config] Configuration object for composite propagator + */ + constructor(config = {}) { + var _a; + this._propagators = (_a = config.propagators) !== null && _a !== void 0 ? _a : []; + this._fields = Array.from(new Set(this._propagators + // older propagators may not have fields function, null check to be sure + .map(p => (typeof p.fields === 'function' ? p.fields() : [])) + .reduce((x, y) => x.concat(y), []))); + } + /** + * Run each of the configured propagators with the given context and carrier. + * Propagators are run in the order they are configured, so if multiple + * propagators write the same carrier key, the propagator later in the list + * will "win". + * + * @param context Context to inject + * @param carrier Carrier into which context will be injected + */ + inject(context, carrier, setter) { + for (const propagator of this._propagators) { + try { + propagator.inject(context, carrier, setter); + } + catch (err) { + api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); + } + } + } + /** + * Run each of the configured propagators with the given context and carrier. + * Propagators are run in the order they are configured, so if multiple + * propagators write the same context key, the propagator later in the list + * will "win". + * + * @param context Context to add values to + * @param carrier Carrier from which to extract context + */ + extract(context, carrier, getter) { + return this._propagators.reduce((ctx, propagator) => { + try { + return propagator.extract(ctx, carrier, getter); + } + catch (err) { + api_1.diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`); + } + return ctx; + }, context); + } + fields() { + // return a new array so our fields cannot be modified + return this._fields.slice(); + } +} +exports.CompositePropagator = CompositePropagator; +//# sourceMappingURL=composite.js.map + +/***/ }), + +/***/ 19666: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TraceState = void 0; +const validators_1 = __nccwpck_require__(61370); +const MAX_TRACE_STATE_ITEMS = 32; +const MAX_TRACE_STATE_LEN = 512; +const LIST_MEMBERS_SEPARATOR = ','; +const LIST_MEMBER_KEY_VALUE_SPLITTER = '='; +/** + * TraceState must be a class and not a simple object type because of the spec + * requirement (https://www.w3.org/TR/trace-context/#tracestate-field). + * + * Here is the list of allowed mutations: + * - New key-value pair should be added into the beginning of the list + * - The value of any key can be updated. Modified keys MUST be moved to the + * beginning of the list. + */ +class TraceState { + constructor(rawTraceState) { + this._internalState = new Map(); + if (rawTraceState) + this._parse(rawTraceState); + } + set(key, value) { + // TODO: Benchmark the different approaches(map vs list) and + // use the faster one. + const traceState = this._clone(); + if (traceState._internalState.has(key)) { + traceState._internalState.delete(key); + } + traceState._internalState.set(key, value); + return traceState; + } + unset(key) { + const traceState = this._clone(); + traceState._internalState.delete(key); + return traceState; + } + get(key) { + return this._internalState.get(key); + } + serialize() { + return this._keys() + .reduce((agg, key) => { + agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key)); + return agg; + }, []) + .join(LIST_MEMBERS_SEPARATOR); + } + _parse(rawTraceState) { + if (rawTraceState.length > MAX_TRACE_STATE_LEN) + return; + this._internalState = rawTraceState + .split(LIST_MEMBERS_SEPARATOR) + .reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning + .reduce((agg, part) => { + const listMember = part.trim(); // Optional Whitespace (OWS) handling + const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); + if (i !== -1) { + const key = listMember.slice(0, i); + const value = listMember.slice(i + 1, part.length); + if ((0, validators_1.validateKey)(key) && (0, validators_1.validateValue)(value)) { + agg.set(key, value); + } + else { + // TODO: Consider to add warning log + } + } + return agg; + }, new Map()); + // Because of the reverse() requirement, trunc must be done after map is created + if (this._internalState.size > MAX_TRACE_STATE_ITEMS) { + this._internalState = new Map(Array.from(this._internalState.entries()) + .reverse() // Use reverse same as original tracestate parse chain + .slice(0, MAX_TRACE_STATE_ITEMS)); + } + } + _keys() { + return Array.from(this._internalState.keys()).reverse(); + } + _clone() { + const traceState = new TraceState(); + traceState._internalState = new Map(this._internalState); + return traceState; + } +} +exports.TraceState = TraceState; +//# sourceMappingURL=TraceState.js.map + +/***/ }), + +/***/ 3449: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0; +const api_1 = __nccwpck_require__(65163); +const suppress_tracing_1 = __nccwpck_require__(94367); +const TraceState_1 = __nccwpck_require__(19666); +exports.TRACE_PARENT_HEADER = 'traceparent'; +exports.TRACE_STATE_HEADER = 'tracestate'; +const VERSION = '00'; +const VERSION_PART = '(?!ff)[\\da-f]{2}'; +const TRACE_ID_PART = '(?![0]{32})[\\da-f]{32}'; +const PARENT_ID_PART = '(?![0]{16})[\\da-f]{16}'; +const FLAGS_PART = '[\\da-f]{2}'; +const TRACE_PARENT_REGEX = new RegExp(`^\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\s?$`); +/** + * Parses information from the [traceparent] span tag and converts it into {@link SpanContext} + * @param traceParent - A meta property that comes from server. + * It should be dynamically generated server side to have the server's request trace Id, + * a parent span Id that was set on the server's request span, + * and the trace flags to indicate the server's sampling decision + * (01 = sampled, 00 = not sampled). + * for example: '{version}-{traceId}-{spanId}-{sampleDecision}' + * For more information see {@link https://www.w3.org/TR/trace-context/} + */ +function parseTraceParent(traceParent) { + const match = TRACE_PARENT_REGEX.exec(traceParent); + if (!match) + return null; + // According to the specification the implementation should be compatible + // with future versions. If there are more parts, we only reject it if it's using version 00 + // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent + if (match[1] === '00' && match[5]) + return null; + return { + traceId: match[2], + spanId: match[3], + traceFlags: parseInt(match[4], 16), + }; +} +exports.parseTraceParent = parseTraceParent; +/** + * Propagates {@link SpanContext} through Trace Context format propagation. + * + * Based on the Trace Context specification: + * https://www.w3.org/TR/trace-context/ + */ +class W3CTraceContextPropagator { + inject(context, carrier, setter) { + const spanContext = api_1.trace.getSpanContext(context); + if (!spanContext || + (0, suppress_tracing_1.isTracingSuppressed)(context) || + !(0, api_1.isSpanContextValid)(spanContext)) + return; + const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; + setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); + if (spanContext.traceState) { + setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); + } + } + extract(context, carrier, getter) { + const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); + if (!traceParentHeader) + return context; + const traceParent = Array.isArray(traceParentHeader) + ? traceParentHeader[0] + : traceParentHeader; + if (typeof traceParent !== 'string') + return context; + const spanContext = parseTraceParent(traceParent); + if (!spanContext) + return context; + spanContext.isRemote = true; + const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); + if (traceStateHeader) { + // If more than one `tracestate` header is found, we merge them into a + // single header. + const state = Array.isArray(traceStateHeader) + ? traceStateHeader.join(',') + : traceStateHeader; + spanContext.traceState = new TraceState_1.TraceState(typeof state === 'string' ? state : undefined); + } + return api_1.trace.setSpanContext(context, spanContext); + } + fields() { + return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; + } +} +exports.W3CTraceContextPropagator = W3CTraceContextPropagator; +//# sourceMappingURL=W3CTraceContextPropagator.js.map + +/***/ }), + +/***/ 79681: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0; +const api_1 = __nccwpck_require__(65163); +const RPC_METADATA_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key RPC_METADATA'); +var RPCType; +(function (RPCType) { + RPCType["HTTP"] = "http"; +})(RPCType = exports.RPCType || (exports.RPCType = {})); +function setRPCMetadata(context, meta) { + return context.setValue(RPC_METADATA_KEY, meta); +} +exports.setRPCMetadata = setRPCMetadata; +function deleteRPCMetadata(context) { + return context.deleteValue(RPC_METADATA_KEY); +} +exports.deleteRPCMetadata = deleteRPCMetadata; +function getRPCMetadata(context) { + return context.getValue(RPC_METADATA_KEY); +} +exports.getRPCMetadata = getRPCMetadata; +//# sourceMappingURL=rpc-metadata.js.map + +/***/ }), + +/***/ 49184: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AlwaysOffSampler = void 0; +const api_1 = __nccwpck_require__(65163); +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + * Sampler that samples no traces. + */ +class AlwaysOffSampler { + shouldSample() { + return { + decision: api_1.SamplingDecision.NOT_RECORD, + }; + } + toString() { + return 'AlwaysOffSampler'; + } +} +exports.AlwaysOffSampler = AlwaysOffSampler; +//# sourceMappingURL=AlwaysOffSampler.js.map + +/***/ }), + +/***/ 48801: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AlwaysOnSampler = void 0; +const api_1 = __nccwpck_require__(65163); +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + * Sampler that samples all traces. + */ +class AlwaysOnSampler { + shouldSample() { + return { + decision: api_1.SamplingDecision.RECORD_AND_SAMPLED, + }; + } + toString() { + return 'AlwaysOnSampler'; + } +} +exports.AlwaysOnSampler = AlwaysOnSampler; +//# sourceMappingURL=AlwaysOnSampler.js.map + +/***/ }), + +/***/ 44874: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ParentBasedSampler = void 0; +const api_1 = __nccwpck_require__(65163); +const global_error_handler_1 = __nccwpck_require__(22961); +const AlwaysOffSampler_1 = __nccwpck_require__(49184); +const AlwaysOnSampler_1 = __nccwpck_require__(48801); +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + * A composite sampler that either respects the parent span's sampling decision + * or delegates to `delegateSampler` for root spans. + */ +class ParentBasedSampler { + constructor(config) { + var _a, _b, _c, _d; + this._root = config.root; + if (!this._root) { + (0, global_error_handler_1.globalErrorHandler)(new Error('ParentBasedSampler must have a root sampler configured')); + this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); + } + this._remoteParentSampled = + (_a = config.remoteParentSampled) !== null && _a !== void 0 ? _a : new AlwaysOnSampler_1.AlwaysOnSampler(); + this._remoteParentNotSampled = + (_b = config.remoteParentNotSampled) !== null && _b !== void 0 ? _b : new AlwaysOffSampler_1.AlwaysOffSampler(); + this._localParentSampled = + (_c = config.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler_1.AlwaysOnSampler(); + this._localParentNotSampled = + (_d = config.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler_1.AlwaysOffSampler(); + } + shouldSample(context, traceId, spanName, spanKind, attributes, links) { + const parentContext = api_1.trace.getSpanContext(context); + if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) { + return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.isRemote) { + if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { + return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { + return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + toString() { + return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; + } +} +exports.ParentBasedSampler = ParentBasedSampler; +//# sourceMappingURL=ParentBasedSampler.js.map + +/***/ }), + +/***/ 76417: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TraceIdRatioBasedSampler = void 0; +const api_1 = __nccwpck_require__(65163); +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + * Sampler that samples a given fraction of traces based of trace id deterministically. + */ +class TraceIdRatioBasedSampler { + constructor(_ratio = 0) { + this._ratio = _ratio; + this._ratio = this._normalize(_ratio); + this._upperBound = Math.floor(this._ratio * 0xffffffff); + } + shouldSample(context, traceId) { + return { + decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound + ? api_1.SamplingDecision.RECORD_AND_SAMPLED + : api_1.SamplingDecision.NOT_RECORD, + }; + } + toString() { + return `TraceIdRatioBased{${this._ratio}}`; + } + _normalize(ratio) { + if (typeof ratio !== 'number' || isNaN(ratio)) + return 0; + return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio; + } + _accumulate(traceId) { + let accumulation = 0; + for (let i = 0; i < traceId.length / 8; i++) { + const pos = i * 8; + const part = parseInt(traceId.slice(pos, pos + 8), 16); + accumulation = (accumulation ^ part) >>> 0; + } + return accumulation; + } +} +exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; +//# sourceMappingURL=TraceIdRatioBasedSampler.js.map + +/***/ }), + +/***/ 94367: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0; +const api_1 = __nccwpck_require__(65163); +const SUPPRESS_TRACING_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key SUPPRESS_TRACING'); +function suppressTracing(context) { + return context.setValue(SUPPRESS_TRACING_KEY, true); +} +exports.suppressTracing = suppressTracing; +function unsuppressTracing(context) { + return context.deleteValue(SUPPRESS_TRACING_KEY); +} +exports.unsuppressTracing = unsuppressTracing; +function isTracingSuppressed(context) { + return context.getValue(SUPPRESS_TRACING_KEY) === true; +} +exports.isTracingSuppressed = isTracingSuppressed; +//# sourceMappingURL=suppress-tracing.js.map + +/***/ }), + +/***/ 17917: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BindOnceFuture = void 0; +const promise_1 = __nccwpck_require__(32139); +/** + * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked. + */ +class BindOnceFuture { + constructor(_callback, _that) { + this._callback = _callback; + this._that = _that; + this._isCalled = false; + this._deferred = new promise_1.Deferred(); + } + get isCalled() { + return this._isCalled; + } + get promise() { + return this._deferred.promise; + } + call(...args) { + if (!this._isCalled) { + this._isCalled = true; + try { + Promise.resolve(this._callback.call(this._that, ...args)).then(val => this._deferred.resolve(val), err => this._deferred.reject(err)); + } + catch (err) { + this._deferred.reject(err); + } + } + return this._deferred.promise; + } +} +exports.BindOnceFuture = BindOnceFuture; +//# sourceMappingURL=callback.js.map + +/***/ }), + +/***/ 40789: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseEnvironment = exports.DEFAULT_ENVIRONMENT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = void 0; +const api_1 = __nccwpck_require__(65163); +const sampling_1 = __nccwpck_require__(87472); +const DEFAULT_LIST_SEPARATOR = ','; +/** + * Environment interface to define all names + */ +const ENVIRONMENT_BOOLEAN_KEYS = ['OTEL_SDK_DISABLED']; +function isEnvVarABoolean(key) { + return (ENVIRONMENT_BOOLEAN_KEYS.indexOf(key) > -1); +} +const ENVIRONMENT_NUMBERS_KEYS = [ + 'OTEL_BSP_EXPORT_TIMEOUT', + 'OTEL_BSP_MAX_EXPORT_BATCH_SIZE', + 'OTEL_BSP_MAX_QUEUE_SIZE', + 'OTEL_BSP_SCHEDULE_DELAY', + 'OTEL_BLRP_EXPORT_TIMEOUT', + 'OTEL_BLRP_MAX_EXPORT_BATCH_SIZE', + 'OTEL_BLRP_MAX_QUEUE_SIZE', + 'OTEL_BLRP_SCHEDULE_DELAY', + 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT', + 'OTEL_ATTRIBUTE_COUNT_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT', + 'OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT', + 'OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT', + 'OTEL_SPAN_EVENT_COUNT_LIMIT', + 'OTEL_SPAN_LINK_COUNT_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT', + 'OTEL_EXPORTER_OTLP_TIMEOUT', + 'OTEL_EXPORTER_OTLP_TRACES_TIMEOUT', + 'OTEL_EXPORTER_OTLP_METRICS_TIMEOUT', + 'OTEL_EXPORTER_OTLP_LOGS_TIMEOUT', + 'OTEL_EXPORTER_JAEGER_AGENT_PORT', +]; +function isEnvVarANumber(key) { + return (ENVIRONMENT_NUMBERS_KEYS.indexOf(key) > -1); +} +const ENVIRONMENT_LISTS_KEYS = [ + 'OTEL_NO_PATCH_MODULES', + 'OTEL_PROPAGATORS', + 'OTEL_SEMCONV_STABILITY_OPT_IN', +]; +function isEnvVarAList(key) { + return ENVIRONMENT_LISTS_KEYS.indexOf(key) > -1; +} +exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity; +exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128; +exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = 128; +exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = 128; +/** + * Default environment variables + */ +exports.DEFAULT_ENVIRONMENT = { + OTEL_SDK_DISABLED: false, + CONTAINER_NAME: '', + ECS_CONTAINER_METADATA_URI_V4: '', + ECS_CONTAINER_METADATA_URI: '', + HOSTNAME: '', + KUBERNETES_SERVICE_HOST: '', + NAMESPACE: '', + OTEL_BSP_EXPORT_TIMEOUT: 30000, + OTEL_BSP_MAX_EXPORT_BATCH_SIZE: 512, + OTEL_BSP_MAX_QUEUE_SIZE: 2048, + OTEL_BSP_SCHEDULE_DELAY: 5000, + OTEL_BLRP_EXPORT_TIMEOUT: 30000, + OTEL_BLRP_MAX_EXPORT_BATCH_SIZE: 512, + OTEL_BLRP_MAX_QUEUE_SIZE: 2048, + OTEL_BLRP_SCHEDULE_DELAY: 5000, + OTEL_EXPORTER_JAEGER_AGENT_HOST: '', + OTEL_EXPORTER_JAEGER_AGENT_PORT: 6832, + OTEL_EXPORTER_JAEGER_ENDPOINT: '', + OTEL_EXPORTER_JAEGER_PASSWORD: '', + OTEL_EXPORTER_JAEGER_USER: '', + OTEL_EXPORTER_OTLP_ENDPOINT: '', + OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: '', + OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '', + OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: '', + OTEL_EXPORTER_OTLP_HEADERS: '', + OTEL_EXPORTER_OTLP_TRACES_HEADERS: '', + OTEL_EXPORTER_OTLP_METRICS_HEADERS: '', + OTEL_EXPORTER_OTLP_LOGS_HEADERS: '', + OTEL_EXPORTER_OTLP_TIMEOUT: 10000, + OTEL_EXPORTER_OTLP_TRACES_TIMEOUT: 10000, + OTEL_EXPORTER_OTLP_METRICS_TIMEOUT: 10000, + OTEL_EXPORTER_OTLP_LOGS_TIMEOUT: 10000, + OTEL_EXPORTER_ZIPKIN_ENDPOINT: 'http://localhost:9411/api/v2/spans', + OTEL_LOG_LEVEL: api_1.DiagLogLevel.INFO, + OTEL_NO_PATCH_MODULES: [], + OTEL_PROPAGATORS: ['tracecontext', 'baggage'], + OTEL_RESOURCE_ATTRIBUTES: '', + OTEL_SERVICE_NAME: '', + OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, + OTEL_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, + OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, + OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, + OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, + OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, + OTEL_SPAN_EVENT_COUNT_LIMIT: 128, + OTEL_SPAN_LINK_COUNT_LIMIT: 128, + OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT: exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, + OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT: exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT, + OTEL_TRACES_EXPORTER: '', + OTEL_TRACES_SAMPLER: sampling_1.TracesSamplerValues.ParentBasedAlwaysOn, + OTEL_TRACES_SAMPLER_ARG: '', + OTEL_LOGS_EXPORTER: '', + OTEL_EXPORTER_OTLP_INSECURE: '', + OTEL_EXPORTER_OTLP_TRACES_INSECURE: '', + OTEL_EXPORTER_OTLP_METRICS_INSECURE: '', + OTEL_EXPORTER_OTLP_LOGS_INSECURE: '', + OTEL_EXPORTER_OTLP_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_COMPRESSION: '', + OTEL_EXPORTER_OTLP_TRACES_COMPRESSION: '', + OTEL_EXPORTER_OTLP_METRICS_COMPRESSION: '', + OTEL_EXPORTER_OTLP_LOGS_COMPRESSION: '', + OTEL_EXPORTER_OTLP_CLIENT_KEY: '', + OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY: '', + OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY: '', + OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY: '', + OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_PROTOCOL: 'http/protobuf', + OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: 'http/protobuf', + OTEL_EXPORTER_OTLP_METRICS_PROTOCOL: 'http/protobuf', + OTEL_EXPORTER_OTLP_LOGS_PROTOCOL: 'http/protobuf', + OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE: 'cumulative', + OTEL_SEMCONV_STABILITY_OPT_IN: [], +}; +/** + * @param key + * @param environment + * @param values + */ +function parseBoolean(key, environment, values) { + if (typeof values[key] === 'undefined') { + return; + } + const value = String(values[key]); + // support case-insensitive "true" + environment[key] = value.toLowerCase() === 'true'; +} +/** + * Parses a variable as number with number validation + * @param name + * @param environment + * @param values + * @param min + * @param max + */ +function parseNumber(name, environment, values, min = -Infinity, max = Infinity) { + if (typeof values[name] !== 'undefined') { + const value = Number(values[name]); + if (!isNaN(value)) { + if (value < min) { + environment[name] = min; + } + else if (value > max) { + environment[name] = max; + } + else { + environment[name] = value; + } + } + } +} +/** + * Parses list-like strings from input into output. + * @param name + * @param environment + * @param values + * @param separator + */ +function parseStringList(name, output, input, separator = DEFAULT_LIST_SEPARATOR) { + const givenValue = input[name]; + if (typeof givenValue === 'string') { + output[name] = givenValue.split(separator).map(v => v.trim()); + } +} +// The support string -> DiagLogLevel mappings +const logLevelMap = { + ALL: api_1.DiagLogLevel.ALL, + VERBOSE: api_1.DiagLogLevel.VERBOSE, + DEBUG: api_1.DiagLogLevel.DEBUG, + INFO: api_1.DiagLogLevel.INFO, + WARN: api_1.DiagLogLevel.WARN, + ERROR: api_1.DiagLogLevel.ERROR, + NONE: api_1.DiagLogLevel.NONE, +}; +/** + * Environmentally sets log level if valid log level string is provided + * @param key + * @param environment + * @param values + */ +function setLogLevelFromEnv(key, environment, values) { + const value = values[key]; + if (typeof value === 'string') { + const theLevel = logLevelMap[value.toUpperCase()]; + if (theLevel != null) { + environment[key] = theLevel; + } + } +} +/** + * Parses environment values + * @param values + */ +function parseEnvironment(values) { + const environment = {}; + for (const env in exports.DEFAULT_ENVIRONMENT) { + const key = env; + switch (key) { + case 'OTEL_LOG_LEVEL': + setLogLevelFromEnv(key, environment, values); + break; + default: + if (isEnvVarABoolean(key)) { + parseBoolean(key, environment, values); + } + else if (isEnvVarANumber(key)) { + parseNumber(key, environment, values); + } + else if (isEnvVarAList(key)) { + parseStringList(key, environment, values); + } + else { + const value = values[key]; + if (typeof value !== 'undefined' && value !== null) { + environment[key] = String(value); + } + } + } + } + return environment; +} +exports.parseEnvironment = parseEnvironment; +//# sourceMappingURL=environment.js.map + +/***/ }), + +/***/ 86886: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isPlainObject = void 0; +/* eslint-disable @typescript-eslint/no-explicit-any */ +/** + * based on lodash in order to support esm builds without esModuleInterop. + * lodash is using MIT License. + **/ +const objectTag = '[object Object]'; +const nullTag = '[object Null]'; +const undefinedTag = '[object Undefined]'; +const funcProto = Function.prototype; +const funcToString = funcProto.toString; +const objectCtorString = funcToString.call(Object); +const getPrototype = overArg(Object.getPrototypeOf, Object); +const objectProto = Object.prototype; +const hasOwnProperty = objectProto.hasOwnProperty; +const symToStringTag = Symbol ? Symbol.toStringTag : undefined; +const nativeObjectToString = objectProto.toString; +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function (arg) { + return func(transform(arg)); + }; +} +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) !== objectTag) { + return false; + } + const proto = getPrototype(value); + if (proto === null) { + return true; + } + const Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return (typeof Ctor == 'function' && + Ctor instanceof Ctor && + funcToString.call(Ctor) === objectCtorString); +} +exports.isPlainObject = isPlainObject; +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return symToStringTag && symToStringTag in Object(value) + ? getRawTag(value) + : objectToString(value); +} +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; + let unmasked = false; + try { + value[symToStringTag] = undefined; + unmasked = true; + } + catch (e) { + // silence + } + const result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } + else { + delete value[symToStringTag]; + } + } + return result; +} +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} +//# sourceMappingURL=lodash.merge.js.map + +/***/ }), + +/***/ 97258: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.merge = void 0; +/* eslint-disable @typescript-eslint/no-explicit-any */ +const lodash_merge_1 = __nccwpck_require__(86886); +const MAX_LEVEL = 20; +/** + * Merges objects together + * @param args - objects / values to be merged + */ +function merge(...args) { + let result = args.shift(); + const objects = new WeakMap(); + while (args.length > 0) { + result = mergeTwoObjects(result, args.shift(), 0, objects); + } + return result; +} +exports.merge = merge; +function takeValue(value) { + if (isArray(value)) { + return value.slice(); + } + return value; +} +/** + * Merges two objects + * @param one - first object + * @param two - second object + * @param level - current deep level + * @param objects - objects holder that has been already referenced - to prevent + * cyclic dependency + */ +function mergeTwoObjects(one, two, level = 0, objects) { + let result; + if (level > MAX_LEVEL) { + return undefined; + } + level++; + if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) { + result = takeValue(two); + } + else if (isArray(one)) { + result = one.slice(); + if (isArray(two)) { + for (let i = 0, j = two.length; i < j; i++) { + result.push(takeValue(two[i])); + } + } + else if (isObject(two)) { + const keys = Object.keys(two); + for (let i = 0, j = keys.length; i < j; i++) { + const key = keys[i]; + result[key] = takeValue(two[key]); + } + } + } + else if (isObject(one)) { + if (isObject(two)) { + if (!shouldMerge(one, two)) { + return two; + } + result = Object.assign({}, one); + const keys = Object.keys(two); + for (let i = 0, j = keys.length; i < j; i++) { + const key = keys[i]; + const twoValue = two[key]; + if (isPrimitive(twoValue)) { + if (typeof twoValue === 'undefined') { + delete result[key]; + } + else { + // result[key] = takeValue(twoValue); + result[key] = twoValue; + } + } + else { + const obj1 = result[key]; + const obj2 = twoValue; + if (wasObjectReferenced(one, key, objects) || + wasObjectReferenced(two, key, objects)) { + delete result[key]; + } + else { + if (isObject(obj1) && isObject(obj2)) { + const arr1 = objects.get(obj1) || []; + const arr2 = objects.get(obj2) || []; + arr1.push({ obj: one, key }); + arr2.push({ obj: two, key }); + objects.set(obj1, arr1); + objects.set(obj2, arr2); + } + result[key] = mergeTwoObjects(result[key], twoValue, level, objects); + } + } + } + } + else { + result = two; + } + } + return result; +} +/** + * Function to check if object has been already reference + * @param obj + * @param key + * @param objects + */ +function wasObjectReferenced(obj, key, objects) { + const arr = objects.get(obj[key]) || []; + for (let i = 0, j = arr.length; i < j; i++) { + const info = arr[i]; + if (info.key === key && info.obj === obj) { + return true; + } + } + return false; +} +function isArray(value) { + return Array.isArray(value); +} +function isFunction(value) { + return typeof value === 'function'; +} +function isObject(value) { + return (!isPrimitive(value) && + !isArray(value) && + !isFunction(value) && + typeof value === 'object'); +} +function isPrimitive(value) { + return (typeof value === 'string' || + typeof value === 'number' || + typeof value === 'boolean' || + typeof value === 'undefined' || + value instanceof Date || + value instanceof RegExp || + value === null); +} +function shouldMerge(one, two) { + if (!(0, lodash_merge_1.isPlainObject)(one) || !(0, lodash_merge_1.isPlainObject)(two)) { + return false; + } + return true; +} +//# sourceMappingURL=merge.js.map + +/***/ }), + +/***/ 32139: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Deferred = void 0; +class Deferred { + constructor() { + this._promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + }); + } + get promise() { + return this._promise; + } + resolve(val) { + this._resolve(val); + } + reject(err) { + this._reject(err); + } +} +exports.Deferred = Deferred; +//# sourceMappingURL=promise.js.map + +/***/ }), + +/***/ 87472: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TracesSamplerValues = void 0; +var TracesSamplerValues; +(function (TracesSamplerValues) { + TracesSamplerValues["AlwaysOff"] = "always_off"; + TracesSamplerValues["AlwaysOn"] = "always_on"; + TracesSamplerValues["ParentBasedAlwaysOff"] = "parentbased_always_off"; + TracesSamplerValues["ParentBasedAlwaysOn"] = "parentbased_always_on"; + TracesSamplerValues["ParentBasedTraceIdRatio"] = "parentbased_traceidratio"; + TracesSamplerValues["TraceIdRatio"] = "traceidratio"; +})(TracesSamplerValues = exports.TracesSamplerValues || (exports.TracesSamplerValues = {})); +//# sourceMappingURL=sampling.js.map + +/***/ }), + +/***/ 69537: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.callWithTimeout = exports.TimeoutError = void 0; +/** + * Error that is thrown on timeouts. + */ +class TimeoutError extends Error { + constructor(message) { + super(message); + // manually adjust prototype to retain `instanceof` functionality when targeting ES5, see: + // https://github.com/Microsoft/TypeScript-wiki/blob/main/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work + Object.setPrototypeOf(this, TimeoutError.prototype); + } +} +exports.TimeoutError = TimeoutError; +/** + * Adds a timeout to a promise and rejects if the specified timeout has elapsed. Also rejects if the specified promise + * rejects, and resolves if the specified promise resolves. + * + *

NOTE: this operation will continue even after it throws a {@link TimeoutError}. + * + * @param promise promise to use with timeout. + * @param timeout the timeout in milliseconds until the returned promise is rejected. + */ +function callWithTimeout(promise, timeout) { + let timeoutHandle; + const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { + timeoutHandle = setTimeout(function timeoutHandler() { + reject(new TimeoutError('Operation timed out.')); + }, timeout); + }); + return Promise.race([promise, timeoutPromise]).then(result => { + clearTimeout(timeoutHandle); + return result; + }, reason => { + clearTimeout(timeoutHandle); + throw reason; + }); +} +exports.callWithTimeout = callWithTimeout; +//# sourceMappingURL=timeout.js.map + +/***/ }), + +/***/ 35641: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isUrlIgnored = exports.urlMatches = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +function urlMatches(url, urlToMatch) { + if (typeof urlToMatch === 'string') { + return url === urlToMatch; + } + else { + return !!url.match(urlToMatch); + } +} +exports.urlMatches = urlMatches; +/** + * Check if {@param url} should be ignored when comparing against {@param ignoredUrls} + * @param url + * @param ignoredUrls + */ +function isUrlIgnored(url, ignoredUrls) { + if (!ignoredUrls) { + return false; + } + for (const ignoreUrl of ignoredUrls) { + if (urlMatches(url, ignoreUrl)) { + return true; + } + } + return false; +} +exports.isUrlIgnored = isUrlIgnored; +//# sourceMappingURL=url.js.map + +/***/ }), + +/***/ 2246: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isWrapped = void 0; +/** + * Checks if certain function has been already wrapped + * @param func + */ +function isWrapped(func) { + return (typeof func === 'function' && + typeof func.__original === 'function' && + typeof func.__unwrap === 'function' && + func.__wrapped === true); +} +exports.isWrapped = isWrapped; +//# sourceMappingURL=wrap.js.map + +/***/ }), + +/***/ 167: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.VERSION = '1.30.1'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 12445: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const ANY = Symbol('SemVer ANY') +// hoisted class for cyclic dependency +class Comparator { + static get ANY () { + return ANY + } + + constructor (comp, options) { + options = parseOptions(options) + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } + + comp = comp.trim().split(/\s+/).join(' ') + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) + + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } + + debug('comp', this) + } + + parse (comp) { + const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + const m = comp.match(r) + + if (!m) { + throw new TypeError(`Invalid comparator: ${comp}`) + } + + this.operator = m[1] !== undefined ? m[1] : '' + if (this.operator === '=') { + this.operator = '' + } + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } + } + + toString () { + return this.value + } + + test (version) { + debug('Comparator.test', version, this.options.loose) + + if (this.semver === ANY || version === ANY) { + return true + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + return cmp(version, this.operator, this.semver, this.options) + } + + intersects (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (this.operator === '') { + if (this.value === '') { + return true + } + return new Range(comp.value, options).test(this.value) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + return new Range(this.value, options).test(comp.semver) + } + + options = parseOptions(options) + + // Special cases where nothing can possibly be lower + if (options.includePrerelease && + (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) { + return false + } + if (!options.includePrerelease && + (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) { + return false + } + + // Same direction increasing (> or >=) + if (this.operator.startsWith('>') && comp.operator.startsWith('>')) { + return true + } + // Same direction decreasing (< or <=) + if (this.operator.startsWith('<') && comp.operator.startsWith('<')) { + return true + } + // same SemVer and both sides are inclusive (<= or >=) + if ( + (this.semver.version === comp.semver.version) && + this.operator.includes('=') && comp.operator.includes('=')) { + return true + } + // opposite directions less than + if (cmp(this.semver, '<', comp.semver, options) && + this.operator.startsWith('>') && comp.operator.startsWith('<')) { + return true + } + // opposite directions greater than + if (cmp(this.semver, '>', comp.semver, options) && + this.operator.startsWith('<') && comp.operator.startsWith('>')) { + return true + } + return false + } +} + +module.exports = Comparator + +const parseOptions = __nccwpck_require__(81667) +const { safeRe: re, t } = __nccwpck_require__(99011) +const cmp = __nccwpck_require__(81949) +const debug = __nccwpck_require__(11897) +const SemVer = __nccwpck_require__(84367) +const Range = __nccwpck_require__(51563) + + +/***/ }), + +/***/ 51563: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SPACE_CHARACTERS = /\s+/g + +// hoisted class for cyclic dependency +class Range { + constructor (range, options) { + options = parseOptions(options) + + if (range instanceof Range) { + if ( + range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease + ) { + return range + } else { + return new Range(range.raw, options) + } + } + + if (range instanceof Comparator) { + // just put it in the set and return + this.raw = range.value + this.set = [[range]] + this.formatted = undefined + return this + } + + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease + + // First reduce all whitespace as much as possible so we do not have to rely + // on potentially slow regexes like \s*. This is then stored and used for + // future error messages as well. + this.raw = range.trim().replace(SPACE_CHARACTERS, ' ') + + // First, split on || + this.set = this.raw + .split('||') + // map the range to a 2d array of comparators + .map(r => this.parseRange(r.trim())) + // throw out any comparator lists that are empty + // this generally means that it was not a valid range, which is allowed + // in loose mode, but will still throw if the WHOLE range is invalid. + .filter(c => c.length) + + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${this.raw}`) + } + + // if we have any that are not the null set, throw out null sets. + if (this.set.length > 1) { + // keep the first one, in case they're all null sets + const first = this.set[0] + this.set = this.set.filter(c => !isNullSet(c[0])) + if (this.set.length === 0) { + this.set = [first] + } else if (this.set.length > 1) { + // if we have any that are *, then the range is just * + for (const c of this.set) { + if (c.length === 1 && isAny(c[0])) { + this.set = [c] + break + } + } + } + } + + this.formatted = undefined + } + + get range () { + if (this.formatted === undefined) { + this.formatted = '' + for (let i = 0; i < this.set.length; i++) { + if (i > 0) { + this.formatted += '||' + } + const comps = this.set[i] + for (let k = 0; k < comps.length; k++) { + if (k > 0) { + this.formatted += ' ' + } + this.formatted += comps[k].toString().trim() + } + } + } + return this.formatted + } + + format () { + return this.range + } + + toString () { + return this.range + } + + parseRange (range) { + // memoize range parsing for performance. + // this is a very hot path, and fully deterministic. + const memoOpts = + (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | + (this.options.loose && FLAG_LOOSE) + const memoKey = memoOpts + ':' + range + const cached = cache.get(memoKey) + if (cached) { + return cached + } + + const loose = this.options.loose + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) + debug('hyphen replace', range) + + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range) + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[t.TILDETRIM], tildeTrimReplace) + debug('tilde trim', range) + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[t.CARETTRIM], caretTrimReplace) + debug('caret trim', range) + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + let rangeList = range + .split(' ') + .map(comp => parseComparator(comp, this.options)) + .join(' ') + .split(/\s+/) + // >=0.0.0 is equivalent to * + .map(comp => replaceGTE0(comp, this.options)) + + if (loose) { + // in loose mode, throw out any that are not valid comparators + rangeList = rangeList.filter(comp => { + debug('loose invalid filter', comp, this.options) + return !!comp.match(re[t.COMPARATORLOOSE]) + }) + } + debug('range list', rangeList) + + // if any comparators are the null set, then replace with JUST null set + // if more than one comparator, remove any * comparators + // also, don't include the same comparator more than once + const rangeMap = new Map() + const comparators = rangeList.map(comp => new Comparator(comp, this.options)) + for (const comp of comparators) { + if (isNullSet(comp)) { + return [comp] + } + rangeMap.set(comp.value, comp) + } + if (rangeMap.size > 1 && rangeMap.has('')) { + rangeMap.delete('') + } + + const result = [...rangeMap.values()] + cache.set(memoKey, result) + return result + } + + intersects (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + + return this.set.some((thisComparators) => { + return ( + isSatisfiable(thisComparators, options) && + range.set.some((rangeComparators) => { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) + } + + // if ANY of the sets match ALL of its comparators, then pass + test (version) { + if (!version) { + return false + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false + } +} + +module.exports = Range + +const LRU = __nccwpck_require__(82933) +const cache = new LRU() + +const parseOptions = __nccwpck_require__(81667) +const Comparator = __nccwpck_require__(12445) +const debug = __nccwpck_require__(11897) +const SemVer = __nccwpck_require__(84367) +const { + safeRe: re, + t, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace, +} = __nccwpck_require__(99011) +const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = __nccwpck_require__(34468) + +const isNullSet = c => c.value === '<0.0.0-0' +const isAny = c => c.value === '' + +// take a set of comparators and determine whether there +// exists a version which can satisfy it +const isSatisfiable = (comparators, options) => { + let result = true + const remainingComparators = comparators.slice() + let testComparator = remainingComparators.pop() + + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options) + }) + + testComparator = remainingComparators.pop() + } + + return result +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +const parseComparator = (comp, options) => { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp +} + +const isX = id => !id || id.toLowerCase() === 'x' || id === '*' + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 +// ~0.0.1 --> >=0.0.1 <0.1.0-0 +const replaceTildes = (comp, options) => { + return comp + .trim() + .split(/\s+/) + .map((c) => replaceTilde(c, options)) + .join(' ') +} + +const replaceTilde = (comp, options) => { + const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] + return comp.replace(r, (_, M, m, p, pr) => { + debug('tilde', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0` + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0-0 + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` + } else if (pr) { + debug('replaceTilde pr', pr) + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } else { + // ~1.2.3 == >=1.2.3 <1.3.0-0 + ret = `>=${M}.${m}.${p + } <${M}.${+m + 1}.0-0` + } + + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 +// ^1.2.3 --> >=1.2.3 <2.0.0-0 +// ^1.2.0 --> >=1.2.0 <2.0.0-0 +// ^0.0.1 --> >=0.0.1 <0.0.2-0 +// ^0.1.0 --> >=0.1.0 <0.2.0-0 +const replaceCarets = (comp, options) => { + return comp + .trim() + .split(/\s+/) + .map((c) => replaceCaret(c, options)) + .join(' ') +} + +const replaceCaret = (comp, options) => { + debug('caret', comp, options) + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] + const z = options.includePrerelease ? '-0' : '' + return comp.replace(r, (_, M, m, p, pr) => { + debug('caret', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` + } else if (isX(p)) { + if (M === '0') { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` + } else { + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${+M + 1}.0.0-0` + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p + }${z} <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p + }${z} <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p + } <${+M + 1}.0.0-0` + } + } + + debug('caret return', ret) + return ret + }) +} + +const replaceXRanges = (comp, options) => { + debug('replaceXRanges', comp, options) + return comp + .split(/\s+/) + .map((c) => replaceXRange(c, options)) + .join(' ') +} + +const replaceXRange = (comp, options) => { + comp = comp.trim() + const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] + return comp.replace(r, (ret, gtlt, M, m, p, pr) => { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + const xM = isX(M) + const xm = xM || isX(m) + const xp = xm || isX(p) + const anyX = xp + + if (gtlt === '=' && anyX) { + gtlt = '' + } + + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } + + if (gtlt === '<') { + pr = '-0' + } + + ret = `${gtlt + M}.${m}.${p}${pr}` + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` + } else if (xp) { + ret = `>=${M}.${m}.0${pr + } <${M}.${+m + 1}.0-0` + } + + debug('xRange return', ret) + + return ret + }) +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +const replaceStars = (comp, options) => { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp + .trim() + .replace(re[t.STAR], '') +} + +const replaceGTE0 = (comp, options) => { + debug('replaceGTE0', comp, options) + return comp + .trim() + .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') +} + +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 +// TODO build? +const hyphenReplace = incPr => ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr) => { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? '-0' : ''}` + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` + } else if (fpr) { + from = `>=${from}` + } else { + from = `>=${from}${incPr ? '-0' : ''}` + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0` + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0` + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}` + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0` + } else { + to = `<=${to}` + } + + return `${from} ${to}`.trim() +} + +const testSet = (set, version, options) => { + for (let i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } + + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (let i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === Comparator.ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + const allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false + } + + return true +} + + +/***/ }), + +/***/ 84367: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const debug = __nccwpck_require__(11897) +const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(34468) +const { safeRe: re, t } = __nccwpck_require__(99011) + +const parseOptions = __nccwpck_require__(81667) +const { compareIdentifiers } = __nccwpck_require__(70974) +class SemVer { + constructor (version, options) { + options = parseOptions(options) + + if (version instanceof SemVer) { + if (version.loose === !!options.loose && + version.includePrerelease === !!options.includePrerelease) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + // this isn't actually relevant for versions, but keep it so that we + // don't run into trouble passing this.options around. + this.includePrerelease = !!options.includePrerelease + + const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) + + if (!m) { + throw new TypeError(`Invalid Version: ${version}`) + } + + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() + } + + format () { + this.version = `${this.major}.${this.minor}.${this.patch}` + if (this.prerelease.length) { + this.version += `-${this.prerelease.join('.')}` + } + return this.version + } + + toString () { + return this.version + } + + compare (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + if (typeof other === 'string' && other === this.version) { + return 0 + } + other = new SemVer(other, this.options) + } + + if (other.version === this.version) { + return 0 + } + + return this.compareMain(other) || this.comparePre(other) + } + + compareMain (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return ( + compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) + ) + } + + comparePre (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + let i = 0 + do { + const a = this.prerelease[i] + const b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + compareBuild (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + let i = 0 + do { + const a = this.build[i] + const b = other.build[i] + debug('build compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc (release, identifier, identifierBase) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier, identifierBase) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier, identifierBase) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier, identifierBase) + this.inc('pre', identifier, identifierBase) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier, identifierBase) + } + this.inc('pre', identifier, identifierBase) + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if ( + this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0 + ) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case 'pre': { + const base = Number(identifierBase) ? 1 : 0 + + if (!identifier && identifierBase === false) { + throw new Error('invalid increment argument: identifier is empty') + } + + if (this.prerelease.length === 0) { + this.prerelease = [base] + } else { + let i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + if (identifier === this.prerelease.join('.') && identifierBase === false) { + throw new Error('invalid increment argument: identifier already exists') + } + this.prerelease.push(base) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + let prerelease = [identifier, base] + if (identifierBase === false) { + prerelease = [identifier] + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease + } + } else { + this.prerelease = prerelease + } + } + break + } + default: + throw new Error(`invalid increment argument: ${release}`) + } + this.raw = this.format() + if (this.build.length) { + this.raw += `+${this.build.join('.')}` + } + return this + } +} + +module.exports = SemVer + + +/***/ }), + +/***/ 51829: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parse = __nccwpck_require__(28985) +const clean = (version, options) => { + const s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} +module.exports = clean + + +/***/ }), + +/***/ 81949: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const eq = __nccwpck_require__(34164) +const neq = __nccwpck_require__(4394) +const gt = __nccwpck_require__(69819) +const gte = __nccwpck_require__(38583) +const lt = __nccwpck_require__(69329) +const lte = __nccwpck_require__(46141) + +const cmp = (a, op, b, loose) => { + switch (op) { + case '===': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a === b + + case '!==': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError(`Invalid operator: ${op}`) + } +} +module.exports = cmp + + +/***/ }), + +/***/ 26321: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(84367) +const parse = __nccwpck_require__(28985) +const { safeRe: re, t } = __nccwpck_require__(99011) + +const coerce = (version, options) => { + if (version instanceof SemVer) { + return version + } + + if (typeof version === 'number') { + version = String(version) + } + + if (typeof version !== 'string') { + return null + } + + options = options || {} + + let match = null + if (!options.rtl) { + match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]) + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL] + let next + while ((next = coerceRtlRegex.exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next + } + coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length + } + // leave it in a clean state + coerceRtlRegex.lastIndex = -1 + } + + if (match === null) { + return null + } + + const major = match[2] + const minor = match[3] || '0' + const patch = match[4] || '0' + const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '' + const build = options.includePrerelease && match[6] ? `+${match[6]}` : '' + + return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options) +} +module.exports = coerce + + +/***/ }), + +/***/ 12205: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(84367) +const compareBuild = (a, b, loose) => { + const versionA = new SemVer(a, loose) + const versionB = new SemVer(b, loose) + return versionA.compare(versionB) || versionA.compareBuild(versionB) +} +module.exports = compareBuild + + +/***/ }), + +/***/ 81597: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(46982) +const compareLoose = (a, b) => compare(a, b, true) +module.exports = compareLoose + + +/***/ }), + +/***/ 46982: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(84367) +const compare = (a, b, loose) => + new SemVer(a, loose).compare(new SemVer(b, loose)) + +module.exports = compare + + +/***/ }), + +/***/ 6514: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parse = __nccwpck_require__(28985) + +const diff = (version1, version2) => { + const v1 = parse(version1, null, true) + const v2 = parse(version2, null, true) + const comparison = v1.compare(v2) + + if (comparison === 0) { + return null + } + + const v1Higher = comparison > 0 + const highVersion = v1Higher ? v1 : v2 + const lowVersion = v1Higher ? v2 : v1 + const highHasPre = !!highVersion.prerelease.length + const lowHasPre = !!lowVersion.prerelease.length + + if (lowHasPre && !highHasPre) { + // Going from prerelease -> no prerelease requires some special casing + + // If the low version has only a major, then it will always be a major + // Some examples: + // 1.0.0-1 -> 1.0.0 + // 1.0.0-1 -> 1.1.1 + // 1.0.0-1 -> 2.0.0 + if (!lowVersion.patch && !lowVersion.minor) { + return 'major' + } + + // Otherwise it can be determined by checking the high version + + if (highVersion.patch) { + // anything higher than a patch bump would result in the wrong version + return 'patch' + } + + if (highVersion.minor) { + // anything higher than a minor bump would result in the wrong version + return 'minor' + } + + // bumping major/minor/patch all have same result + return 'major' + } + + // add the `pre` prefix if we are going to a prerelease version + const prefix = highHasPre ? 'pre' : '' + + if (v1.major !== v2.major) { + return prefix + 'major' + } + + if (v1.minor !== v2.minor) { + return prefix + 'minor' + } + + if (v1.patch !== v2.patch) { + return prefix + 'patch' + } + + // high and low are preleases + return 'prerelease' +} + +module.exports = diff + + +/***/ }), + +/***/ 34164: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(46982) +const eq = (a, b, loose) => compare(a, b, loose) === 0 +module.exports = eq + + +/***/ }), + +/***/ 69819: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(46982) +const gt = (a, b, loose) => compare(a, b, loose) > 0 +module.exports = gt + + +/***/ }), + +/***/ 38583: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(46982) +const gte = (a, b, loose) => compare(a, b, loose) >= 0 +module.exports = gte + + +/***/ }), + +/***/ 5310: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(84367) + +const inc = (version, release, options, identifier, identifierBase) => { + if (typeof (options) === 'string') { + identifierBase = identifier + identifier = options + options = undefined + } + + try { + return new SemVer( + version instanceof SemVer ? version.version : version, + options + ).inc(release, identifier, identifierBase).version + } catch (er) { + return null + } +} +module.exports = inc + + +/***/ }), + +/***/ 69329: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(46982) +const lt = (a, b, loose) => compare(a, b, loose) < 0 +module.exports = lt + + +/***/ }), + +/***/ 46141: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(46982) +const lte = (a, b, loose) => compare(a, b, loose) <= 0 +module.exports = lte + + +/***/ }), + +/***/ 58615: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(84367) +const major = (a, loose) => new SemVer(a, loose).major +module.exports = major + + +/***/ }), + +/***/ 10034: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(84367) +const minor = (a, loose) => new SemVer(a, loose).minor +module.exports = minor + + +/***/ }), + +/***/ 4394: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(46982) +const neq = (a, b, loose) => compare(a, b, loose) !== 0 +module.exports = neq + + +/***/ }), + +/***/ 28985: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(84367) +const parse = (version, options, throwErrors = false) => { + if (version instanceof SemVer) { + return version + } + try { + return new SemVer(version, options) + } catch (er) { + if (!throwErrors) { + return null + } + throw er + } +} + +module.exports = parse + + +/***/ }), + +/***/ 69881: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(84367) +const patch = (a, loose) => new SemVer(a, loose).patch +module.exports = patch + + +/***/ }), + +/***/ 69091: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parse = __nccwpck_require__(28985) +const prerelease = (version, options) => { + const parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} +module.exports = prerelease + + +/***/ }), + +/***/ 44954: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(46982) +const rcompare = (a, b, loose) => compare(b, a, loose) +module.exports = rcompare + + +/***/ }), + +/***/ 85917: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compareBuild = __nccwpck_require__(12205) +const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) +module.exports = rsort + + +/***/ }), + +/***/ 31014: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(51563) +const satisfies = (version, range, options) => { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} +module.exports = satisfies + + +/***/ }), + +/***/ 36737: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compareBuild = __nccwpck_require__(12205) +const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) +module.exports = sort + + +/***/ }), + +/***/ 58879: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parse = __nccwpck_require__(28985) +const valid = (version, options) => { + const v = parse(version, options) + return v ? v.version : null +} +module.exports = valid + + +/***/ }), + +/***/ 50326: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// just pre-load all the stuff that index.js lazily exports +const internalRe = __nccwpck_require__(99011) +const constants = __nccwpck_require__(34468) +const SemVer = __nccwpck_require__(84367) +const identifiers = __nccwpck_require__(70974) +const parse = __nccwpck_require__(28985) +const valid = __nccwpck_require__(58879) +const clean = __nccwpck_require__(51829) +const inc = __nccwpck_require__(5310) +const diff = __nccwpck_require__(6514) +const major = __nccwpck_require__(58615) +const minor = __nccwpck_require__(10034) +const patch = __nccwpck_require__(69881) +const prerelease = __nccwpck_require__(69091) +const compare = __nccwpck_require__(46982) +const rcompare = __nccwpck_require__(44954) +const compareLoose = __nccwpck_require__(81597) +const compareBuild = __nccwpck_require__(12205) +const sort = __nccwpck_require__(36737) +const rsort = __nccwpck_require__(85917) +const gt = __nccwpck_require__(69819) +const lt = __nccwpck_require__(69329) +const eq = __nccwpck_require__(34164) +const neq = __nccwpck_require__(4394) +const gte = __nccwpck_require__(38583) +const lte = __nccwpck_require__(46141) +const cmp = __nccwpck_require__(81949) +const coerce = __nccwpck_require__(26321) +const Comparator = __nccwpck_require__(12445) +const Range = __nccwpck_require__(51563) +const satisfies = __nccwpck_require__(31014) +const toComparators = __nccwpck_require__(75257) +const maxSatisfying = __nccwpck_require__(70647) +const minSatisfying = __nccwpck_require__(87404) +const minVersion = __nccwpck_require__(12336) +const validRange = __nccwpck_require__(13657) +const outside = __nccwpck_require__(67573) +const gtr = __nccwpck_require__(78962) +const ltr = __nccwpck_require__(60088) +const intersects = __nccwpck_require__(35690) +const simplifyRange = __nccwpck_require__(22321) +const subset = __nccwpck_require__(36464) +module.exports = { + parse, + valid, + clean, + inc, + diff, + major, + minor, + patch, + prerelease, + compare, + rcompare, + compareLoose, + compareBuild, + sort, + rsort, + gt, + lt, + eq, + neq, + gte, + lte, + cmp, + coerce, + Comparator, + Range, + satisfies, + toComparators, + maxSatisfying, + minSatisfying, + minVersion, + validRange, + outside, + gtr, + ltr, + intersects, + simplifyRange, + subset, + SemVer, + re: internalRe.re, + src: internalRe.src, + tokens: internalRe.t, + SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, + RELEASE_TYPES: constants.RELEASE_TYPES, + compareIdentifiers: identifiers.compareIdentifiers, + rcompareIdentifiers: identifiers.rcompareIdentifiers, +} + + +/***/ }), + +/***/ 34468: +/***/ ((module) => { + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +const SEMVER_SPEC_VERSION = '2.0.0' + +const MAX_LENGTH = 256 +const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || +/* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +const MAX_SAFE_COMPONENT_LENGTH = 16 + +// Max safe length for a build identifier. The max length minus 6 characters for +// the shortest version with a build 0.0.0+BUILD. +const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 + +const RELEASE_TYPES = [ + 'major', + 'premajor', + 'minor', + 'preminor', + 'patch', + 'prepatch', + 'prerelease', +] + +module.exports = { + MAX_LENGTH, + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_SAFE_INTEGER, + RELEASE_TYPES, + SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 0b001, + FLAG_LOOSE: 0b010, +} + + +/***/ }), + +/***/ 11897: +/***/ ((module) => { + +const debug = ( + typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG) +) ? (...args) => console.error('SEMVER', ...args) + : () => {} + +module.exports = debug + + +/***/ }), + +/***/ 70974: +/***/ ((module) => { + +const numeric = /^[0-9]+$/ +const compareIdentifiers = (a, b) => { + const anum = numeric.test(a) + const bnum = numeric.test(b) + + if (anum && bnum) { + a = +a + b = +b + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +} + +const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) + +module.exports = { + compareIdentifiers, + rcompareIdentifiers, +} + + +/***/ }), + +/***/ 82933: +/***/ ((module) => { + +class LRUCache { + constructor () { + this.max = 1000 + this.map = new Map() + } + + get (key) { + const value = this.map.get(key) + if (value === undefined) { + return undefined + } else { + // Remove the key from the map and add it to the end + this.map.delete(key) + this.map.set(key, value) + return value + } + } + + delete (key) { + return this.map.delete(key) + } + + set (key, value) { + const deleted = this.delete(key) + + if (!deleted && value !== undefined) { + // If cache is full, delete the least recently used item + if (this.map.size >= this.max) { + const firstKey = this.map.keys().next().value + this.delete(firstKey) + } + + this.map.set(key, value) + } + + return this + } +} + +module.exports = LRUCache + + +/***/ }), + +/***/ 81667: +/***/ ((module) => { + +// parse out just the options we care about +const looseOption = Object.freeze({ loose: true }) +const emptyOpts = Object.freeze({ }) +const parseOptions = options => { + if (!options) { + return emptyOpts + } + + if (typeof options !== 'object') { + return looseOption + } + + return options +} +module.exports = parseOptions + + +/***/ }), + +/***/ 99011: +/***/ ((module, exports, __nccwpck_require__) => { + +const { + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_LENGTH, +} = __nccwpck_require__(34468) +const debug = __nccwpck_require__(11897) +exports = module.exports = {} + +// The actual regexps go on exports.re +const re = exports.re = [] +const safeRe = exports.safeRe = [] +const src = exports.src = [] +const t = exports.t = {} +let R = 0 + +const LETTERDASHNUMBER = '[a-zA-Z0-9-]' + +// Replace some greedy regex tokens to prevent regex dos issues. These regex are +// used internally via the safeRe object since all inputs in this library get +// normalized first to trim and collapse all extra whitespace. The original +// regexes are exported for userland consumption and lower level usage. A +// future breaking change could export the safer regex only with a note that +// all input should have extra whitespace removed. +const safeRegexReplacements = [ + ['\\s', 1], + ['\\d', MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], +] + +const makeSafeRegex = (value) => { + for (const [token, max] of safeRegexReplacements) { + value = value + .split(`${token}*`).join(`${token}{0,${max}}`) + .split(`${token}+`).join(`${token}{1,${max}}`) + } + return value +} + +const createToken = (name, value, isGlobal) => { + const safe = makeSafeRegex(value) + const index = R++ + debug(name, index, value) + t[name] = index + src[index] = value + re[index] = new RegExp(value, isGlobal ? 'g' : undefined) + safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined) +} + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') +createToken('NUMERICIDENTIFIERLOOSE', '\\d+') + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`) + +// ## Main Version +// Three dot-separated numeric identifiers. + +createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})`) + +createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})`) + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] +}|${src[t.NONNUMERICIDENTIFIER]})`) + +createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] +}|${src[t.NONNUMERICIDENTIFIER]})`) + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] +}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) + +createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] +}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`) + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] +}(?:\\.${src[t.BUILDIDENTIFIER]})*))`) + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +createToken('FULLPLAIN', `v?${src[t.MAINVERSION] +}${src[t.PRERELEASE]}?${ + src[t.BUILD]}?`) + +createToken('FULL', `^${src[t.FULLPLAIN]}$`) + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] +}${src[t.PRERELEASELOOSE]}?${ + src[t.BUILD]}?`) + +createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) + +createToken('GTLT', '((?:<|>)?=?)') + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) +createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) + +createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:${src[t.PRERELEASE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:${src[t.PRERELEASELOOSE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) +createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +createToken('COERCEPLAIN', `${'(^|[^\\d])' + + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`) +createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`) +createToken('COERCEFULL', src[t.COERCEPLAIN] + + `(?:${src[t.PRERELEASE]})?` + + `(?:${src[t.BUILD]})?` + + `(?:$|[^\\d])`) +createToken('COERCERTL', src[t.COERCE], true) +createToken('COERCERTLFULL', src[t.COERCEFULL], true) + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +createToken('LONETILDE', '(?:~>?)') + +createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) +exports.tildeTrimReplace = '$1~' + +createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) +createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +createToken('LONECARET', '(?:\\^)') + +createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) +exports.caretTrimReplace = '$1^' + +createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) +createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) +createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] +}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) +exports.comparatorTrimReplace = '$1$2$3' + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAIN]})` + + `\\s*$`) + +createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAINLOOSE]})` + + `\\s*$`) + +// Star ranges basically just allow anything at all. +createToken('STAR', '(<|>)?=?\\s*\\*') +// >=0.0.0 is like a star +createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$') +createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$') + + +/***/ }), + +/***/ 78962: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// Determine if version is greater than all the versions possible in the range. +const outside = __nccwpck_require__(67573) +const gtr = (version, range, options) => outside(version, range, '>', options) +module.exports = gtr + + +/***/ }), + +/***/ 35690: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(51563) +const intersects = (r1, r2, options) => { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2, options) +} +module.exports = intersects + + +/***/ }), + +/***/ 60088: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const outside = __nccwpck_require__(67573) +// Determine if version is less than all the versions possible in the range +const ltr = (version, range, options) => outside(version, range, '<', options) +module.exports = ltr + + +/***/ }), + +/***/ 70647: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(84367) +const Range = __nccwpck_require__(51563) + +const maxSatisfying = (versions, range, options) => { + let max = null + let maxSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max +} +module.exports = maxSatisfying + + +/***/ }), + +/***/ 87404: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(84367) +const Range = __nccwpck_require__(51563) +const minSatisfying = (versions, range, options) => { + let min = null + let minSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min +} +module.exports = minSatisfying + + +/***/ }), + +/***/ 12336: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(84367) +const Range = __nccwpck_require__(51563) +const gt = __nccwpck_require__(69819) + +const minVersion = (range, loose) => { + range = new Range(range, loose) + + let minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } + + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } + + minver = null + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let setMin = null + comparators.forEach((comparator) => { + // Clone to avoid manipulating the comparator's semver object. + const compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!setMin || gt(compver, setMin)) { + setMin = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error(`Unexpected operation: ${comparator.operator}`) + } + }) + if (setMin && (!minver || gt(minver, setMin))) { + minver = setMin + } + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} +module.exports = minVersion + + +/***/ }), + +/***/ 67573: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(84367) +const Comparator = __nccwpck_require__(12445) +const { ANY } = Comparator +const Range = __nccwpck_require__(51563) +const satisfies = __nccwpck_require__(31014) +const gt = __nccwpck_require__(69819) +const lt = __nccwpck_require__(69329) +const lte = __nccwpck_require__(46141) +const gte = __nccwpck_require__(38583) + +const outside = (version, range, hilo, options) => { + version = new SemVer(version, options) + range = new Range(range, options) + + let gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisfies the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let high = null + let low = null + + comparators.forEach((comparator) => { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +module.exports = outside + + +/***/ }), + +/***/ 22321: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// given a set of versions and a range, create a "simplified" range +// that includes the same versions that the original range does +// If the original range is shorter than the simplified one, return that. +const satisfies = __nccwpck_require__(31014) +const compare = __nccwpck_require__(46982) +module.exports = (versions, range, options) => { + const set = [] + let first = null + let prev = null + const v = versions.sort((a, b) => compare(a, b, options)) + for (const version of v) { + const included = satisfies(version, range, options) + if (included) { + prev = version + if (!first) { + first = version + } + } else { + if (prev) { + set.push([first, prev]) + } + prev = null + first = null + } + } + if (first) { + set.push([first, null]) + } + + const ranges = [] + for (const [min, max] of set) { + if (min === max) { + ranges.push(min) + } else if (!max && min === v[0]) { + ranges.push('*') + } else if (!max) { + ranges.push(`>=${min}`) + } else if (min === v[0]) { + ranges.push(`<=${max}`) + } else { + ranges.push(`${min} - ${max}`) + } + } + const simplified = ranges.join(' || ') + const original = typeof range.raw === 'string' ? range.raw : String(range) + return simplified.length < original.length ? simplified : range +} + + +/***/ }), + +/***/ 36464: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(51563) +const Comparator = __nccwpck_require__(12445) +const { ANY } = Comparator +const satisfies = __nccwpck_require__(31014) +const compare = __nccwpck_require__(46982) + +// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: +// - Every simple range `r1, r2, ...` is a null set, OR +// - Every simple range `r1, r2, ...` which is not a null set is a subset of +// some `R1, R2, ...` +// +// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: +// - If c is only the ANY comparator +// - If C is only the ANY comparator, return true +// - Else if in prerelease mode, return false +// - else replace c with `[>=0.0.0]` +// - If C is only the ANY comparator +// - if in prerelease mode, return true +// - else replace C with `[>=0.0.0]` +// - Let EQ be the set of = comparators in c +// - If EQ is more than one, return true (null set) +// - Let GT be the highest > or >= comparator in c +// - Let LT be the lowest < or <= comparator in c +// - If GT and LT, and GT.semver > LT.semver, return true (null set) +// - If any C is a = range, and GT or LT are set, return false +// - If EQ +// - If GT, and EQ does not satisfy GT, return true (null set) +// - If LT, and EQ does not satisfy LT, return true (null set) +// - If EQ satisfies every C, return true +// - Else return false +// - If GT +// - If GT.semver is lower than any > or >= comp in C, return false +// - If GT is >=, and GT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the GT.semver tuple, return false +// - If LT +// - If LT.semver is greater than any < or <= comp in C, return false +// - If LT is <=, and LT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the LT.semver tuple, return false +// - Else return true + +const subset = (sub, dom, options = {}) => { + if (sub === dom) { + return true + } + + sub = new Range(sub, options) + dom = new Range(dom, options) + let sawNonNull = false + + OUTER: for (const simpleSub of sub.set) { + for (const simpleDom of dom.set) { + const isSub = simpleSubset(simpleSub, simpleDom, options) + sawNonNull = sawNonNull || isSub !== null + if (isSub) { + continue OUTER + } + } + // the null set is a subset of everything, but null simple ranges in + // a complex range should be ignored. so if we saw a non-null range, + // then we know this isn't a subset, but if EVERY simple range was null, + // then it is a subset. + if (sawNonNull) { + return false + } + } + return true +} + +const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')] +const minimumVersion = [new Comparator('>=0.0.0')] + +const simpleSubset = (sub, dom, options) => { + if (sub === dom) { + return true + } + + if (sub.length === 1 && sub[0].semver === ANY) { + if (dom.length === 1 && dom[0].semver === ANY) { + return true + } else if (options.includePrerelease) { + sub = minimumVersionWithPreRelease + } else { + sub = minimumVersion + } + } + + if (dom.length === 1 && dom[0].semver === ANY) { + if (options.includePrerelease) { + return true + } else { + dom = minimumVersion + } + } + + const eqSet = new Set() + let gt, lt + for (const c of sub) { + if (c.operator === '>' || c.operator === '>=') { + gt = higherGT(gt, c, options) + } else if (c.operator === '<' || c.operator === '<=') { + lt = lowerLT(lt, c, options) + } else { + eqSet.add(c.semver) + } + } + + if (eqSet.size > 1) { + return null + } + + let gtltComp + if (gt && lt) { + gtltComp = compare(gt.semver, lt.semver, options) + if (gtltComp > 0) { + return null + } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { + return null + } + } + + // will iterate one or zero times + for (const eq of eqSet) { + if (gt && !satisfies(eq, String(gt), options)) { + return null + } + + if (lt && !satisfies(eq, String(lt), options)) { + return null + } + + for (const c of dom) { + if (!satisfies(eq, String(c), options)) { + return false + } + } + + return true + } + + let higher, lower + let hasDomLT, hasDomGT + // if the subset has a prerelease, we need a comparator in the superset + // with the same tuple and a prerelease, or it's not a subset + let needDomLTPre = lt && + !options.includePrerelease && + lt.semver.prerelease.length ? lt.semver : false + let needDomGTPre = gt && + !options.includePrerelease && + gt.semver.prerelease.length ? gt.semver : false + // exception: <1.2.3-0 is the same as <1.2.3 + if (needDomLTPre && needDomLTPre.prerelease.length === 1 && + lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { + needDomLTPre = false + } + + for (const c of dom) { + hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' + hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' + if (gt) { + if (needDomGTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomGTPre.major && + c.semver.minor === needDomGTPre.minor && + c.semver.patch === needDomGTPre.patch) { + needDomGTPre = false + } + } + if (c.operator === '>' || c.operator === '>=') { + higher = higherGT(gt, c, options) + if (higher === c && higher !== gt) { + return false + } + } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) { + return false + } + } + if (lt) { + if (needDomLTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomLTPre.major && + c.semver.minor === needDomLTPre.minor && + c.semver.patch === needDomLTPre.patch) { + needDomLTPre = false + } + } + if (c.operator === '<' || c.operator === '<=') { + lower = lowerLT(lt, c, options) + if (lower === c && lower !== lt) { + return false + } + } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) { + return false + } + } + if (!c.operator && (lt || gt) && gtltComp !== 0) { + return false + } + } + + // if there was a < or >, and nothing in the dom, then must be false + // UNLESS it was limited by another range in the other direction. + // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 + if (gt && hasDomLT && !lt && gtltComp !== 0) { + return false + } + + if (lt && hasDomGT && !gt && gtltComp !== 0) { + return false + } + + // we needed a prerelease range in a specific tuple, but didn't get one + // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, + // because it includes prereleases in the 1.2.3 tuple + if (needDomGTPre || needDomLTPre) { + return false + } + + return true +} + +// >=1.2.3 is lower than >1.2.3 +const higherGT = (a, b, options) => { + if (!a) { + return b + } + const comp = compare(a.semver, b.semver, options) + return comp > 0 ? a + : comp < 0 ? b + : b.operator === '>' && a.operator === '>=' ? b + : a +} + +// <=1.2.3 is higher than <1.2.3 +const lowerLT = (a, b, options) => { + if (!a) { + return b + } + const comp = compare(a.semver, b.semver, options) + return comp < 0 ? a + : comp > 0 ? b + : b.operator === '<' && a.operator === '<=' ? b + : a +} + +module.exports = subset + + +/***/ }), + +/***/ 75257: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(51563) + +// Mostly just for testing and legacy API reasons +const toComparators = (range, options) => + new Range(range, options).set + .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) + +module.exports = toComparators + + +/***/ }), + +/***/ 13657: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(51563) +const validRange = (range, options) => { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} +module.exports = validRange + + +/***/ }), + +/***/ 45038: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(50795), exports); +__exportStar(__nccwpck_require__(51636), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 50795: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.IORedisInstrumentation = void 0; +const api_1 = __nccwpck_require__(65163); +const instrumentation_1 = __nccwpck_require__(65584); +const semantic_conventions_1 = __nccwpck_require__(67275); +const instrumentation_2 = __nccwpck_require__(65584); +const utils_1 = __nccwpck_require__(80681); +const redis_common_1 = __nccwpck_require__(3194); +/** @knipignore */ +const version_1 = __nccwpck_require__(99183); +const DEFAULT_CONFIG = { + requireParentSpan: true, +}; +class IORedisInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, Object.assign(Object.assign({}, DEFAULT_CONFIG), config)); + } + setConfig(config = {}) { + super.setConfig(Object.assign(Object.assign({}, DEFAULT_CONFIG), config)); + } + init() { + return [ + new instrumentation_1.InstrumentationNodeModuleDefinition('ioredis', ['>=2.0.0 <6'], (module, moduleVersion) => { + const moduleExports = module[Symbol.toStringTag] === 'Module' + ? module.default // ESM + : module; // CommonJS + if ((0, instrumentation_1.isWrapped)(moduleExports.prototype.sendCommand)) { + this._unwrap(moduleExports.prototype, 'sendCommand'); + } + this._wrap(moduleExports.prototype, 'sendCommand', this._patchSendCommand(moduleVersion)); + if ((0, instrumentation_1.isWrapped)(moduleExports.prototype.connect)) { + this._unwrap(moduleExports.prototype, 'connect'); + } + this._wrap(moduleExports.prototype, 'connect', this._patchConnection()); + return module; + }, module => { + if (module === undefined) + return; + const moduleExports = module[Symbol.toStringTag] === 'Module' + ? module.default // ESM + : module; // CommonJS + this._unwrap(moduleExports.prototype, 'sendCommand'); + this._unwrap(moduleExports.prototype, 'connect'); + }), + ]; + } + /** + * Patch send command internal to trace requests + */ + _patchSendCommand(moduleVersion) { + return (original) => { + return this._traceSendCommand(original, moduleVersion); + }; + } + _patchConnection() { + return (original) => { + return this._traceConnection(original); + }; + } + _traceSendCommand(original, moduleVersion) { + const instrumentation = this; + return function (cmd) { + if (arguments.length < 1 || typeof cmd !== 'object') { + return original.apply(this, arguments); + } + const config = instrumentation.getConfig(); + const dbStatementSerializer = config.dbStatementSerializer || redis_common_1.defaultDbStatementSerializer; + const hasNoParentSpan = api_1.trace.getSpan(api_1.context.active()) === undefined; + if (config.requireParentSpan === true && hasNoParentSpan) { + return original.apply(this, arguments); + } + const span = instrumentation.tracer.startSpan(cmd.name, { + kind: api_1.SpanKind.CLIENT, + attributes: { + [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_REDIS, + [semantic_conventions_1.SEMATTRS_DB_STATEMENT]: dbStatementSerializer(cmd.name, cmd.args), + }, + }); + const { requestHook } = config; + if (requestHook) { + (0, instrumentation_2.safeExecuteInTheMiddle)(() => requestHook(span, { + moduleVersion, + cmdName: cmd.name, + cmdArgs: cmd.args, + }), e => { + if (e) { + api_1.diag.error('ioredis instrumentation: request hook failed', e); + } + }, true); + } + const { host, port } = this.options; + span.setAttributes({ + [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: host, + [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: port, + [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: `redis://${host}:${port}`, + }); + try { + const result = original.apply(this, arguments); + const origResolve = cmd.resolve; + /* eslint-disable @typescript-eslint/no-explicit-any */ + cmd.resolve = function (result) { + (0, instrumentation_2.safeExecuteInTheMiddle)(() => { var _a; return (_a = config.responseHook) === null || _a === void 0 ? void 0 : _a.call(config, span, cmd.name, cmd.args, result); }, e => { + if (e) { + api_1.diag.error('ioredis instrumentation: response hook failed', e); + } + }, true); + (0, utils_1.endSpan)(span, null); + origResolve(result); + }; + const origReject = cmd.reject; + cmd.reject = function (err) { + (0, utils_1.endSpan)(span, err); + origReject(err); + }; + return result; + } + catch (error) { + (0, utils_1.endSpan)(span, error); + throw error; + } + }; + } + _traceConnection(original) { + const instrumentation = this; + return function () { + const hasNoParentSpan = api_1.trace.getSpan(api_1.context.active()) === undefined; + if (instrumentation.getConfig().requireParentSpan === true && + hasNoParentSpan) { + return original.apply(this, arguments); + } + const span = instrumentation.tracer.startSpan('connect', { + kind: api_1.SpanKind.CLIENT, + attributes: { + [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_REDIS, + [semantic_conventions_1.SEMATTRS_DB_STATEMENT]: 'connect', + }, + }); + const { host, port } = this.options; + span.setAttributes({ + [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: host, + [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: port, + [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: `redis://${host}:${port}`, + }); + try { + const client = original.apply(this, arguments); + (0, utils_1.endSpan)(span, null); + return client; + } + catch (error) { + (0, utils_1.endSpan)(span, error); + throw error; + } + }; + } +} +exports.IORedisInstrumentation = IORedisInstrumentation; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 51636: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 80681: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.endSpan = void 0; +const api_1 = __nccwpck_require__(65163); +const endSpan = (span, err) => { + if (err) { + span.recordException(err); + span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: err.message, + }); + } + span.end(); +}; +exports.endSpan = endSpan; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 99183: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.47.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-ioredis'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 82331: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors, Aspecto + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(61675), exports); +__exportStar(__nccwpck_require__(97810), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 61675: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors, Aspecto + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.KafkaJsInstrumentation = void 0; +const api_1 = __nccwpck_require__(65163); +const semantic_conventions_1 = __nccwpck_require__(67275); +/** @knipignore */ +const version_1 = __nccwpck_require__(58887); +const propagator_1 = __nccwpck_require__(11863); +const instrumentation_1 = __nccwpck_require__(65584); +class KafkaJsInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); + } + init() { + const unpatch = (moduleExports) => { + var _a, _b; + if ((0, instrumentation_1.isWrapped)((_a = moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.Kafka) === null || _a === void 0 ? void 0 : _a.prototype.producer)) { + this._unwrap(moduleExports.Kafka.prototype, 'producer'); + } + if ((0, instrumentation_1.isWrapped)((_b = moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.Kafka) === null || _b === void 0 ? void 0 : _b.prototype.consumer)) { + this._unwrap(moduleExports.Kafka.prototype, 'consumer'); + } + }; + const module = new instrumentation_1.InstrumentationNodeModuleDefinition('kafkajs', ['>=0.1.0 <3'], (moduleExports) => { + var _a, _b; + unpatch(moduleExports); + this._wrap((_a = moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.Kafka) === null || _a === void 0 ? void 0 : _a.prototype, 'producer', this._getProducerPatch()); + this._wrap((_b = moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.Kafka) === null || _b === void 0 ? void 0 : _b.prototype, 'consumer', this._getConsumerPatch()); + return moduleExports; + }, unpatch); + return module; + } + _getConsumerPatch() { + const instrumentation = this; + return (original) => { + return function consumer(...args) { + const newConsumer = original.apply(this, args); + if ((0, instrumentation_1.isWrapped)(newConsumer.run)) { + instrumentation._unwrap(newConsumer, 'run'); + } + instrumentation._wrap(newConsumer, 'run', instrumentation._getConsumerRunPatch()); + return newConsumer; + }; + }; + } + _getProducerPatch() { + const instrumentation = this; + return (original) => { + return function consumer(...args) { + const newProducer = original.apply(this, args); + if ((0, instrumentation_1.isWrapped)(newProducer.sendBatch)) { + instrumentation._unwrap(newProducer, 'sendBatch'); + } + instrumentation._wrap(newProducer, 'sendBatch', instrumentation._getProducerSendBatchPatch()); + if ((0, instrumentation_1.isWrapped)(newProducer.send)) { + instrumentation._unwrap(newProducer, 'send'); + } + instrumentation._wrap(newProducer, 'send', instrumentation._getProducerSendPatch()); + return newProducer; + }; + }; + } + _getConsumerRunPatch() { + const instrumentation = this; + return (original) => { + return function run(...args) { + const config = args[0]; + if (config === null || config === void 0 ? void 0 : config.eachMessage) { + if ((0, instrumentation_1.isWrapped)(config.eachMessage)) { + instrumentation._unwrap(config, 'eachMessage'); + } + instrumentation._wrap(config, 'eachMessage', instrumentation._getConsumerEachMessagePatch()); + } + if (config === null || config === void 0 ? void 0 : config.eachBatch) { + if ((0, instrumentation_1.isWrapped)(config.eachBatch)) { + instrumentation._unwrap(config, 'eachBatch'); + } + instrumentation._wrap(config, 'eachBatch', instrumentation._getConsumerEachBatchPatch()); + } + return original.call(this, config); + }; + }; + } + _getConsumerEachMessagePatch() { + const instrumentation = this; + return (original) => { + return function eachMessage(...args) { + const payload = args[0]; + const propagatedContext = api_1.propagation.extract(api_1.ROOT_CONTEXT, payload.message.headers, propagator_1.bufferTextMapGetter); + const span = instrumentation._startConsumerSpan(payload.topic, payload.message, semantic_conventions_1.MESSAGINGOPERATIONVALUES_PROCESS, propagatedContext); + const eachMessagePromise = api_1.context.with(api_1.trace.setSpan(propagatedContext, span), () => { + return original.apply(this, args); + }); + return instrumentation._endSpansOnPromise([span], eachMessagePromise); + }; + }; + } + _getConsumerEachBatchPatch() { + return (original) => { + const instrumentation = this; + return function eachBatch(...args) { + const payload = args[0]; + // https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/messaging.md#topic-with-multiple-consumers + const receivingSpan = instrumentation._startConsumerSpan(payload.batch.topic, undefined, semantic_conventions_1.MESSAGINGOPERATIONVALUES_RECEIVE, api_1.ROOT_CONTEXT); + return api_1.context.with(api_1.trace.setSpan(api_1.context.active(), receivingSpan), () => { + const spans = payload.batch.messages.map((message) => { + var _a; + const propagatedContext = api_1.propagation.extract(api_1.ROOT_CONTEXT, message.headers, propagator_1.bufferTextMapGetter); + const spanContext = (_a = api_1.trace + .getSpan(propagatedContext)) === null || _a === void 0 ? void 0 : _a.spanContext(); + let origSpanLink; + if (spanContext) { + origSpanLink = { + context: spanContext, + }; + } + return instrumentation._startConsumerSpan(payload.batch.topic, message, semantic_conventions_1.MESSAGINGOPERATIONVALUES_PROCESS, undefined, origSpanLink); + }); + const batchMessagePromise = original.apply(this, args); + spans.unshift(receivingSpan); + return instrumentation._endSpansOnPromise(spans, batchMessagePromise); + }); + }; + }; + } + _getProducerSendBatchPatch() { + const instrumentation = this; + return (original) => { + return function sendBatch(...args) { + const batch = args[0]; + const messages = batch.topicMessages || []; + const spans = messages + .map(topicMessage => topicMessage.messages.map(message => instrumentation._startProducerSpan(topicMessage.topic, message))) + .reduce((acc, val) => acc.concat(val), []); + const origSendResult = original.apply(this, args); + return instrumentation._endSpansOnPromise(spans, origSendResult); + }; + }; + } + _getProducerSendPatch() { + const instrumentation = this; + return (original) => { + return function send(...args) { + const record = args[0]; + const spans = record.messages.map(message => { + return instrumentation._startProducerSpan(record.topic, message); + }); + const origSendResult = original.apply(this, args); + return instrumentation._endSpansOnPromise(spans, origSendResult); + }; + }; + } + _endSpansOnPromise(spans, sendPromise) { + return Promise.resolve(sendPromise) + .catch(reason => { + let errorMessage; + if (typeof reason === 'string') + errorMessage = reason; + else if (typeof reason === 'object' && + Object.prototype.hasOwnProperty.call(reason, 'message')) + errorMessage = reason.message; + spans.forEach(span => span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: errorMessage, + })); + throw reason; + }) + .finally(() => { + spans.forEach(span => span.end()); + }); + } + _startConsumerSpan(topic, message, operation, context, link) { + const span = this.tracer.startSpan(topic, { + kind: api_1.SpanKind.CONSUMER, + attributes: { + [semantic_conventions_1.SEMATTRS_MESSAGING_SYSTEM]: 'kafka', + [semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION]: topic, + [semantic_conventions_1.SEMATTRS_MESSAGING_OPERATION]: operation, + }, + links: link ? [link] : [], + }, context); + const { consumerHook } = this.getConfig(); + if (consumerHook && message) { + (0, instrumentation_1.safeExecuteInTheMiddle)(() => consumerHook(span, { topic, message }), e => { + if (e) + this._diag.error('consumerHook error', e); + }, true); + } + return span; + } + _startProducerSpan(topic, message) { + var _a; + const span = this.tracer.startSpan(topic, { + kind: api_1.SpanKind.PRODUCER, + attributes: { + [semantic_conventions_1.SEMATTRS_MESSAGING_SYSTEM]: 'kafka', + [semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION]: topic, + }, + }); + message.headers = (_a = message.headers) !== null && _a !== void 0 ? _a : {}; + api_1.propagation.inject(api_1.trace.setSpan(api_1.context.active(), span), message.headers); + const { producerHook } = this.getConfig(); + if (producerHook) { + (0, instrumentation_1.safeExecuteInTheMiddle)(() => producerHook(span, { topic, message }), e => { + if (e) + this._diag.error('producerHook error', e); + }, true); + } + return span; + } +} +exports.KafkaJsInstrumentation = KafkaJsInstrumentation; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 11863: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.bufferTextMapGetter = void 0; +/* +same as open telemetry's `defaultTextMapGetter`, +but also handle case where header is buffer, +adding toString() to make sure string is returned +*/ +exports.bufferTextMapGetter = { + get(carrier, key) { + var _a; + if (!carrier) { + return undefined; + } + const keys = Object.keys(carrier); + for (const carrierKey of keys) { + if (carrierKey === key || carrierKey.toLowerCase() === key) { + return (_a = carrier[carrierKey]) === null || _a === void 0 ? void 0 : _a.toString(); + } + } + return undefined; + }, + keys(carrier) { + return carrier ? Object.keys(carrier) : []; + }, +}; +//# sourceMappingURL=propagator.js.map + +/***/ }), + +/***/ 97810: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 58887: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.7.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-kafkajs'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 79507: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SUPPORTED_VERSIONS = exports.MODULE_NAME = void 0; +exports.MODULE_NAME = 'knex'; +exports.SUPPORTED_VERSIONS = [ + // use "lib/execution" for runner.js, "lib" for client.js as basepath, latest tested 0.95.6 + '>=0.22.0 <4', + // use "lib" as basepath + '>=0.10.0 <0.18.0', + '>=0.19.0 <0.22.0', + // use "src" as basepath + '>=0.18.0 <0.19.0', +]; +//# sourceMappingURL=constants.js.map + +/***/ }), + +/***/ 12083: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(28661), exports); +__exportStar(__nccwpck_require__(58437), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 28661: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.KnexInstrumentation = void 0; +const api = __nccwpck_require__(65163); +/** @knipignore */ +const version_1 = __nccwpck_require__(59922); +const constants = __nccwpck_require__(79507); +const instrumentation_1 = __nccwpck_require__(65584); +const semantic_conventions_1 = __nccwpck_require__(67275); +const utils = __nccwpck_require__(19556); +const contextSymbol = Symbol('opentelemetry.instrumentation-knex.context'); +const DEFAULT_CONFIG = { + maxQueryLength: 1022, + requireParentSpan: false, +}; +class KnexInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, Object.assign(Object.assign({}, DEFAULT_CONFIG), config)); + } + setConfig(config = {}) { + super.setConfig(Object.assign(Object.assign({}, DEFAULT_CONFIG), config)); + } + init() { + const module = new instrumentation_1.InstrumentationNodeModuleDefinition(constants.MODULE_NAME, constants.SUPPORTED_VERSIONS); + module.files.push(this.getClientNodeModuleFileInstrumentation('src'), this.getClientNodeModuleFileInstrumentation('lib'), this.getRunnerNodeModuleFileInstrumentation('src'), this.getRunnerNodeModuleFileInstrumentation('lib'), this.getRunnerNodeModuleFileInstrumentation('lib/execution')); + return module; + } + getRunnerNodeModuleFileInstrumentation(basePath) { + return new instrumentation_1.InstrumentationNodeModuleFile(`knex/${basePath}/runner.js`, constants.SUPPORTED_VERSIONS, (Runner, moduleVersion) => { + this.ensureWrapped(Runner.prototype, 'query', this.createQueryWrapper(moduleVersion)); + return Runner; + }, (Runner, moduleVersion) => { + this._unwrap(Runner.prototype, 'query'); + return Runner; + }); + } + getClientNodeModuleFileInstrumentation(basePath) { + return new instrumentation_1.InstrumentationNodeModuleFile(`knex/${basePath}/client.js`, constants.SUPPORTED_VERSIONS, (Client) => { + this.ensureWrapped(Client.prototype, 'queryBuilder', this.storeContext.bind(this)); + this.ensureWrapped(Client.prototype, 'schemaBuilder', this.storeContext.bind(this)); + this.ensureWrapped(Client.prototype, 'raw', this.storeContext.bind(this)); + return Client; + }, (Client) => { + this._unwrap(Client.prototype, 'queryBuilder'); + this._unwrap(Client.prototype, 'schemaBuilder'); + this._unwrap(Client.prototype, 'raw'); + return Client; + }); + } + createQueryWrapper(moduleVersion) { + const instrumentation = this; + return function wrapQuery(original) { + return function wrapped_logging_method(query) { + var _a, _b, _c, _d, _e, _f; + const config = this.client.config; + const table = utils.extractTableName(this.builder); + // `method` actually refers to the knex API method - Not exactly "operation" + // in the spec sense, but matches most of the time. + const operation = query === null || query === void 0 ? void 0 : query.method; + const name = ((_a = config === null || config === void 0 ? void 0 : config.connection) === null || _a === void 0 ? void 0 : _a.filename) || ((_b = config === null || config === void 0 ? void 0 : config.connection) === null || _b === void 0 ? void 0 : _b.database); + const { maxQueryLength } = instrumentation.getConfig(); + const attributes = { + 'knex.version': moduleVersion, + [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: utils.mapSystem(config.client), + [semantic_conventions_1.SEMATTRS_DB_SQL_TABLE]: table, + [semantic_conventions_1.SEMATTRS_DB_OPERATION]: operation, + [semantic_conventions_1.SEMATTRS_DB_USER]: (_c = config === null || config === void 0 ? void 0 : config.connection) === null || _c === void 0 ? void 0 : _c.user, + [semantic_conventions_1.SEMATTRS_DB_NAME]: name, + [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: (_d = config === null || config === void 0 ? void 0 : config.connection) === null || _d === void 0 ? void 0 : _d.host, + [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: (_e = config === null || config === void 0 ? void 0 : config.connection) === null || _e === void 0 ? void 0 : _e.port, + [semantic_conventions_1.SEMATTRS_NET_TRANSPORT]: ((_f = config === null || config === void 0 ? void 0 : config.connection) === null || _f === void 0 ? void 0 : _f.filename) === ':memory:' ? 'inproc' : undefined, + }; + if (maxQueryLength) { + // filters both undefined and 0 + attributes[semantic_conventions_1.SEMATTRS_DB_STATEMENT] = utils.limitLength(query === null || query === void 0 ? void 0 : query.sql, maxQueryLength); + } + const parentContext = this.builder[contextSymbol] || api.context.active(); + const parentSpan = api.trace.getSpan(parentContext); + const hasActiveParent = parentSpan && api.trace.isSpanContextValid(parentSpan.spanContext()); + if (instrumentation._config.requireParentSpan && !hasActiveParent) { + return original.bind(this)(...arguments); + } + const span = instrumentation.tracer.startSpan(utils.getName(name, operation, table), { + kind: api.SpanKind.CLIENT, + attributes, + }, parentContext); + const spanContext = api.trace.setSpan(api.context.active(), span); + return api.context + .with(spanContext, original, this, ...arguments) + .then((result) => { + span.end(); + return result; + }) + .catch((err) => { + // knex adds full query with all the binding values to the message, + // we want to undo that without changing the original error + const formatter = utils.getFormatter(this); + const fullQuery = formatter(query.sql, query.bindings || []); + const message = err.message.replace(fullQuery + ' - ', ''); + const clonedError = utils.cloneErrorWithNewMessage(err, message); + span.recordException(clonedError); + span.setStatus({ code: api.SpanStatusCode.ERROR, message }); + span.end(); + throw err; + }); + }; + }; + } + storeContext(original) { + return function wrapped_logging_method() { + const builder = original.apply(this, arguments); + // Builder is a custom promise type and when awaited it fails to propagate context. + // We store the parent context at the moment of initiating the builder + // otherwise we'd have nothing to attach the span as a child for in `query`. + Object.defineProperty(builder, contextSymbol, { + value: api.context.active(), + }); + return builder; + }; + } + ensureWrapped(obj, methodName, wrapper) { + if ((0, instrumentation_1.isWrapped)(obj[methodName])) { + this._unwrap(obj, methodName); + } + this._wrap(obj, methodName, wrapper); + } +} +exports.KnexInstrumentation = KnexInstrumentation; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 58437: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 19556: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.extractTableName = exports.limitLength = exports.getName = exports.mapSystem = exports.cloneErrorWithNewMessage = exports.getFormatter = void 0; +const semantic_conventions_1 = __nccwpck_require__(67275); +const getFormatter = (runner) => { + if (runner) { + if (runner.client) { + if (runner.client._formatQuery) { + return runner.client._formatQuery.bind(runner.client); + } + else if (runner.client.SqlString) { + return runner.client.SqlString.format.bind(runner.client.SqlString); + } + } + if (runner.builder) { + return runner.builder.toString.bind(runner.builder); + } + } + return () => ''; +}; +exports.getFormatter = getFormatter; +const cloneErrorWithNewMessage = (err, message) => { + if (err && err instanceof Error) { + const clonedError = new err.constructor(message); + clonedError.code = err.code; + clonedError.stack = err.stack; + clonedError.errno = err.errno; + return clonedError; + } + return err; +}; +exports.cloneErrorWithNewMessage = cloneErrorWithNewMessage; +const systemMap = new Map([ + ['sqlite3', semantic_conventions_1.DBSYSTEMVALUES_SQLITE], + ['pg', semantic_conventions_1.DBSYSTEMVALUES_POSTGRESQL], +]); +const mapSystem = (knexSystem) => { + return systemMap.get(knexSystem) || knexSystem; +}; +exports.mapSystem = mapSystem; +const getName = (db, operation, table) => { + if (operation) { + if (table) { + return `${operation} ${db}.${table}`; + } + return `${operation} ${db}`; + } + return db; +}; +exports.getName = getName; +const limitLength = (str, maxLength) => { + if (typeof str === 'string' && + typeof maxLength === 'number' && + 0 < maxLength && + maxLength < str.length) { + return str.substring(0, maxLength) + '..'; + } + return str; +}; +exports.limitLength = limitLength; +const extractTableName = (builder) => { + var _a; + const table = (_a = builder === null || builder === void 0 ? void 0 : builder._single) === null || _a === void 0 ? void 0 : _a.table; + if (typeof table === 'object') { + return (0, exports.extractTableName)(table); + } + return table; +}; +exports.extractTableName = extractTableName; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 59922: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.44.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-knex'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 8364: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AttributeNames = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var AttributeNames; +(function (AttributeNames) { + AttributeNames["KOA_TYPE"] = "koa.type"; + AttributeNames["KOA_NAME"] = "koa.name"; +})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {})); +//# sourceMappingURL=AttributeNames.js.map + +/***/ }), + +/***/ 68168: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(200), exports); +__exportStar(__nccwpck_require__(4993), exports); +__exportStar(__nccwpck_require__(8364), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 200: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.KoaInstrumentation = void 0; +const api = __nccwpck_require__(65163); +const instrumentation_1 = __nccwpck_require__(65584); +const types_1 = __nccwpck_require__(4993); +/** @knipignore */ +const version_1 = __nccwpck_require__(74757); +const utils_1 = __nccwpck_require__(26619); +const core_1 = __nccwpck_require__(89736); +const internal_types_1 = __nccwpck_require__(8207); +/** Koa instrumentation for OpenTelemetry */ +class KoaInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); + } + init() { + return new instrumentation_1.InstrumentationNodeModuleDefinition('koa', ['>=2.0.0 <3'], (module) => { + const moduleExports = module[Symbol.toStringTag] === 'Module' + ? module.default // ESM + : module; // CommonJS + if (moduleExports == null) { + return moduleExports; + } + if ((0, instrumentation_1.isWrapped)(moduleExports.prototype.use)) { + this._unwrap(moduleExports.prototype, 'use'); + } + this._wrap(moduleExports.prototype, 'use', this._getKoaUsePatch.bind(this)); + return module; + }, (module) => { + const moduleExports = module[Symbol.toStringTag] === 'Module' + ? module.default // ESM + : module; // CommonJS + if ((0, instrumentation_1.isWrapped)(moduleExports.prototype.use)) { + this._unwrap(moduleExports.prototype, 'use'); + } + }); + } + /** + * Patches the Koa.use function in order to instrument each original + * middleware layer which is introduced + * @param {KoaMiddleware} middleware - the original middleware function + */ + _getKoaUsePatch(original) { + const plugin = this; + return function use(middlewareFunction) { + let patchedFunction; + if (middlewareFunction.router) { + patchedFunction = plugin._patchRouterDispatch(middlewareFunction); + } + else { + patchedFunction = plugin._patchLayer(middlewareFunction, false); + } + return original.apply(this, [patchedFunction]); + }; + } + /** + * Patches the dispatch function used by @koa/router. This function + * goes through each routed middleware and adds instrumentation via a call + * to the @function _patchLayer function. + * @param {KoaMiddleware} dispatchLayer - the original dispatch function which dispatches + * routed middleware + */ + _patchRouterDispatch(dispatchLayer) { + var _a; + api.diag.debug('Patching @koa/router dispatch'); + const router = dispatchLayer.router; + const routesStack = (_a = router === null || router === void 0 ? void 0 : router.stack) !== null && _a !== void 0 ? _a : []; + for (const pathLayer of routesStack) { + const path = pathLayer.path; + const pathStack = pathLayer.stack; + for (let j = 0; j < pathStack.length; j++) { + const routedMiddleware = pathStack[j]; + pathStack[j] = this._patchLayer(routedMiddleware, true, path); + } + } + return dispatchLayer; + } + /** + * Patches each individual @param middlewareLayer function in order to create the + * span and propagate context. It does not create spans when there is no parent span. + * @param {KoaMiddleware} middlewareLayer - the original middleware function. + * @param {boolean} isRouter - tracks whether the original middleware function + * was dispatched by the router originally + * @param {string?} layerPath - if present, provides additional data from the + * router about the routed path which the middleware is attached to + */ + _patchLayer(middlewareLayer, isRouter, layerPath) { + const layerType = isRouter ? types_1.KoaLayerType.ROUTER : types_1.KoaLayerType.MIDDLEWARE; + // Skip patching layer if its ignored in the config + if (middlewareLayer[internal_types_1.kLayerPatched] === true || + (0, utils_1.isLayerIgnored)(layerType, this.getConfig())) + return middlewareLayer; + if (middlewareLayer.constructor.name === 'GeneratorFunction' || + middlewareLayer.constructor.name === 'AsyncGeneratorFunction') { + api.diag.debug('ignoring generator-based Koa middleware layer'); + return middlewareLayer; + } + middlewareLayer[internal_types_1.kLayerPatched] = true; + api.diag.debug('patching Koa middleware layer'); + return async (context, next) => { + const parent = api.trace.getSpan(api.context.active()); + if (parent === undefined) { + return middlewareLayer(context, next); + } + const metadata = (0, utils_1.getMiddlewareMetadata)(context, middlewareLayer, isRouter, layerPath); + const span = this.tracer.startSpan(metadata.name, { + attributes: metadata.attributes, + }); + const rpcMetadata = (0, core_1.getRPCMetadata)(api.context.active()); + if ((rpcMetadata === null || rpcMetadata === void 0 ? void 0 : rpcMetadata.type) === core_1.RPCType.HTTP && context._matchedRoute) { + rpcMetadata.route = context._matchedRoute.toString(); + } + const { requestHook } = this.getConfig(); + if (requestHook) { + (0, instrumentation_1.safeExecuteInTheMiddle)(() => requestHook(span, { + context, + middlewareLayer, + layerType, + }), e => { + if (e) { + api.diag.error('koa instrumentation: request hook failed', e); + } + }, true); + } + const newContext = api.trace.setSpan(api.context.active(), span); + return api.context.with(newContext, async () => { + try { + return await middlewareLayer(context, next); + } + catch (err) { + span.recordException(err); + throw err; + } + finally { + span.end(); + } + }); + }; + } +} +exports.KoaInstrumentation = KoaInstrumentation; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 8207: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.kLayerPatched = void 0; +/** + * This symbol is used to mark a Koa layer as being already instrumented + * since its possible to use a given layer multiple times (ex: middlewares) + */ +exports.kLayerPatched = Symbol('koa-layer-patched'); +//# sourceMappingURL=internal-types.js.map + +/***/ }), + +/***/ 4993: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.KoaLayerType = void 0; +var KoaLayerType; +(function (KoaLayerType) { + KoaLayerType["ROUTER"] = "router"; + KoaLayerType["MIDDLEWARE"] = "middleware"; +})(KoaLayerType = exports.KoaLayerType || (exports.KoaLayerType = {})); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 26619: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isLayerIgnored = exports.getMiddlewareMetadata = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const types_1 = __nccwpck_require__(4993); +const AttributeNames_1 = __nccwpck_require__(8364); +const semantic_conventions_1 = __nccwpck_require__(67275); +const getMiddlewareMetadata = (context, layer, isRouter, layerPath) => { + var _a; + if (isRouter) { + return { + attributes: { + [AttributeNames_1.AttributeNames.KOA_NAME]: layerPath === null || layerPath === void 0 ? void 0 : layerPath.toString(), + [AttributeNames_1.AttributeNames.KOA_TYPE]: types_1.KoaLayerType.ROUTER, + [semantic_conventions_1.SEMATTRS_HTTP_ROUTE]: layerPath === null || layerPath === void 0 ? void 0 : layerPath.toString(), + }, + name: context._matchedRouteName || `router - ${layerPath}`, + }; + } + else { + return { + attributes: { + [AttributeNames_1.AttributeNames.KOA_NAME]: (_a = layer.name) !== null && _a !== void 0 ? _a : 'middleware', + [AttributeNames_1.AttributeNames.KOA_TYPE]: types_1.KoaLayerType.MIDDLEWARE, + }, + name: `middleware - ${layer.name}`, + }; + } +}; +exports.getMiddlewareMetadata = getMiddlewareMetadata; +/** + * Check whether the given request is ignored by configuration + * @param [list] List of ignore patterns + * @param [onException] callback for doing something when an exception has + * occurred + */ +const isLayerIgnored = (type, config) => { + var _a; + return !!(Array.isArray(config === null || config === void 0 ? void 0 : config.ignoreLayersType) && + ((_a = config === null || config === void 0 ? void 0 : config.ignoreLayersType) === null || _a === void 0 ? void 0 : _a.includes(type))); +}; +exports.isLayerIgnored = isLayerIgnored; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 74757: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.47.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-koa'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 7362: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(78588), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 78588: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.LruMemoizerInstrumentation = void 0; +const api_1 = __nccwpck_require__(65163); +const instrumentation_1 = __nccwpck_require__(65584); +/** @knipignore */ +const version_1 = __nccwpck_require__(11528); +class LruMemoizerInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); + } + init() { + return [ + new instrumentation_1.InstrumentationNodeModuleDefinition('lru-memoizer', ['>=1.3 <3'], moduleExports => { + // moduleExports is a function which receives an options object, + // and returns a "memoizer" function upon invocation. + // We want to patch this "memoizer's" internal function + const asyncMemoizer = function () { + // This following function is invoked every time the user wants to get a (possible) memoized value + // We replace it with another function in which we bind the current context to the last argument (callback) + const origMemoizer = moduleExports.apply(this, arguments); + return function () { + const modifiedArguments = [...arguments]; + // last argument is the callback + const origCallback = modifiedArguments.pop(); + const callbackWithContext = typeof origCallback === 'function' + ? api_1.context.bind(api_1.context.active(), origCallback) + : origCallback; + modifiedArguments.push(callbackWithContext); + return origMemoizer.apply(this, modifiedArguments); + }; + }; + // sync function preserves context, but we still need to export it + // as the lru-memoizer package does + asyncMemoizer.sync = moduleExports.sync; + return asyncMemoizer; + }, undefined // no need to disable as this instrumentation does not create any spans + ), + ]; + } +} +exports.LruMemoizerInstrumentation = LruMemoizerInstrumentation; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 11528: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.44.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-lru-memoizer'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 25625: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(45373), exports); +__exportStar(__nccwpck_require__(68969), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 45373: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MongoDBInstrumentation = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const api_1 = __nccwpck_require__(65163); +const instrumentation_1 = __nccwpck_require__(65584); +const semantic_conventions_1 = __nccwpck_require__(67275); +const internal_types_1 = __nccwpck_require__(55807); +/** @knipignore */ +const version_1 = __nccwpck_require__(39617); +/** mongodb instrumentation plugin for OpenTelemetry */ +class MongoDBInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); + } + _updateMetricInstruments() { + this._connectionsUsage = this.meter.createUpDownCounter('db.client.connections.usage', { + description: 'The number of connections that are currently in state described by the state attribute.', + unit: '{connection}', + }); + } + init() { + const { v3PatchConnection: v3PatchConnection, v3UnpatchConnection: v3UnpatchConnection, } = this._getV3ConnectionPatches(); + const { v4PatchConnect, v4UnpatchConnect } = this._getV4ConnectPatches(); + const { v4PatchConnectionCallback, v4PatchConnectionPromise, v4UnpatchConnection, } = this._getV4ConnectionPatches(); + const { v4PatchConnectionPool, v4UnpatchConnectionPool } = this._getV4ConnectionPoolPatches(); + const { v4PatchSessions, v4UnpatchSessions } = this._getV4SessionsPatches(); + return [ + new instrumentation_1.InstrumentationNodeModuleDefinition('mongodb', ['>=3.3.0 <4'], undefined, undefined, [ + new instrumentation_1.InstrumentationNodeModuleFile('mongodb/lib/core/wireprotocol/index.js', ['>=3.3.0 <4'], v3PatchConnection, v3UnpatchConnection), + ]), + new instrumentation_1.InstrumentationNodeModuleDefinition('mongodb', ['>=4.0.0 <7'], undefined, undefined, [ + new instrumentation_1.InstrumentationNodeModuleFile('mongodb/lib/cmap/connection.js', ['>=4.0.0 <6.4'], v4PatchConnectionCallback, v4UnpatchConnection), + new instrumentation_1.InstrumentationNodeModuleFile('mongodb/lib/cmap/connection.js', ['>=6.4.0 <7'], v4PatchConnectionPromise, v4UnpatchConnection), + new instrumentation_1.InstrumentationNodeModuleFile('mongodb/lib/cmap/connection_pool.js', ['>=4.0.0 <6.4'], v4PatchConnectionPool, v4UnpatchConnectionPool), + new instrumentation_1.InstrumentationNodeModuleFile('mongodb/lib/cmap/connect.js', ['>=4.0.0 <7'], v4PatchConnect, v4UnpatchConnect), + new instrumentation_1.InstrumentationNodeModuleFile('mongodb/lib/sessions.js', ['>=4.0.0 <7'], v4PatchSessions, v4UnpatchSessions), + ]), + ]; + } + _getV3ConnectionPatches() { + return { + v3PatchConnection: (moduleExports) => { + // patch insert operation + if ((0, instrumentation_1.isWrapped)(moduleExports.insert)) { + this._unwrap(moduleExports, 'insert'); + } + this._wrap(moduleExports, 'insert', this._getV3PatchOperation('insert')); + // patch remove operation + if ((0, instrumentation_1.isWrapped)(moduleExports.remove)) { + this._unwrap(moduleExports, 'remove'); + } + this._wrap(moduleExports, 'remove', this._getV3PatchOperation('remove')); + // patch update operation + if ((0, instrumentation_1.isWrapped)(moduleExports.update)) { + this._unwrap(moduleExports, 'update'); + } + this._wrap(moduleExports, 'update', this._getV3PatchOperation('update')); + // patch other command + if ((0, instrumentation_1.isWrapped)(moduleExports.command)) { + this._unwrap(moduleExports, 'command'); + } + this._wrap(moduleExports, 'command', this._getV3PatchCommand()); + // patch query + if ((0, instrumentation_1.isWrapped)(moduleExports.query)) { + this._unwrap(moduleExports, 'query'); + } + this._wrap(moduleExports, 'query', this._getV3PatchFind()); + // patch get more operation on cursor + if ((0, instrumentation_1.isWrapped)(moduleExports.getMore)) { + this._unwrap(moduleExports, 'getMore'); + } + this._wrap(moduleExports, 'getMore', this._getV3PatchCursor()); + return moduleExports; + }, + v3UnpatchConnection: (moduleExports) => { + if (moduleExports === undefined) + return; + this._unwrap(moduleExports, 'insert'); + this._unwrap(moduleExports, 'remove'); + this._unwrap(moduleExports, 'update'); + this._unwrap(moduleExports, 'command'); + this._unwrap(moduleExports, 'query'); + this._unwrap(moduleExports, 'getMore'); + }, + }; + } + _getV4SessionsPatches() { + return { + v4PatchSessions: (moduleExports) => { + if ((0, instrumentation_1.isWrapped)(moduleExports.acquire)) { + this._unwrap(moduleExports, 'acquire'); + } + this._wrap(moduleExports.ServerSessionPool.prototype, 'acquire', this._getV4AcquireCommand()); + if ((0, instrumentation_1.isWrapped)(moduleExports.release)) { + this._unwrap(moduleExports, 'release'); + } + this._wrap(moduleExports.ServerSessionPool.prototype, 'release', this._getV4ReleaseCommand()); + return moduleExports; + }, + v4UnpatchSessions: (moduleExports) => { + if (moduleExports === undefined) + return; + if ((0, instrumentation_1.isWrapped)(moduleExports.acquire)) { + this._unwrap(moduleExports, 'acquire'); + } + if ((0, instrumentation_1.isWrapped)(moduleExports.release)) { + this._unwrap(moduleExports, 'release'); + } + }, + }; + } + _getV4AcquireCommand() { + const instrumentation = this; + return (original) => { + return function patchAcquire() { + const nSessionsBeforeAcquire = this.sessions.length; + const session = original.call(this); + const nSessionsAfterAcquire = this.sessions.length; + if (nSessionsBeforeAcquire === nSessionsAfterAcquire) { + //no session in the pool. a new session was created and used + instrumentation._connectionsUsage.add(1, { + state: 'used', + 'pool.name': instrumentation._poolName, + }); + } + else if (nSessionsBeforeAcquire - 1 === nSessionsAfterAcquire) { + //a session was already in the pool. remove it from the pool and use it. + instrumentation._connectionsUsage.add(-1, { + state: 'idle', + 'pool.name': instrumentation._poolName, + }); + instrumentation._connectionsUsage.add(1, { + state: 'used', + 'pool.name': instrumentation._poolName, + }); + } + return session; + }; + }; + } + _getV4ReleaseCommand() { + const instrumentation = this; + return (original) => { + return function patchRelease(session) { + const cmdPromise = original.call(this, session); + instrumentation._connectionsUsage.add(-1, { + state: 'used', + 'pool.name': instrumentation._poolName, + }); + instrumentation._connectionsUsage.add(1, { + state: 'idle', + 'pool.name': instrumentation._poolName, + }); + return cmdPromise; + }; + }; + } + _getV4ConnectionPoolPatches() { + return { + v4PatchConnectionPool: (moduleExports) => { + const poolPrototype = moduleExports.ConnectionPool.prototype; + if ((0, instrumentation_1.isWrapped)(poolPrototype.checkOut)) { + this._unwrap(poolPrototype, 'checkOut'); + } + this._wrap(poolPrototype, 'checkOut', this._getV4ConnectionPoolCheckOut()); + return moduleExports; + }, + v4UnpatchConnectionPool: (moduleExports) => { + if (moduleExports === undefined) + return; + this._unwrap(moduleExports.ConnectionPool.prototype, 'checkOut'); + }, + }; + } + _getV4ConnectPatches() { + return { + v4PatchConnect: (moduleExports) => { + if ((0, instrumentation_1.isWrapped)(moduleExports.connect)) { + this._unwrap(moduleExports, 'connect'); + } + this._wrap(moduleExports, 'connect', this._getV4ConnectCommand()); + return moduleExports; + }, + v4UnpatchConnect: (moduleExports) => { + if (moduleExports === undefined) + return; + this._unwrap(moduleExports, 'connect'); + }, + }; + } + // This patch will become unnecessary once + // https://jira.mongodb.org/browse/NODE-5639 is done. + _getV4ConnectionPoolCheckOut() { + return (original) => { + return function patchedCheckout(callback) { + const patchedCallback = api_1.context.bind(api_1.context.active(), callback); + return original.call(this, patchedCallback); + }; + }; + } + _getV4ConnectCommand() { + const instrumentation = this; + return (original) => { + return function patchedConnect(options, callback) { + // from v6.4 `connect` method only accepts an options param and returns a promise + // with the connection + if (original.length === 1) { + const result = original.call(this, options); + if (result && typeof result.then === 'function') { + result.then(() => instrumentation.setPoolName(options), + // this handler is set to pass the lint rules + () => undefined); + } + return result; + } + // Earlier versions expects a callback param and return void + const patchedCallback = function (err, conn) { + if (err || !conn) { + callback(err, conn); + return; + } + instrumentation.setPoolName(options); + callback(err, conn); + }; + return original.call(this, options, patchedCallback); + }; + }; + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _getV4ConnectionPatches() { + return { + v4PatchConnectionCallback: (moduleExports) => { + // patch insert operation + if ((0, instrumentation_1.isWrapped)(moduleExports.Connection.prototype.command)) { + this._unwrap(moduleExports.Connection.prototype, 'command'); + } + this._wrap(moduleExports.Connection.prototype, 'command', this._getV4PatchCommandCallback()); + return moduleExports; + }, + v4PatchConnectionPromise: (moduleExports) => { + // patch insert operation + if ((0, instrumentation_1.isWrapped)(moduleExports.Connection.prototype.command)) { + this._unwrap(moduleExports.Connection.prototype, 'command'); + } + this._wrap(moduleExports.Connection.prototype, 'command', this._getV4PatchCommandPromise()); + return moduleExports; + }, + v4UnpatchConnection: (moduleExports) => { + if (moduleExports === undefined) + return; + this._unwrap(moduleExports.Connection.prototype, 'command'); + }, + }; + } + /** Creates spans for common operations */ + _getV3PatchOperation(operationName) { + const instrumentation = this; + return (original) => { + return function patchedServerCommand(server, ns, ops, options, callback) { + const currentSpan = api_1.trace.getSpan(api_1.context.active()); + const resultHandler = typeof options === 'function' ? options : callback; + if (!currentSpan || + typeof resultHandler !== 'function' || + typeof ops !== 'object') { + if (typeof options === 'function') { + return original.call(this, server, ns, ops, options); + } + else { + return original.call(this, server, ns, ops, options, callback); + } + } + const span = instrumentation.tracer.startSpan(`mongodb.${operationName}`, { + kind: api_1.SpanKind.CLIENT, + }); + instrumentation._populateV3Attributes(span, ns, server, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ops[0], operationName); + const patchedCallback = instrumentation._patchEnd(span, resultHandler); + // handle when options is the callback to send the correct number of args + if (typeof options === 'function') { + return original.call(this, server, ns, ops, patchedCallback); + } + else { + return original.call(this, server, ns, ops, options, patchedCallback); + } + }; + }; + } + /** Creates spans for command operation */ + _getV3PatchCommand() { + const instrumentation = this; + return (original) => { + return function patchedServerCommand(server, ns, cmd, options, callback) { + const currentSpan = api_1.trace.getSpan(api_1.context.active()); + const resultHandler = typeof options === 'function' ? options : callback; + if (!currentSpan || + typeof resultHandler !== 'function' || + typeof cmd !== 'object') { + if (typeof options === 'function') { + return original.call(this, server, ns, cmd, options); + } + else { + return original.call(this, server, ns, cmd, options, callback); + } + } + const commandType = MongoDBInstrumentation._getCommandType(cmd); + const type = commandType === internal_types_1.MongodbCommandType.UNKNOWN ? 'command' : commandType; + const span = instrumentation.tracer.startSpan(`mongodb.${type}`, { + kind: api_1.SpanKind.CLIENT, + }); + const operation = commandType === internal_types_1.MongodbCommandType.UNKNOWN ? undefined : commandType; + instrumentation._populateV3Attributes(span, ns, server, cmd, operation); + const patchedCallback = instrumentation._patchEnd(span, resultHandler); + // handle when options is the callback to send the correct number of args + if (typeof options === 'function') { + return original.call(this, server, ns, cmd, patchedCallback); + } + else { + return original.call(this, server, ns, cmd, options, patchedCallback); + } + }; + }; + } + /** Creates spans for command operation */ + _getV4PatchCommandCallback() { + const instrumentation = this; + return (original) => { + return function patchedV4ServerCommand(ns, cmd, options, callback) { + const currentSpan = api_1.trace.getSpan(api_1.context.active()); + const resultHandler = callback; + const commandType = Object.keys(cmd)[0]; + if (typeof resultHandler !== 'function' || + typeof cmd !== 'object' || + cmd.ismaster || + cmd.hello) { + return original.call(this, ns, cmd, options, callback); + } + let span = undefined; + if (currentSpan) { + span = instrumentation.tracer.startSpan(`mongodb.${commandType}`, { + kind: api_1.SpanKind.CLIENT, + }); + instrumentation._populateV4Attributes(span, this, ns, cmd, commandType); + } + const patchedCallback = instrumentation._patchEnd(span, resultHandler, this.id, commandType); + return original.call(this, ns, cmd, options, patchedCallback); + }; + }; + } + _getV4PatchCommandPromise() { + const instrumentation = this; + return (original) => { + return function patchedV4ServerCommand(...args) { + const [ns, cmd] = args; + const currentSpan = api_1.trace.getSpan(api_1.context.active()); + const commandType = Object.keys(cmd)[0]; + const resultHandler = () => undefined; + if (typeof cmd !== 'object' || cmd.ismaster || cmd.hello) { + return original.apply(this, args); + } + let span = undefined; + if (currentSpan) { + span = instrumentation.tracer.startSpan(`mongodb.${commandType}`, { + kind: api_1.SpanKind.CLIENT, + }); + instrumentation._populateV4Attributes(span, this, ns, cmd, commandType); + } + const patchedCallback = instrumentation._patchEnd(span, resultHandler, this.id, commandType); + const result = original.apply(this, args); + result.then((res) => patchedCallback(null, res), (err) => patchedCallback(err)); + return result; + }; + }; + } + /** Creates spans for find operation */ + _getV3PatchFind() { + const instrumentation = this; + return (original) => { + return function patchedServerCommand(server, ns, cmd, cursorState, options, callback) { + const currentSpan = api_1.trace.getSpan(api_1.context.active()); + const resultHandler = typeof options === 'function' ? options : callback; + if (!currentSpan || + typeof resultHandler !== 'function' || + typeof cmd !== 'object') { + if (typeof options === 'function') { + return original.call(this, server, ns, cmd, cursorState, options); + } + else { + return original.call(this, server, ns, cmd, cursorState, options, callback); + } + } + const span = instrumentation.tracer.startSpan('mongodb.find', { + kind: api_1.SpanKind.CLIENT, + }); + instrumentation._populateV3Attributes(span, ns, server, cmd, 'find'); + const patchedCallback = instrumentation._patchEnd(span, resultHandler); + // handle when options is the callback to send the correct number of args + if (typeof options === 'function') { + return original.call(this, server, ns, cmd, cursorState, patchedCallback); + } + else { + return original.call(this, server, ns, cmd, cursorState, options, patchedCallback); + } + }; + }; + } + /** Creates spans for find operation */ + _getV3PatchCursor() { + const instrumentation = this; + return (original) => { + return function patchedServerCommand(server, ns, cursorState, batchSize, options, callback) { + const currentSpan = api_1.trace.getSpan(api_1.context.active()); + const resultHandler = typeof options === 'function' ? options : callback; + if (!currentSpan || typeof resultHandler !== 'function') { + if (typeof options === 'function') { + return original.call(this, server, ns, cursorState, batchSize, options); + } + else { + return original.call(this, server, ns, cursorState, batchSize, options, callback); + } + } + const span = instrumentation.tracer.startSpan('mongodb.getMore', { + kind: api_1.SpanKind.CLIENT, + }); + instrumentation._populateV3Attributes(span, ns, server, cursorState.cmd, 'getMore'); + const patchedCallback = instrumentation._patchEnd(span, resultHandler); + // handle when options is the callback to send the correct number of args + if (typeof options === 'function') { + return original.call(this, server, ns, cursorState, batchSize, patchedCallback); + } + else { + return original.call(this, server, ns, cursorState, batchSize, options, patchedCallback); + } + }; + }; + } + /** + * Get the mongodb command type from the object. + * @param command Internal mongodb command object + */ + static _getCommandType(command) { + if (command.createIndexes !== undefined) { + return internal_types_1.MongodbCommandType.CREATE_INDEXES; + } + else if (command.findandmodify !== undefined) { + return internal_types_1.MongodbCommandType.FIND_AND_MODIFY; + } + else if (command.ismaster !== undefined) { + return internal_types_1.MongodbCommandType.IS_MASTER; + } + else if (command.count !== undefined) { + return internal_types_1.MongodbCommandType.COUNT; + } + else if (command.aggregate !== undefined) { + return internal_types_1.MongodbCommandType.AGGREGATE; + } + else { + return internal_types_1.MongodbCommandType.UNKNOWN; + } + } + /** + * Populate span's attributes by fetching related metadata from the context + * @param span span to add attributes to + * @param connectionCtx mongodb internal connection context + * @param ns mongodb namespace + * @param command mongodb internal representation of a command + */ + _populateV4Attributes(span, connectionCtx, ns, command, operation) { + let host, port; + if (connectionCtx) { + const hostParts = typeof connectionCtx.address === 'string' + ? connectionCtx.address.split(':') + : ''; + if (hostParts.length === 2) { + host = hostParts[0]; + port = hostParts[1]; + } + } + // capture parameters within the query as well if enhancedDatabaseReporting is enabled. + let commandObj; + if ((command === null || command === void 0 ? void 0 : command.documents) && command.documents[0]) { + commandObj = command.documents[0]; + } + else if (command === null || command === void 0 ? void 0 : command.cursors) { + commandObj = command.cursors; + } + else { + commandObj = command; + } + this._addAllSpanAttributes(span, ns.db, ns.collection, host, port, commandObj, operation); + } + /** + * Populate span's attributes by fetching related metadata from the context + * @param span span to add attributes to + * @param ns mongodb namespace + * @param topology mongodb internal representation of the network topology + * @param command mongodb internal representation of a command + */ + _populateV3Attributes(span, ns, topology, command, operation) { + var _a, _b, _c, _d, _e, _f, _g, _h; + // add network attributes to determine the remote server + let host; + let port; + if (topology && topology.s) { + host = (_b = (_a = topology.s.options) === null || _a === void 0 ? void 0 : _a.host) !== null && _b !== void 0 ? _b : topology.s.host; + port = (_e = ((_d = (_c = topology.s.options) === null || _c === void 0 ? void 0 : _c.port) !== null && _d !== void 0 ? _d : topology.s.port)) === null || _e === void 0 ? void 0 : _e.toString(); + if (host == null || port == null) { + const address = (_f = topology.description) === null || _f === void 0 ? void 0 : _f.address; + if (address) { + const addressSegments = address.split(':'); + host = addressSegments[0]; + port = addressSegments[1]; + } + } + } + // The namespace is a combination of the database name and the name of the + // collection or index, like so: [database-name].[collection-or-index-name]. + // It could be a string or an instance of MongoDBNamespace, as such we + // always coerce to a string to extract db and collection. + const [dbName, dbCollection] = ns.toString().split('.'); + // capture parameters within the query as well if enhancedDatabaseReporting is enabled. + const commandObj = (_h = (_g = command === null || command === void 0 ? void 0 : command.query) !== null && _g !== void 0 ? _g : command === null || command === void 0 ? void 0 : command.q) !== null && _h !== void 0 ? _h : command; + this._addAllSpanAttributes(span, dbName, dbCollection, host, port, commandObj, operation); + } + _addAllSpanAttributes(span, dbName, dbCollection, host, port, commandObj, operation) { + // add database related attributes + span.setAttributes({ + [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_MONGODB, + [semantic_conventions_1.SEMATTRS_DB_NAME]: dbName, + [semantic_conventions_1.SEMATTRS_DB_MONGODB_COLLECTION]: dbCollection, + [semantic_conventions_1.SEMATTRS_DB_OPERATION]: operation, + [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: `mongodb://${host}:${port}/${dbName}`, + }); + if (host && port) { + span.setAttribute(semantic_conventions_1.SEMATTRS_NET_PEER_NAME, host); + const portNumber = parseInt(port, 10); + if (!isNaN(portNumber)) { + span.setAttribute(semantic_conventions_1.SEMATTRS_NET_PEER_PORT, portNumber); + } + } + if (!commandObj) + return; + const { dbStatementSerializer: configDbStatementSerializer } = this.getConfig(); + const dbStatementSerializer = typeof configDbStatementSerializer === 'function' + ? configDbStatementSerializer + : this._defaultDbStatementSerializer.bind(this); + (0, instrumentation_1.safeExecuteInTheMiddle)(() => { + const query = dbStatementSerializer(commandObj); + span.setAttribute(semantic_conventions_1.SEMATTRS_DB_STATEMENT, query); + }, err => { + if (err) { + this._diag.error('Error running dbStatementSerializer hook', err); + } + }, true); + } + _defaultDbStatementSerializer(commandObj) { + const { enhancedDatabaseReporting } = this.getConfig(); + const resultObj = enhancedDatabaseReporting + ? commandObj + : this._scrubStatement(commandObj); + return JSON.stringify(resultObj); + } + _scrubStatement(value) { + if (Array.isArray(value)) { + return value.map(element => this._scrubStatement(element)); + } + if (typeof value === 'object' && value !== null) { + return Object.fromEntries(Object.entries(value).map(([key, element]) => [ + key, + this._scrubStatement(element), + ])); + } + // A value like string or number, possible contains PII, scrub it + return '?'; + } + /** + * Triggers the response hook in case it is defined. + * @param span The span to add the results to. + * @param result The command result + */ + _handleExecutionResult(span, result) { + const { responseHook } = this.getConfig(); + if (typeof responseHook === 'function') { + (0, instrumentation_1.safeExecuteInTheMiddle)(() => { + responseHook(span, { data: result }); + }, err => { + if (err) { + this._diag.error('Error running response hook', err); + } + }, true); + } + } + /** + * Ends a created span. + * @param span The created span to end. + * @param resultHandler A callback function. + * @param connectionId: The connection ID of the Command response. + */ + _patchEnd(span, resultHandler, connectionId, commandType) { + // mongodb is using "tick" when calling a callback, this way the context + // in final callback (resultHandler) is lost + const activeContext = api_1.context.active(); + const instrumentation = this; + return function patchedEnd(...args) { + const error = args[0]; + if (span) { + if (error instanceof Error) { + span === null || span === void 0 ? void 0 : span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: error.message, + }); + } + else { + const result = args[1]; + instrumentation._handleExecutionResult(span, result); + } + span.end(); + } + return api_1.context.with(activeContext, () => { + if (commandType === 'endSessions') { + instrumentation._connectionsUsage.add(-1, { + state: 'idle', + 'pool.name': instrumentation._poolName, + }); + } + return resultHandler.apply(this, args); + }); + }; + } + setPoolName(options) { + var _a, _b; + const host = (_a = options.hostAddress) === null || _a === void 0 ? void 0 : _a.host; + const port = (_b = options.hostAddress) === null || _b === void 0 ? void 0 : _b.port; + const database = options.dbName; + const poolName = `mongodb://${host}:${port}/${database}`; + this._poolName = poolName; + } +} +exports.MongoDBInstrumentation = MongoDBInstrumentation; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 55807: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MongodbCommandType = void 0; +var MongodbCommandType; +(function (MongodbCommandType) { + MongodbCommandType["CREATE_INDEXES"] = "createIndexes"; + MongodbCommandType["FIND_AND_MODIFY"] = "findAndModify"; + MongodbCommandType["IS_MASTER"] = "isMaster"; + MongodbCommandType["COUNT"] = "count"; + MongodbCommandType["AGGREGATE"] = "aggregate"; + MongodbCommandType["UNKNOWN"] = "unknown"; +})(MongodbCommandType = exports.MongodbCommandType || (exports.MongodbCommandType = {})); +//# sourceMappingURL=internal-types.js.map + +/***/ }), + +/***/ 68969: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MongodbCommandType = void 0; +var MongodbCommandType; +(function (MongodbCommandType) { + MongodbCommandType["CREATE_INDEXES"] = "createIndexes"; + MongodbCommandType["FIND_AND_MODIFY"] = "findAndModify"; + MongodbCommandType["IS_MASTER"] = "isMaster"; + MongodbCommandType["COUNT"] = "count"; + MongodbCommandType["UNKNOWN"] = "unknown"; +})(MongodbCommandType = exports.MongodbCommandType || (exports.MongodbCommandType = {})); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 39617: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.51.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-mongodb'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 17168: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +__exportStar(__nccwpck_require__(12531), exports); +__exportStar(__nccwpck_require__(2734), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 12531: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MongooseInstrumentation = exports._STORED_PARENT_SPAN = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(89736); +const utils_1 = __nccwpck_require__(82856); +const instrumentation_1 = __nccwpck_require__(65584); +/** @knipignore */ +const version_1 = __nccwpck_require__(942); +const semantic_conventions_1 = __nccwpck_require__(67275); +const contextCaptureFunctionsCommon = [ + 'deleteOne', + 'deleteMany', + 'find', + 'findOne', + 'estimatedDocumentCount', + 'countDocuments', + 'distinct', + 'where', + '$where', + 'findOneAndUpdate', + 'findOneAndDelete', + 'findOneAndReplace', +]; +const contextCaptureFunctions6 = [ + 'remove', + 'count', + 'findOneAndRemove', + ...contextCaptureFunctionsCommon, +]; +const contextCaptureFunctions7 = [ + 'count', + 'findOneAndRemove', + ...contextCaptureFunctionsCommon, +]; +const contextCaptureFunctions8 = [...contextCaptureFunctionsCommon]; +function getContextCaptureFunctions(moduleVersion) { + /* istanbul ignore next */ + if (!moduleVersion) { + return contextCaptureFunctionsCommon; + } + else if (moduleVersion.startsWith('6.') || moduleVersion.startsWith('5.')) { + return contextCaptureFunctions6; + } + else if (moduleVersion.startsWith('7.')) { + return contextCaptureFunctions7; + } + else { + return contextCaptureFunctions8; + } +} +function instrumentRemove(moduleVersion) { + return ((moduleVersion && + (moduleVersion.startsWith('5.') || moduleVersion.startsWith('6.'))) || + false); +} +// when mongoose functions are called, we store the original call context +// and then set it as the parent for the spans created by Query/Aggregate exec() +// calls. this bypass the unlinked spans issue on thenables await operations. +exports._STORED_PARENT_SPAN = Symbol('stored-parent-span'); +class MongooseInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); + } + init() { + const module = new instrumentation_1.InstrumentationNodeModuleDefinition('mongoose', ['>=5.9.7 <9'], this.patch.bind(this), this.unpatch.bind(this)); + return module; + } + patch(moduleExports, moduleVersion) { + this._wrap(moduleExports.Model.prototype, 'save', this.patchOnModelMethods('save', moduleVersion)); + // mongoose applies this code on module require: + // Model.prototype.$save = Model.prototype.save; + // which captures the save function before it is patched. + // so we need to apply the same logic after instrumenting the save function. + moduleExports.Model.prototype.$save = moduleExports.Model.prototype.save; + if (instrumentRemove(moduleVersion)) { + this._wrap(moduleExports.Model.prototype, 'remove', this.patchOnModelMethods('remove', moduleVersion)); + } + this._wrap(moduleExports.Query.prototype, 'exec', this.patchQueryExec(moduleVersion)); + this._wrap(moduleExports.Aggregate.prototype, 'exec', this.patchAggregateExec(moduleVersion)); + const contextCaptureFunctions = getContextCaptureFunctions(moduleVersion); + contextCaptureFunctions.forEach((funcName) => { + this._wrap(moduleExports.Query.prototype, funcName, this.patchAndCaptureSpanContext(funcName)); + }); + this._wrap(moduleExports.Model, 'aggregate', this.patchModelAggregate()); + return moduleExports; + } + unpatch(moduleExports, moduleVersion) { + const contextCaptureFunctions = getContextCaptureFunctions(moduleVersion); + this._unwrap(moduleExports.Model.prototype, 'save'); + // revert the patch for $save which we applied by aliasing it to patched `save` + moduleExports.Model.prototype.$save = moduleExports.Model.prototype.save; + if (instrumentRemove(moduleVersion)) { + this._unwrap(moduleExports.Model.prototype, 'remove'); + } + this._unwrap(moduleExports.Query.prototype, 'exec'); + this._unwrap(moduleExports.Aggregate.prototype, 'exec'); + contextCaptureFunctions.forEach((funcName) => { + this._unwrap(moduleExports.Query.prototype, funcName); + }); + this._unwrap(moduleExports.Model, 'aggregate'); + } + patchAggregateExec(moduleVersion) { + const self = this; + return (originalAggregate) => { + return function exec(callback) { + var _a; + if (self.getConfig().requireParentSpan && + api_1.trace.getSpan(api_1.context.active()) === undefined) { + return originalAggregate.apply(this, arguments); + } + const parentSpan = this[exports._STORED_PARENT_SPAN]; + const attributes = {}; + const { dbStatementSerializer } = self.getConfig(); + if (dbStatementSerializer) { + attributes[semantic_conventions_1.SEMATTRS_DB_STATEMENT] = dbStatementSerializer('aggregate', { + options: this.options, + aggregatePipeline: this._pipeline, + }); + } + const span = self._startSpan(this._model.collection, (_a = this._model) === null || _a === void 0 ? void 0 : _a.modelName, 'aggregate', attributes, parentSpan); + return self._handleResponse(span, originalAggregate, this, arguments, callback, moduleVersion); + }; + }; + } + patchQueryExec(moduleVersion) { + const self = this; + return (originalExec) => { + return function exec(callback) { + if (self.getConfig().requireParentSpan && + api_1.trace.getSpan(api_1.context.active()) === undefined) { + return originalExec.apply(this, arguments); + } + const parentSpan = this[exports._STORED_PARENT_SPAN]; + const attributes = {}; + const { dbStatementSerializer } = self.getConfig(); + if (dbStatementSerializer) { + attributes[semantic_conventions_1.SEMATTRS_DB_STATEMENT] = dbStatementSerializer(this.op, { + condition: this._conditions, + updates: this._update, + options: this.options, + fields: this._fields, + }); + } + const span = self._startSpan(this.mongooseCollection, this.model.modelName, this.op, attributes, parentSpan); + return self._handleResponse(span, originalExec, this, arguments, callback, moduleVersion); + }; + }; + } + patchOnModelMethods(op, moduleVersion) { + const self = this; + return (originalOnModelFunction) => { + return function method(options, callback) { + if (self.getConfig().requireParentSpan && + api_1.trace.getSpan(api_1.context.active()) === undefined) { + return originalOnModelFunction.apply(this, arguments); + } + const serializePayload = { document: this }; + if (options && !(options instanceof Function)) { + serializePayload.options = options; + } + const attributes = {}; + const { dbStatementSerializer } = self.getConfig(); + if (dbStatementSerializer) { + attributes[semantic_conventions_1.SEMATTRS_DB_STATEMENT] = dbStatementSerializer(op, serializePayload); + } + const span = self._startSpan(this.constructor.collection, this.constructor.modelName, op, attributes); + if (options instanceof Function) { + callback = options; + options = undefined; + } + return self._handleResponse(span, originalOnModelFunction, this, arguments, callback, moduleVersion); + }; + }; + } + // we want to capture the otel span on the object which is calling exec. + // in the special case of aggregate, we need have no function to path + // on the Aggregate object to capture the context on, so we patch + // the aggregate of Model, and set the context on the Aggregate object + patchModelAggregate() { + const self = this; + return (original) => { + return function captureSpanContext() { + const currentSpan = api_1.trace.getSpan(api_1.context.active()); + const aggregate = self._callOriginalFunction(() => original.apply(this, arguments)); + if (aggregate) + aggregate[exports._STORED_PARENT_SPAN] = currentSpan; + return aggregate; + }; + }; + } + patchAndCaptureSpanContext(funcName) { + const self = this; + return (original) => { + return function captureSpanContext() { + this[exports._STORED_PARENT_SPAN] = api_1.trace.getSpan(api_1.context.active()); + return self._callOriginalFunction(() => original.apply(this, arguments)); + }; + }; + } + _startSpan(collection, modelName, operation, attributes, parentSpan) { + return this.tracer.startSpan(`mongoose.${modelName}.${operation}`, { + kind: api_1.SpanKind.CLIENT, + attributes: Object.assign(Object.assign(Object.assign({}, attributes), (0, utils_1.getAttributesFromCollection)(collection)), { [semantic_conventions_1.SEMATTRS_DB_OPERATION]: operation, [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: 'mongoose' }), + }, parentSpan ? api_1.trace.setSpan(api_1.context.active(), parentSpan) : undefined); + } + _handleResponse(span, exec, originalThis, args, callback, moduleVersion = undefined) { + const self = this; + if (callback instanceof Function) { + return self._callOriginalFunction(() => (0, utils_1.handleCallbackResponse)(callback, exec, originalThis, span, args, self.getConfig().responseHook, moduleVersion)); + } + else { + const response = self._callOriginalFunction(() => exec.apply(originalThis, args)); + return (0, utils_1.handlePromiseResponse)(response, span, self.getConfig().responseHook, moduleVersion); + } + } + _callOriginalFunction(originalFunction) { + if (this.getConfig().suppressInternalInstrumentation) { + return api_1.context.with((0, core_1.suppressTracing)(api_1.context.active()), originalFunction); + } + else { + return originalFunction(); + } + } +} +exports.MongooseInstrumentation = MongooseInstrumentation; +//# sourceMappingURL=mongoose.js.map + +/***/ }), + +/***/ 2734: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 82856: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.handleCallbackResponse = exports.handlePromiseResponse = exports.getAttributesFromCollection = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const api_1 = __nccwpck_require__(65163); +const instrumentation_1 = __nccwpck_require__(65584); +const semantic_conventions_1 = __nccwpck_require__(67275); +function getAttributesFromCollection(collection) { + return { + [semantic_conventions_1.SEMATTRS_DB_MONGODB_COLLECTION]: collection.name, + [semantic_conventions_1.SEMATTRS_DB_NAME]: collection.conn.name, + [semantic_conventions_1.SEMATTRS_DB_USER]: collection.conn.user, + [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: collection.conn.host, + [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: collection.conn.port, + }; +} +exports.getAttributesFromCollection = getAttributesFromCollection; +function setErrorStatus(span, error = {}) { + span.recordException(error); + span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: `${error.message} ${error.code ? `\nMongoose Error Code: ${error.code}` : ''}`, + }); +} +function applyResponseHook(span, response, responseHook, moduleVersion = undefined) { + if (!responseHook) { + return; + } + (0, instrumentation_1.safeExecuteInTheMiddle)(() => responseHook(span, { moduleVersion, response }), e => { + if (e) { + api_1.diag.error('mongoose instrumentation: responseHook error', e); + } + }, true); +} +function handlePromiseResponse(execResponse, span, responseHook, moduleVersion = undefined) { + if (!(execResponse instanceof Promise)) { + applyResponseHook(span, execResponse, responseHook, moduleVersion); + span.end(); + return execResponse; + } + return execResponse + .then(response => { + applyResponseHook(span, response, responseHook, moduleVersion); + return response; + }) + .catch(err => { + setErrorStatus(span, err); + throw err; + }) + .finally(() => span.end()); +} +exports.handlePromiseResponse = handlePromiseResponse; +function handleCallbackResponse(callback, exec, originalThis, span, args, responseHook, moduleVersion = undefined) { + let callbackArgumentIndex = 0; + if (args.length === 2) { + callbackArgumentIndex = 1; + } + args[callbackArgumentIndex] = (err, response) => { + err + ? setErrorStatus(span, err) + : applyResponseHook(span, response, responseHook, moduleVersion); + span.end(); + return callback(err, response); + }; + return exec.apply(originalThis, args); +} +exports.handleCallbackResponse = handleCallbackResponse; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 942: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.46.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-mongoose'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 68110: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AttributeNames = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Mysql specific attributes not covered by semantic conventions +var AttributeNames; +(function (AttributeNames) { + AttributeNames["MYSQL_VALUES"] = "db.mysql.values"; +})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {})); +//# sourceMappingURL=AttributeNames.js.map + +/***/ }), + +/***/ 80144: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(82407), exports); +__exportStar(__nccwpck_require__(92101), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 82407: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MySQLInstrumentation = void 0; +const api_1 = __nccwpck_require__(65163); +const instrumentation_1 = __nccwpck_require__(65584); +const semantic_conventions_1 = __nccwpck_require__(67275); +const AttributeNames_1 = __nccwpck_require__(68110); +const utils_1 = __nccwpck_require__(55621); +/** @knipignore */ +const version_1 = __nccwpck_require__(58592); +class MySQLInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); + this._setMetricInstruments(); + } + setMeterProvider(meterProvider) { + super.setMeterProvider(meterProvider); + this._setMetricInstruments(); + } + _setMetricInstruments() { + this._connectionsUsage = this.meter.createUpDownCounter('db.client.connections.usage', //TODO:: use semantic convention + { + description: 'The number of connections that are currently in state described by the state attribute.', + unit: '{connection}', + }); + } + init() { + return [ + new instrumentation_1.InstrumentationNodeModuleDefinition('mysql', ['>=2.0.0 <3'], (moduleExports) => { + if ((0, instrumentation_1.isWrapped)(moduleExports.createConnection)) { + this._unwrap(moduleExports, 'createConnection'); + } + this._wrap(moduleExports, 'createConnection', this._patchCreateConnection()); + if ((0, instrumentation_1.isWrapped)(moduleExports.createPool)) { + this._unwrap(moduleExports, 'createPool'); + } + this._wrap(moduleExports, 'createPool', this._patchCreatePool()); + if ((0, instrumentation_1.isWrapped)(moduleExports.createPoolCluster)) { + this._unwrap(moduleExports, 'createPoolCluster'); + } + this._wrap(moduleExports, 'createPoolCluster', this._patchCreatePoolCluster()); + return moduleExports; + }, (moduleExports) => { + if (moduleExports === undefined) + return; + this._unwrap(moduleExports, 'createConnection'); + this._unwrap(moduleExports, 'createPool'); + this._unwrap(moduleExports, 'createPoolCluster'); + }), + ]; + } + // global export function + _patchCreateConnection() { + return (originalCreateConnection) => { + const thisPlugin = this; + return function createConnection(_connectionUri) { + const originalResult = originalCreateConnection(...arguments); + // This is unwrapped on next call after unpatch + thisPlugin._wrap(originalResult, 'query', thisPlugin._patchQuery(originalResult)); + return originalResult; + }; + }; + } + // global export function + _patchCreatePool() { + return (originalCreatePool) => { + const thisPlugin = this; + return function createPool(_config) { + const pool = originalCreatePool(...arguments); + thisPlugin._wrap(pool, 'query', thisPlugin._patchQuery(pool)); + thisPlugin._wrap(pool, 'getConnection', thisPlugin._patchGetConnection(pool)); + thisPlugin._wrap(pool, 'end', thisPlugin._patchPoolEnd(pool)); + thisPlugin._setPoolcallbacks(pool, thisPlugin, ''); + return pool; + }; + }; + } + _patchPoolEnd(pool) { + return (originalPoolEnd) => { + const thisPlugin = this; + return function end(callback) { + const nAll = pool._allConnections.length; + const nFree = pool._freeConnections.length; + const nUsed = nAll - nFree; + const poolName = (0, utils_1.getPoolName)(pool); + thisPlugin._connectionsUsage.add(-nUsed, { + state: 'used', + name: poolName, + }); + thisPlugin._connectionsUsage.add(-nFree, { + state: 'idle', + name: poolName, + }); + originalPoolEnd.apply(pool, arguments); + }; + }; + } + // global export function + _patchCreatePoolCluster() { + return (originalCreatePoolCluster) => { + const thisPlugin = this; + return function createPool(_config) { + const cluster = originalCreatePoolCluster(...arguments); + // This is unwrapped on next call after unpatch + thisPlugin._wrap(cluster, 'getConnection', thisPlugin._patchGetConnection(cluster)); + thisPlugin._wrap(cluster, 'add', thisPlugin._patchAdd(cluster)); + return cluster; + }; + }; + } + _patchAdd(cluster) { + return (originalAdd) => { + const thisPlugin = this; + return function add(id, config) { + // Unwrap if unpatch has been called + if (!thisPlugin['_enabled']) { + thisPlugin._unwrap(cluster, 'add'); + return originalAdd.apply(cluster, arguments); + } + originalAdd.apply(cluster, arguments); + const nodes = cluster['_nodes']; + if (nodes) { + const nodeId = typeof id === 'object' + ? 'CLUSTER::' + cluster._lastId + : String(id); + const pool = nodes[nodeId].pool; + thisPlugin._setPoolcallbacks(pool, thisPlugin, id); + } + }; + }; + } + // method on cluster or pool + _patchGetConnection(pool) { + return (originalGetConnection) => { + const thisPlugin = this; + return function getConnection(arg1, arg2, arg3) { + // Unwrap if unpatch has been called + if (!thisPlugin['_enabled']) { + thisPlugin._unwrap(pool, 'getConnection'); + return originalGetConnection.apply(pool, arguments); + } + if (arguments.length === 1 && typeof arg1 === 'function') { + const patchFn = thisPlugin._getConnectionCallbackPatchFn(arg1); + return originalGetConnection.call(pool, patchFn); + } + if (arguments.length === 2 && typeof arg2 === 'function') { + const patchFn = thisPlugin._getConnectionCallbackPatchFn(arg2); + return originalGetConnection.call(pool, arg1, patchFn); + } + if (arguments.length === 3 && typeof arg3 === 'function') { + const patchFn = thisPlugin._getConnectionCallbackPatchFn(arg3); + return originalGetConnection.call(pool, arg1, arg2, patchFn); + } + return originalGetConnection.apply(pool, arguments); + }; + }; + } + _getConnectionCallbackPatchFn(cb) { + const thisPlugin = this; + const activeContext = api_1.context.active(); + return function (err, connection) { + if (connection) { + // this is the callback passed into a query + // no need to unwrap + if (!(0, instrumentation_1.isWrapped)(connection.query)) { + thisPlugin._wrap(connection, 'query', thisPlugin._patchQuery(connection)); + } + } + if (typeof cb === 'function') { + api_1.context.with(activeContext, cb, this, err, connection); + } + }; + } + _patchQuery(connection) { + return (originalQuery) => { + const thisPlugin = this; + return function query(query, _valuesOrCallback, _callback) { + if (!thisPlugin['_enabled']) { + thisPlugin._unwrap(connection, 'query'); + return originalQuery.apply(connection, arguments); + } + const span = thisPlugin.tracer.startSpan((0, utils_1.getSpanName)(query), { + kind: api_1.SpanKind.CLIENT, + attributes: Object.assign(Object.assign({}, MySQLInstrumentation.COMMON_ATTRIBUTES), (0, utils_1.getConnectionAttributes)(connection.config)), + }); + span.setAttribute(semantic_conventions_1.SEMATTRS_DB_STATEMENT, (0, utils_1.getDbStatement)(query)); + if (thisPlugin.getConfig().enhancedDatabaseReporting) { + let values; + if (Array.isArray(_valuesOrCallback)) { + values = _valuesOrCallback; + } + else if (arguments[2]) { + values = [_valuesOrCallback]; + } + span.setAttribute(AttributeNames_1.AttributeNames.MYSQL_VALUES, (0, utils_1.getDbValues)(query, values)); + } + const cbIndex = Array.from(arguments).findIndex(arg => typeof arg === 'function'); + const parentContext = api_1.context.active(); + if (cbIndex === -1) { + const streamableQuery = api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { + return originalQuery.apply(connection, arguments); + }); + api_1.context.bind(parentContext, streamableQuery); + return streamableQuery + .on('error', err => span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: err.message, + })) + .on('end', () => { + span.end(); + }); + } + else { + thisPlugin._wrap(arguments, cbIndex, thisPlugin._patchCallbackQuery(span, parentContext)); + return api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { + return originalQuery.apply(connection, arguments); + }); + } + }; + }; + } + _patchCallbackQuery(span, parentContext) { + return (originalCallback) => { + return function (err, results, fields) { + if (err) { + span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: err.message, + }); + } + span.end(); + return api_1.context.with(parentContext, () => originalCallback(...arguments)); + }; + }; + } + _setPoolcallbacks(pool, thisPlugin, id) { + //TODO:: use semantic convention + const poolName = id || (0, utils_1.getPoolName)(pool); + pool.on('connection', connection => { + thisPlugin._connectionsUsage.add(1, { + state: 'idle', + name: poolName, + }); + }); + pool.on('acquire', connection => { + thisPlugin._connectionsUsage.add(-1, { + state: 'idle', + name: poolName, + }); + thisPlugin._connectionsUsage.add(1, { + state: 'used', + name: poolName, + }); + }); + pool.on('release', connection => { + thisPlugin._connectionsUsage.add(-1, { + state: 'used', + name: poolName, + }); + thisPlugin._connectionsUsage.add(1, { + state: 'idle', + name: poolName, + }); + }); + } +} +exports.MySQLInstrumentation = MySQLInstrumentation; +MySQLInstrumentation.COMMON_ATTRIBUTES = { + [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_MYSQL, +}; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 92101: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 55621: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getPoolName = exports.arrayStringifyHelper = exports.getSpanName = exports.getDbValues = exports.getDbStatement = exports.getConnectionAttributes = void 0; +const semantic_conventions_1 = __nccwpck_require__(67275); +/** + * Get an Attributes map from a mysql connection config object + * + * @param config ConnectionConfig + */ +function getConnectionAttributes(config) { + const { host, port, database, user } = getConfig(config); + const portNumber = parseInt(port, 10); + if (!isNaN(portNumber)) { + return { + [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: host, + [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: portNumber, + [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: getJDBCString(host, port, database), + [semantic_conventions_1.SEMATTRS_DB_NAME]: database, + [semantic_conventions_1.SEMATTRS_DB_USER]: user, + }; + } + return { + [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: host, + [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: getJDBCString(host, port, database), + [semantic_conventions_1.SEMATTRS_DB_NAME]: database, + [semantic_conventions_1.SEMATTRS_DB_USER]: user, + }; +} +exports.getConnectionAttributes = getConnectionAttributes; +function getConfig(config) { + const { host, port, database, user } = (config && config.connectionConfig) || config || {}; + return { host, port, database, user }; +} +function getJDBCString(host, port, database) { + let jdbcString = `jdbc:mysql://${host || 'localhost'}`; + if (typeof port === 'number') { + jdbcString += `:${port}`; + } + if (typeof database === 'string') { + jdbcString += `/${database}`; + } + return jdbcString; +} +/** + * @returns the database statement being executed. + */ +function getDbStatement(query) { + if (typeof query === 'string') { + return query; + } + else { + return query.sql; + } +} +exports.getDbStatement = getDbStatement; +function getDbValues(query, values) { + if (typeof query === 'string') { + return arrayStringifyHelper(values); + } + else { + // According to https://github.com/mysqljs/mysql#performing-queries + // The values argument will override the values in the option object. + return arrayStringifyHelper(values || query.values); + } +} +exports.getDbValues = getDbValues; +/** + * The span name SHOULD be set to a low cardinality value + * representing the statement executed on the database. + * + * @returns SQL statement without variable arguments or SQL verb + */ +function getSpanName(query) { + const rawQuery = typeof query === 'object' ? query.sql : query; + // Extract the SQL verb + const firstSpace = rawQuery === null || rawQuery === void 0 ? void 0 : rawQuery.indexOf(' '); + if (typeof firstSpace === 'number' && firstSpace !== -1) { + return rawQuery === null || rawQuery === void 0 ? void 0 : rawQuery.substring(0, firstSpace); + } + return rawQuery; +} +exports.getSpanName = getSpanName; +function arrayStringifyHelper(arr) { + if (arr) + return `[${arr.toString()}]`; + return ''; +} +exports.arrayStringifyHelper = arrayStringifyHelper; +function getPoolName(pool) { + const c = pool.config.connectionConfig; + let poolName = ''; + poolName += c.host ? `host: '${c.host}', ` : ''; + poolName += c.port ? `port: ${c.port}, ` : ''; + poolName += c.database ? `database: '${c.database}', ` : ''; + poolName += c.user ? `user: '${c.user}'` : ''; + if (!c.user) { + poolName = poolName.substring(0, poolName.length - 2); //omit last comma + } + return poolName.trim(); +} +exports.getPoolName = getPoolName; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 58592: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.45.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-mysql'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 79651: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(48126), exports); +__exportStar(__nccwpck_require__(97119), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 48126: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MySQL2Instrumentation = void 0; +const api = __nccwpck_require__(65163); +const instrumentation_1 = __nccwpck_require__(65584); +const semantic_conventions_1 = __nccwpck_require__(67275); +const sql_common_1 = __nccwpck_require__(58156); +const utils_1 = __nccwpck_require__(66655); +/** @knipignore */ +const version_1 = __nccwpck_require__(51750); +class MySQL2Instrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); + } + init() { + return [ + new instrumentation_1.InstrumentationNodeModuleDefinition('mysql2', ['>=1.4.2 <4'], (moduleExports) => { + const ConnectionPrototype = (0, utils_1.getConnectionPrototypeToInstrument)(moduleExports.Connection); + if ((0, instrumentation_1.isWrapped)(ConnectionPrototype.query)) { + this._unwrap(ConnectionPrototype, 'query'); + } + this._wrap(ConnectionPrototype, 'query', this._patchQuery(moduleExports.format, false)); + if ((0, instrumentation_1.isWrapped)(ConnectionPrototype.execute)) { + this._unwrap(ConnectionPrototype, 'execute'); + } + this._wrap(ConnectionPrototype, 'execute', this._patchQuery(moduleExports.format, true)); + return moduleExports; + }, (moduleExports) => { + if (moduleExports === undefined) + return; + const ConnectionPrototype = moduleExports.Connection.prototype; + this._unwrap(ConnectionPrototype, 'query'); + this._unwrap(ConnectionPrototype, 'execute'); + }), + ]; + } + _patchQuery(format, isPrepared) { + return (originalQuery) => { + const thisPlugin = this; + return function query(query, _valuesOrCallback, _callback) { + let values; + if (Array.isArray(_valuesOrCallback)) { + values = _valuesOrCallback; + } + else if (arguments[2]) { + values = [_valuesOrCallback]; + } + const span = thisPlugin.tracer.startSpan((0, utils_1.getSpanName)(query), { + kind: api.SpanKind.CLIENT, + attributes: Object.assign(Object.assign(Object.assign({}, MySQL2Instrumentation.COMMON_ATTRIBUTES), (0, utils_1.getConnectionAttributes)(this.config)), { [semantic_conventions_1.SEMATTRS_DB_STATEMENT]: (0, utils_1.getDbStatement)(query, format, values) }), + }); + if (!isPrepared && + thisPlugin.getConfig().addSqlCommenterCommentToQueries) { + arguments[0] = query = + typeof query === 'string' + ? (0, sql_common_1.addSqlCommenterComment)(span, query) + : Object.assign(query, { + sql: (0, sql_common_1.addSqlCommenterComment)(span, query.sql), + }); + } + const endSpan = (0, utils_1.once)((err, results) => { + if (err) { + span.setStatus({ + code: api.SpanStatusCode.ERROR, + message: err.message, + }); + } + else { + const { responseHook } = thisPlugin.getConfig(); + if (typeof responseHook === 'function') { + (0, instrumentation_1.safeExecuteInTheMiddle)(() => { + responseHook(span, { + queryResults: results, + }); + }, err => { + if (err) { + thisPlugin._diag.warn('Failed executing responseHook', err); + } + }, true); + } + } + span.end(); + }); + if (arguments.length === 1) { + if (typeof query.onResult === 'function') { + thisPlugin._wrap(query, 'onResult', thisPlugin._patchCallbackQuery(endSpan)); + } + const streamableQuery = originalQuery.apply(this, arguments); + // `end` in mysql behaves similarly to `result` in mysql2. + streamableQuery + .once('error', err => { + endSpan(err); + }) + .once('result', results => { + endSpan(undefined, results); + }); + return streamableQuery; + } + if (typeof arguments[1] === 'function') { + thisPlugin._wrap(arguments, 1, thisPlugin._patchCallbackQuery(endSpan)); + } + else if (typeof arguments[2] === 'function') { + thisPlugin._wrap(arguments, 2, thisPlugin._patchCallbackQuery(endSpan)); + } + return originalQuery.apply(this, arguments); + }; + }; + } + _patchCallbackQuery(endSpan) { + return (originalCallback) => { + return function (err, results, fields) { + endSpan(err, results); + return originalCallback(...arguments); + }; + }; + } +} +exports.MySQL2Instrumentation = MySQL2Instrumentation; +MySQL2Instrumentation.COMMON_ATTRIBUTES = { + [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_MYSQL, +}; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 97119: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 66655: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getConnectionPrototypeToInstrument = exports.once = exports.getSpanName = exports.getDbStatement = exports.getConnectionAttributes = void 0; +const semantic_conventions_1 = __nccwpck_require__(67275); +/** + * Get an Attributes map from a mysql connection config object + * + * @param config ConnectionConfig + */ +function getConnectionAttributes(config) { + const { host, port, database, user } = getConfig(config); + const portNumber = parseInt(port, 10); + if (!isNaN(portNumber)) { + return { + [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: host, + [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: portNumber, + [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: getJDBCString(host, port, database), + [semantic_conventions_1.SEMATTRS_DB_NAME]: database, + [semantic_conventions_1.SEMATTRS_DB_USER]: user, + }; + } + return { + [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: host, + [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: getJDBCString(host, port, database), + [semantic_conventions_1.SEMATTRS_DB_NAME]: database, + [semantic_conventions_1.SEMATTRS_DB_USER]: user, + }; +} +exports.getConnectionAttributes = getConnectionAttributes; +function getConfig(config) { + const { host, port, database, user } = (config && config.connectionConfig) || config || {}; + return { host, port, database, user }; +} +function getJDBCString(host, port, database) { + let jdbcString = `jdbc:mysql://${host || 'localhost'}`; + if (typeof port === 'number') { + jdbcString += `:${port}`; + } + if (typeof database === 'string') { + jdbcString += `/${database}`; + } + return jdbcString; +} +/** + * Conjures up the value for the db.statement attribute by formatting a SQL query. + * + * @returns the database statement being executed. + */ +function getDbStatement(query, format, values) { + if (typeof query === 'string') { + return values ? format(query, values) : query; + } + else { + // According to https://github.com/mysqljs/mysql#performing-queries + // The values argument will override the values in the option object. + return values || query.values + ? format(query.sql, values || query.values) + : query.sql; + } +} +exports.getDbStatement = getDbStatement; +/** + * The span name SHOULD be set to a low cardinality value + * representing the statement executed on the database. + * + * @returns SQL statement without variable arguments or SQL verb + */ +function getSpanName(query) { + const rawQuery = typeof query === 'object' ? query.sql : query; + // Extract the SQL verb + const firstSpace = rawQuery === null || rawQuery === void 0 ? void 0 : rawQuery.indexOf(' '); + if (typeof firstSpace === 'number' && firstSpace !== -1) { + return rawQuery === null || rawQuery === void 0 ? void 0 : rawQuery.substring(0, firstSpace); + } + return rawQuery; +} +exports.getSpanName = getSpanName; +const once = (fn) => { + let called = false; + return (...args) => { + if (called) + return; + called = true; + return fn(...args); + }; +}; +exports.once = once; +function getConnectionPrototypeToInstrument(connection) { + const connectionPrototype = connection.prototype; + const basePrototype = Object.getPrototypeOf(connectionPrototype); + // mysql2@3.11.5 included a refactoring, where most code was moved out of the `Connection` class and into a shared base + // so we need to instrument that instead, see https://github.com/sidorares/node-mysql2/pull/3081 + // This checks if the functions we're instrumenting are there on the base - we cannot use the presence of a base + // prototype since EventEmitter is the base for mysql2@<=3.11.4 + if (typeof (basePrototype === null || basePrototype === void 0 ? void 0 : basePrototype.query) === 'function' && + typeof (basePrototype === null || basePrototype === void 0 ? void 0 : basePrototype.execute) === 'function') { + return basePrototype; + } + // otherwise instrument the connection directly. + return connectionPrototype; +} +exports.getConnectionPrototypeToInstrument = getConnectionPrototypeToInstrument; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 51750: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.45.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-mysql2'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 1290: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AttributeNames = void 0; +var AttributeNames; +(function (AttributeNames) { + AttributeNames["VERSION"] = "nestjs.version"; + AttributeNames["TYPE"] = "nestjs.type"; + AttributeNames["MODULE"] = "nestjs.module"; + AttributeNames["CONTROLLER"] = "nestjs.controller"; + AttributeNames["CALLBACK"] = "nestjs.callback"; + AttributeNames["PIPES"] = "nestjs.pipes"; + AttributeNames["INTERCEPTORS"] = "nestjs.interceptors"; + AttributeNames["GUARDS"] = "nestjs.guards"; +})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {})); +//# sourceMappingURL=AttributeNames.js.map + +/***/ }), + +/***/ 6179: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NestType = void 0; +var NestType; +(function (NestType) { + NestType["APP_CREATION"] = "app_creation"; + NestType["REQUEST_CONTEXT"] = "request_context"; + NestType["REQUEST_HANDLER"] = "handler"; +})(NestType = exports.NestType || (exports.NestType = {})); +//# sourceMappingURL=NestType.js.map + +/***/ }), + +/***/ 65843: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NestType = exports.AttributeNames = void 0; +var AttributeNames_1 = __nccwpck_require__(1290); +Object.defineProperty(exports, "AttributeNames", ({ enumerable: true, get: function () { return AttributeNames_1.AttributeNames; } })); +var NestType_1 = __nccwpck_require__(6179); +Object.defineProperty(exports, "NestType", ({ enumerable: true, get: function () { return NestType_1.NestType; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 81551: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(57590), exports); +__exportStar(__nccwpck_require__(1290), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 57590: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NestInstrumentation = void 0; +const api = __nccwpck_require__(65163); +const instrumentation_1 = __nccwpck_require__(65584); +/** @knipignore */ +const version_1 = __nccwpck_require__(73365); +const semantic_conventions_1 = __nccwpck_require__(67275); +const enums_1 = __nccwpck_require__(65843); +const supportedVersions = ['>=4.0.0 <11']; +class NestInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); + } + init() { + const module = new instrumentation_1.InstrumentationNodeModuleDefinition(NestInstrumentation.COMPONENT, supportedVersions); + module.files.push(this.getNestFactoryFileInstrumentation(supportedVersions), this.getRouterExecutionContextFileInstrumentation(supportedVersions)); + return module; + } + getNestFactoryFileInstrumentation(versions) { + return new instrumentation_1.InstrumentationNodeModuleFile('@nestjs/core/nest-factory.js', versions, (NestFactoryStatic, moduleVersion) => { + this.ensureWrapped(NestFactoryStatic.NestFactoryStatic.prototype, 'create', createWrapNestFactoryCreate(this.tracer, moduleVersion)); + return NestFactoryStatic; + }, (NestFactoryStatic) => { + this._unwrap(NestFactoryStatic.NestFactoryStatic.prototype, 'create'); + }); + } + getRouterExecutionContextFileInstrumentation(versions) { + return new instrumentation_1.InstrumentationNodeModuleFile('@nestjs/core/router/router-execution-context.js', versions, (RouterExecutionContext, moduleVersion) => { + this.ensureWrapped(RouterExecutionContext.RouterExecutionContext.prototype, 'create', createWrapCreateHandler(this.tracer, moduleVersion)); + return RouterExecutionContext; + }, (RouterExecutionContext) => { + this._unwrap(RouterExecutionContext.RouterExecutionContext.prototype, 'create'); + }); + } + ensureWrapped(obj, methodName, wrapper) { + if ((0, instrumentation_1.isWrapped)(obj[methodName])) { + this._unwrap(obj, methodName); + } + this._wrap(obj, methodName, wrapper); + } +} +exports.NestInstrumentation = NestInstrumentation; +NestInstrumentation.COMPONENT = '@nestjs/core'; +NestInstrumentation.COMMON_ATTRIBUTES = { + component: NestInstrumentation.COMPONENT, +}; +function createWrapNestFactoryCreate(tracer, moduleVersion) { + return function wrapCreate(original) { + return function createWithTrace(nestModule + /* serverOrOptions */ + ) { + const span = tracer.startSpan('Create Nest App', { + attributes: Object.assign(Object.assign({}, NestInstrumentation.COMMON_ATTRIBUTES), { [enums_1.AttributeNames.TYPE]: enums_1.NestType.APP_CREATION, [enums_1.AttributeNames.VERSION]: moduleVersion, [enums_1.AttributeNames.MODULE]: nestModule.name }), + }); + const spanContext = api.trace.setSpan(api.context.active(), span); + return api.context.with(spanContext, async () => { + try { + return await original.apply(this, arguments); + } + catch (e) { + throw addError(span, e); + } + finally { + span.end(); + } + }); + }; + }; +} +function createWrapCreateHandler(tracer, moduleVersion) { + return function wrapCreateHandler(original) { + return function createHandlerWithTrace(instance, callback) { + arguments[1] = createWrapHandler(tracer, moduleVersion, callback); + const handler = original.apply(this, arguments); + const callbackName = callback.name; + const instanceName = instance.constructor && instance.constructor.name + ? instance.constructor.name + : 'UnnamedInstance'; + const spanName = callbackName + ? `${instanceName}.${callbackName}` + : instanceName; + return function (req, res, next) { + var _a, _b; + const span = tracer.startSpan(spanName, { + attributes: Object.assign(Object.assign({}, NestInstrumentation.COMMON_ATTRIBUTES), { [enums_1.AttributeNames.VERSION]: moduleVersion, [enums_1.AttributeNames.TYPE]: enums_1.NestType.REQUEST_CONTEXT, [semantic_conventions_1.SEMATTRS_HTTP_METHOD]: req.method, [semantic_conventions_1.SEMATTRS_HTTP_URL]: req.originalUrl || req.url, [semantic_conventions_1.SEMATTRS_HTTP_ROUTE]: ((_a = req.route) === null || _a === void 0 ? void 0 : _a.path) || ((_b = req.routeOptions) === null || _b === void 0 ? void 0 : _b.url) || req.routerPath, [enums_1.AttributeNames.CONTROLLER]: instanceName, [enums_1.AttributeNames.CALLBACK]: callbackName }), + }); + const spanContext = api.trace.setSpan(api.context.active(), span); + return api.context.with(spanContext, async () => { + try { + return await handler.apply(this, arguments); + } + catch (e) { + throw addError(span, e); + } + finally { + span.end(); + } + }); + }; + }; + }; +} +function createWrapHandler(tracer, moduleVersion, handler) { + const spanName = handler.name || 'anonymous nest handler'; + const options = { + attributes: Object.assign(Object.assign({}, NestInstrumentation.COMMON_ATTRIBUTES), { [enums_1.AttributeNames.VERSION]: moduleVersion, [enums_1.AttributeNames.TYPE]: enums_1.NestType.REQUEST_HANDLER, [enums_1.AttributeNames.CALLBACK]: handler.name }), + }; + const wrappedHandler = function () { + const span = tracer.startSpan(spanName, options); + const spanContext = api.trace.setSpan(api.context.active(), span); + return api.context.with(spanContext, async () => { + try { + return await handler.apply(this, arguments); + } + catch (e) { + throw addError(span, e); + } + finally { + span.end(); + } + }); + }; + if (handler.name) { + Object.defineProperty(wrappedHandler, 'name', { value: handler.name }); + } + // Get the current metadata and set onto the wrapper to ensure other decorators ( ie: NestJS EventPattern / RolesGuard ) + // won't be affected by the use of this instrumentation + Reflect.getMetadataKeys(handler).forEach(metadataKey => { + Reflect.defineMetadata(metadataKey, Reflect.getMetadata(metadataKey, handler), wrappedHandler); + }); + return wrappedHandler; +} +const addError = (span, error) => { + span.recordException(error); + span.setStatus({ code: api.SpanStatusCode.ERROR, message: error.message }); + return error; +}; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 73365: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.44.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-nestjs-core'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 31692: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AttributeNames = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Postgresql specific attributes not covered by semantic conventions +var AttributeNames; +(function (AttributeNames) { + AttributeNames["PG_VALUES"] = "db.postgresql.values"; + AttributeNames["PG_PLAN"] = "db.postgresql.plan"; + AttributeNames["IDLE_TIMEOUT_MILLIS"] = "db.postgresql.idle.timeout.millis"; + AttributeNames["MAX_CLIENT"] = "db.postgresql.max.client"; +})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {})); +//# sourceMappingURL=AttributeNames.js.map + +/***/ }), + +/***/ 40104: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SpanNames = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Contains span names produced by instrumentation +var SpanNames; +(function (SpanNames) { + SpanNames["QUERY_PREFIX"] = "pg.query"; + SpanNames["CONNECT"] = "pg.connect"; + SpanNames["POOL_CONNECT"] = "pg-pool.connect"; +})(SpanNames = exports.SpanNames || (exports.SpanNames = {})); +//# sourceMappingURL=SpanNames.js.map + +/***/ }), + +/***/ 31758: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(33800), exports); +__exportStar(__nccwpck_require__(23808), exports); +__exportStar(__nccwpck_require__(31692), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 33800: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PgInstrumentation = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const instrumentation_1 = __nccwpck_require__(65584); +const api_1 = __nccwpck_require__(65163); +const internal_types_1 = __nccwpck_require__(62205); +const utils = __nccwpck_require__(95782); +const sql_common_1 = __nccwpck_require__(58156); +/** @knipignore */ +const version_1 = __nccwpck_require__(20331); +const SpanNames_1 = __nccwpck_require__(40104); +const core_1 = __nccwpck_require__(89736); +const semantic_conventions_1 = __nccwpck_require__(32736); +const incubating_1 = __nccwpck_require__(65849); +class PgInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); + // Pool events connect, acquire, release and remove can be called + // multiple times without changing the values of total, idle and waiting + // connections. The _connectionsCounter is used to keep track of latest + // values and only update the metrics _connectionsCount and _connectionPendingRequests + // when the value change. + this._connectionsCounter = { + used: 0, + idle: 0, + pending: 0, + }; + } + _updateMetricInstruments() { + this._operationDuration = this.meter.createHistogram(incubating_1.METRIC_DB_CLIENT_OPERATION_DURATION, { + description: 'Duration of database client operations.', + unit: 's', + valueType: api_1.ValueType.DOUBLE, + advice: { + explicitBucketBoundaries: [ + 0.001, 0.005, 0.01, 0.05, 0.1, 0.5, 1, 5, 10, + ], + }, + }); + this._connectionsCounter = { + idle: 0, + pending: 0, + used: 0, + }; + this._connectionsCount = this.meter.createUpDownCounter(incubating_1.METRIC_DB_CLIENT_CONNECTION_COUNT, { + description: 'The number of connections that are currently in state described by the state attribute.', + unit: '{connection}', + }); + this._connectionPendingRequests = this.meter.createUpDownCounter(incubating_1.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS, { + description: 'The number of current pending requests for an open connection.', + unit: '{connection}', + }); + } + init() { + const modulePG = new instrumentation_1.InstrumentationNodeModuleDefinition('pg', ['>=8.0.3 <9'], (module) => { + const moduleExports = module[Symbol.toStringTag] === 'Module' + ? module.default // ESM + : module; // CommonJS + if ((0, instrumentation_1.isWrapped)(moduleExports.Client.prototype.query)) { + this._unwrap(moduleExports.Client.prototype, 'query'); + } + if ((0, instrumentation_1.isWrapped)(moduleExports.Client.prototype.connect)) { + this._unwrap(moduleExports.Client.prototype, 'connect'); + } + this._wrap(moduleExports.Client.prototype, 'query', this._getClientQueryPatch()); + this._wrap(moduleExports.Client.prototype, 'connect', this._getClientConnectPatch()); + return module; + }, (module) => { + const moduleExports = module[Symbol.toStringTag] === 'Module' + ? module.default // ESM + : module; // CommonJS + if ((0, instrumentation_1.isWrapped)(moduleExports.Client.prototype.query)) { + this._unwrap(moduleExports.Client.prototype, 'query'); + } + }); + const modulePGPool = new instrumentation_1.InstrumentationNodeModuleDefinition('pg-pool', ['>=2.0.0 <4'], (moduleExports) => { + if ((0, instrumentation_1.isWrapped)(moduleExports.prototype.connect)) { + this._unwrap(moduleExports.prototype, 'connect'); + } + this._wrap(moduleExports.prototype, 'connect', this._getPoolConnectPatch()); + return moduleExports; + }, (moduleExports) => { + if ((0, instrumentation_1.isWrapped)(moduleExports.prototype.connect)) { + this._unwrap(moduleExports.prototype, 'connect'); + } + }); + return [modulePG, modulePGPool]; + } + _getClientConnectPatch() { + const plugin = this; + return (original) => { + return function connect(callback) { + if (utils.shouldSkipInstrumentation(plugin.getConfig())) { + return original.call(this, callback); + } + const span = plugin.tracer.startSpan(SpanNames_1.SpanNames.CONNECT, { + kind: api_1.SpanKind.CLIENT, + attributes: utils.getSemanticAttributesFromConnection(this), + }); + if (callback) { + const parentSpan = api_1.trace.getSpan(api_1.context.active()); + callback = utils.patchClientConnectCallback(span, callback); + if (parentSpan) { + callback = api_1.context.bind(api_1.context.active(), callback); + } + } + const connectResult = api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { + return original.call(this, callback); + }); + return handleConnectResult(span, connectResult); + }; + }; + } + recordOperationDuration(attributes, startTime) { + const metricsAttributes = {}; + const keysToCopy = [ + semantic_conventions_1.SEMATTRS_DB_SYSTEM, + incubating_1.ATTR_DB_NAMESPACE, + semantic_conventions_1.ATTR_ERROR_TYPE, + semantic_conventions_1.ATTR_SERVER_PORT, + semantic_conventions_1.ATTR_SERVER_ADDRESS, + incubating_1.ATTR_DB_OPERATION_NAME, + ]; + keysToCopy.forEach(key => { + if (key in attributes) { + metricsAttributes[key] = attributes[key]; + } + }); + const durationSeconds = (0, core_1.hrTimeToMilliseconds)((0, core_1.hrTimeDuration)(startTime, (0, core_1.hrTime)())) / 1000; + this._operationDuration.record(durationSeconds, metricsAttributes); + } + _getClientQueryPatch() { + const plugin = this; + return (original) => { + this._diag.debug('Patching pg.Client.prototype.query'); + return function query(...args) { + if (utils.shouldSkipInstrumentation(plugin.getConfig())) { + return original.apply(this, args); + } + const startTime = (0, core_1.hrTime)(); + // client.query(text, cb?), client.query(text, values, cb?), and + // client.query(configObj, cb?) are all valid signatures. We construct + // a queryConfig obj from all (valid) signatures to build the span in a + // unified way. We verify that we at least have query text, and code + // defensively when dealing with `queryConfig` after that (to handle all + // the other invalid cases, like a non-array for values being provided). + // The type casts here reflect only what we've actually validated. + const arg0 = args[0]; + const firstArgIsString = typeof arg0 === 'string'; + const firstArgIsQueryObjectWithText = utils.isObjectWithTextString(arg0); + // TODO: remove the `as ...` casts below when the TS version is upgraded. + // Newer TS versions will use the result of firstArgIsQueryObjectWithText + // to properly narrow arg0, but TS 4.3.5 does not. + const queryConfig = firstArgIsString + ? { + text: arg0, + values: Array.isArray(args[1]) ? args[1] : undefined, + } + : firstArgIsQueryObjectWithText + ? arg0 + : undefined; + const attributes = { + [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_POSTGRESQL, + [incubating_1.ATTR_DB_NAMESPACE]: this.database, + [semantic_conventions_1.ATTR_SERVER_PORT]: this.connectionParameters.port, + [semantic_conventions_1.ATTR_SERVER_ADDRESS]: this.connectionParameters.host, + }; + if (queryConfig === null || queryConfig === void 0 ? void 0 : queryConfig.text) { + attributes[incubating_1.ATTR_DB_OPERATION_NAME] = + utils.parseNormalizedOperationName(queryConfig === null || queryConfig === void 0 ? void 0 : queryConfig.text); + } + const recordDuration = () => { + plugin.recordOperationDuration(attributes, startTime); + }; + const instrumentationConfig = plugin.getConfig(); + const span = utils.handleConfigQuery.call(this, plugin.tracer, instrumentationConfig, queryConfig); + // Modify query text w/ a tracing comment before invoking original for + // tracing, but only if args[0] has one of our expected shapes. + if (instrumentationConfig.addSqlCommenterCommentToQueries) { + if (firstArgIsString) { + args[0] = (0, sql_common_1.addSqlCommenterComment)(span, arg0); + } + else if (firstArgIsQueryObjectWithText && !('name' in arg0)) { + // In the case of a query object, we need to ensure there's no name field + // as this indicates a prepared query, where the comment would remain the same + // for every invocation and contain an outdated trace context. + args[0] = Object.assign(Object.assign({}, arg0), { text: (0, sql_common_1.addSqlCommenterComment)(span, arg0.text) }); + } + } + // Bind callback (if any) to parent span (if any) + if (args.length > 0) { + const parentSpan = api_1.trace.getSpan(api_1.context.active()); + if (typeof args[args.length - 1] === 'function') { + // Patch ParameterQuery callback + args[args.length - 1] = utils.patchCallback(instrumentationConfig, span, args[args.length - 1], // nb: not type safe. + attributes, recordDuration); + // If a parent span exists, bind the callback + if (parentSpan) { + args[args.length - 1] = api_1.context.bind(api_1.context.active(), args[args.length - 1]); + } + } + else if (typeof (queryConfig === null || queryConfig === void 0 ? void 0 : queryConfig.callback) === 'function') { + // Patch ConfigQuery callback + let callback = utils.patchCallback(plugin.getConfig(), span, queryConfig.callback, // nb: not type safe. + attributes, recordDuration); + // If a parent span existed, bind the callback + if (parentSpan) { + callback = api_1.context.bind(api_1.context.active(), callback); + } + args[0].callback = callback; + } + } + const { requestHook } = instrumentationConfig; + if (typeof requestHook === 'function' && queryConfig) { + (0, instrumentation_1.safeExecuteInTheMiddle)(() => { + // pick keys to expose explicitly, so we're not leaking pg package + // internals that are subject to change + const { database, host, port, user } = this.connectionParameters; + const connection = { database, host, port, user }; + requestHook(span, { + connection, + query: { + text: queryConfig.text, + // nb: if `client.query` is called with illegal arguments + // (e.g., if `queryConfig.values` is passed explicitly, but a + // non-array is given), then the type casts will be wrong. But + // we leave it up to the queryHook to handle that, and we + // catch and swallow any errors it throws. The other options + // are all worse. E.g., we could leave `queryConfig.values` + // and `queryConfig.name` as `unknown`, but then the hook body + // would be forced to validate (or cast) them before using + // them, which seems incredibly cumbersome given that these + // casts will be correct 99.9% of the time -- and pg.query + // will immediately throw during development in the other .1% + // of cases. Alternatively, we could simply skip calling the + // hook when `values` or `name` don't have the expected type, + // but that would add unnecessary validation overhead to every + // hook invocation and possibly be even more confusing/unexpected. + values: queryConfig.values, + name: queryConfig.name, + }, + }); + }, err => { + if (err) { + plugin._diag.error('Error running query hook', err); + } + }, true); + } + let result; + try { + result = original.apply(this, args); + } + catch (e) { + span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: utils.getErrorMessage(e), + }); + span.end(); + throw e; + } + // Bind promise to parent span and end the span + if (result instanceof Promise) { + return result + .then((result) => { + // Return a pass-along promise which ends the span and then goes to user's orig resolvers + return new Promise(resolve => { + utils.handleExecutionResult(plugin.getConfig(), span, result); + recordDuration(); + span.end(); + resolve(result); + }); + }) + .catch((error) => { + return new Promise((_, reject) => { + span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: error.message, + }); + recordDuration(); + span.end(); + reject(error); + }); + }); + } + // else returns void + return result; // void + }; + }; + } + _setPoolConnectEventListeners(pgPool) { + if (pgPool[internal_types_1.EVENT_LISTENERS_SET]) + return; + const poolName = utils.getPoolName(pgPool.options); + pgPool.on('connect', () => { + this._connectionsCounter = utils.updateCounter(poolName, pgPool, this._connectionsCount, this._connectionPendingRequests, this._connectionsCounter); + }); + pgPool.on('acquire', () => { + this._connectionsCounter = utils.updateCounter(poolName, pgPool, this._connectionsCount, this._connectionPendingRequests, this._connectionsCounter); + }); + pgPool.on('remove', () => { + this._connectionsCounter = utils.updateCounter(poolName, pgPool, this._connectionsCount, this._connectionPendingRequests, this._connectionsCounter); + }); + pgPool.on('release', () => { + this._connectionsCounter = utils.updateCounter(poolName, pgPool, this._connectionsCount, this._connectionPendingRequests, this._connectionsCounter); + }); + pgPool[internal_types_1.EVENT_LISTENERS_SET] = true; + } + _getPoolConnectPatch() { + const plugin = this; + return (originalConnect) => { + return function connect(callback) { + if (utils.shouldSkipInstrumentation(plugin.getConfig())) { + return originalConnect.call(this, callback); + } + // setup span + const span = plugin.tracer.startSpan(SpanNames_1.SpanNames.POOL_CONNECT, { + kind: api_1.SpanKind.CLIENT, + attributes: utils.getSemanticAttributesFromPool(this.options), + }); + plugin._setPoolConnectEventListeners(this); + if (callback) { + const parentSpan = api_1.trace.getSpan(api_1.context.active()); + callback = utils.patchCallbackPGPool(span, callback); + // If a parent span exists, bind the callback + if (parentSpan) { + callback = api_1.context.bind(api_1.context.active(), callback); + } + } + const connectResult = api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { + return originalConnect.call(this, callback); + }); + return handleConnectResult(span, connectResult); + }; + }; + } +} +exports.PgInstrumentation = PgInstrumentation; +function handleConnectResult(span, connectResult) { + if (!(connectResult instanceof Promise)) { + return connectResult; + } + const connectResultPromise = connectResult; + return api_1.context.bind(api_1.context.active(), connectResultPromise + .then(result => { + span.end(); + return result; + }) + .catch((error) => { + span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: utils.getErrorMessage(error), + }); + span.end(); + return Promise.reject(error); + })); +} +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 62205: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.EVENT_LISTENERS_SET = void 0; +exports.EVENT_LISTENERS_SET = Symbol('opentelemetry.instrumentation.pg.eventListenersSet'); +//# sourceMappingURL=internal-types.js.map + +/***/ }), + +/***/ 23808: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 95782: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isObjectWithTextString = exports.getErrorMessage = exports.patchClientConnectCallback = exports.patchCallbackPGPool = exports.updateCounter = exports.getPoolName = exports.patchCallback = exports.handleExecutionResult = exports.handleConfigQuery = exports.shouldSkipInstrumentation = exports.getSemanticAttributesFromPool = exports.getSemanticAttributesFromConnection = exports.getConnectionString = exports.parseNormalizedOperationName = exports.getQuerySpanName = void 0; +const api_1 = __nccwpck_require__(65163); +const AttributeNames_1 = __nccwpck_require__(31692); +const semantic_conventions_1 = __nccwpck_require__(32736); +const incubating_1 = __nccwpck_require__(65849); +const instrumentation_1 = __nccwpck_require__(65584); +const SpanNames_1 = __nccwpck_require__(40104); +/** + * Helper function to get a low cardinality span name from whatever info we have + * about the query. + * + * This is tricky, because we don't have most of the information (table name, + * operation name, etc) the spec recommends using to build a low-cardinality + * value w/o parsing. So, we use db.name and assume that, if the query's a named + * prepared statement, those `name` values will be low cardinality. If we don't + * have a named prepared statement, we try to parse an operation (despite the + * spec's warnings). + * + * @params dbName The name of the db against which this query is being issued, + * which could be missing if no db name was given at the time that the + * connection was established. + * @params queryConfig Information we have about the query being issued, typed + * to reflect only the validation we've actually done on the args to + * `client.query()`. This will be undefined if `client.query()` was called + * with invalid arguments. + */ +function getQuerySpanName(dbName, queryConfig) { + // NB: when the query config is invalid, we omit the dbName too, so that + // someone (or some tool) reading the span name doesn't misinterpret the + // dbName as being a prepared statement or sql commit name. + if (!queryConfig) + return SpanNames_1.SpanNames.QUERY_PREFIX; + // Either the name of a prepared statement; or an attempted parse + // of the SQL command, normalized to uppercase; or unknown. + const command = typeof queryConfig.name === 'string' && queryConfig.name + ? queryConfig.name + : parseNormalizedOperationName(queryConfig.text); + return `${SpanNames_1.SpanNames.QUERY_PREFIX}:${command}${dbName ? ` ${dbName}` : ''}`; +} +exports.getQuerySpanName = getQuerySpanName; +function parseNormalizedOperationName(queryText) { + const indexOfFirstSpace = queryText.indexOf(' '); + let sqlCommand = indexOfFirstSpace === -1 + ? queryText + : queryText.slice(0, indexOfFirstSpace); + sqlCommand = sqlCommand.toUpperCase(); + // Handle query text being "COMMIT;", which has an extra semicolon before the space. + return sqlCommand.endsWith(';') ? sqlCommand.slice(0, -1) : sqlCommand; +} +exports.parseNormalizedOperationName = parseNormalizedOperationName; +function getConnectionString(params) { + const host = params.host || 'localhost'; + const port = params.port || 5432; + const database = params.database || ''; + return `postgresql://${host}:${port}/${database}`; +} +exports.getConnectionString = getConnectionString; +function getPort(port) { + // Port may be NaN as parseInt() is used on the value, passing null will result in NaN being parsed. + // https://github.com/brianc/node-postgres/blob/2a8efbee09a284be12748ed3962bc9b816965e36/packages/pg/lib/connection-parameters.js#L66 + if (Number.isInteger(port)) { + return port; + } + // Unable to find the default used in pg code, so falling back to 'undefined'. + return undefined; +} +function getSemanticAttributesFromConnection(params) { + return { + [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_POSTGRESQL, + [semantic_conventions_1.SEMATTRS_DB_NAME]: params.database, + [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: getConnectionString(params), + [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: params.host, + [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: getPort(params.port), + [semantic_conventions_1.SEMATTRS_DB_USER]: params.user, + }; +} +exports.getSemanticAttributesFromConnection = getSemanticAttributesFromConnection; +function getSemanticAttributesFromPool(params) { + return { + [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_POSTGRESQL, + [semantic_conventions_1.SEMATTRS_DB_NAME]: params.database, + [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: getConnectionString(params), + [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: params.host, + [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: getPort(params.port), + [semantic_conventions_1.SEMATTRS_DB_USER]: params.user, + [AttributeNames_1.AttributeNames.IDLE_TIMEOUT_MILLIS]: params.idleTimeoutMillis, + [AttributeNames_1.AttributeNames.MAX_CLIENT]: params.maxClient, + }; +} +exports.getSemanticAttributesFromPool = getSemanticAttributesFromPool; +function shouldSkipInstrumentation(instrumentationConfig) { + return (instrumentationConfig.requireParentSpan === true && + api_1.trace.getSpan(api_1.context.active()) === undefined); +} +exports.shouldSkipInstrumentation = shouldSkipInstrumentation; +// Create a span from our normalized queryConfig object, +// or return a basic span if no queryConfig was given/could be created. +function handleConfigQuery(tracer, instrumentationConfig, queryConfig) { + // Create child span. + const { connectionParameters } = this; + const dbName = connectionParameters.database; + const spanName = getQuerySpanName(dbName, queryConfig); + const span = tracer.startSpan(spanName, { + kind: api_1.SpanKind.CLIENT, + attributes: getSemanticAttributesFromConnection(connectionParameters), + }); + if (!queryConfig) { + return span; + } + // Set attributes + if (queryConfig.text) { + span.setAttribute(semantic_conventions_1.SEMATTRS_DB_STATEMENT, queryConfig.text); + } + if (instrumentationConfig.enhancedDatabaseReporting && + Array.isArray(queryConfig.values)) { + try { + const convertedValues = queryConfig.values.map(value => { + if (value == null) { + return 'null'; + } + else if (value instanceof Buffer) { + return value.toString(); + } + else if (typeof value === 'object') { + if (typeof value.toPostgres === 'function') { + return value.toPostgres(); + } + return JSON.stringify(value); + } + else { + //string, number + return value.toString(); + } + }); + span.setAttribute(AttributeNames_1.AttributeNames.PG_VALUES, convertedValues); + } + catch (e) { + api_1.diag.error('failed to stringify ', queryConfig.values, e); + } + } + // Set plan name attribute, if present + if (typeof queryConfig.name === 'string') { + span.setAttribute(AttributeNames_1.AttributeNames.PG_PLAN, queryConfig.name); + } + return span; +} +exports.handleConfigQuery = handleConfigQuery; +function handleExecutionResult(config, span, pgResult) { + if (typeof config.responseHook === 'function') { + (0, instrumentation_1.safeExecuteInTheMiddle)(() => { + config.responseHook(span, { + data: pgResult, + }); + }, err => { + if (err) { + api_1.diag.error('Error running response hook', err); + } + }, true); + } +} +exports.handleExecutionResult = handleExecutionResult; +function patchCallback(instrumentationConfig, span, cb, attributes, recordDuration) { + return function patchedCallback(err, res) { + if (err) { + if (Object.prototype.hasOwnProperty.call(err, 'code')) { + attributes[semantic_conventions_1.ATTR_ERROR_TYPE] = err['code']; + } + span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: err.message, + }); + } + else { + handleExecutionResult(instrumentationConfig, span, res); + } + recordDuration(); + span.end(); + cb.call(this, err, res); + }; +} +exports.patchCallback = patchCallback; +function getPoolName(pool) { + let poolName = ''; + poolName += ((pool === null || pool === void 0 ? void 0 : pool.host) ? `${pool.host}` : 'unknown_host') + ':'; + poolName += ((pool === null || pool === void 0 ? void 0 : pool.port) ? `${pool.port}` : 'unknown_port') + '/'; + poolName += (pool === null || pool === void 0 ? void 0 : pool.database) ? `${pool.database}` : 'unknown_database'; + return poolName.trim(); +} +exports.getPoolName = getPoolName; +function updateCounter(poolName, pool, connectionCount, connectionPendingRequests, latestCounter) { + const all = pool.totalCount; + const pending = pool.waitingCount; + const idle = pool.idleCount; + const used = all - idle; + connectionCount.add(used - latestCounter.used, { + [incubating_1.ATTR_DB_CLIENT_CONNECTION_STATE]: incubating_1.DB_CLIENT_CONNECTION_STATE_VALUE_USED, + [incubating_1.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]: poolName, + }); + connectionCount.add(idle - latestCounter.idle, { + [incubating_1.ATTR_DB_CLIENT_CONNECTION_STATE]: incubating_1.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE, + [incubating_1.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]: poolName, + }); + connectionPendingRequests.add(pending - latestCounter.pending, { + [incubating_1.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]: poolName, + }); + return { used: used, idle: idle, pending: pending }; +} +exports.updateCounter = updateCounter; +function patchCallbackPGPool(span, cb) { + return function patchedCallback(err, res, done) { + if (err) { + span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: err.message, + }); + } + span.end(); + cb.call(this, err, res, done); + }; +} +exports.patchCallbackPGPool = patchCallbackPGPool; +function patchClientConnectCallback(span, cb) { + return function patchedClientConnectCallback(err) { + if (err) { + span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: err.message, + }); + } + span.end(); + cb.apply(this, arguments); + }; +} +exports.patchClientConnectCallback = patchClientConnectCallback; +/** + * Attempt to get a message string from a thrown value, while being quite + * defensive, to recognize the fact that, in JS, any kind of value (even + * primitives) can be thrown. + */ +function getErrorMessage(e) { + return typeof e === 'object' && e !== null && 'message' in e + ? String(e.message) + : undefined; +} +exports.getErrorMessage = getErrorMessage; +function isObjectWithTextString(it) { + var _a; + return (typeof it === 'object' && + typeof ((_a = it) === null || _a === void 0 ? void 0 : _a.text) === 'string'); +} +exports.isObjectWithTextString = isObjectWithTextString; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 20331: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.50.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-pg'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 86219: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ATTR_AWS_REQUEST_ID = exports.ATTR_AWS_LOG_STREAM_NAMES = exports.ATTR_AWS_LOG_STREAM_ARNS = exports.ATTR_AWS_LOG_GROUP_NAMES = exports.ATTR_AWS_LOG_GROUP_ARNS = exports.ATTR_AWS_LAMBDA_INVOKED_ARN = exports.ATTR_AWS_EKS_CLUSTER_ARN = exports.ATTR_AWS_ECS_TASK_REVISION = exports.ATTR_AWS_ECS_TASK_FAMILY = exports.ATTR_AWS_ECS_TASK_ARN = exports.AWS_ECS_LAUNCHTYPE_VALUE_FARGATE = exports.AWS_ECS_LAUNCHTYPE_VALUE_EC2 = exports.ATTR_AWS_ECS_LAUNCHTYPE = exports.ATTR_AWS_ECS_CONTAINER_ARN = exports.ATTR_AWS_ECS_CLUSTER_ARN = exports.ATTR_AWS_DYNAMODB_TOTAL_SEGMENTS = exports.ATTR_AWS_DYNAMODB_TABLE_NAMES = exports.ATTR_AWS_DYNAMODB_TABLE_COUNT = exports.ATTR_AWS_DYNAMODB_SELECT = exports.ATTR_AWS_DYNAMODB_SEGMENT = exports.ATTR_AWS_DYNAMODB_SCANNED_COUNT = exports.ATTR_AWS_DYNAMODB_SCAN_FORWARD = exports.ATTR_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = exports.ATTR_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = exports.ATTR_AWS_DYNAMODB_PROJECTION = exports.ATTR_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = exports.ATTR_AWS_DYNAMODB_LIMIT = exports.ATTR_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = exports.ATTR_AWS_DYNAMODB_INDEX_NAME = exports.ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = exports.ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = exports.ATTR_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = exports.ATTR_AWS_DYNAMODB_COUNT = exports.ATTR_AWS_DYNAMODB_CONSUMED_CAPACITY = exports.ATTR_AWS_DYNAMODB_CONSISTENT_READ = exports.ATTR_AWS_DYNAMODB_ATTRIBUTES_TO_GET = exports.ATTR_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = exports.ATTR_ARTIFACT_VERSION = exports.ATTR_ARTIFACT_PURL = exports.ATTR_ARTIFACT_HASH = exports.ATTR_ARTIFACT_FILENAME = exports.ATTR_ARTIFACT_ATTESTATION_ID = exports.ATTR_ARTIFACT_ATTESTATION_HASH = exports.ATTR_ARTIFACT_ATTESTATION_FILENAME = exports.ANDROID_STATE_VALUE_FOREGROUND = exports.ANDROID_STATE_VALUE_CREATED = exports.ANDROID_STATE_VALUE_BACKGROUND = exports.ATTR_ANDROID_STATE = exports.ATTR_ANDROID_OS_API_LEVEL = exports.ATTR_AWS_ECS_TASK_ID = void 0; +exports.CLOUD_PLATFORM_VALUE_TENCENT_CLOUD_EKS = exports.CLOUD_PLATFORM_VALUE_TENCENT_CLOUD_CVM = exports.CLOUD_PLATFORM_VALUE_IBM_CLOUD_OPENSHIFT = exports.CLOUD_PLATFORM_VALUE_GCP_OPENSHIFT = exports.CLOUD_PLATFORM_VALUE_GCP_KUBERNETES_ENGINE = exports.CLOUD_PLATFORM_VALUE_GCP_COMPUTE_ENGINE = exports.CLOUD_PLATFORM_VALUE_GCP_CLOUD_RUN = exports.CLOUD_PLATFORM_VALUE_GCP_CLOUD_FUNCTIONS = exports.CLOUD_PLATFORM_VALUE_GCP_BARE_METAL_SOLUTION = exports.CLOUD_PLATFORM_VALUE_GCP_APP_ENGINE = exports.CLOUD_PLATFORM_VALUE_AZURE_VM = exports.CLOUD_PLATFORM_VALUE_AZURE_OPENSHIFT = exports.CLOUD_PLATFORM_VALUE_AZURE_FUNCTIONS = exports.CLOUD_PLATFORM_VALUE_AZURE_CONTAINER_INSTANCES = exports.CLOUD_PLATFORM_VALUE_AZURE_CONTAINER_APPS = exports.CLOUD_PLATFORM_VALUE_AZURE_APP_SERVICE = exports.CLOUD_PLATFORM_VALUE_AZURE_AKS = exports.CLOUD_PLATFORM_VALUE_AWS_OPENSHIFT = exports.CLOUD_PLATFORM_VALUE_AWS_LAMBDA = exports.CLOUD_PLATFORM_VALUE_AWS_ELASTIC_BEANSTALK = exports.CLOUD_PLATFORM_VALUE_AWS_EKS = exports.CLOUD_PLATFORM_VALUE_AWS_ECS = exports.CLOUD_PLATFORM_VALUE_AWS_EC2 = exports.CLOUD_PLATFORM_VALUE_AWS_APP_RUNNER = exports.CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_OPENSHIFT = exports.CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_FC = exports.CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS = exports.ATTR_CLOUD_PLATFORM = exports.ATTR_CLOUD_AVAILABILITY_ZONE = exports.ATTR_CLOUD_ACCOUNT_ID = exports.CICD_PIPELINE_TASK_TYPE_VALUE_TEST = exports.CICD_PIPELINE_TASK_TYPE_VALUE_DEPLOY = exports.CICD_PIPELINE_TASK_TYPE_VALUE_BUILD = exports.ATTR_CICD_PIPELINE_TASK_TYPE = exports.ATTR_CICD_PIPELINE_TASK_RUN_URL_FULL = exports.ATTR_CICD_PIPELINE_TASK_RUN_ID = exports.ATTR_CICD_PIPELINE_TASK_NAME = exports.ATTR_CICD_PIPELINE_RUN_ID = exports.ATTR_CICD_PIPELINE_NAME = exports.ATTR_BROWSER_PLATFORM = exports.ATTR_BROWSER_MOBILE = exports.ATTR_BROWSER_LANGUAGE = exports.ATTR_BROWSER_BRANDS = exports.ATTR_AZ_SERVICE_REQUEST_ID = exports.ATTR_AWS_S3_UPLOAD_ID = exports.ATTR_AWS_S3_PART_NUMBER = exports.ATTR_AWS_S3_KEY = exports.ATTR_AWS_S3_DELETE = exports.ATTR_AWS_S3_COPY_SOURCE = exports.ATTR_AWS_S3_BUCKET = void 0; +exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ANY = exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ALL = exports.ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL = exports.CPU_MODE_VALUE_USER = exports.CPU_MODE_VALUE_SYSTEM = exports.CPU_MODE_VALUE_STEAL = exports.CPU_MODE_VALUE_NICE = exports.CPU_MODE_VALUE_KERNEL = exports.CPU_MODE_VALUE_IOWAIT = exports.CPU_MODE_VALUE_INTERRUPT = exports.CPU_MODE_VALUE_IDLE = exports.ATTR_CPU_MODE = exports.ATTR_CONTAINER_RUNTIME = exports.ATTR_CONTAINER_NAME = exports.ATTR_CONTAINER_LABELS = exports.ATTR_CONTAINER_LABEL = exports.ATTR_CONTAINER_IMAGE_TAGS = exports.ATTR_CONTAINER_IMAGE_REPO_DIGESTS = exports.ATTR_CONTAINER_IMAGE_NAME = exports.ATTR_CONTAINER_IMAGE_ID = exports.ATTR_CONTAINER_ID = exports.CONTAINER_CPU_STATE_VALUE_USER = exports.CONTAINER_CPU_STATE_VALUE_SYSTEM = exports.CONTAINER_CPU_STATE_VALUE_KERNEL = exports.ATTR_CONTAINER_CPU_STATE = exports.ATTR_CONTAINER_COMMAND_LINE = exports.ATTR_CONTAINER_COMMAND_ARGS = exports.ATTR_CONTAINER_COMMAND = exports.ATTR_CODE_STACKTRACE = exports.ATTR_CODE_NAMESPACE = exports.ATTR_CODE_LINENO = exports.ATTR_CODE_FUNCTION = exports.ATTR_CODE_FILEPATH = exports.ATTR_CODE_COLUMN = exports.ATTR_CLOUDEVENTS_EVENT_TYPE = exports.ATTR_CLOUDEVENTS_EVENT_SUBJECT = exports.ATTR_CLOUDEVENTS_EVENT_SPEC_VERSION = exports.ATTR_CLOUDEVENTS_EVENT_SOURCE = exports.ATTR_CLOUDEVENTS_EVENT_ID = exports.ATTR_CLOUD_RESOURCE_ID = exports.ATTR_CLOUD_REGION = exports.CLOUD_PROVIDER_VALUE_TENCENT_CLOUD = exports.CLOUD_PROVIDER_VALUE_IBM_CLOUD = exports.CLOUD_PROVIDER_VALUE_HEROKU = exports.CLOUD_PROVIDER_VALUE_GCP = exports.CLOUD_PROVIDER_VALUE_AZURE = exports.CLOUD_PROVIDER_VALUE_AWS = exports.CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD = exports.ATTR_CLOUD_PROVIDER = exports.CLOUD_PLATFORM_VALUE_TENCENT_CLOUD_SCF = void 0; +exports.ATTR_DB_COSMOSDB_SUB_STATUS_CODE = exports.ATTR_DB_COSMOSDB_STATUS_CODE = exports.ATTR_DB_COSMOSDB_REQUEST_CONTENT_LENGTH = exports.ATTR_DB_COSMOSDB_REQUEST_CHARGE = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_UPSERT = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_REPLACE = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_READ_FEED = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_READ = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_QUERY_PLAN = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_QUERY = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_PATCH = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_INVALID = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_HEAD_FEED = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_HEAD = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_EXECUTE_JAVASCRIPT = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_EXECUTE = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_DELETE = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_CREATE = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_BATCH = exports.ATTR_DB_COSMOSDB_OPERATION_TYPE = exports.ATTR_DB_COSMOSDB_CONTAINER = exports.DB_COSMOSDB_CONNECTION_MODE_VALUE_GATEWAY = exports.DB_COSMOSDB_CONNECTION_MODE_VALUE_DIRECT = exports.ATTR_DB_COSMOSDB_CONNECTION_MODE = exports.ATTR_DB_COSMOSDB_CLIENT_ID = exports.ATTR_DB_CONNECTION_STRING = exports.ATTR_DB_COLLECTION_NAME = exports.DB_CLIENT_CONNECTIONS_STATE_VALUE_USED = exports.DB_CLIENT_CONNECTIONS_STATE_VALUE_IDLE = exports.ATTR_DB_CLIENT_CONNECTIONS_STATE = exports.ATTR_DB_CLIENT_CONNECTIONS_POOL_NAME = exports.DB_CLIENT_CONNECTION_STATE_VALUE_USED = exports.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE = exports.ATTR_DB_CLIENT_CONNECTION_STATE = exports.ATTR_DB_CLIENT_CONNECTION_POOL_NAME = exports.ATTR_DB_CASSANDRA_TABLE = exports.ATTR_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = exports.ATTR_DB_CASSANDRA_PAGE_SIZE = exports.ATTR_DB_CASSANDRA_IDEMPOTENCE = exports.ATTR_DB_CASSANDRA_COORDINATOR_ID = exports.ATTR_DB_CASSANDRA_COORDINATOR_DC = exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_TWO = exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_THREE = exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_SERIAL = exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_QUORUM = exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ONE = exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_SERIAL = exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_QUORUM = exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_ONE = exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_EACH_QUORUM = void 0; +exports.DB_SYSTEM_VALUE_MAXDB = exports.DB_SYSTEM_VALUE_MARIADB = exports.DB_SYSTEM_VALUE_INTERSYSTEMS_CACHE = exports.DB_SYSTEM_VALUE_INTERBASE = exports.DB_SYSTEM_VALUE_INSTANTDB = exports.DB_SYSTEM_VALUE_INGRES = exports.DB_SYSTEM_VALUE_INFORMIX = exports.DB_SYSTEM_VALUE_INFLUXDB = exports.DB_SYSTEM_VALUE_HSQLDB = exports.DB_SYSTEM_VALUE_HIVE = exports.DB_SYSTEM_VALUE_HBASE = exports.DB_SYSTEM_VALUE_HANADB = exports.DB_SYSTEM_VALUE_H2 = exports.DB_SYSTEM_VALUE_GEODE = exports.DB_SYSTEM_VALUE_FIRSTSQL = exports.DB_SYSTEM_VALUE_FIREBIRD = exports.DB_SYSTEM_VALUE_FILEMAKER = exports.DB_SYSTEM_VALUE_ELASTICSEARCH = exports.DB_SYSTEM_VALUE_EDB = exports.DB_SYSTEM_VALUE_DYNAMODB = exports.DB_SYSTEM_VALUE_DERBY = exports.DB_SYSTEM_VALUE_DB2 = exports.DB_SYSTEM_VALUE_COUCHDB = exports.DB_SYSTEM_VALUE_COUCHBASE = exports.DB_SYSTEM_VALUE_COSMOSDB = exports.DB_SYSTEM_VALUE_COLDFUSION = exports.DB_SYSTEM_VALUE_COCKROACHDB = exports.DB_SYSTEM_VALUE_CLOUDSCAPE = exports.DB_SYSTEM_VALUE_CLICKHOUSE = exports.DB_SYSTEM_VALUE_CASSANDRA = exports.DB_SYSTEM_VALUE_CACHE = exports.DB_SYSTEM_VALUE_ADABAS = exports.ATTR_DB_SYSTEM = exports.ATTR_DB_STATEMENT = exports.ATTR_DB_SQL_TABLE = exports.ATTR_DB_REDIS_DATABASE_INDEX = exports.ATTR_DB_QUERY_TEXT = exports.ATTR_DB_QUERY_PARAMETER = exports.ATTR_DB_OPERATION_NAME = exports.ATTR_DB_OPERATION_BATCH_SIZE = exports.ATTR_DB_OPERATION = exports.ATTR_DB_NAMESPACE = exports.ATTR_DB_NAME = exports.ATTR_DB_MSSQL_INSTANCE_NAME = exports.ATTR_DB_MONGODB_COLLECTION = exports.ATTR_DB_JDBC_DRIVER_CLASSNAME = exports.ATTR_DB_INSTANCE_ID = exports.ATTR_DB_ELASTICSEARCH_PATH_PARTS = exports.ATTR_DB_ELASTICSEARCH_NODE_NAME = exports.ATTR_DB_ELASTICSEARCH_CLUSTER_NAME = void 0; +exports.FAAS_DOCUMENT_OPERATION_VALUE_DELETE = exports.ATTR_FAAS_DOCUMENT_OPERATION = exports.ATTR_FAAS_DOCUMENT_NAME = exports.ATTR_FAAS_DOCUMENT_COLLECTION = exports.ATTR_FAAS_CRON = exports.ATTR_FAAS_COLDSTART = exports.ATTR_EVENT_NAME = exports.ATTR_ENDUSER_SCOPE = exports.ATTR_ENDUSER_ROLE = exports.ATTR_ENDUSER_ID = exports.ATTR_DNS_QUESTION_NAME = exports.DISK_IO_DIRECTION_VALUE_WRITE = exports.DISK_IO_DIRECTION_VALUE_READ = exports.ATTR_DISK_IO_DIRECTION = exports.ATTR_DEVICE_MODEL_NAME = exports.ATTR_DEVICE_MODEL_IDENTIFIER = exports.ATTR_DEVICE_MANUFACTURER = exports.ATTR_DEVICE_ID = exports.ATTR_DESTINATION_PORT = exports.ATTR_DESTINATION_ADDRESS = exports.DEPLOYMENT_STATUS_VALUE_SUCCEEDED = exports.DEPLOYMENT_STATUS_VALUE_FAILED = exports.ATTR_DEPLOYMENT_STATUS = exports.ATTR_DEPLOYMENT_NAME = exports.ATTR_DEPLOYMENT_ID = exports.ATTR_DEPLOYMENT_ENVIRONMENT_NAME = exports.ATTR_DEPLOYMENT_ENVIRONMENT = exports.ATTR_DB_USER = exports.DB_SYSTEM_VALUE_VERTICA = exports.DB_SYSTEM_VALUE_TRINO = exports.DB_SYSTEM_VALUE_TERADATA = exports.DB_SYSTEM_VALUE_SYBASE = exports.DB_SYSTEM_VALUE_SQLITE = exports.DB_SYSTEM_VALUE_SPANNER = exports.DB_SYSTEM_VALUE_REDSHIFT = exports.DB_SYSTEM_VALUE_REDIS = exports.DB_SYSTEM_VALUE_PROGRESS = exports.DB_SYSTEM_VALUE_POSTGRESQL = exports.DB_SYSTEM_VALUE_POINTBASE = exports.DB_SYSTEM_VALUE_PERVASIVE = exports.DB_SYSTEM_VALUE_OTHER_SQL = exports.DB_SYSTEM_VALUE_ORACLE = exports.DB_SYSTEM_VALUE_OPENSEARCH = exports.DB_SYSTEM_VALUE_NETEZZA = exports.DB_SYSTEM_VALUE_NEO4J = exports.DB_SYSTEM_VALUE_MYSQL = exports.DB_SYSTEM_VALUE_MSSQLCOMPACT = exports.DB_SYSTEM_VALUE_MSSQL = exports.DB_SYSTEM_VALUE_MONGODB = exports.DB_SYSTEM_VALUE_MEMCACHED = void 0; +exports.ATTR_GEN_AI_RESPONSE_FINISH_REASONS = exports.ATTR_GEN_AI_REQUEST_TOP_P = exports.ATTR_GEN_AI_REQUEST_TOP_K = exports.ATTR_GEN_AI_REQUEST_TEMPERATURE = exports.ATTR_GEN_AI_REQUEST_STOP_SEQUENCES = exports.ATTR_GEN_AI_REQUEST_PRESENCE_PENALTY = exports.ATTR_GEN_AI_REQUEST_MODEL = exports.ATTR_GEN_AI_REQUEST_MAX_TOKENS = exports.ATTR_GEN_AI_REQUEST_FREQUENCY_PENALTY = exports.ATTR_GEN_AI_PROMPT = exports.GEN_AI_OPERATION_NAME_VALUE_TEXT_COMPLETION = exports.GEN_AI_OPERATION_NAME_VALUE_CHAT = exports.ATTR_GEN_AI_OPERATION_NAME = exports.ATTR_GEN_AI_COMPLETION = exports.ATTR_GCP_GCE_INSTANCE_NAME = exports.ATTR_GCP_GCE_INSTANCE_HOSTNAME = exports.ATTR_GCP_CLOUD_RUN_JOB_TASK_INDEX = exports.ATTR_GCP_CLOUD_RUN_JOB_EXECUTION = exports.ATTR_GCP_CLIENT_SERVICE = exports.ATTR_FILE_SIZE = exports.ATTR_FILE_PATH = exports.ATTR_FILE_NAME = exports.ATTR_FILE_EXTENSION = exports.ATTR_FILE_DIRECTORY = exports.ATTR_FEATURE_FLAG_VARIANT = exports.ATTR_FEATURE_FLAG_PROVIDER_NAME = exports.ATTR_FEATURE_FLAG_KEY = exports.ATTR_FAAS_VERSION = exports.FAAS_TRIGGER_VALUE_TIMER = exports.FAAS_TRIGGER_VALUE_PUBSUB = exports.FAAS_TRIGGER_VALUE_OTHER = exports.FAAS_TRIGGER_VALUE_HTTP = exports.FAAS_TRIGGER_VALUE_DATASOURCE = exports.ATTR_FAAS_TRIGGER = exports.ATTR_FAAS_TIME = exports.ATTR_FAAS_NAME = exports.ATTR_FAAS_MAX_MEMORY = exports.ATTR_FAAS_INVOKED_REGION = exports.FAAS_INVOKED_PROVIDER_VALUE_TENCENT_CLOUD = exports.FAAS_INVOKED_PROVIDER_VALUE_GCP = exports.FAAS_INVOKED_PROVIDER_VALUE_AZURE = exports.FAAS_INVOKED_PROVIDER_VALUE_AWS = exports.FAAS_INVOKED_PROVIDER_VALUE_ALIBABA_CLOUD = exports.ATTR_FAAS_INVOKED_PROVIDER = exports.ATTR_FAAS_INVOKED_NAME = exports.ATTR_FAAS_INVOCATION_ID = exports.ATTR_FAAS_INSTANCE = exports.ATTR_FAAS_DOCUMENT_TIME = exports.FAAS_DOCUMENT_OPERATION_VALUE_INSERT = exports.FAAS_DOCUMENT_OPERATION_VALUE_EDIT = void 0; +exports.ATTR_HTTP_CLIENT_IP = exports.ATTR_HOST_TYPE = exports.ATTR_HOST_NAME = exports.ATTR_HOST_MAC = exports.ATTR_HOST_IP = exports.ATTR_HOST_IMAGE_VERSION = exports.ATTR_HOST_IMAGE_NAME = exports.ATTR_HOST_IMAGE_ID = exports.ATTR_HOST_ID = exports.ATTR_HOST_CPU_VENDOR_ID = exports.ATTR_HOST_CPU_STEPPING = exports.ATTR_HOST_CPU_MODEL_NAME = exports.ATTR_HOST_CPU_MODEL_ID = exports.ATTR_HOST_CPU_FAMILY = exports.ATTR_HOST_CPU_CACHE_L2_SIZE = exports.HOST_ARCH_VALUE_X86 = exports.HOST_ARCH_VALUE_S390X = exports.HOST_ARCH_VALUE_PPC64 = exports.HOST_ARCH_VALUE_PPC32 = exports.HOST_ARCH_VALUE_IA64 = exports.HOST_ARCH_VALUE_ARM64 = exports.HOST_ARCH_VALUE_ARM32 = exports.HOST_ARCH_VALUE_AMD64 = exports.ATTR_HOST_ARCH = exports.ATTR_HEROKU_RELEASE_CREATION_TIMESTAMP = exports.ATTR_HEROKU_RELEASE_COMMIT = exports.ATTR_HEROKU_APP_ID = exports.GRAPHQL_OPERATION_TYPE_VALUE_SUBSCRIPTION = exports.GRAPHQL_OPERATION_TYPE_VALUE_QUERY = exports.GRAPHQL_OPERATION_TYPE_VALUE_MUTATION = exports.ATTR_GRAPHQL_OPERATION_TYPE = exports.ATTR_GRAPHQL_OPERATION_NAME = exports.ATTR_GRAPHQL_DOCUMENT = exports.GO_MEMORY_TYPE_VALUE_STACK = exports.GO_MEMORY_TYPE_VALUE_OTHER = exports.ATTR_GO_MEMORY_TYPE = exports.ATTR_GEN_AI_USAGE_PROMPT_TOKENS = exports.ATTR_GEN_AI_USAGE_OUTPUT_TOKENS = exports.ATTR_GEN_AI_USAGE_INPUT_TOKENS = exports.ATTR_GEN_AI_USAGE_COMPLETION_TOKENS = exports.GEN_AI_TOKEN_TYPE_VALUE_COMPLETION = exports.GEN_AI_TOKEN_TYPE_VALUE_INPUT = exports.ATTR_GEN_AI_TOKEN_TYPE = exports.GEN_AI_SYSTEM_VALUE_VERTEX_AI = exports.GEN_AI_SYSTEM_VALUE_OPENAI = exports.GEN_AI_SYSTEM_VALUE_COHERE = exports.GEN_AI_SYSTEM_VALUE_ANTHROPIC = exports.ATTR_GEN_AI_SYSTEM = exports.ATTR_GEN_AI_RESPONSE_MODEL = exports.ATTR_GEN_AI_RESPONSE_ID = void 0; +exports.ATTR_K8S_POD_ANNOTATION = exports.ATTR_K8S_NODE_UID = exports.ATTR_K8S_NODE_NAME = exports.ATTR_K8S_NAMESPACE_NAME = exports.ATTR_K8S_JOB_UID = exports.ATTR_K8S_JOB_NAME = exports.ATTR_K8S_DEPLOYMENT_UID = exports.ATTR_K8S_DEPLOYMENT_NAME = exports.ATTR_K8S_DAEMONSET_UID = exports.ATTR_K8S_DAEMONSET_NAME = exports.ATTR_K8S_CRONJOB_UID = exports.ATTR_K8S_CRONJOB_NAME = exports.ATTR_K8S_CONTAINER_STATUS_LAST_TERMINATED_REASON = exports.ATTR_K8S_CONTAINER_RESTART_COUNT = exports.ATTR_K8S_CONTAINER_NAME = exports.ATTR_K8S_CLUSTER_UID = exports.ATTR_K8S_CLUSTER_NAME = exports.ATTR_JVM_BUFFER_POOL_NAME = exports.IOS_STATE_VALUE_TERMINATE = exports.IOS_STATE_VALUE_INACTIVE = exports.IOS_STATE_VALUE_FOREGROUND = exports.IOS_STATE_VALUE_BACKGROUND = exports.IOS_STATE_VALUE_ACTIVE = exports.ATTR_IOS_STATE = exports.ATTR_HTTP_USER_AGENT = exports.ATTR_HTTP_URL = exports.ATTR_HTTP_TARGET = exports.ATTR_HTTP_STATUS_CODE = exports.ATTR_HTTP_SERVER_NAME = exports.ATTR_HTTP_SCHEME = exports.ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = exports.ATTR_HTTP_RESPONSE_CONTENT_LENGTH = exports.ATTR_HTTP_RESPONSE_SIZE = exports.ATTR_HTTP_RESPONSE_BODY_SIZE = exports.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = exports.ATTR_HTTP_REQUEST_CONTENT_LENGTH = exports.ATTR_HTTP_REQUEST_SIZE = exports.ATTR_HTTP_REQUEST_BODY_SIZE = exports.ATTR_HTTP_METHOD = exports.ATTR_HTTP_HOST = exports.HTTP_FLAVOR_VALUE_SPDY = exports.HTTP_FLAVOR_VALUE_QUIC = exports.HTTP_FLAVOR_VALUE_HTTP_3_0 = exports.HTTP_FLAVOR_VALUE_HTTP_2_0 = exports.HTTP_FLAVOR_VALUE_HTTP_1_1 = exports.HTTP_FLAVOR_VALUE_HTTP_1_0 = exports.ATTR_HTTP_FLAVOR = exports.HTTP_CONNECTION_STATE_VALUE_IDLE = exports.HTTP_CONNECTION_STATE_VALUE_ACTIVE = exports.ATTR_HTTP_CONNECTION_STATE = void 0; +exports.ATTR_MESSAGING_MESSAGE_BODY_SIZE = exports.ATTR_MESSAGING_KAFKA_OFFSET = exports.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE = exports.ATTR_MESSAGING_KAFKA_MESSAGE_OFFSET = exports.ATTR_MESSAGING_KAFKA_MESSAGE_KEY = exports.ATTR_MESSAGING_KAFKA_DESTINATION_PARTITION = exports.ATTR_MESSAGING_KAFKA_CONSUMER_GROUP = exports.ATTR_MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY = exports.ATTR_MESSAGING_GCP_PUBSUB_MESSAGE_DELIVERY_ATTEMPT = exports.ATTR_MESSAGING_GCP_PUBSUB_MESSAGE_ACK_ID = exports.ATTR_MESSAGING_GCP_PUBSUB_MESSAGE_ACK_DEADLINE = exports.ATTR_MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME = exports.ATTR_MESSAGING_EVENTHUBS_CONSUMER_GROUP = exports.ATTR_MESSAGING_DESTINATION_PUBLISH_NAME = exports.ATTR_MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = exports.ATTR_MESSAGING_DESTINATION_TEMPORARY = exports.ATTR_MESSAGING_DESTINATION_TEMPLATE = exports.ATTR_MESSAGING_DESTINATION_SUBSCRIPTION_NAME = exports.ATTR_MESSAGING_DESTINATION_PARTITION_ID = exports.ATTR_MESSAGING_DESTINATION_NAME = exports.ATTR_MESSAGING_DESTINATION_ANONYMOUS = exports.ATTR_MESSAGING_CONSUMER_GROUP_NAME = exports.ATTR_MESSAGING_CLIENT_ID = exports.ATTR_MESSAGING_BATCH_MESSAGE_COUNT = exports.ATTR_MESSAGE_UNCOMPRESSED_SIZE = exports.MESSAGE_TYPE_VALUE_SENT = exports.MESSAGE_TYPE_VALUE_RECEIVED = exports.ATTR_MESSAGE_TYPE = exports.ATTR_MESSAGE_ID = exports.ATTR_MESSAGE_COMPRESSED_SIZE = exports.ATTR_LOG_RECORD_UID = exports.ATTR_LOG_RECORD_ORIGINAL = exports.LOG_IOSTREAM_VALUE_STDOUT = exports.LOG_IOSTREAM_VALUE_STDERR = exports.ATTR_LOG_IOSTREAM = exports.ATTR_LOG_FILE_PATH_RESOLVED = exports.ATTR_LOG_FILE_PATH = exports.ATTR_LOG_FILE_NAME_RESOLVED = exports.ATTR_LOG_FILE_NAME = exports.LINUX_MEMORY_SLAB_STATE_VALUE_UNRECLAIMABLE = exports.LINUX_MEMORY_SLAB_STATE_VALUE_RECLAIMABLE = exports.ATTR_LINUX_MEMORY_SLAB_STATE = exports.ATTR_K8S_STATEFULSET_UID = exports.ATTR_K8S_STATEFULSET_NAME = exports.ATTR_K8S_REPLICASET_UID = exports.ATTR_K8S_REPLICASET_NAME = exports.ATTR_K8S_POD_UID = exports.ATTR_K8S_POD_NAME = exports.ATTR_K8S_POD_LABELS = exports.ATTR_K8S_POD_LABEL = void 0; +exports.ATTR_NET_HOST_IP = exports.MESSAGING_SYSTEM_VALUE_SERVICEBUS = exports.MESSAGING_SYSTEM_VALUE_ROCKETMQ = exports.MESSAGING_SYSTEM_VALUE_RABBITMQ = exports.MESSAGING_SYSTEM_VALUE_PULSAR = exports.MESSAGING_SYSTEM_VALUE_KAFKA = exports.MESSAGING_SYSTEM_VALUE_JMS = exports.MESSAGING_SYSTEM_VALUE_GCP_PUBSUB = exports.MESSAGING_SYSTEM_VALUE_EVENTHUBS = exports.MESSAGING_SYSTEM_VALUE_EVENTGRID = exports.MESSAGING_SYSTEM_VALUE_AWS_SQS = exports.MESSAGING_SYSTEM_VALUE_ACTIVEMQ = exports.ATTR_MESSAGING_SYSTEM = exports.ATTR_MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME = exports.ATTR_MESSAGING_SERVICEBUS_MESSAGE_DELIVERY_COUNT = exports.MESSAGING_SERVICEBUS_DISPOSITION_STATUS_VALUE_DEFER = exports.MESSAGING_SERVICEBUS_DISPOSITION_STATUS_VALUE_DEAD_LETTER = exports.MESSAGING_SERVICEBUS_DISPOSITION_STATUS_VALUE_COMPLETE = exports.MESSAGING_SERVICEBUS_DISPOSITION_STATUS_VALUE_ABANDON = exports.ATTR_MESSAGING_SERVICEBUS_DISPOSITION_STATUS = exports.ATTR_MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME = exports.ATTR_MESSAGING_ROCKETMQ_NAMESPACE = exports.MESSAGING_ROCKETMQ_MESSAGE_TYPE_VALUE_TRANSACTION = exports.MESSAGING_ROCKETMQ_MESSAGE_TYPE_VALUE_NORMAL = exports.MESSAGING_ROCKETMQ_MESSAGE_TYPE_VALUE_FIFO = exports.MESSAGING_ROCKETMQ_MESSAGE_TYPE_VALUE_DELAY = exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_TYPE = exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_TAG = exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_KEYS = exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_GROUP = exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = exports.MESSAGING_ROCKETMQ_CONSUMPTION_MODEL_VALUE_CLUSTERING = exports.MESSAGING_ROCKETMQ_CONSUMPTION_MODEL_VALUE_BROADCASTING = exports.ATTR_MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = exports.ATTR_MESSAGING_ROCKETMQ_CLIENT_GROUP = exports.ATTR_MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG = exports.ATTR_MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = exports.MESSAGING_OPERATION_TYPE_VALUE_SETTLE = exports.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE = exports.MESSAGING_OPERATION_TYPE_VALUE_PUBLISH = exports.MESSAGING_OPERATION_TYPE_VALUE_PROCESS = exports.MESSAGING_OPERATION_TYPE_VALUE_DELIVER = exports.MESSAGING_OPERATION_TYPE_VALUE_CREATE = exports.ATTR_MESSAGING_OPERATION_TYPE = exports.ATTR_MESSAGING_OPERATION_NAME = exports.ATTR_MESSAGING_OPERATION = exports.ATTR_MESSAGING_MESSAGE_ID = exports.ATTR_MESSAGING_MESSAGE_ENVELOPE_SIZE = exports.ATTR_MESSAGING_MESSAGE_CONVERSATION_ID = void 0; +exports.NETWORK_CONNECTION_TYPE_VALUE_CELL = exports.ATTR_NETWORK_CONNECTION_TYPE = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_UMTS = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_TD_SCDMA = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_NRNSA = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_NR = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_LTE_CA = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_LTE = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_IWLAN = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_IDEN = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_HSUPA = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_HSPAP = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_HSPA = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_HSDPA = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_GSM = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_GPRS = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_EVDO_B = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_EVDO_A = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_EVDO_0 = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_EHRPD = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_EDGE = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_CDMA2000_1XRTT = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_CDMA = exports.ATTR_NETWORK_CONNECTION_SUBTYPE = exports.ATTR_NETWORK_CARRIER_NAME = exports.ATTR_NETWORK_CARRIER_MNC = exports.ATTR_NETWORK_CARRIER_MCC = exports.ATTR_NETWORK_CARRIER_ICC = exports.NET_TRANSPORT_VALUE_PIPE = exports.NET_TRANSPORT_VALUE_OTHER = exports.NET_TRANSPORT_VALUE_IP_UDP = exports.NET_TRANSPORT_VALUE_IP_TCP = exports.NET_TRANSPORT_VALUE_INPROC = exports.ATTR_NET_TRANSPORT = exports.ATTR_NET_SOCK_PEER_PORT = exports.ATTR_NET_SOCK_PEER_NAME = exports.ATTR_NET_SOCK_PEER_ADDR = exports.ATTR_NET_SOCK_HOST_PORT = exports.ATTR_NET_SOCK_HOST_ADDR = exports.NET_SOCK_FAMILY_VALUE_UNIX = exports.NET_SOCK_FAMILY_VALUE_INET6 = exports.NET_SOCK_FAMILY_VALUE_INET = exports.ATTR_NET_SOCK_FAMILY = exports.ATTR_NET_PROTOCOL_VERSION = exports.ATTR_NET_PROTOCOL_NAME = exports.ATTR_NET_PEER_PORT = exports.ATTR_NET_PEER_NAME = exports.ATTR_NET_PEER_IP = exports.ATTR_NET_HOST_PORT = exports.ATTR_NET_HOST_NAME = void 0; +exports.ATTR_PROCESS_PAGING_FAULT_TYPE = exports.ATTR_PROCESS_OWNER = exports.ATTR_PROCESS_INTERACTIVE = exports.ATTR_PROCESS_GROUP_LEADER_PID = exports.ATTR_PROCESS_EXIT_TIME = exports.ATTR_PROCESS_EXIT_CODE = exports.ATTR_PROCESS_EXECUTABLE_PATH = exports.ATTR_PROCESS_EXECUTABLE_NAME = exports.ATTR_PROCESS_CREATION_TIME = exports.PROCESS_CPU_STATE_VALUE_WAIT = exports.PROCESS_CPU_STATE_VALUE_USER = exports.PROCESS_CPU_STATE_VALUE_SYSTEM = exports.ATTR_PROCESS_CPU_STATE = exports.PROCESS_CONTEXT_SWITCH_TYPE_VALUE_VOLUNTARY = exports.PROCESS_CONTEXT_SWITCH_TYPE_VALUE_INVOLUNTARY = exports.ATTR_PROCESS_CONTEXT_SWITCH_TYPE = exports.ATTR_PROCESS_COMMAND_LINE = exports.ATTR_PROCESS_COMMAND_ARGS = exports.ATTR_PROCESS_COMMAND = exports.ATTR_POOL_NAME = exports.ATTR_PEER_SERVICE = exports.ATTR_OTEL_LIBRARY_VERSION = exports.ATTR_OTEL_LIBRARY_NAME = exports.ATTR_OS_VERSION = exports.OS_TYPE_VALUE_Z_OS = exports.OS_TYPE_VALUE_WINDOWS = exports.OS_TYPE_VALUE_SOLARIS = exports.OS_TYPE_VALUE_OPENBSD = exports.OS_TYPE_VALUE_NETBSD = exports.OS_TYPE_VALUE_LINUX = exports.OS_TYPE_VALUE_HPUX = exports.OS_TYPE_VALUE_FREEBSD = exports.OS_TYPE_VALUE_DRAGONFLYBSD = exports.OS_TYPE_VALUE_DARWIN = exports.OS_TYPE_VALUE_AIX = exports.ATTR_OS_TYPE = exports.ATTR_OS_NAME = exports.ATTR_OS_DESCRIPTION = exports.ATTR_OS_BUILD_ID = exports.OPENTRACING_REF_TYPE_VALUE_FOLLOWS_FROM = exports.OPENTRACING_REF_TYPE_VALUE_CHILD_OF = exports.ATTR_OPENTRACING_REF_TYPE = exports.ATTR_OCI_MANIFEST_DIGEST = exports.NETWORK_IO_DIRECTION_VALUE_TRANSMIT = exports.NETWORK_IO_DIRECTION_VALUE_RECEIVE = exports.ATTR_NETWORK_IO_DIRECTION = exports.NETWORK_CONNECTION_TYPE_VALUE_WIRED = exports.NETWORK_CONNECTION_TYPE_VALUE_WIFI = exports.NETWORK_CONNECTION_TYPE_VALUE_UNKNOWN = exports.NETWORK_CONNECTION_TYPE_VALUE_UNAVAILABLE = void 0; +exports.RPC_GRPC_STATUS_CODE_VALUE_UNIMPLEMENTED = exports.RPC_GRPC_STATUS_CODE_VALUE_OUT_OF_RANGE = exports.RPC_GRPC_STATUS_CODE_VALUE_ABORTED = exports.RPC_GRPC_STATUS_CODE_VALUE_FAILED_PRECONDITION = exports.RPC_GRPC_STATUS_CODE_VALUE_RESOURCE_EXHAUSTED = exports.RPC_GRPC_STATUS_CODE_VALUE_PERMISSION_DENIED = exports.RPC_GRPC_STATUS_CODE_VALUE_ALREADY_EXISTS = exports.RPC_GRPC_STATUS_CODE_VALUE_NOT_FOUND = exports.RPC_GRPC_STATUS_CODE_VALUE_DEADLINE_EXCEEDED = exports.RPC_GRPC_STATUS_CODE_VALUE_INVALID_ARGUMENT = exports.RPC_GRPC_STATUS_CODE_VALUE_UNKNOWN = exports.RPC_GRPC_STATUS_CODE_VALUE_CANCELLED = exports.RPC_GRPC_STATUS_CODE_VALUE_OK = exports.ATTR_RPC_GRPC_STATUS_CODE = exports.ATTR_RPC_GRPC_RESPONSE_METADATA = exports.ATTR_RPC_GRPC_REQUEST_METADATA = exports.ATTR_RPC_CONNECT_RPC_RESPONSE_METADATA = exports.ATTR_RPC_CONNECT_RPC_REQUEST_METADATA = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_UNKNOWN = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_UNIMPLEMENTED = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_UNAVAILABLE = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_UNAUTHENTICATED = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_RESOURCE_EXHAUSTED = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_PERMISSION_DENIED = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_OUT_OF_RANGE = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_NOT_FOUND = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_INVALID_ARGUMENT = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_INTERNAL = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_FAILED_PRECONDITION = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_DEADLINE_EXCEEDED = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_DATA_LOSS = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_CANCELLED = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_ALREADY_EXISTS = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_ABORTED = exports.ATTR_RPC_CONNECT_RPC_ERROR_CODE = exports.ATTR_PROCESS_VPID = exports.ATTR_PROCESS_USER_NAME = exports.ATTR_PROCESS_USER_ID = exports.ATTR_PROCESS_SESSION_LEADER_PID = exports.ATTR_PROCESS_SAVED_USER_NAME = exports.ATTR_PROCESS_SAVED_USER_ID = exports.ATTR_PROCESS_RUNTIME_VERSION = exports.ATTR_PROCESS_RUNTIME_NAME = exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = exports.ATTR_PROCESS_REAL_USER_NAME = exports.ATTR_PROCESS_REAL_USER_ID = exports.ATTR_PROCESS_PID = exports.ATTR_PROCESS_PARENT_PID = exports.PROCESS_PAGING_FAULT_TYPE_VALUE_MINOR = exports.PROCESS_PAGING_FAULT_TYPE_VALUE_MAJOR = void 0; +exports.SYSTEM_FILESYSTEM_TYPE_VALUE_EXT4 = exports.SYSTEM_FILESYSTEM_TYPE_VALUE_EXFAT = exports.ATTR_SYSTEM_FILESYSTEM_TYPE = exports.SYSTEM_FILESYSTEM_STATE_VALUE_USED = exports.SYSTEM_FILESYSTEM_STATE_VALUE_RESERVED = exports.SYSTEM_FILESYSTEM_STATE_VALUE_FREE = exports.ATTR_SYSTEM_FILESYSTEM_STATE = exports.ATTR_SYSTEM_FILESYSTEM_MOUNTPOINT = exports.ATTR_SYSTEM_FILESYSTEM_MODE = exports.ATTR_SYSTEM_DEVICE = exports.SYSTEM_CPU_STATE_VALUE_USER = exports.SYSTEM_CPU_STATE_VALUE_SYSTEM = exports.SYSTEM_CPU_STATE_VALUE_STEAL = exports.SYSTEM_CPU_STATE_VALUE_NICE = exports.SYSTEM_CPU_STATE_VALUE_IOWAIT = exports.SYSTEM_CPU_STATE_VALUE_INTERRUPT = exports.SYSTEM_CPU_STATE_VALUE_IDLE = exports.ATTR_SYSTEM_CPU_STATE = exports.ATTR_SYSTEM_CPU_LOGICAL_NUMBER = exports.STATE_VALUE_USED = exports.STATE_VALUE_IDLE = exports.ATTR_STATE = exports.ATTR_SOURCE_PORT = exports.ATTR_SOURCE_ADDRESS = exports.ATTR_SESSION_PREVIOUS_ID = exports.ATTR_SESSION_ID = exports.ATTR_SERVICE_NAMESPACE = exports.ATTR_SERVICE_INSTANCE_ID = exports.RPC_SYSTEM_VALUE_JAVA_RMI = exports.RPC_SYSTEM_VALUE_GRPC = exports.RPC_SYSTEM_VALUE_DOTNET_WCF = exports.RPC_SYSTEM_VALUE_CONNECT_RPC = exports.RPC_SYSTEM_VALUE_APACHE_DUBBO = exports.ATTR_RPC_SYSTEM = exports.ATTR_RPC_SERVICE = exports.ATTR_RPC_METHOD = exports.ATTR_RPC_MESSAGE_UNCOMPRESSED_SIZE = exports.RPC_MESSAGE_TYPE_VALUE_SENT = exports.RPC_MESSAGE_TYPE_VALUE_RECEIVED = exports.ATTR_RPC_MESSAGE_TYPE = exports.ATTR_RPC_MESSAGE_ID = exports.ATTR_RPC_MESSAGE_COMPRESSED_SIZE = exports.ATTR_RPC_JSONRPC_VERSION = exports.ATTR_RPC_JSONRPC_REQUEST_ID = exports.ATTR_RPC_JSONRPC_ERROR_MESSAGE = exports.ATTR_RPC_JSONRPC_ERROR_CODE = exports.RPC_GRPC_STATUS_CODE_VALUE_UNAUTHENTICATED = exports.RPC_GRPC_STATUS_CODE_VALUE_DATA_LOSS = exports.RPC_GRPC_STATUS_CODE_VALUE_UNAVAILABLE = exports.RPC_GRPC_STATUS_CODE_VALUE_INTERNAL = void 0; +exports.ATTR_TEST_SUITE_RUN_STATUS = exports.ATTR_TEST_SUITE_NAME = exports.TEST_CASE_RESULT_STATUS_VALUE_PASS = exports.TEST_CASE_RESULT_STATUS_VALUE_FAIL = exports.ATTR_TEST_CASE_RESULT_STATUS = exports.ATTR_TEST_CASE_NAME = exports.ATTR_TELEMETRY_DISTRO_VERSION = exports.ATTR_TELEMETRY_DISTRO_NAME = exports.SYSTEM_PROCESSES_STATUS_VALUE_STOPPED = exports.SYSTEM_PROCESSES_STATUS_VALUE_SLEEPING = exports.SYSTEM_PROCESSES_STATUS_VALUE_RUNNING = exports.SYSTEM_PROCESSES_STATUS_VALUE_DEFUNCT = exports.ATTR_SYSTEM_PROCESSES_STATUS = exports.SYSTEM_PROCESS_STATUS_VALUE_STOPPED = exports.SYSTEM_PROCESS_STATUS_VALUE_SLEEPING = exports.SYSTEM_PROCESS_STATUS_VALUE_RUNNING = exports.SYSTEM_PROCESS_STATUS_VALUE_DEFUNCT = exports.ATTR_SYSTEM_PROCESS_STATUS = exports.SYSTEM_PAGING_TYPE_VALUE_MINOR = exports.SYSTEM_PAGING_TYPE_VALUE_MAJOR = exports.ATTR_SYSTEM_PAGING_TYPE = exports.SYSTEM_PAGING_STATE_VALUE_USED = exports.SYSTEM_PAGING_STATE_VALUE_FREE = exports.ATTR_SYSTEM_PAGING_STATE = exports.SYSTEM_PAGING_DIRECTION_VALUE_OUT = exports.SYSTEM_PAGING_DIRECTION_VALUE_IN = exports.ATTR_SYSTEM_PAGING_DIRECTION = exports.SYSTEM_NETWORK_STATE_VALUE_TIME_WAIT = exports.SYSTEM_NETWORK_STATE_VALUE_SYN_SENT = exports.SYSTEM_NETWORK_STATE_VALUE_SYN_RECV = exports.SYSTEM_NETWORK_STATE_VALUE_LISTEN = exports.SYSTEM_NETWORK_STATE_VALUE_LAST_ACK = exports.SYSTEM_NETWORK_STATE_VALUE_FIN_WAIT_2 = exports.SYSTEM_NETWORK_STATE_VALUE_FIN_WAIT_1 = exports.SYSTEM_NETWORK_STATE_VALUE_ESTABLISHED = exports.SYSTEM_NETWORK_STATE_VALUE_DELETE = exports.SYSTEM_NETWORK_STATE_VALUE_CLOSING = exports.SYSTEM_NETWORK_STATE_VALUE_CLOSE_WAIT = exports.SYSTEM_NETWORK_STATE_VALUE_CLOSE = exports.ATTR_SYSTEM_NETWORK_STATE = exports.SYSTEM_MEMORY_STATE_VALUE_USED = exports.SYSTEM_MEMORY_STATE_VALUE_SHARED = exports.SYSTEM_MEMORY_STATE_VALUE_FREE = exports.SYSTEM_MEMORY_STATE_VALUE_CACHED = exports.SYSTEM_MEMORY_STATE_VALUE_BUFFERS = exports.ATTR_SYSTEM_MEMORY_STATE = exports.SYSTEM_FILESYSTEM_TYPE_VALUE_REFS = exports.SYSTEM_FILESYSTEM_TYPE_VALUE_NTFS = exports.SYSTEM_FILESYSTEM_TYPE_VALUE_HFSPLUS = exports.SYSTEM_FILESYSTEM_TYPE_VALUE_FAT32 = void 0; +exports.ATTR_USER_HASH = exports.ATTR_USER_FULL_NAME = exports.ATTR_USER_EMAIL = exports.ATTR_URL_TOP_LEVEL_DOMAIN = exports.ATTR_URL_TEMPLATE = exports.ATTR_URL_SUBDOMAIN = exports.ATTR_URL_REGISTERED_DOMAIN = exports.ATTR_URL_PORT = exports.ATTR_URL_ORIGINAL = exports.ATTR_URL_EXTENSION = exports.ATTR_URL_DOMAIN = exports.ATTR_TLS_SERVER_SUBJECT = exports.ATTR_TLS_SERVER_NOT_BEFORE = exports.ATTR_TLS_SERVER_NOT_AFTER = exports.ATTR_TLS_SERVER_JA3S = exports.ATTR_TLS_SERVER_ISSUER = exports.ATTR_TLS_SERVER_HASH_SHA256 = exports.ATTR_TLS_SERVER_HASH_SHA1 = exports.ATTR_TLS_SERVER_HASH_MD5 = exports.ATTR_TLS_SERVER_CERTIFICATE_CHAIN = exports.ATTR_TLS_SERVER_CERTIFICATE = exports.ATTR_TLS_RESUMED = exports.ATTR_TLS_PROTOCOL_VERSION = exports.TLS_PROTOCOL_NAME_VALUE_TLS = exports.TLS_PROTOCOL_NAME_VALUE_SSL = exports.ATTR_TLS_PROTOCOL_NAME = exports.ATTR_TLS_NEXT_PROTOCOL = exports.ATTR_TLS_ESTABLISHED = exports.ATTR_TLS_CURVE = exports.ATTR_TLS_CLIENT_SUPPORTED_CIPHERS = exports.ATTR_TLS_CLIENT_SUBJECT = exports.ATTR_TLS_CLIENT_SERVER_NAME = exports.ATTR_TLS_CLIENT_NOT_BEFORE = exports.ATTR_TLS_CLIENT_NOT_AFTER = exports.ATTR_TLS_CLIENT_JA3 = exports.ATTR_TLS_CLIENT_ISSUER = exports.ATTR_TLS_CLIENT_HASH_SHA256 = exports.ATTR_TLS_CLIENT_HASH_SHA1 = exports.ATTR_TLS_CLIENT_HASH_MD5 = exports.ATTR_TLS_CLIENT_CERTIFICATE_CHAIN = exports.ATTR_TLS_CLIENT_CERTIFICATE = exports.ATTR_TLS_CIPHER = exports.ATTR_THREAD_NAME = exports.ATTR_THREAD_ID = exports.TEST_SUITE_RUN_STATUS_VALUE_TIMED_OUT = exports.TEST_SUITE_RUN_STATUS_VALUE_SUCCESS = exports.TEST_SUITE_RUN_STATUS_VALUE_SKIPPED = exports.TEST_SUITE_RUN_STATUS_VALUE_IN_PROGRESS = exports.TEST_SUITE_RUN_STATUS_VALUE_FAILURE = exports.TEST_SUITE_RUN_STATUS_VALUE_ABORTED = void 0; +exports.ATTR_WEBENGINE_VERSION = exports.ATTR_WEBENGINE_NAME = exports.ATTR_WEBENGINE_DESCRIPTION = exports.ATTR_VCS_REPOSITORY_URL_FULL = exports.VCS_REPOSITORY_REF_TYPE_VALUE_TAG = exports.VCS_REPOSITORY_REF_TYPE_VALUE_BRANCH = exports.ATTR_VCS_REPOSITORY_REF_TYPE = exports.ATTR_VCS_REPOSITORY_REF_REVISION = exports.ATTR_VCS_REPOSITORY_REF_NAME = exports.ATTR_VCS_REPOSITORY_CHANGE_TITLE = exports.ATTR_VCS_REPOSITORY_CHANGE_ID = exports.V8JS_HEAP_SPACE_NAME_VALUE_OLD_SPACE = exports.V8JS_HEAP_SPACE_NAME_VALUE_NEW_SPACE = exports.V8JS_HEAP_SPACE_NAME_VALUE_MAP_SPACE = exports.V8JS_HEAP_SPACE_NAME_VALUE_LARGE_OBJECT_SPACE = exports.V8JS_HEAP_SPACE_NAME_VALUE_CODE_SPACE = exports.ATTR_V8JS_HEAP_SPACE_NAME = exports.V8JS_GC_TYPE_VALUE_WEAKCB = exports.V8JS_GC_TYPE_VALUE_MINOR = exports.V8JS_GC_TYPE_VALUE_MAJOR = exports.V8JS_GC_TYPE_VALUE_INCREMENTAL = exports.ATTR_V8JS_GC_TYPE = exports.ATTR_USER_AGENT_VERSION = exports.ATTR_USER_AGENT_NAME = exports.ATTR_USER_ROLES = exports.ATTR_USER_NAME = exports.ATTR_USER_ID = void 0; +//---------------------------------------------------------------------------------------------------------- +// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/registry/stable/attributes.ts.j2 +//---------------------------------------------------------------------------------------------------------- +/** + * The ID of a running ECS task. The ID **MUST** be extracted from `task.arn`. + * + * @example 10838bed-421f-43ef-870a-f43feacbbb5b + * + * @example 23ebb8ac-c18f-46c6-8bbe-d55d0e37cfbd + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_ECS_TASK_ID = 'aws.ecs.task.id'; +/** + * Uniquely identifies the framework API revision offered by a version (`os.version`) of the android operating system. More information can be found [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels). + * + * @example 33 + * + * @example 32 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_ANDROID_OS_API_LEVEL = 'android.os.api_level'; +/** + * Deprecated use the `device.app.lifecycle` event definition including `android.state` as a payload field instead. + * + * @note The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), and from which the `OS identifiers` are derived. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_ANDROID_STATE = 'android.state'; +/** + * Enum value "background" for attribute {@link ATTR_ANDROID_STATE}. + */ +exports.ANDROID_STATE_VALUE_BACKGROUND = "background"; +/** + * Enum value "created" for attribute {@link ATTR_ANDROID_STATE}. + */ +exports.ANDROID_STATE_VALUE_CREATED = "created"; +/** + * Enum value "foreground" for attribute {@link ATTR_ANDROID_STATE}. + */ +exports.ANDROID_STATE_VALUE_FOREGROUND = "foreground"; +/** + * The provenance filename of the built attestation which directly relates to the build artifact filename. This filename **SHOULD** accompany the artifact at publish time. See the [SLSA Relationship](https://slsa.dev/spec/v1.0/distributing-provenance#relationship-between-artifacts-and-attestations) specification for more information. + * + * @example golang-binary-amd64-v0.1.0.attestation + * + * @example docker-image-amd64-v0.1.0.intoto.json1 + * + * @example release-1.tar.gz.attestation + * + * @example file-name-package.tar.gz.intoto.json1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_ARTIFACT_ATTESTATION_FILENAME = 'artifact.attestation.filename'; +/** + * The full [hash value (see glossary)](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf), of the built attestation. Some envelopes in the software attestation space also refer to this as the [digest](https://github.com/in-toto/attestation/blob/main/spec/README.md#in-toto-attestation-framework-spec). + * + * @example 1b31dfcd5b7f9267bf2ff47651df1cfb9147b9e4df1f335accf65b4cda498408 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_ARTIFACT_ATTESTATION_HASH = 'artifact.attestation.hash'; +/** + * The id of the build [software attestation](https://slsa.dev/attestation-model). + * + * @example 123 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_ARTIFACT_ATTESTATION_ID = 'artifact.attestation.id'; +/** + * The human readable file name of the artifact, typically generated during build and release processes. Often includes the package name and version in the file name. + * + * @example golang-binary-amd64-v0.1.0 + * + * @example docker-image-amd64-v0.1.0 + * + * @example release-1.tar.gz + * + * @example file-name-package.tar.gz + * + * @note This file name can also act as the [Package Name](https://slsa.dev/spec/v1.0/terminology#package-model) + * in cases where the package ecosystem maps accordingly. + * Additionally, the artifact [can be published](https://slsa.dev/spec/v1.0/terminology#software-supply-chain) + * for others, but that is not a guarantee. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_ARTIFACT_FILENAME = 'artifact.filename'; +/** + * The full [hash value (see glossary)](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf), often found in checksum.txt on a release of the artifact and used to verify package integrity. + * + * @example 9ff4c52759e2c4ac70b7d517bc7fcdc1cda631ca0045271ddd1b192544f8a3e9 + * + * @note The specific algorithm used to create the cryptographic hash value is + * not defined. In situations where an artifact has multiple + * cryptographic hashes, it is up to the implementer to choose which + * hash value to set here; this should be the most secure hash algorithm + * that is suitable for the situation and consistent with the + * corresponding attestation. The implementer can then provide the other + * hash values through an additional set of attribute extensions as they + * deem necessary. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_ARTIFACT_HASH = 'artifact.hash'; +/** + * The [Package URL](https://github.com/package-url/purl-spec) of the [package artifact](https://slsa.dev/spec/v1.0/terminology#package-model) provides a standard way to identify and locate the packaged artifact. + * + * @example pkg:github/package-url/purl-spec@1209109710924 + * + * @example pkg:npm/foo@12.12.3 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_ARTIFACT_PURL = 'artifact.purl'; +/** + * The version of the artifact. + * + * @example v0.1.0 + * + * @example 1.2.1 + * + * @example 122691-build + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_ARTIFACT_VERSION = 'artifact.version'; +/** + * The JSON-serialized value of each item in the `AttributeDefinitions` request field. + * + * @example { "AttributeName": "string", "AttributeType": "string" } + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = 'aws.dynamodb.attribute_definitions'; +/** + * The value of the `AttributesToGet` request parameter. + * + * @example lives + * + * @example id + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_ATTRIBUTES_TO_GET = 'aws.dynamodb.attributes_to_get'; +/** + * The value of the `ConsistentRead` request parameter. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_CONSISTENT_READ = 'aws.dynamodb.consistent_read'; +/** + * The JSON-serialized value of each item in the `ConsumedCapacity` response field. + * + * @example { "CapacityUnits": number, "GlobalSecondaryIndexes": { "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number } }, "ReadCapacityUnits": number, "Table": { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number }, "TableName": "string", "WriteCapacityUnits": number } + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_CONSUMED_CAPACITY = 'aws.dynamodb.consumed_capacity'; +/** + * The value of the `Count` response parameter. + * + * @example 10 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_COUNT = 'aws.dynamodb.count'; +/** + * The value of the `ExclusiveStartTableName` request parameter. + * + * @example Users + * + * @example CatsTable + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = 'aws.dynamodb.exclusive_start_table'; +/** + * The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` request field. + * + * @example { "Create": { "IndexName": "string", "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits": number } } + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = 'aws.dynamodb.global_secondary_index_updates'; +/** + * The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field + * + * @example { "IndexName": "string", "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits": number } } + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = 'aws.dynamodb.global_secondary_indexes'; +/** + * The value of the `IndexName` request parameter. + * + * @example name_to_group + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_INDEX_NAME = 'aws.dynamodb.index_name'; +/** + * The JSON-serialized value of the `ItemCollectionMetrics` response field. + * + * @example { "string" : [ { "ItemCollectionKey": { "string" : { "B": blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ], "NULL": boolean, "S": "string", "SS": [ "string" ] } }, "SizeEstimateRangeGB": [ number ] } ] } + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = 'aws.dynamodb.item_collection_metrics'; +/** + * The value of the `Limit` request parameter. + * + * @example 10 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_LIMIT = 'aws.dynamodb.limit'; +/** + * The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. + * + * @example { "IndexArn": "string", "IndexName": "string", "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } } + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = 'aws.dynamodb.local_secondary_indexes'; +/** + * The value of the `ProjectionExpression` request parameter. + * + * @example Title + * + * @example Title, Price, Color + * + * @example Title, Description, RelatedItems, ProductReviews + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_PROJECTION = 'aws.dynamodb.projection'; +/** + * The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. + * + * @example 1.0 + * + * @example 2.0 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = 'aws.dynamodb.provisioned_read_capacity'; +/** + * The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. + * + * @example 1.0 + * + * @example 2.0 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = 'aws.dynamodb.provisioned_write_capacity'; +/** + * The value of the `ScanIndexForward` request parameter. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_SCAN_FORWARD = 'aws.dynamodb.scan_forward'; +/** + * The value of the `ScannedCount` response parameter. + * + * @example 50 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_SCANNED_COUNT = 'aws.dynamodb.scanned_count'; +/** + * The value of the `Segment` request parameter. + * + * @example 10 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_SEGMENT = 'aws.dynamodb.segment'; +/** + * The value of the `Select` request parameter. + * + * @example ALL_ATTRIBUTES + * + * @example COUNT + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_SELECT = 'aws.dynamodb.select'; +/** + * The number of items in the `TableNames` response parameter. + * + * @example 20 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_TABLE_COUNT = 'aws.dynamodb.table_count'; +/** + * The keys in the `RequestItems` object field. + * + * @example Users + * + * @example Cats + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_TABLE_NAMES = 'aws.dynamodb.table_names'; +/** + * The value of the `TotalSegments` request parameter. + * + * @example 100 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_DYNAMODB_TOTAL_SEGMENTS = 'aws.dynamodb.total_segments'; +/** + * The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). + * + * @example arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_ECS_CLUSTER_ARN = 'aws.ecs.cluster.arn'; +/** + * The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). + * + * @example arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_ECS_CONTAINER_ARN = 'aws.ecs.container.arn'; +/** + * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_ECS_LAUNCHTYPE = 'aws.ecs.launchtype'; +/** + * Enum value "ec2" for attribute {@link ATTR_AWS_ECS_LAUNCHTYPE}. + */ +exports.AWS_ECS_LAUNCHTYPE_VALUE_EC2 = "ec2"; +/** + * Enum value "fargate" for attribute {@link ATTR_AWS_ECS_LAUNCHTYPE}. + */ +exports.AWS_ECS_LAUNCHTYPE_VALUE_FARGATE = "fargate"; +/** + * The ARN of a running [ECS task](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids). + * + * @example arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b + * + * @example arn:aws:ecs:us-west-1:123456789123:task/my-cluster/task-id/23ebb8ac-c18f-46c6-8bbe-d55d0e37cfbd + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_ECS_TASK_ARN = 'aws.ecs.task.arn'; +/** + * The family name of the [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html) used to create the ECS task. + * + * @example opentelemetry-family + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_ECS_TASK_FAMILY = 'aws.ecs.task.family'; +/** + * The revision for the task definition used to create the ECS task. + * + * @example 8 + * + * @example 26 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_ECS_TASK_REVISION = 'aws.ecs.task.revision'; +/** + * The ARN of an EKS cluster. + * + * @example arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_EKS_CLUSTER_ARN = 'aws.eks.cluster.arn'; +/** + * The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). + * + * @example arn:aws:lambda:us-east-1:123456:function:myfunction:myalias + * + * @note This may be different from `cloud.resource_id` if an alias is involved. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_LAMBDA_INVOKED_ARN = 'aws.lambda.invoked_arn'; +/** + * The Amazon Resource Name(s) (ARN) of the AWS log group(s). + * + * @example arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:* + * + * @note See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_LOG_GROUP_ARNS = 'aws.log.group.arns'; +/** + * The name(s) of the AWS log group(s) an application is writing to. + * + * @example /aws/lambda/my-function + * + * @example opentelemetry-service + * + * @note Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_LOG_GROUP_NAMES = 'aws.log.group.names'; +/** + * The ARN(s) of the AWS log stream(s). + * + * @example arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b + * + * @note See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_LOG_STREAM_ARNS = 'aws.log.stream.arns'; +/** + * The name(s) of the AWS log stream(s) an application is writing to. + * + * @example logs/main/10838bed-421f-43ef-870a-f43feacbbb5b + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_LOG_STREAM_NAMES = 'aws.log.stream.names'; +/** + * The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. + * + * @example 79b9da39-b7ae-508a-a6bc-864b2829c622 + * + * @example C9ER4AJX75574TDJ + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_REQUEST_ID = 'aws.request_id'; +/** + * The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. + * + * @example some-bucket-name + * + * @note The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter. + * This applies to almost all S3 operations except `list-buckets`. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_S3_BUCKET = 'aws.s3.bucket'; +/** + * The source object (in the form `bucket`/`key`) for the copy operation. + * + * @example someFile.yml + * + * @note The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter + * of the [copy-object operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). + * This applies in particular to the following operations: + * + * - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) + * - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_S3_COPY_SOURCE = 'aws.s3.copy_source'; +/** + * The delete request container that specifies the objects to be deleted. + * + * @example Objects=[{Key=string,VersionId=string},{Key=string,VersionId=string}],Quiet=boolean + * + * @note The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. + * The `delete` attribute corresponds to the `--delete` parameter of the + * [delete-objects operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_S3_DELETE = 'aws.s3.delete'; +/** + * The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. + * + * @example someFile.yml + * + * @note The `key` attribute is applicable to all object-related S3 operations, i.e. that require the object key as a mandatory parameter. + * This applies in particular to the following operations: + * + * - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) + * - [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) + * - [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html) + * - [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html) + * - [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html) + * - [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html) + * - [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html) + * - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) + * - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) + * - [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html) + * - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) + * - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) + * - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_S3_KEY = 'aws.s3.key'; +/** + * The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. + * + * @example 3456 + * + * @note The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) + * and [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) operations. + * The `part_number` attribute corresponds to the `--part-number` parameter of the + * [upload-part operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_S3_PART_NUMBER = 'aws.s3.part_number'; +/** + * Upload ID that identifies the multipart upload. + * + * @example dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ + * + * @note The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter + * of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) multipart operations. + * This applies in particular to the following operations: + * + * - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) + * - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) + * - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) + * - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) + * - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AWS_S3_UPLOAD_ID = 'aws.s3.upload_id'; +/** + * The unique identifier of the service request. It's generated by the Azure service and returned with the response. + * + * @example 00000000-0000-0000-0000-000000000000 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_AZ_SERVICE_REQUEST_ID = 'az.service_request_id'; +/** + * Array of brand name and version separated by a space + * + * @example Not A;Brand 99 + * + * @example Chromium 99 + * + * @example Chrome 99 + * + * @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_BROWSER_BRANDS = 'browser.brands'; +/** + * Preferred language of the user using the browser + * + * @example en + * + * @example en-US + * + * @example fr + * + * @example fr-FR + * + * @note This value is intended to be taken from the Navigator API `navigator.language`. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_BROWSER_LANGUAGE = 'browser.language'; +/** + * A boolean that is true if the browser is running on a mobile device + * + * @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute **SHOULD** be left unset. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_BROWSER_MOBILE = 'browser.mobile'; +/** + * The platform on which the browser is running + * + * @example Windows + * + * @example macOS + * + * @example Android + * + * @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API **SHOULD** **NOT** be used instead and this attribute **SHOULD** be left unset in order for the values to be consistent. + * The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_BROWSER_PLATFORM = 'browser.platform'; +/** + * The human readable name of the pipeline within a CI/CD system. + * + * @example Build and Test + * + * @example Lint + * + * @example Deploy Go Project + * + * @example deploy_to_environment + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CICD_PIPELINE_NAME = 'cicd.pipeline.name'; +/** + * The unique identifier of a pipeline run within a CI/CD system. + * + * @example 120912 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CICD_PIPELINE_RUN_ID = 'cicd.pipeline.run.id'; +/** + * The human readable name of a task within a pipeline. Task here most closely aligns with a [computing process](https://en.wikipedia.org/wiki/Pipeline_(computing)) in a pipeline. Other terms for tasks include commands, steps, and procedures. + * + * @example Run GoLang Linter + * + * @example Go Build + * + * @example go-test + * + * @example deploy_binary + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CICD_PIPELINE_TASK_NAME = 'cicd.pipeline.task.name'; +/** + * The unique identifier of a task run within a pipeline. + * + * @example 12097 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CICD_PIPELINE_TASK_RUN_ID = 'cicd.pipeline.task.run.id'; +/** + * The [URL](https://en.wikipedia.org/wiki/URL) of the pipeline run providing the complete address in order to locate and identify the pipeline run. + * + * @example https://github.com/open-telemetry/semantic-conventions/actions/runs/9753949763/job/26920038674?pr=1075 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CICD_PIPELINE_TASK_RUN_URL_FULL = 'cicd.pipeline.task.run.url.full'; +/** + * The type of the task within a pipeline. + * + * @example build + * + * @example test + * + * @example deploy + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CICD_PIPELINE_TASK_TYPE = 'cicd.pipeline.task.type'; +/** + * Enum value "build" for attribute {@link ATTR_CICD_PIPELINE_TASK_TYPE}. + */ +exports.CICD_PIPELINE_TASK_TYPE_VALUE_BUILD = "build"; +/** + * Enum value "deploy" for attribute {@link ATTR_CICD_PIPELINE_TASK_TYPE}. + */ +exports.CICD_PIPELINE_TASK_TYPE_VALUE_DEPLOY = "deploy"; +/** + * Enum value "test" for attribute {@link ATTR_CICD_PIPELINE_TASK_TYPE}. + */ +exports.CICD_PIPELINE_TASK_TYPE_VALUE_TEST = "test"; +/** + * The cloud account ID the resource is assigned to. + * + * @example 111111111111 + * + * @example opentelemetry + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CLOUD_ACCOUNT_ID = 'cloud.account.id'; +/** + * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. + * + * @example us-east-1c + * + * @note Availability zones are called "zones" on Alibaba Cloud and Google Cloud. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CLOUD_AVAILABILITY_ZONE = 'cloud.availability_zone'; +/** + * The cloud platform in use. + * + * @note The prefix of the service **SHOULD** match the one specified in `cloud.provider`. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CLOUD_PLATFORM = 'cloud.platform'; +/** + * Enum value "alibaba_cloud_ecs" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs"; +/** + * Enum value "alibaba_cloud_fc" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_FC = "alibaba_cloud_fc"; +/** + * Enum value "alibaba_cloud_openshift" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_OPENSHIFT = "alibaba_cloud_openshift"; +/** + * Enum value "aws_app_runner" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_AWS_APP_RUNNER = "aws_app_runner"; +/** + * Enum value "aws_ec2" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_AWS_EC2 = "aws_ec2"; +/** + * Enum value "aws_ecs" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_AWS_ECS = "aws_ecs"; +/** + * Enum value "aws_eks" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_AWS_EKS = "aws_eks"; +/** + * Enum value "aws_elastic_beanstalk" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk"; +/** + * Enum value "aws_lambda" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_AWS_LAMBDA = "aws_lambda"; +/** + * Enum value "aws_openshift" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_AWS_OPENSHIFT = "aws_openshift"; +/** + * Enum value "azure_aks" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_AZURE_AKS = "azure_aks"; +/** + * Enum value "azure_app_service" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_AZURE_APP_SERVICE = "azure_app_service"; +/** + * Enum value "azure_container_apps" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_AZURE_CONTAINER_APPS = "azure_container_apps"; +/** + * Enum value "azure_container_instances" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_AZURE_CONTAINER_INSTANCES = "azure_container_instances"; +/** + * Enum value "azure_functions" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_AZURE_FUNCTIONS = "azure_functions"; +/** + * Enum value "azure_openshift" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_AZURE_OPENSHIFT = "azure_openshift"; +/** + * Enum value "azure_vm" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_AZURE_VM = "azure_vm"; +/** + * Enum value "gcp_app_engine" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_GCP_APP_ENGINE = "gcp_app_engine"; +/** + * Enum value "gcp_bare_metal_solution" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_GCP_BARE_METAL_SOLUTION = "gcp_bare_metal_solution"; +/** + * Enum value "gcp_cloud_functions" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_GCP_CLOUD_FUNCTIONS = "gcp_cloud_functions"; +/** + * Enum value "gcp_cloud_run" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_GCP_CLOUD_RUN = "gcp_cloud_run"; +/** + * Enum value "gcp_compute_engine" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_GCP_COMPUTE_ENGINE = "gcp_compute_engine"; +/** + * Enum value "gcp_kubernetes_engine" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_GCP_KUBERNETES_ENGINE = "gcp_kubernetes_engine"; +/** + * Enum value "gcp_openshift" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_GCP_OPENSHIFT = "gcp_openshift"; +/** + * Enum value "ibm_cloud_openshift" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_IBM_CLOUD_OPENSHIFT = "ibm_cloud_openshift"; +/** + * Enum value "tencent_cloud_cvm" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_TENCENT_CLOUD_CVM = "tencent_cloud_cvm"; +/** + * Enum value "tencent_cloud_eks" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_TENCENT_CLOUD_EKS = "tencent_cloud_eks"; +/** + * Enum value "tencent_cloud_scf" for attribute {@link ATTR_CLOUD_PLATFORM}. + */ +exports.CLOUD_PLATFORM_VALUE_TENCENT_CLOUD_SCF = "tencent_cloud_scf"; +/** + * Name of the cloud provider. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CLOUD_PROVIDER = 'cloud.provider'; +/** + * Enum value "alibaba_cloud" for attribute {@link ATTR_CLOUD_PROVIDER}. + */ +exports.CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD = "alibaba_cloud"; +/** + * Enum value "aws" for attribute {@link ATTR_CLOUD_PROVIDER}. + */ +exports.CLOUD_PROVIDER_VALUE_AWS = "aws"; +/** + * Enum value "azure" for attribute {@link ATTR_CLOUD_PROVIDER}. + */ +exports.CLOUD_PROVIDER_VALUE_AZURE = "azure"; +/** + * Enum value "gcp" for attribute {@link ATTR_CLOUD_PROVIDER}. + */ +exports.CLOUD_PROVIDER_VALUE_GCP = "gcp"; +/** + * Enum value "heroku" for attribute {@link ATTR_CLOUD_PROVIDER}. + */ +exports.CLOUD_PROVIDER_VALUE_HEROKU = "heroku"; +/** + * Enum value "ibm_cloud" for attribute {@link ATTR_CLOUD_PROVIDER}. + */ +exports.CLOUD_PROVIDER_VALUE_IBM_CLOUD = "ibm_cloud"; +/** + * Enum value "tencent_cloud" for attribute {@link ATTR_CLOUD_PROVIDER}. + */ +exports.CLOUD_PROVIDER_VALUE_TENCENT_CLOUD = "tencent_cloud"; +/** + * The geographical region the resource is running. + * + * @example us-central1 + * + * @example us-east-1 + * + * @note Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CLOUD_REGION = 'cloud.region'; +/** + * Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP) + * + * @example arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function + * + * @example //run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID + * + * @example /subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/ + * + * @note On some cloud providers, it may not be possible to determine the full ID at startup, + * so it may be necessary to set `cloud.resource_id` as a span attribute instead. + * + * The exact value to use for `cloud.resource_id` depends on the cloud provider. + * The following well-known definitions **MUST** be used if you set this attribute and they apply: + * + * * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). + * Take care not to use the "invoked ARN" directly but replace any + * [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) + * with the resolved function version, as the same runtime instance may be invocable with + * multiple different aliases. + * * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) + * * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id) of the invoked function, + * *not* the function app, having the form + * `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`. + * This means that a span attribute **MUST** be used, as an Azure function app can host multiple functions that would usually share + * a TracerProvider. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CLOUD_RESOURCE_ID = 'cloud.resource_id'; +/** + * The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. + * + * @example 123e4567-e89b-12d3-a456-426614174000 + * + * @example 0001 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CLOUDEVENTS_EVENT_ID = 'cloudevents.event_id'; +/** + * The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. + * + * @example https://github.com/cloudevents + * + * @example /cloudevents/spec/pull/123 + * + * @example my-service + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CLOUDEVENTS_EVENT_SOURCE = 'cloudevents.event_source'; +/** + * The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. + * + * @example "1.0" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CLOUDEVENTS_EVENT_SPEC_VERSION = 'cloudevents.event_spec_version'; +/** + * The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). + * + * @example "mynewfile.jpg" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CLOUDEVENTS_EVENT_SUBJECT = 'cloudevents.event_subject'; +/** + * The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. + * + * @example com.github.pull_request.opened + * + * @example com.example.object.deleted.v2 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CLOUDEVENTS_EVENT_TYPE = 'cloudevents.event_type'; +/** + * The column number in `code.filepath` best representing the operation. It **SHOULD** point within the code unit named in `code.function`. + * + * @example 16 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CODE_COLUMN = 'code.column'; +/** + * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). + * + * @example "/usr/local/MyApplication/content_root/app/index.php" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CODE_FILEPATH = 'code.filepath'; +/** + * The method or function name, or equivalent (usually rightmost part of the code unit's name). + * + * @example "serveRequest" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CODE_FUNCTION = 'code.function'; +/** + * The line number in `code.filepath` best representing the operation. It **SHOULD** point within the code unit named in `code.function`. + * + * @example 42 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CODE_LINENO = 'code.lineno'; +/** + * The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. + * + * @example "com.example.MyHttpService" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CODE_NAMESPACE = 'code.namespace'; +/** + * 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. + * + * @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)" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CODE_STACKTRACE = 'code.stacktrace'; +/** + * The command used to run the container (i.e. the command name). + * + * @example otelcontribcol + * + * @note If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CONTAINER_COMMAND = 'container.command'; +/** + * All the command arguments (including the command/executable itself) run by the container. [2] + * + * @example otelcontribcol, --config, config.yaml + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CONTAINER_COMMAND_ARGS = 'container.command_args'; +/** + * The full command run by the container as a single string representing the full command. [2] + * + * @example otelcontribcol --config config.yaml + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CONTAINER_COMMAND_LINE = 'container.command_line'; +/** + * Deprecated, use `cpu.mode` instead. + * + * @example user + * + * @example kernel + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `cpu.mode` + */ +exports.ATTR_CONTAINER_CPU_STATE = 'container.cpu.state'; +/** + * Enum value "kernel" for attribute {@link ATTR_CONTAINER_CPU_STATE}. + */ +exports.CONTAINER_CPU_STATE_VALUE_KERNEL = "kernel"; +/** + * Enum value "system" for attribute {@link ATTR_CONTAINER_CPU_STATE}. + */ +exports.CONTAINER_CPU_STATE_VALUE_SYSTEM = "system"; +/** + * Enum value "user" for attribute {@link ATTR_CONTAINER_CPU_STATE}. + */ +exports.CONTAINER_CPU_STATE_VALUE_USER = "user"; +/** + * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. + * + * @example a3bf90e006b2 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CONTAINER_ID = 'container.id'; +/** + * Runtime specific image identifier. Usually a hash algorithm followed by a UUID. + * + * @example sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f + * + * @note Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint. + * K8s defines a link to the container registry repository with digest `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. + * The ID is assigned by the container runtime and can vary in different environments. Consider using `oci.manifest.digest` if it is important to identify the same image in different environments/runtimes. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CONTAINER_IMAGE_ID = 'container.image.id'; +/** + * Name of the image the container was built on. + * + * @example gcr.io/opentelemetry/operator + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CONTAINER_IMAGE_NAME = 'container.image.name'; +/** + * Repo digests of the container image as provided by the container runtime. + * + * @example example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb + * + * @example internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578 + * + * @note [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CONTAINER_IMAGE_REPO_DIGESTS = 'container.image.repo_digests'; +/** + * Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. + * + * @example v1.27.1 + * + * @example 3.5.7-0 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CONTAINER_IMAGE_TAGS = 'container.image.tags'; +/** + * Container labels, `` being the label name, the value being the label value. + * + * @example container.label.app=nginx + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +const ATTR_CONTAINER_LABEL = (key) => `container.label.${key}`; +exports.ATTR_CONTAINER_LABEL = ATTR_CONTAINER_LABEL; +/** + * Deprecated, use `container.label` instead. + * + * @example container.label.app=nginx + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `container.label`. + */ +const ATTR_CONTAINER_LABELS = (key) => `container.labels.${key}`; +exports.ATTR_CONTAINER_LABELS = ATTR_CONTAINER_LABELS; +/** + * Container name used by container runtime. + * + * @example opentelemetry-autoconf + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CONTAINER_NAME = 'container.name'; +/** + * The container runtime managing this container. + * + * @example docker + * + * @example containerd + * + * @example rkt + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CONTAINER_RUNTIME = 'container.runtime'; +/** + * The mode of the CPU + * + * @example user + * + * @example system + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_CPU_MODE = 'cpu.mode'; +/** + * Enum value "idle" for attribute {@link ATTR_CPU_MODE}. + */ +exports.CPU_MODE_VALUE_IDLE = "idle"; +/** + * Enum value "interrupt" for attribute {@link ATTR_CPU_MODE}. + */ +exports.CPU_MODE_VALUE_INTERRUPT = "interrupt"; +/** + * Enum value "iowait" for attribute {@link ATTR_CPU_MODE}. + */ +exports.CPU_MODE_VALUE_IOWAIT = "iowait"; +/** + * Enum value "kernel" for attribute {@link ATTR_CPU_MODE}. + */ +exports.CPU_MODE_VALUE_KERNEL = "kernel"; +/** + * Enum value "nice" for attribute {@link ATTR_CPU_MODE}. + */ +exports.CPU_MODE_VALUE_NICE = "nice"; +/** + * Enum value "steal" for attribute {@link ATTR_CPU_MODE}. + */ +exports.CPU_MODE_VALUE_STEAL = "steal"; +/** + * Enum value "system" for attribute {@link ATTR_CPU_MODE}. + */ +exports.CPU_MODE_VALUE_SYSTEM = "system"; +/** + * Enum value "user" for attribute {@link ATTR_CPU_MODE}. + */ +exports.CPU_MODE_VALUE_USER = "user"; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL = 'db.cassandra.consistency_level'; +/** + * Enum value "all" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. + */ +exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ALL = "all"; +/** + * Enum value "any" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. + */ +exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ANY = "any"; +/** + * Enum value "each_quorum" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. + */ +exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_EACH_QUORUM = "each_quorum"; +/** + * Enum value "local_one" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. + */ +exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_ONE = "local_one"; +/** + * Enum value "local_quorum" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. + */ +exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_QUORUM = "local_quorum"; +/** + * Enum value "local_serial" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. + */ +exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_SERIAL = "local_serial"; +/** + * Enum value "one" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. + */ +exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ONE = "one"; +/** + * Enum value "quorum" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. + */ +exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_QUORUM = "quorum"; +/** + * Enum value "serial" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. + */ +exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_SERIAL = "serial"; +/** + * Enum value "three" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. + */ +exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_THREE = "three"; +/** + * Enum value "two" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. + */ +exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_TWO = "two"; +/** + * The data center of the coordinating node for a query. + * + * @example "us-west-2" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_CASSANDRA_COORDINATOR_DC = 'db.cassandra.coordinator.dc'; +/** + * The ID of the coordinating node for a query. + * + * @example "be13faa2-8574-4d71-926d-27f16cf8a7af" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_CASSANDRA_COORDINATOR_ID = 'db.cassandra.coordinator.id'; +/** + * Whether or not the query is idempotent. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_CASSANDRA_IDEMPOTENCE = 'db.cassandra.idempotence'; +/** + * The fetch size used for paging, i.e. how many rows will be returned at once. + * + * @example 5000 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_CASSANDRA_PAGE_SIZE = 'db.cassandra.page_size'; +/** + * The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. + * + * @example 0 + * + * @example 2 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = 'db.cassandra.speculative_execution_count'; +/** + * Deprecated, use `db.collection.name` instead. + * + * @example "mytable" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.collection.name`. + */ +exports.ATTR_DB_CASSANDRA_TABLE = 'db.cassandra.table'; +/** + * The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation **SHOULD** use a combination of parameters that would make the name unique, for example, combining attributes `server.address`, `server.port`, and `db.namespace`, formatted as `server.address:server.port/db.namespace`. Instrumentations that generate connection pool name following different patterns **SHOULD** document it. + * + * @example myDataSource + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_CLIENT_CONNECTION_POOL_NAME = 'db.client.connection.pool.name'; +/** + * The state of a connection in the pool + * + * @example idle + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_CLIENT_CONNECTION_STATE = 'db.client.connection.state'; +/** + * Enum value "idle" for attribute {@link ATTR_DB_CLIENT_CONNECTION_STATE}. + */ +exports.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE = "idle"; +/** + * Enum value "used" for attribute {@link ATTR_DB_CLIENT_CONNECTION_STATE}. + */ +exports.DB_CLIENT_CONNECTION_STATE_VALUE_USED = "used"; +/** + * Deprecated, use `db.client.connection.pool.name` instead. + * + * @example myDataSource + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.client.connection.pool.name`. + */ +exports.ATTR_DB_CLIENT_CONNECTIONS_POOL_NAME = 'db.client.connections.pool.name'; +/** + * Deprecated, use `db.client.connection.state` instead. + * + * @example idle + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.client.connection.state`. + */ +exports.ATTR_DB_CLIENT_CONNECTIONS_STATE = 'db.client.connections.state'; +/** + * Enum value "idle" for attribute {@link ATTR_DB_CLIENT_CONNECTIONS_STATE}. + */ +exports.DB_CLIENT_CONNECTIONS_STATE_VALUE_IDLE = "idle"; +/** + * Enum value "used" for attribute {@link ATTR_DB_CLIENT_CONNECTIONS_STATE}. + */ +exports.DB_CLIENT_CONNECTIONS_STATE_VALUE_USED = "used"; +/** + * The name of a collection (table, container) within the database. + * + * @example public.users + * + * @example customers + * + * @note It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. + * If the collection name is parsed from the query text, it **SHOULD** be the first collection name found in the query and it **SHOULD** match the value provided in the query text including any schema and database name prefix. + * For batch operations, if the individual operations are known to have the same collection name then that collection name **SHOULD** be used, otherwise `db.collection.name` **SHOULD** **NOT** be captured. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_COLLECTION_NAME = 'db.collection.name'; +/** + * Deprecated, use `server.address`, `server.port` attributes instead. + * + * @example "Server=(localdb)\\v11.0;Integrated Security=true;" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * "Replaced by `server.address` and `server.port`." + */ +exports.ATTR_DB_CONNECTION_STRING = 'db.connection_string'; +/** + * Unique Cosmos client instance id. + * + * @example "3ba4827d-4422-483f-b59f-85b74211c11d" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_COSMOSDB_CLIENT_ID = 'db.cosmosdb.client_id'; +/** + * Cosmos client connection mode. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_COSMOSDB_CONNECTION_MODE = 'db.cosmosdb.connection_mode'; +/** + * Enum value "direct" for attribute {@link ATTR_DB_COSMOSDB_CONNECTION_MODE}. + */ +exports.DB_COSMOSDB_CONNECTION_MODE_VALUE_DIRECT = "direct"; +/** + * Enum value "gateway" for attribute {@link ATTR_DB_COSMOSDB_CONNECTION_MODE}. + */ +exports.DB_COSMOSDB_CONNECTION_MODE_VALUE_GATEWAY = "gateway"; +/** + * Deprecated, use `db.collection.name` instead. + * + * @example "mytable" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.collection.name`. + */ +exports.ATTR_DB_COSMOSDB_CONTAINER = 'db.cosmosdb.container'; +/** + * CosmosDB Operation Type. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_COSMOSDB_OPERATION_TYPE = 'db.cosmosdb.operation_type'; +/** + * Enum value "Batch" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. + */ +exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_BATCH = "Batch"; +/** + * Enum value "Create" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. + */ +exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_CREATE = "Create"; +/** + * Enum value "Delete" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. + */ +exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_DELETE = "Delete"; +/** + * Enum value "Execute" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. + */ +exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_EXECUTE = "Execute"; +/** + * Enum value "ExecuteJavaScript" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. + */ +exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_EXECUTE_JAVASCRIPT = "ExecuteJavaScript"; +/** + * Enum value "Head" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. + */ +exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_HEAD = "Head"; +/** + * Enum value "HeadFeed" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. + */ +exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_HEAD_FEED = "HeadFeed"; +/** + * Enum value "Invalid" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. + */ +exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_INVALID = "Invalid"; +/** + * Enum value "Patch" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. + */ +exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_PATCH = "Patch"; +/** + * Enum value "Query" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. + */ +exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_QUERY = "Query"; +/** + * Enum value "QueryPlan" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. + */ +exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_QUERY_PLAN = "QueryPlan"; +/** + * Enum value "Read" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. + */ +exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_READ = "Read"; +/** + * Enum value "ReadFeed" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. + */ +exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_READ_FEED = "ReadFeed"; +/** + * Enum value "Replace" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. + */ +exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_REPLACE = "Replace"; +/** + * Enum value "Upsert" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. + */ +exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_UPSERT = "Upsert"; +/** + * RU consumed for that operation + * + * @example 46.18 + * + * @example 1.0 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_COSMOSDB_REQUEST_CHARGE = 'db.cosmosdb.request_charge'; +/** + * Request payload size in bytes + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_COSMOSDB_REQUEST_CONTENT_LENGTH = 'db.cosmosdb.request_content_length'; +/** + * Cosmos DB status code. + * + * @example 200 + * + * @example 201 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_COSMOSDB_STATUS_CODE = 'db.cosmosdb.status_code'; +/** + * Cosmos DB sub status code. + * + * @example 1000 + * + * @example 1002 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_COSMOSDB_SUB_STATUS_CODE = 'db.cosmosdb.sub_status_code'; +/** + * Deprecated, use `db.namespace` instead. + * + * @example e9106fc68e3044f0b1475b04bf4ffd5f + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.namespace`. + */ +exports.ATTR_DB_ELASTICSEARCH_CLUSTER_NAME = 'db.elasticsearch.cluster.name'; +/** + * Represents the human-readable identifier of the node/instance to which a request was routed. + * + * @example instance-0000000001 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_ELASTICSEARCH_NODE_NAME = 'db.elasticsearch.node.name'; +/** + * A dynamic value in the url path. + * + * @example db.elasticsearch.path_parts.index=test-index + * + * @example db.elasticsearch.path_parts.doc_id=123 + * + * @note Many Elasticsearch url paths allow dynamic values. These **SHOULD** be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation **SHOULD** reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +const ATTR_DB_ELASTICSEARCH_PATH_PARTS = (key) => `db.elasticsearch.path_parts.${key}`; +exports.ATTR_DB_ELASTICSEARCH_PATH_PARTS = ATTR_DB_ELASTICSEARCH_PATH_PARTS; +/** + * Deprecated, no general replacement at this time. For Elasticsearch, use `db.elasticsearch.node.name` instead. + * + * @example "mysql-e26b99z.example.com" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Deprecated, no general replacement at this time. For Elasticsearch, use `db.elasticsearch.node.name` instead. + */ +exports.ATTR_DB_INSTANCE_ID = 'db.instance.id'; +/** + * Removed, no replacement at this time. + * + * @example org.postgresql.Driver + * + * @example com.microsoft.sqlserver.jdbc.SQLServerDriver + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Removed as not used. + */ +exports.ATTR_DB_JDBC_DRIVER_CLASSNAME = 'db.jdbc.driver_classname'; +/** + * Deprecated, use `db.collection.name` instead. + * + * @example "mytable" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.collection.name`. + */ +exports.ATTR_DB_MONGODB_COLLECTION = 'db.mongodb.collection'; +/** + * Deprecated, SQL Server instance is now populated as a part of `db.namespace` attribute. + * + * @example "MSSQLSERVER" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Deprecated, no replacement at this time. + */ +exports.ATTR_DB_MSSQL_INSTANCE_NAME = 'db.mssql.instance_name'; +/** + * Deprecated, use `db.namespace` instead. + * + * @example customers + * + * @example main + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.namespace`. + */ +exports.ATTR_DB_NAME = 'db.name'; +/** + * The name of the database, fully qualified within the server address and port. + * + * @example customers + * + * @example test.users + * + * @note If a database system has multiple namespace components, they **SHOULD** be concatenated (potentially using database system specific conventions) from most general to most specific namespace component, and more specific namespaces **SHOULD** **NOT** be captured without the more general namespaces, to ensure that "startswith" queries for the more general namespaces will be valid. + * Semantic conventions for individual database systems **SHOULD** document what `db.namespace` means in the context of that system. + * It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_NAMESPACE = 'db.namespace'; +/** + * Deprecated, use `db.operation.name` instead. + * + * @example findAndModify + * + * @example HMSET + * + * @example SELECT + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.operation.name`. + */ +exports.ATTR_DB_OPERATION = 'db.operation'; +/** + * The number of queries included in a [batch operation](/docs/database/database-spans.md#batch-operations). + * + * @example 2 + * + * @example 3 + * + * @example 4 + * + * @note Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` **SHOULD** never be `1`. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_OPERATION_BATCH_SIZE = 'db.operation.batch.size'; +/** + * The name of the operation or command being executed. + * + * @example findAndModify + * + * @example HMSET + * + * @example SELECT + * + * @note It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. + * If the operation name is parsed from the query text, it **SHOULD** be the first operation name found in the query. + * For batch operations, if the individual operations are known to have the same operation name then that operation name **SHOULD** be used prepended by `BATCH `, otherwise `db.operation.name` **SHOULD** be `BATCH` or some other database system specific term if more applicable. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_OPERATION_NAME = 'db.operation.name'; +/** + * A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. + * + * @example someval + * + * @example 55 + * + * @note Query parameters should only be captured when `db.query.text` is parameterized with placeholders. + * If a parameter has no name and instead is referenced only by index, then `` **SHOULD** be the 0-based index. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +const ATTR_DB_QUERY_PARAMETER = (key) => `db.query.parameter.${key}`; +exports.ATTR_DB_QUERY_PARAMETER = ATTR_DB_QUERY_PARAMETER; +/** + * The database query being executed. + * + * @example SELECT * FROM wuser_table where username = ? + * + * @example SET mykey "WuValue" + * + * @note For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). + * 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. + * 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. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_QUERY_TEXT = 'db.query.text'; +/** + * Deprecated, use `db.namespace` instead. + * + * @example 0 + * + * @example 1 + * + * @example 15 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.namespace`. + */ +exports.ATTR_DB_REDIS_DATABASE_INDEX = 'db.redis.database_index'; +/** + * Deprecated, use `db.collection.name` instead. + * + * @example "mytable" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.collection.name`. + */ +exports.ATTR_DB_SQL_TABLE = 'db.sql.table'; +/** + * The database statement being executed. + * + * @example SELECT * FROM wuser_table + * + * @example SET mykey "WuValue" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.query.text`. + */ +exports.ATTR_DB_STATEMENT = 'db.statement'; +/** + * The database management system (DBMS) product as identified by the client instrumentation. + * + * @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` is set to `postgresql` based on the instrumentation's best knowledge. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DB_SYSTEM = 'db.system'; +/** + * Enum value "adabas" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_ADABAS = "adabas"; +/** + * Enum value "cache" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_CACHE = "cache"; +/** + * Enum value "cassandra" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_CASSANDRA = "cassandra"; +/** + * Enum value "clickhouse" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_CLICKHOUSE = "clickhouse"; +/** + * Enum value "cloudscape" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_CLOUDSCAPE = "cloudscape"; +/** + * Enum value "cockroachdb" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_COCKROACHDB = "cockroachdb"; +/** + * Enum value "coldfusion" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_COLDFUSION = "coldfusion"; +/** + * Enum value "cosmosdb" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_COSMOSDB = "cosmosdb"; +/** + * Enum value "couchbase" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_COUCHBASE = "couchbase"; +/** + * Enum value "couchdb" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_COUCHDB = "couchdb"; +/** + * Enum value "db2" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_DB2 = "db2"; +/** + * Enum value "derby" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_DERBY = "derby"; +/** + * Enum value "dynamodb" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_DYNAMODB = "dynamodb"; +/** + * Enum value "edb" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_EDB = "edb"; +/** + * Enum value "elasticsearch" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_ELASTICSEARCH = "elasticsearch"; +/** + * Enum value "filemaker" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_FILEMAKER = "filemaker"; +/** + * Enum value "firebird" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_FIREBIRD = "firebird"; +/** + * Enum value "firstsql" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_FIRSTSQL = "firstsql"; +/** + * Enum value "geode" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_GEODE = "geode"; +/** + * Enum value "h2" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_H2 = "h2"; +/** + * Enum value "hanadb" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_HANADB = "hanadb"; +/** + * Enum value "hbase" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_HBASE = "hbase"; +/** + * Enum value "hive" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_HIVE = "hive"; +/** + * Enum value "hsqldb" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_HSQLDB = "hsqldb"; +/** + * Enum value "influxdb" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_INFLUXDB = "influxdb"; +/** + * Enum value "informix" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_INFORMIX = "informix"; +/** + * Enum value "ingres" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_INGRES = "ingres"; +/** + * Enum value "instantdb" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_INSTANTDB = "instantdb"; +/** + * Enum value "interbase" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_INTERBASE = "interbase"; +/** + * Enum value "intersystems_cache" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_INTERSYSTEMS_CACHE = "intersystems_cache"; +/** + * Enum value "mariadb" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_MARIADB = "mariadb"; +/** + * Enum value "maxdb" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_MAXDB = "maxdb"; +/** + * Enum value "memcached" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_MEMCACHED = "memcached"; +/** + * Enum value "mongodb" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_MONGODB = "mongodb"; +/** + * Enum value "mssql" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_MSSQL = "mssql"; +/** + * Enum value "mssqlcompact" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_MSSQLCOMPACT = "mssqlcompact"; +/** + * Enum value "mysql" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_MYSQL = "mysql"; +/** + * Enum value "neo4j" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_NEO4J = "neo4j"; +/** + * Enum value "netezza" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_NETEZZA = "netezza"; +/** + * Enum value "opensearch" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_OPENSEARCH = "opensearch"; +/** + * Enum value "oracle" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_ORACLE = "oracle"; +/** + * Enum value "other_sql" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_OTHER_SQL = "other_sql"; +/** + * Enum value "pervasive" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_PERVASIVE = "pervasive"; +/** + * Enum value "pointbase" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_POINTBASE = "pointbase"; +/** + * Enum value "postgresql" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_POSTGRESQL = "postgresql"; +/** + * Enum value "progress" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_PROGRESS = "progress"; +/** + * Enum value "redis" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_REDIS = "redis"; +/** + * Enum value "redshift" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_REDSHIFT = "redshift"; +/** + * Enum value "spanner" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_SPANNER = "spanner"; +/** + * Enum value "sqlite" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_SQLITE = "sqlite"; +/** + * Enum value "sybase" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_SYBASE = "sybase"; +/** + * Enum value "teradata" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_TERADATA = "teradata"; +/** + * Enum value "trino" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_TRINO = "trino"; +/** + * Enum value "vertica" for attribute {@link ATTR_DB_SYSTEM}. + */ +exports.DB_SYSTEM_VALUE_VERTICA = "vertica"; +/** + * Deprecated, no replacement at this time. + * + * @example readonly_user + * + * @example reporting_user + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * No replacement at this time. + */ +exports.ATTR_DB_USER = 'db.user'; +/** + * 'Deprecated, use `deployment.environment.name` instead.' + * + * @example staging + * + * @example production + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Deprecated, use `deployment.environment.name` instead. + */ +exports.ATTR_DEPLOYMENT_ENVIRONMENT = 'deployment.environment'; +/** + * Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). + * + * @example staging + * + * @example production + * + * @note `deployment.environment.name` does not affect the uniqueness constraints defined through + * the `service.namespace`, `service.name` and `service.instance.id` resource attributes. + * This implies that resources carrying the following attribute combinations **MUST** be + * considered to be identifying the same service: + * + * * `service.name=frontend`, `deployment.environment.name=production` + * * `service.name=frontend`, `deployment.environment.name=staging`. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DEPLOYMENT_ENVIRONMENT_NAME = 'deployment.environment.name'; +/** + * The id of the deployment. + * + * @example 1208 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DEPLOYMENT_ID = 'deployment.id'; +/** + * The name of the deployment. + * + * @example deploy my app + * + * @example deploy-frontend + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DEPLOYMENT_NAME = 'deployment.name'; +/** + * The status of the deployment. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DEPLOYMENT_STATUS = 'deployment.status'; +/** + * Enum value "failed" for attribute {@link ATTR_DEPLOYMENT_STATUS}. + */ +exports.DEPLOYMENT_STATUS_VALUE_FAILED = "failed"; +/** + * Enum value "succeeded" for attribute {@link ATTR_DEPLOYMENT_STATUS}. + */ +exports.DEPLOYMENT_STATUS_VALUE_SUCCEEDED = "succeeded"; +/** + * Destination address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. + * + * @example destination.example.com + * + * @example 10.1.2.80 + * + * @example /tmp/my.sock + * + * @note When observed from the source side, and when communicating through an intermediary, `destination.address` **SHOULD** represent the destination address behind any intermediaries, for example proxies, if it's available. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DESTINATION_ADDRESS = 'destination.address'; +/** + * Destination port number + * + * @example 3389 + * + * @example 2888 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DESTINATION_PORT = 'destination.port'; +/** + * A unique identifier representing the device + * + * @example 2ab2916d-a51f-4ac8-80ee-45ac31a28092 + * + * @note The device identifier **MUST** only be defined using the values outlined below. This value is not an advertising identifier and **MUST** **NOT** be used as such. On iOS (Swift or Objective-C), this value **MUST** be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value **MUST** be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DEVICE_ID = 'device.id'; +/** + * The name of the device manufacturer + * + * @example Apple + * + * @example Samsung + * + * @note The Android OS provides this field via [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). iOS apps **SHOULD** hardcode the value `Apple`. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DEVICE_MANUFACTURER = 'device.manufacturer'; +/** + * The model identifier for the device + * + * @example iPhone3,4 + * + * @example SM-G920F + * + * @note It's recommended this value represents a machine-readable version of the model identifier rather than the market or consumer-friendly name of the device. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DEVICE_MODEL_IDENTIFIER = 'device.model.identifier'; +/** + * The marketing name for the device model + * + * @example iPhone 6s Plus + * + * @example Samsung Galaxy S6 + * + * @note It's recommended this value represents a human-readable version of the device model rather than a machine-readable alternative. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DEVICE_MODEL_NAME = 'device.model.name'; +/** + * The disk IO operation direction. + * + * @example read + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DISK_IO_DIRECTION = 'disk.io.direction'; +/** + * Enum value "read" for attribute {@link ATTR_DISK_IO_DIRECTION}. + */ +exports.DISK_IO_DIRECTION_VALUE_READ = "read"; +/** + * Enum value "write" for attribute {@link ATTR_DISK_IO_DIRECTION}. + */ +exports.DISK_IO_DIRECTION_VALUE_WRITE = "write"; +/** + * The name being queried. + * + * @example www.example.com + * + * @example opentelemetry.io + * + * @note If the name field contains non-printable characters (below 32 or above 126), those characters should be represented as escaped base 10 integers (\DDD). Back slashes and quotes should be escaped. Tabs, carriage returns, and line feeds should be converted to \t, \r, and \n respectively. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_DNS_QUESTION_NAME = 'dns.question.name'; +/** + * Deprecated, use `user.id` instead. + * + * @example "username" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `user.id` attribute. + */ +exports.ATTR_ENDUSER_ID = 'enduser.id'; +/** + * Deprecated, use `user.roles` instead. + * + * @example "admin" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `user.roles` attribute. + */ +exports.ATTR_ENDUSER_ROLE = 'enduser.role'; +/** + * Deprecated, no replacement at this time. + * + * @example "read:message, write:files" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Removed. + */ +exports.ATTR_ENDUSER_SCOPE = 'enduser.scope'; +/** + * Identifies the class / type of event. + * + * @example browser.mouse.click + * + * @example device.app.lifecycle + * + * @note Event names are subject to the same rules as [attribute names](/docs/general/attribute-naming.md). Notably, event names are namespaced to avoid collisions and provide a clean separation of semantics for events in separate domains like browser, mobile, and kubernetes. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_EVENT_NAME = 'event.name'; +/** + * A boolean that is true if the serverless function is executed for the first time (aka cold-start). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FAAS_COLDSTART = 'faas.coldstart'; +/** + * A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). + * + * @example "0/5 * * * ? *" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FAAS_CRON = 'faas.cron'; +/** + * The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. + * + * @example myBucketName + * + * @example myDbName + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FAAS_DOCUMENT_COLLECTION = 'faas.document.collection'; +/** + * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. + * + * @example myFile.txt + * + * @example myTableName + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FAAS_DOCUMENT_NAME = 'faas.document.name'; +/** + * Describes the type of the operation that was performed on the data. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FAAS_DOCUMENT_OPERATION = 'faas.document.operation'; +/** + * Enum value "delete" for attribute {@link ATTR_FAAS_DOCUMENT_OPERATION}. + */ +exports.FAAS_DOCUMENT_OPERATION_VALUE_DELETE = "delete"; +/** + * Enum value "edit" for attribute {@link ATTR_FAAS_DOCUMENT_OPERATION}. + */ +exports.FAAS_DOCUMENT_OPERATION_VALUE_EDIT = "edit"; +/** + * Enum value "insert" for attribute {@link ATTR_FAAS_DOCUMENT_OPERATION}. + */ +exports.FAAS_DOCUMENT_OPERATION_VALUE_INSERT = "insert"; +/** + * A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). + * + * @example "2020-01-23T13:47:06Z" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FAAS_DOCUMENT_TIME = 'faas.document.time'; +/** + * The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. + * + * @example 2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de + * + * @note * **AWS Lambda:** Use the (full) log stream name. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FAAS_INSTANCE = 'faas.instance'; +/** + * The invocation ID of the current function invocation. + * + * @example "af9d5aa4-a685-4c5f-a22b-444f80b3cc28" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FAAS_INVOCATION_ID = 'faas.invocation_id'; +/** + * The name of the invoked function. + * + * @example "my-function" + * + * @note SHOULD be equal to the `faas.name` resource attribute of the invoked function. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FAAS_INVOKED_NAME = 'faas.invoked_name'; +/** + * The cloud provider of the invoked function. + * + * @note SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FAAS_INVOKED_PROVIDER = 'faas.invoked_provider'; +/** + * Enum value "alibaba_cloud" for attribute {@link ATTR_FAAS_INVOKED_PROVIDER}. + */ +exports.FAAS_INVOKED_PROVIDER_VALUE_ALIBABA_CLOUD = "alibaba_cloud"; +/** + * Enum value "aws" for attribute {@link ATTR_FAAS_INVOKED_PROVIDER}. + */ +exports.FAAS_INVOKED_PROVIDER_VALUE_AWS = "aws"; +/** + * Enum value "azure" for attribute {@link ATTR_FAAS_INVOKED_PROVIDER}. + */ +exports.FAAS_INVOKED_PROVIDER_VALUE_AZURE = "azure"; +/** + * Enum value "gcp" for attribute {@link ATTR_FAAS_INVOKED_PROVIDER}. + */ +exports.FAAS_INVOKED_PROVIDER_VALUE_GCP = "gcp"; +/** + * Enum value "tencent_cloud" for attribute {@link ATTR_FAAS_INVOKED_PROVIDER}. + */ +exports.FAAS_INVOKED_PROVIDER_VALUE_TENCENT_CLOUD = "tencent_cloud"; +/** + * The cloud region of the invoked function. + * + * @example "eu-central-1" + * + * @note SHOULD be equal to the `cloud.region` resource attribute of the invoked function. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FAAS_INVOKED_REGION = 'faas.invoked_region'; +/** + * The amount of memory available to the serverless function converted to Bytes. + * + * @example 134217728 + * + * @note It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FAAS_MAX_MEMORY = 'faas.max_memory'; +/** + * The name of the single function that this runtime instance executes. + * + * @example my-function + * + * @example myazurefunctionapp/some-function-name + * + * @note This is the name of the function as configured/deployed on the FaaS + * platform and is usually different from the name of the callback + * function (which may be stored in the + * [`code.namespace`/`code.function`](/docs/general/attributes.md#source-code-attributes) + * span attributes). + * + * For some cloud providers, the above definition is ambiguous. The following + * definition of function name **MUST** be used for this attribute + * (and consequently the span name) for the listed cloud providers/products: + * + * * **Azure:** The full name `/`, i.e., function app name + * followed by a forward slash followed by the function name (this form + * can also be seen in the resource JSON for the function). + * This means that a span attribute **MUST** be used, as an Azure function + * app can host multiple functions that would usually share + * a TracerProvider (see also the `cloud.resource_id` attribute). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FAAS_NAME = 'faas.name'; +/** + * A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). + * + * @example "2020-01-23T13:47:06Z" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FAAS_TIME = 'faas.time'; +/** + * Type of the trigger which caused this function invocation. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FAAS_TRIGGER = 'faas.trigger'; +/** + * Enum value "datasource" for attribute {@link ATTR_FAAS_TRIGGER}. + */ +exports.FAAS_TRIGGER_VALUE_DATASOURCE = "datasource"; +/** + * Enum value "http" for attribute {@link ATTR_FAAS_TRIGGER}. + */ +exports.FAAS_TRIGGER_VALUE_HTTP = "http"; +/** + * Enum value "other" for attribute {@link ATTR_FAAS_TRIGGER}. + */ +exports.FAAS_TRIGGER_VALUE_OTHER = "other"; +/** + * Enum value "pubsub" for attribute {@link ATTR_FAAS_TRIGGER}. + */ +exports.FAAS_TRIGGER_VALUE_PUBSUB = "pubsub"; +/** + * Enum value "timer" for attribute {@link ATTR_FAAS_TRIGGER}. + */ +exports.FAAS_TRIGGER_VALUE_TIMER = "timer"; +/** + * The immutable version of the function being executed. + * + * @example 26 + * + * @example pinkfroid-00002 + * + * @note Depending on the cloud provider and platform, use: + * + * * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) + * (an integer represented as a decimal string). + * * **Google Cloud Run (Services):** The [revision](https://cloud.google.com/run/docs/managing/revisions) + * (i.e., the function name plus the revision suffix). + * * **Google Cloud Functions:** The value of the + * [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). + * * **Azure Functions:** Not applicable. Do not set this attribute. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FAAS_VERSION = 'faas.version'; +/** + * The unique identifier of the feature flag. + * + * @example logo-color + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FEATURE_FLAG_KEY = 'feature_flag.key'; +/** + * The name of the service provider that performs the flag evaluation. + * + * @example Flag Manager + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FEATURE_FLAG_PROVIDER_NAME = 'feature_flag.provider_name'; +/** + * **SHOULD** be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used. + * + * @example red + * + * @example true + * + * @example on + * + * @note A semantic identifier, commonly referred to as a variant, provides a means + * for referring to a value without including the value itself. This can + * provide additional context for understanding the meaning behind a value. + * For example, the variant `red` maybe be used for the value `#c05543`. + * + * A stringified version of the value can be used in situations where a + * semantic identifier is unavailable. String representation of the value + * should be determined by the implementer. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FEATURE_FLAG_VARIANT = 'feature_flag.variant'; +/** + * Directory where the file is located. It should include the drive letter, when appropriate. + * + * @example /home/user + * + * @example C:\Program Files\MyApp + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FILE_DIRECTORY = 'file.directory'; +/** + * File extension, excluding the leading dot. + * + * @example png + * + * @example gz + * + * @note When the file name has multiple extensions (example.tar.gz), only the last one should be captured ("gz", not "tar.gz"). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FILE_EXTENSION = 'file.extension'; +/** + * Name of the file including the extension, without the directory. + * + * @example example.png + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FILE_NAME = 'file.name'; +/** + * Full path to the file, including the file name. It should include the drive letter, when appropriate. + * + * @example /home/alice/example.png + * + * @example C:\Program Files\MyApp\myapp.exe + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FILE_PATH = 'file.path'; +/** + * File size in bytes. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_FILE_SIZE = 'file.size'; +/** + * Identifies the Google Cloud service for which the official client library is intended. + * + * @example appengine + * + * @example run + * + * @example firestore + * + * @example alloydb + * + * @example spanner + * + * @note Intended to be a stable identifier for Google Cloud client libraries that is uniform across implementation languages. The value should be derived from the canonical service domain for the service; for example, 'foo.googleapis.com' should result in a value of 'foo'. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GCP_CLIENT_SERVICE = 'gcp.client.service'; +/** + * The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. + * + * @example job-name-xxxx + * + * @example sample-job-mdw84 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GCP_CLOUD_RUN_JOB_EXECUTION = 'gcp.cloud_run.job.execution'; +/** + * The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. + * + * @example 0 + * + * @example 1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GCP_CLOUD_RUN_JOB_TASK_INDEX = 'gcp.cloud_run.job.task_index'; +/** + * The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). + * + * @example my-host1234.example.com + * + * @example sample-vm.us-west1-b.c.my-project.internal + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GCP_GCE_INSTANCE_HOSTNAME = 'gcp.gce.instance.hostname'; +/** + * The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). + * + * @example instance-1 + * + * @example my-vm-name + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GCP_GCE_INSTANCE_NAME = 'gcp.gce.instance.name'; +/** + * The full response received from the GenAI model. + * + * @example [{'role': 'assistant', 'content': 'The capital of France is Paris.'}] + * + * @note It's RECOMMENDED to format completions as JSON string matching [OpenAI messages format](https://platform.openai.com/docs/guides/text-generation) + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GEN_AI_COMPLETION = 'gen_ai.completion'; +/** + * The name of the operation being performed. + * + * @note If one of the predefined values applies, but specific system uses a different name it's RECOMMENDED to document it in the semantic conventions for specific GenAI system and use system-specific name in the instrumentation. If a different name is not documented, instrumentation libraries **SHOULD** use applicable predefined value. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GEN_AI_OPERATION_NAME = 'gen_ai.operation.name'; +/** + * Enum value "chat" for attribute {@link ATTR_GEN_AI_OPERATION_NAME}. + */ +exports.GEN_AI_OPERATION_NAME_VALUE_CHAT = "chat"; +/** + * Enum value "text_completion" for attribute {@link ATTR_GEN_AI_OPERATION_NAME}. + */ +exports.GEN_AI_OPERATION_NAME_VALUE_TEXT_COMPLETION = "text_completion"; +/** + * The full prompt sent to the GenAI model. + * + * @example [{'role': 'user', 'content': 'What is the capital of France?'}] + * + * @note It's RECOMMENDED to format prompts as JSON string matching [OpenAI messages format](https://platform.openai.com/docs/guides/text-generation) + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GEN_AI_PROMPT = 'gen_ai.prompt'; +/** + * The frequency penalty setting for the GenAI request. + * + * @example 0.1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GEN_AI_REQUEST_FREQUENCY_PENALTY = 'gen_ai.request.frequency_penalty'; +/** + * The maximum number of tokens the model generates for a request. + * + * @example 100 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GEN_AI_REQUEST_MAX_TOKENS = 'gen_ai.request.max_tokens'; +/** + * The name of the GenAI model a request is being made to. + * + * @example "gpt-4" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GEN_AI_REQUEST_MODEL = 'gen_ai.request.model'; +/** + * The presence penalty setting for the GenAI request. + * + * @example 0.1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GEN_AI_REQUEST_PRESENCE_PENALTY = 'gen_ai.request.presence_penalty'; +/** + * List of sequences that the model will use to stop generating further tokens. + * + * @example forest + * + * @example lived + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GEN_AI_REQUEST_STOP_SEQUENCES = 'gen_ai.request.stop_sequences'; +/** + * The temperature setting for the GenAI request. + * + * @example 0.0 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GEN_AI_REQUEST_TEMPERATURE = 'gen_ai.request.temperature'; +/** + * The top_k sampling setting for the GenAI request. + * + * @example 1.0 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GEN_AI_REQUEST_TOP_K = 'gen_ai.request.top_k'; +/** + * The top_p sampling setting for the GenAI request. + * + * @example 1.0 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GEN_AI_REQUEST_TOP_P = 'gen_ai.request.top_p'; +/** + * Array of reasons the model stopped generating tokens, corresponding to each generation received. + * + * @example stop + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GEN_AI_RESPONSE_FINISH_REASONS = 'gen_ai.response.finish_reasons'; +/** + * The unique identifier for the completion. + * + * @example chatcmpl-123 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GEN_AI_RESPONSE_ID = 'gen_ai.response.id'; +/** + * The name of the model that generated the response. + * + * @example gpt-4-0613 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GEN_AI_RESPONSE_MODEL = 'gen_ai.response.model'; +/** + * The Generative AI product as identified by the client or server instrumentation. + * + * @example "openai" + * + * @note The `gen_ai.system` describes a family of GenAI models with specific model identified + * by `gen_ai.request.model` and `gen_ai.response.model` attributes. + * + * The actual GenAI product may differ from the one identified by the client. + * For example, when using OpenAI client libraries to communicate with Mistral, the `gen_ai.system` + * is set to `openai` based on the instrumentation's best knowledge. + * + * For custom model, a custom friendly name **SHOULD** be used. + * If none of these options apply, the `gen_ai.system` **SHOULD** be set to `_OTHER`. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GEN_AI_SYSTEM = 'gen_ai.system'; +/** + * Enum value "anthropic" for attribute {@link ATTR_GEN_AI_SYSTEM}. + */ +exports.GEN_AI_SYSTEM_VALUE_ANTHROPIC = "anthropic"; +/** + * Enum value "cohere" for attribute {@link ATTR_GEN_AI_SYSTEM}. + */ +exports.GEN_AI_SYSTEM_VALUE_COHERE = "cohere"; +/** + * Enum value "openai" for attribute {@link ATTR_GEN_AI_SYSTEM}. + */ +exports.GEN_AI_SYSTEM_VALUE_OPENAI = "openai"; +/** + * Enum value "vertex_ai" for attribute {@link ATTR_GEN_AI_SYSTEM}. + */ +exports.GEN_AI_SYSTEM_VALUE_VERTEX_AI = "vertex_ai"; +/** + * The type of token being counted. + * + * @example input + * + * @example output + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GEN_AI_TOKEN_TYPE = 'gen_ai.token.type'; +/** + * Enum value "input" for attribute {@link ATTR_GEN_AI_TOKEN_TYPE}. + */ +exports.GEN_AI_TOKEN_TYPE_VALUE_INPUT = "input"; +/** + * Enum value "output" for attribute {@link ATTR_GEN_AI_TOKEN_TYPE}. + */ +exports.GEN_AI_TOKEN_TYPE_VALUE_COMPLETION = "output"; +/** + * Deprecated, use `gen_ai.usage.output_tokens` instead. + * + * @example 42 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `gen_ai.usage.output_tokens` attribute. + */ +exports.ATTR_GEN_AI_USAGE_COMPLETION_TOKENS = 'gen_ai.usage.completion_tokens'; +/** + * The number of tokens used in the GenAI input (prompt). + * + * @example 100 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GEN_AI_USAGE_INPUT_TOKENS = 'gen_ai.usage.input_tokens'; +/** + * The number of tokens used in the GenAI response (completion). + * + * @example 180 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GEN_AI_USAGE_OUTPUT_TOKENS = 'gen_ai.usage.output_tokens'; +/** + * Deprecated, use `gen_ai.usage.input_tokens` instead. + * + * @example 42 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `gen_ai.usage.input_tokens` attribute. + */ +exports.ATTR_GEN_AI_USAGE_PROMPT_TOKENS = 'gen_ai.usage.prompt_tokens'; +/** + * The type of memory. + * + * @example other + * + * @example stack + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GO_MEMORY_TYPE = 'go.memory.type'; +/** + * Enum value "other" for attribute {@link ATTR_GO_MEMORY_TYPE}. + */ +exports.GO_MEMORY_TYPE_VALUE_OTHER = "other"; +/** + * Enum value "stack" for attribute {@link ATTR_GO_MEMORY_TYPE}. + */ +exports.GO_MEMORY_TYPE_VALUE_STACK = "stack"; +/** + * The GraphQL document being executed. + * + * @example "query findBookById { bookById(id: ?) { name } }" + * + * @note The value may be sanitized to exclude sensitive information. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GRAPHQL_DOCUMENT = 'graphql.document'; +/** + * The name of the operation being executed. + * + * @example "findBookById" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GRAPHQL_OPERATION_NAME = 'graphql.operation.name'; +/** + * The type of the operation being executed. + * + * @example query + * + * @example mutation + * + * @example subscription + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_GRAPHQL_OPERATION_TYPE = 'graphql.operation.type'; +/** + * Enum value "mutation" for attribute {@link ATTR_GRAPHQL_OPERATION_TYPE}. + */ +exports.GRAPHQL_OPERATION_TYPE_VALUE_MUTATION = "mutation"; +/** + * Enum value "query" for attribute {@link ATTR_GRAPHQL_OPERATION_TYPE}. + */ +exports.GRAPHQL_OPERATION_TYPE_VALUE_QUERY = "query"; +/** + * Enum value "subscription" for attribute {@link ATTR_GRAPHQL_OPERATION_TYPE}. + */ +exports.GRAPHQL_OPERATION_TYPE_VALUE_SUBSCRIPTION = "subscription"; +/** + * Unique identifier for the application + * + * @example 2daa2797-e42b-4624-9322-ec3f968df4da + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HEROKU_APP_ID = 'heroku.app.id'; +/** + * Commit hash for the current release + * + * @example e6134959463efd8966b20e75b913cafe3f5ec + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HEROKU_RELEASE_COMMIT = 'heroku.release.commit'; +/** + * Time and date the release was created + * + * @example 2022-10-23T18:00:42Z + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HEROKU_RELEASE_CREATION_TIMESTAMP = 'heroku.release.creation_timestamp'; +/** + * The CPU architecture the host system is running on. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HOST_ARCH = 'host.arch'; +/** + * Enum value "amd64" for attribute {@link ATTR_HOST_ARCH}. + */ +exports.HOST_ARCH_VALUE_AMD64 = "amd64"; +/** + * Enum value "arm32" for attribute {@link ATTR_HOST_ARCH}. + */ +exports.HOST_ARCH_VALUE_ARM32 = "arm32"; +/** + * Enum value "arm64" for attribute {@link ATTR_HOST_ARCH}. + */ +exports.HOST_ARCH_VALUE_ARM64 = "arm64"; +/** + * Enum value "ia64" for attribute {@link ATTR_HOST_ARCH}. + */ +exports.HOST_ARCH_VALUE_IA64 = "ia64"; +/** + * Enum value "ppc32" for attribute {@link ATTR_HOST_ARCH}. + */ +exports.HOST_ARCH_VALUE_PPC32 = "ppc32"; +/** + * Enum value "ppc64" for attribute {@link ATTR_HOST_ARCH}. + */ +exports.HOST_ARCH_VALUE_PPC64 = "ppc64"; +/** + * Enum value "s390x" for attribute {@link ATTR_HOST_ARCH}. + */ +exports.HOST_ARCH_VALUE_S390X = "s390x"; +/** + * Enum value "x86" for attribute {@link ATTR_HOST_ARCH}. + */ +exports.HOST_ARCH_VALUE_X86 = "x86"; +/** + * The amount of level 2 memory cache available to the processor (in Bytes). + * + * @example 12288000 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HOST_CPU_CACHE_L2_SIZE = 'host.cpu.cache.l2.size'; +/** + * Family or generation of the CPU. + * + * @example 6 + * + * @example PA-RISC 1.1e + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HOST_CPU_FAMILY = 'host.cpu.family'; +/** + * Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. + * + * @example 6 + * + * @example 9000/778/B180L + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HOST_CPU_MODEL_ID = 'host.cpu.model.id'; +/** + * Model designation of the processor. + * + * @example 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HOST_CPU_MODEL_NAME = 'host.cpu.model.name'; +/** + * Stepping or core revisions. + * + * @example 1 + * + * @example r1p1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HOST_CPU_STEPPING = 'host.cpu.stepping'; +/** + * Processor manufacturer identifier. A maximum 12-character string. + * + * @example GenuineIntel + * + * @note [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor ID string in EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character string. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HOST_CPU_VENDOR_ID = 'host.cpu.vendor.id'; +/** + * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. + * + * @example fdbf79e8af94cb7f9e8df36789187052 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HOST_ID = 'host.id'; +/** + * VM image ID or host OS image ID. For Cloud, this value is from the provider. + * + * @example ami-07b06b442921831e5 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HOST_IMAGE_ID = 'host.image.id'; +/** + * Name of the VM image or OS install the host was instantiated from. + * + * @example infra-ami-eks-worker-node-7d4ec78312 + * + * @example CentOS-8-x86_64-1905 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HOST_IMAGE_NAME = 'host.image.name'; +/** + * The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). + * + * @example 0.1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HOST_IMAGE_VERSION = 'host.image.version'; +/** + * Available IP addresses of the host, excluding loopback interfaces. + * + * @example 192.168.1.140 + * + * @example fe80::abc2:4a28:737a:609e + * + * @note IPv4 Addresses **MUST** be specified in dotted-quad notation. IPv6 addresses **MUST** be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HOST_IP = 'host.ip'; +/** + * Available MAC addresses of the host, excluding loopback interfaces. + * + * @example AC-DE-48-23-45-67 + * + * @example AC-DE-48-23-45-67-01-9F + * + * @note MAC Addresses **MUST** be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf): as hyphen-separated octets in uppercase hexadecimal form from most to least significant. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HOST_MAC = 'host.mac'; +/** + * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. + * + * @example opentelemetry-test + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HOST_NAME = 'host.name'; +/** + * Type of host. For Cloud, this must be the machine type. + * + * @example n1-standard-1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HOST_TYPE = 'host.type'; +/** + * Deprecated, use `client.address` instead. + * + * @example "83.164.160.102" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `client.address`. + */ +exports.ATTR_HTTP_CLIENT_IP = 'http.client_ip'; +/** + * State of the HTTP connection in the HTTP connection pool. + * + * @example active + * + * @example idle + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HTTP_CONNECTION_STATE = 'http.connection.state'; +/** + * Enum value "active" for attribute {@link ATTR_HTTP_CONNECTION_STATE}. + */ +exports.HTTP_CONNECTION_STATE_VALUE_ACTIVE = "active"; +/** + * Enum value "idle" for attribute {@link ATTR_HTTP_CONNECTION_STATE}. + */ +exports.HTTP_CONNECTION_STATE_VALUE_IDLE = "idle"; +/** + * Deprecated, use `network.protocol.name` instead. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `network.protocol.name`. + */ +exports.ATTR_HTTP_FLAVOR = 'http.flavor'; +/** + * Enum value "1.0" for attribute {@link ATTR_HTTP_FLAVOR}. + */ +exports.HTTP_FLAVOR_VALUE_HTTP_1_0 = "1.0"; +/** + * Enum value "1.1" for attribute {@link ATTR_HTTP_FLAVOR}. + */ +exports.HTTP_FLAVOR_VALUE_HTTP_1_1 = "1.1"; +/** + * Enum value "2.0" for attribute {@link ATTR_HTTP_FLAVOR}. + */ +exports.HTTP_FLAVOR_VALUE_HTTP_2_0 = "2.0"; +/** + * Enum value "3.0" for attribute {@link ATTR_HTTP_FLAVOR}. + */ +exports.HTTP_FLAVOR_VALUE_HTTP_3_0 = "3.0"; +/** + * Enum value "QUIC" for attribute {@link ATTR_HTTP_FLAVOR}. + */ +exports.HTTP_FLAVOR_VALUE_QUIC = "QUIC"; +/** + * Enum value "SPDY" for attribute {@link ATTR_HTTP_FLAVOR}. + */ +exports.HTTP_FLAVOR_VALUE_SPDY = "SPDY"; +/** + * Deprecated, use one of `server.address`, `client.address` or `http.request.header.host` instead, depending on the usage. + * + * @example www.example.org + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by one of `server.address`, `client.address` or `http.request.header.host`, depending on the usage. + */ +exports.ATTR_HTTP_HOST = 'http.host'; +/** + * Deprecated, use `http.request.method` instead. + * + * @example GET + * + * @example POST + * + * @example HEAD + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `http.request.method`. + */ +exports.ATTR_HTTP_METHOD = 'http.method'; +/** + * The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. + * + * @example 3495 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HTTP_REQUEST_BODY_SIZE = 'http.request.body.size'; +/** + * The total size of the request in bytes. This should be the total number of bytes sent over the wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request body if any. + * + * @example 1437 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HTTP_REQUEST_SIZE = 'http.request.size'; +/** + * Deprecated, use `http.request.header.content-length` instead. + * + * @example 3495 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `http.request.header.content-length`. + */ +exports.ATTR_HTTP_REQUEST_CONTENT_LENGTH = 'http.request_content_length'; +/** + * Deprecated, use `http.request.body.size` instead. + * + * @example 5493 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `http.request.body.size`. + */ +exports.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = 'http.request_content_length_uncompressed'; +/** + * The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. + * + * @example 3495 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HTTP_RESPONSE_BODY_SIZE = 'http.response.body.size'; +/** + * The total size of the response in bytes. This should be the total number of bytes sent over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and response body and trailers if any. + * + * @example 1437 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_HTTP_RESPONSE_SIZE = 'http.response.size'; +/** + * Deprecated, use `http.response.header.content-length` instead. + * + * @example 3495 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `http.response.header.content-length`. + */ +exports.ATTR_HTTP_RESPONSE_CONTENT_LENGTH = 'http.response_content_length'; +/** + * Deprecated, use `http.response.body.size` instead. + * + * @example 5493 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replace by `http.response.body.size`. + */ +exports.ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = 'http.response_content_length_uncompressed'; +/** + * Deprecated, use `url.scheme` instead. + * + * @example http + * + * @example https + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `url.scheme` instead. + */ +exports.ATTR_HTTP_SCHEME = 'http.scheme'; +/** + * Deprecated, use `server.address` instead. + * + * @example example.com + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `server.address`. + */ +exports.ATTR_HTTP_SERVER_NAME = 'http.server_name'; +/** + * Deprecated, use `http.response.status_code` instead. + * + * @example 200 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `http.response.status_code`. + */ +exports.ATTR_HTTP_STATUS_CODE = 'http.status_code'; +/** + * Deprecated, use `url.path` and `url.query` instead. + * + * @example /search?q=OpenTelemetry#SemConv + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Split to `url.path` and `url.query. + */ +exports.ATTR_HTTP_TARGET = 'http.target'; +/** + * Deprecated, use `url.full` instead. + * + * @example https://www.foo.bar/search?q=OpenTelemetry#SemConv + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `url.full`. + */ +exports.ATTR_HTTP_URL = 'http.url'; +/** + * Deprecated, use `user_agent.original` instead. + * + * @example CERN-LineMode/2.15 libwww/2.17b3 + * + * @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 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `user_agent.original`. + */ +exports.ATTR_HTTP_USER_AGENT = 'http.user_agent'; +/** + * Deprecated use the `device.app.lifecycle` event definition including `ios.state` as a payload field instead. + * + * @note The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), and from which the `OS terminology` column values are derived. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Moved to a payload field of `device.app.lifecycle`. + */ +exports.ATTR_IOS_STATE = 'ios.state'; +/** + * Enum value "active" for attribute {@link ATTR_IOS_STATE}. + */ +exports.IOS_STATE_VALUE_ACTIVE = "active"; +/** + * Enum value "background" for attribute {@link ATTR_IOS_STATE}. + */ +exports.IOS_STATE_VALUE_BACKGROUND = "background"; +/** + * Enum value "foreground" for attribute {@link ATTR_IOS_STATE}. + */ +exports.IOS_STATE_VALUE_FOREGROUND = "foreground"; +/** + * Enum value "inactive" for attribute {@link ATTR_IOS_STATE}. + */ +exports.IOS_STATE_VALUE_INACTIVE = "inactive"; +/** + * Enum value "terminate" for attribute {@link ATTR_IOS_STATE}. + */ +exports.IOS_STATE_VALUE_TERMINATE = "terminate"; +/** + * Name of the buffer pool. + * + * @example mapped + * + * @example direct + * + * @note Pool names are generally obtained via [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_JVM_BUFFER_POOL_NAME = 'jvm.buffer.pool.name'; +/** + * The name of the cluster. + * + * @example opentelemetry-cluster + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_CLUSTER_NAME = 'k8s.cluster.name'; +/** + * A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. + * + * @example 218fc5a9-a5f1-4b54-aa05-46717d0ab26d + * + * @note K8s doesn't have support for obtaining a cluster ID. If this is ever + * added, we will recommend collecting the `k8s.cluster.uid` through the + * official APIs. In the meantime, we are able to use the `uid` of the + * `kube-system` namespace as a proxy for cluster ID. Read on for the + * rationale. + * + * Every object created in a K8s cluster is assigned a distinct UID. The + * `kube-system` namespace is used by Kubernetes itself and will exist + * for the lifetime of the cluster. Using the `uid` of the `kube-system` + * namespace is a reasonable proxy for the K8s ClusterID as it will only + * change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are + * UUIDs as standardized by + * [ISO/IEC 9834-8 and ITU-T X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html). + * Which states: + * + * > If generated according to one of the mechanisms defined in Rec. + * ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be + * different from all other UUIDs generated before 3603 A.D., or is + * extremely likely to be different (depending on the mechanism chosen). + * + * Therefore, UIDs between clusters should be extremely unlikely to + * conflict. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_CLUSTER_UID = 'k8s.cluster.uid'; +/** + * The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). + * + * @example redis + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_CONTAINER_NAME = 'k8s.container.name'; +/** + * Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_CONTAINER_RESTART_COUNT = 'k8s.container.restart_count'; +/** + * Last terminated reason of the Container. + * + * @example Evicted + * + * @example Error + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_CONTAINER_STATUS_LAST_TERMINATED_REASON = 'k8s.container.status.last_terminated_reason'; +/** + * The name of the CronJob. + * + * @example opentelemetry + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_CRONJOB_NAME = 'k8s.cronjob.name'; +/** + * The UID of the CronJob. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_CRONJOB_UID = 'k8s.cronjob.uid'; +/** + * The name of the DaemonSet. + * + * @example opentelemetry + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_DAEMONSET_NAME = 'k8s.daemonset.name'; +/** + * The UID of the DaemonSet. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_DAEMONSET_UID = 'k8s.daemonset.uid'; +/** + * The name of the Deployment. + * + * @example opentelemetry + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_DEPLOYMENT_NAME = 'k8s.deployment.name'; +/** + * The UID of the Deployment. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_DEPLOYMENT_UID = 'k8s.deployment.uid'; +/** + * The name of the Job. + * + * @example opentelemetry + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_JOB_NAME = 'k8s.job.name'; +/** + * The UID of the Job. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_JOB_UID = 'k8s.job.uid'; +/** + * The name of the namespace that the pod is running in. + * + * @example default + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_NAMESPACE_NAME = 'k8s.namespace.name'; +/** + * The name of the Node. + * + * @example node-1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_NODE_NAME = 'k8s.node.name'; +/** + * The UID of the Node. + * + * @example 1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_NODE_UID = 'k8s.node.uid'; +/** + * The annotation key-value pairs placed on the Pod, the `` being the annotation name, the value being the annotation value. + * + * @example k8s.pod.annotation.kubernetes.io/enforce-mountable-secrets=true + * + * @example k8s.pod.annotation.mycompany.io/arch=x64 + * + * @example k8s.pod.annotation.data= + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +const ATTR_K8S_POD_ANNOTATION = (key) => `k8s.pod.annotation.${key}`; +exports.ATTR_K8S_POD_ANNOTATION = ATTR_K8S_POD_ANNOTATION; +/** + * The label key-value pairs placed on the Pod, the `` being the label name, the value being the label value. + * + * @example k8s.pod.label.app=my-app + * + * @example k8s.pod.label.mycompany.io/arch=x64 + * + * @example k8s.pod.label.data= + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +const ATTR_K8S_POD_LABEL = (key) => `k8s.pod.label.${key}`; +exports.ATTR_K8S_POD_LABEL = ATTR_K8S_POD_LABEL; +/** + * Deprecated, use `k8s.pod.label` instead. + * + * @example k8s.pod.label.app=my-app + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `k8s.pod.label`. + */ +const ATTR_K8S_POD_LABELS = (key) => `k8s.pod.labels.${key}`; +exports.ATTR_K8S_POD_LABELS = ATTR_K8S_POD_LABELS; +/** + * The name of the Pod. + * + * @example opentelemetry-pod-autoconf + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_POD_NAME = 'k8s.pod.name'; +/** + * The UID of the Pod. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_POD_UID = 'k8s.pod.uid'; +/** + * The name of the ReplicaSet. + * + * @example opentelemetry + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_REPLICASET_NAME = 'k8s.replicaset.name'; +/** + * The UID of the ReplicaSet. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_REPLICASET_UID = 'k8s.replicaset.uid'; +/** + * The name of the StatefulSet. + * + * @example opentelemetry + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_STATEFULSET_NAME = 'k8s.statefulset.name'; +/** + * The UID of the StatefulSet. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_K8S_STATEFULSET_UID = 'k8s.statefulset.uid'; +/** + * The Linux Slab memory state + * + * @example reclaimable + * + * @example unreclaimable + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_LINUX_MEMORY_SLAB_STATE = 'linux.memory.slab.state'; +/** + * Enum value "reclaimable" for attribute {@link ATTR_LINUX_MEMORY_SLAB_STATE}. + */ +exports.LINUX_MEMORY_SLAB_STATE_VALUE_RECLAIMABLE = "reclaimable"; +/** + * Enum value "unreclaimable" for attribute {@link ATTR_LINUX_MEMORY_SLAB_STATE}. + */ +exports.LINUX_MEMORY_SLAB_STATE_VALUE_UNRECLAIMABLE = "unreclaimable"; +/** + * The basename of the file. + * + * @example audit.log + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_LOG_FILE_NAME = 'log.file.name'; +/** + * The basename of the file, with symlinks resolved. + * + * @example uuid.log + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_LOG_FILE_NAME_RESOLVED = 'log.file.name_resolved'; +/** + * The full path to the file. + * + * @example /var/log/mysql/audit.log + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_LOG_FILE_PATH = 'log.file.path'; +/** + * The full path to the file, with symlinks resolved. + * + * @example /var/lib/docker/uuid.log + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_LOG_FILE_PATH_RESOLVED = 'log.file.path_resolved'; +/** + * The stream associated with the log. See below for a list of well-known values. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_LOG_IOSTREAM = 'log.iostream'; +/** + * Enum value "stderr" for attribute {@link ATTR_LOG_IOSTREAM}. + */ +exports.LOG_IOSTREAM_VALUE_STDERR = "stderr"; +/** + * Enum value "stdout" for attribute {@link ATTR_LOG_IOSTREAM}. + */ +exports.LOG_IOSTREAM_VALUE_STDOUT = "stdout"; +/** + * The complete orignal Log Record. + * + * @example 77 <86>1 2015-08-06T21:58:59.694Z 192.168.2.133 inactive - - - Something happened + * + * @example [INFO] 8/3/24 12:34:56 Something happened + * + * @note This value **MAY** be added when processing a Log Record which was originally transmitted as a string or equivalent data type AND the Body field of the Log Record does not contain the same value. (e.g. a syslog or a log record read from a file.) + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_LOG_RECORD_ORIGINAL = 'log.record.original'; +/** + * A unique identifier for the Log Record. + * + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + * + * @note If an id is provided, other log records with the same id will be considered duplicates and can be removed safely. This means, that two distinguishable log records **MUST** have different values. + * The id **MAY** be an [Universally Unique Lexicographically Sortable Identifier (ULID)](https://github.com/ulid/spec), but other identifiers (e.g. UUID) may be used as needed. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_LOG_RECORD_UID = 'log.record.uid'; +/** + * Deprecated, use `rpc.message.compressed_size` instead. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `rpc.message.compressed_size`. + */ +exports.ATTR_MESSAGE_COMPRESSED_SIZE = 'message.compressed_size'; +/** + * Deprecated, use `rpc.message.id` instead. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `rpc.message.id`. + */ +exports.ATTR_MESSAGE_ID = 'message.id'; +/** + * Deprecated, use `rpc.message.type` instead. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `rpc.message.type`. + */ +exports.ATTR_MESSAGE_TYPE = 'message.type'; +/** + * Enum value "RECEIVED" for attribute {@link ATTR_MESSAGE_TYPE}. + */ +exports.MESSAGE_TYPE_VALUE_RECEIVED = "RECEIVED"; +/** + * Enum value "SENT" for attribute {@link ATTR_MESSAGE_TYPE}. + */ +exports.MESSAGE_TYPE_VALUE_SENT = "SENT"; +/** + * Deprecated, use `rpc.message.uncompressed_size` instead. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `rpc.message.uncompressed_size`. + */ +exports.ATTR_MESSAGE_UNCOMPRESSED_SIZE = 'message.uncompressed_size'; +/** + * The number of messages sent, received, or processed in the scope of the batching operation. + * + * @example 0 + * + * @example 1 + * + * @example 2 + * + * @note Instrumentations **SHOULD** **NOT** set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations **SHOULD** use `messaging.batch.message_count` for batching APIs and **SHOULD** **NOT** use it for single-message APIs. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_BATCH_MESSAGE_COUNT = 'messaging.batch.message_count'; +/** + * A unique identifier for the client that consumes or produces a message. + * + * @example client-5 + * + * @example myhost@8742@s8083jm + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_CLIENT_ID = 'messaging.client.id'; +/** + * The name of the consumer group with which a consumer is associated. + * + * @example my-group + * + * @example indexer + * + * @note Semantic conventions for individual messaging systems **SHOULD** document whether `messaging.consumer.group.name` is applicable and what it means in the context of that system. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_CONSUMER_GROUP_NAME = 'messaging.consumer.group.name'; +/** + * A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_DESTINATION_ANONYMOUS = 'messaging.destination.anonymous'; +/** + * The message destination name + * + * @example MyQueue + * + * @example MyTopic + * + * @note Destination name **SHOULD** uniquely identify a specific queue, topic or other entity within the broker. If + * the broker doesn't have such notion, the destination name **SHOULD** uniquely identify the broker. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_DESTINATION_NAME = 'messaging.destination.name'; +/** + * The identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`. + * + * @example "1" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_DESTINATION_PARTITION_ID = 'messaging.destination.partition.id'; +/** + * The name of the destination subscription from which a message is consumed. + * + * @example subscription-a + * + * @note Semantic conventions for individual messaging systems **SHOULD** document whether `messaging.destination.subscription.name` is applicable and what it means in the context of that system. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_DESTINATION_SUBSCRIPTION_NAME = 'messaging.destination.subscription.name'; +/** + * Low cardinality representation of the messaging destination name + * + * @example /customers/{customerId} + * + * @note Destination names could be constructed from templates. An example would be a destination name involving a user name or product id. Although the destination name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_DESTINATION_TEMPLATE = 'messaging.destination.template'; +/** + * A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_DESTINATION_TEMPORARY = 'messaging.destination.temporary'; +/** + * Deprecated, no replacement at this time. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * No replacement at this time. + */ +exports.ATTR_MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = 'messaging.destination_publish.anonymous'; +/** + * Deprecated, no replacement at this time. + * + * @example MyQueue + * + * @example MyTopic + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * No replacement at this time. + */ +exports.ATTR_MESSAGING_DESTINATION_PUBLISH_NAME = 'messaging.destination_publish.name'; +/** + * Deprecated, use `messaging.consumer.group.name` instead. + * + * @example "$Default" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `messaging.consumer.group.name`. + */ +exports.ATTR_MESSAGING_EVENTHUBS_CONSUMER_GROUP = 'messaging.eventhubs.consumer.group'; +/** + * The UTC epoch seconds at which the message has been accepted and stored in the entity. + * + * @example 1701393730 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME = 'messaging.eventhubs.message.enqueued_time'; +/** + * The ack deadline in seconds set for the modify ack deadline request. + * + * @example 10 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_GCP_PUBSUB_MESSAGE_ACK_DEADLINE = 'messaging.gcp_pubsub.message.ack_deadline'; +/** + * The ack id for a given message. + * + * @example "ack_id" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_GCP_PUBSUB_MESSAGE_ACK_ID = 'messaging.gcp_pubsub.message.ack_id'; +/** + * The delivery attempt for a given message. + * + * @example 2 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_GCP_PUBSUB_MESSAGE_DELIVERY_ATTEMPT = 'messaging.gcp_pubsub.message.delivery_attempt'; +/** + * The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. + * + * @example "ordering_key" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY = 'messaging.gcp_pubsub.message.ordering_key'; +/** + * Deprecated, use `messaging.consumer.group.name` instead. + * + * @example "my-group" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `messaging.consumer.group.name`. + */ +exports.ATTR_MESSAGING_KAFKA_CONSUMER_GROUP = 'messaging.kafka.consumer.group'; +/** + * Deprecated, use `messaging.destination.partition.id` instead. + * + * @example 2 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `messaging.destination.partition.id`. + */ +exports.ATTR_MESSAGING_KAFKA_DESTINATION_PARTITION = 'messaging.kafka.destination.partition'; +/** + * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute **MUST** **NOT** be set. + * + * @example "myKey" + * + * @note If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_KAFKA_MESSAGE_KEY = 'messaging.kafka.message.key'; +/** + * Deprecated, use `messaging.kafka.offset` instead. + * + * @example 42 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `messaging.kafka.offset`. + */ +exports.ATTR_MESSAGING_KAFKA_MESSAGE_OFFSET = 'messaging.kafka.message.offset'; +/** + * A boolean that is true if the message is a tombstone. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE = 'messaging.kafka.message.tombstone'; +/** + * The offset of a record in the corresponding Kafka partition. + * + * @example 42 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_KAFKA_OFFSET = 'messaging.kafka.offset'; +/** + * The size of the message body in bytes. + * + * @example 1439 + * + * @note This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed + * body size should be used. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_MESSAGE_BODY_SIZE = 'messaging.message.body.size'; +/** + * The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". + * + * @example "MyConversationId" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_MESSAGE_CONVERSATION_ID = 'messaging.message.conversation_id'; +/** + * The size of the message body and metadata in bytes. + * + * @example 2738 + * + * @note This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed + * size should be used. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_MESSAGE_ENVELOPE_SIZE = 'messaging.message.envelope.size'; +/** + * A value used by the messaging system as an identifier for the message, represented as a string. + * + * @example "452a7c7c7c7048c2f887f61572b18fc2" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_MESSAGE_ID = 'messaging.message.id'; +/** + * Deprecated, use `messaging.operation.type` instead. + * + * @example publish + * + * @example create + * + * @example process + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `messaging.operation.type`. + */ +exports.ATTR_MESSAGING_OPERATION = 'messaging.operation'; +/** + * The system-specific name of the messaging operation. + * + * @example ack + * + * @example nack + * + * @example send + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_OPERATION_NAME = 'messaging.operation.name'; +/** + * A string identifying the type of the messaging operation. + * + * @note If a custom value is used, it **MUST** be of low cardinality. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_OPERATION_TYPE = 'messaging.operation.type'; +/** + * Enum value "create" for attribute {@link ATTR_MESSAGING_OPERATION_TYPE}. + */ +exports.MESSAGING_OPERATION_TYPE_VALUE_CREATE = "create"; +/** + * Enum value "deliver" for attribute {@link ATTR_MESSAGING_OPERATION_TYPE}. + */ +exports.MESSAGING_OPERATION_TYPE_VALUE_DELIVER = "deliver"; +/** + * Enum value "process" for attribute {@link ATTR_MESSAGING_OPERATION_TYPE}. + */ +exports.MESSAGING_OPERATION_TYPE_VALUE_PROCESS = "process"; +/** + * Enum value "publish" for attribute {@link ATTR_MESSAGING_OPERATION_TYPE}. + */ +exports.MESSAGING_OPERATION_TYPE_VALUE_PUBLISH = "publish"; +/** + * Enum value "receive" for attribute {@link ATTR_MESSAGING_OPERATION_TYPE}. + */ +exports.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE = "receive"; +/** + * Enum value "settle" for attribute {@link ATTR_MESSAGING_OPERATION_TYPE}. + */ +exports.MESSAGING_OPERATION_TYPE_VALUE_SETTLE = "settle"; +/** + * RabbitMQ message routing key. + * + * @example "myKey" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = 'messaging.rabbitmq.destination.routing_key'; +/** + * RabbitMQ message delivery tag + * + * @example 123 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG = 'messaging.rabbitmq.message.delivery_tag'; +/** + * Deprecated, use `messaging.consumer.group.name` instead. + * + * @example "myConsumerGroup" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `messaging.consumer.group.name` on the consumer spans. No replacement for producer spans. + */ +exports.ATTR_MESSAGING_ROCKETMQ_CLIENT_GROUP = 'messaging.rocketmq.client_group'; +/** + * Model of message consumption. This only applies to consumer spans. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = 'messaging.rocketmq.consumption_model'; +/** + * Enum value "broadcasting" for attribute {@link ATTR_MESSAGING_ROCKETMQ_CONSUMPTION_MODEL}. + */ +exports.MESSAGING_ROCKETMQ_CONSUMPTION_MODEL_VALUE_BROADCASTING = "broadcasting"; +/** + * Enum value "clustering" for attribute {@link ATTR_MESSAGING_ROCKETMQ_CONSUMPTION_MODEL}. + */ +exports.MESSAGING_ROCKETMQ_CONSUMPTION_MODEL_VALUE_CLUSTERING = "clustering"; +/** + * The delay time level for delay message, which determines the message delay time. + * + * @example 3 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = 'messaging.rocketmq.message.delay_time_level'; +/** + * The timestamp in milliseconds that the delay message is expected to be delivered to consumer. + * + * @example 1665987217045 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = 'messaging.rocketmq.message.delivery_timestamp'; +/** + * It is essential for FIFO message. Messages that belong to the same message group are always processed one by one within the same consumer group. + * + * @example "myMessageGroup" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_GROUP = 'messaging.rocketmq.message.group'; +/** + * Key(s) of message, another way to mark message besides message id. + * + * @example keyA + * + * @example keyB + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_KEYS = 'messaging.rocketmq.message.keys'; +/** + * The secondary classifier of message besides topic. + * + * @example "tagA" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_TAG = 'messaging.rocketmq.message.tag'; +/** + * Type of message. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_TYPE = 'messaging.rocketmq.message.type'; +/** + * Enum value "delay" for attribute {@link ATTR_MESSAGING_ROCKETMQ_MESSAGE_TYPE}. + */ +exports.MESSAGING_ROCKETMQ_MESSAGE_TYPE_VALUE_DELAY = "delay"; +/** + * Enum value "fifo" for attribute {@link ATTR_MESSAGING_ROCKETMQ_MESSAGE_TYPE}. + */ +exports.MESSAGING_ROCKETMQ_MESSAGE_TYPE_VALUE_FIFO = "fifo"; +/** + * Enum value "normal" for attribute {@link ATTR_MESSAGING_ROCKETMQ_MESSAGE_TYPE}. + */ +exports.MESSAGING_ROCKETMQ_MESSAGE_TYPE_VALUE_NORMAL = "normal"; +/** + * Enum value "transaction" for attribute {@link ATTR_MESSAGING_ROCKETMQ_MESSAGE_TYPE}. + */ +exports.MESSAGING_ROCKETMQ_MESSAGE_TYPE_VALUE_TRANSACTION = "transaction"; +/** + * Namespace of RocketMQ resources, resources in different namespaces are individual. + * + * @example "myNamespace" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_ROCKETMQ_NAMESPACE = 'messaging.rocketmq.namespace'; +/** + * Deprecated, use `messaging.servicebus.destination.subscription_name` instead. + * + * @example "subscription-a" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `messaging.servicebus.destination.subscription_name`. + */ +exports.ATTR_MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME = 'messaging.servicebus.destination.subscription_name'; +/** + * Describes the [settlement type](https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_SERVICEBUS_DISPOSITION_STATUS = 'messaging.servicebus.disposition_status'; +/** + * Enum value "abandon" for attribute {@link ATTR_MESSAGING_SERVICEBUS_DISPOSITION_STATUS}. + */ +exports.MESSAGING_SERVICEBUS_DISPOSITION_STATUS_VALUE_ABANDON = "abandon"; +/** + * Enum value "complete" for attribute {@link ATTR_MESSAGING_SERVICEBUS_DISPOSITION_STATUS}. + */ +exports.MESSAGING_SERVICEBUS_DISPOSITION_STATUS_VALUE_COMPLETE = "complete"; +/** + * Enum value "dead_letter" for attribute {@link ATTR_MESSAGING_SERVICEBUS_DISPOSITION_STATUS}. + */ +exports.MESSAGING_SERVICEBUS_DISPOSITION_STATUS_VALUE_DEAD_LETTER = "dead_letter"; +/** + * Enum value "defer" for attribute {@link ATTR_MESSAGING_SERVICEBUS_DISPOSITION_STATUS}. + */ +exports.MESSAGING_SERVICEBUS_DISPOSITION_STATUS_VALUE_DEFER = "defer"; +/** + * Number of deliveries that have been attempted for this message. + * + * @example 2 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_SERVICEBUS_MESSAGE_DELIVERY_COUNT = 'messaging.servicebus.message.delivery_count'; +/** + * The UTC epoch seconds at which the message has been accepted and stored in the entity. + * + * @example 1701393730 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME = 'messaging.servicebus.message.enqueued_time'; +/** + * The messaging system as identified by the client instrumentation. + * + * @note The actual messaging system may differ from the one known by the client. For example, when using Kafka client libraries to communicate with Azure Event Hubs, the `messaging.system` is set to `kafka` based on the instrumentation's best knowledge. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_MESSAGING_SYSTEM = 'messaging.system'; +/** + * Enum value "activemq" for attribute {@link ATTR_MESSAGING_SYSTEM}. + */ +exports.MESSAGING_SYSTEM_VALUE_ACTIVEMQ = "activemq"; +/** + * Enum value "aws_sqs" for attribute {@link ATTR_MESSAGING_SYSTEM}. + */ +exports.MESSAGING_SYSTEM_VALUE_AWS_SQS = "aws_sqs"; +/** + * Enum value "eventgrid" for attribute {@link ATTR_MESSAGING_SYSTEM}. + */ +exports.MESSAGING_SYSTEM_VALUE_EVENTGRID = "eventgrid"; +/** + * Enum value "eventhubs" for attribute {@link ATTR_MESSAGING_SYSTEM}. + */ +exports.MESSAGING_SYSTEM_VALUE_EVENTHUBS = "eventhubs"; +/** + * Enum value "gcp_pubsub" for attribute {@link ATTR_MESSAGING_SYSTEM}. + */ +exports.MESSAGING_SYSTEM_VALUE_GCP_PUBSUB = "gcp_pubsub"; +/** + * Enum value "jms" for attribute {@link ATTR_MESSAGING_SYSTEM}. + */ +exports.MESSAGING_SYSTEM_VALUE_JMS = "jms"; +/** + * Enum value "kafka" for attribute {@link ATTR_MESSAGING_SYSTEM}. + */ +exports.MESSAGING_SYSTEM_VALUE_KAFKA = "kafka"; +/** + * Enum value "pulsar" for attribute {@link ATTR_MESSAGING_SYSTEM}. + */ +exports.MESSAGING_SYSTEM_VALUE_PULSAR = "pulsar"; +/** + * Enum value "rabbitmq" for attribute {@link ATTR_MESSAGING_SYSTEM}. + */ +exports.MESSAGING_SYSTEM_VALUE_RABBITMQ = "rabbitmq"; +/** + * Enum value "rocketmq" for attribute {@link ATTR_MESSAGING_SYSTEM}. + */ +exports.MESSAGING_SYSTEM_VALUE_ROCKETMQ = "rocketmq"; +/** + * Enum value "servicebus" for attribute {@link ATTR_MESSAGING_SYSTEM}. + */ +exports.MESSAGING_SYSTEM_VALUE_SERVICEBUS = "servicebus"; +/** + * Deprecated, use `network.local.address`. + * + * @example "192.168.0.1" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `network.local.address`. + */ +exports.ATTR_NET_HOST_IP = 'net.host.ip'; +/** + * Deprecated, use `server.address`. + * + * @example example.com + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `server.address`. + */ +exports.ATTR_NET_HOST_NAME = 'net.host.name'; +/** + * Deprecated, use `server.port`. + * + * @example 8080 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `server.port`. + */ +exports.ATTR_NET_HOST_PORT = 'net.host.port'; +/** + * Deprecated, use `network.peer.address`. + * + * @example "127.0.0.1" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `network.peer.address`. + */ +exports.ATTR_NET_PEER_IP = 'net.peer.ip'; +/** + * Deprecated, use `server.address` on client spans and `client.address` on server spans. + * + * @example example.com + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `server.address` on client spans and `client.address` on server spans. + */ +exports.ATTR_NET_PEER_NAME = 'net.peer.name'; +/** + * Deprecated, use `server.port` on client spans and `client.port` on server spans. + * + * @example 8080 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `server.port` on client spans and `client.port` on server spans. + */ +exports.ATTR_NET_PEER_PORT = 'net.peer.port'; +/** + * Deprecated, use `network.protocol.name`. + * + * @example amqp + * + * @example http + * + * @example mqtt + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `network.protocol.name`. + */ +exports.ATTR_NET_PROTOCOL_NAME = 'net.protocol.name'; +/** + * Deprecated, use `network.protocol.version`. + * + * @example "3.1.1" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `network.protocol.version`. + */ +exports.ATTR_NET_PROTOCOL_VERSION = 'net.protocol.version'; +/** + * Deprecated, use `network.transport` and `network.type`. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Split to `network.transport` and `network.type`. + */ +exports.ATTR_NET_SOCK_FAMILY = 'net.sock.family'; +/** + * Enum value "inet" for attribute {@link ATTR_NET_SOCK_FAMILY}. + */ +exports.NET_SOCK_FAMILY_VALUE_INET = "inet"; +/** + * Enum value "inet6" for attribute {@link ATTR_NET_SOCK_FAMILY}. + */ +exports.NET_SOCK_FAMILY_VALUE_INET6 = "inet6"; +/** + * Enum value "unix" for attribute {@link ATTR_NET_SOCK_FAMILY}. + */ +exports.NET_SOCK_FAMILY_VALUE_UNIX = "unix"; +/** + * Deprecated, use `network.local.address`. + * + * @example /var/my.sock + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `network.local.address`. + */ +exports.ATTR_NET_SOCK_HOST_ADDR = 'net.sock.host.addr'; +/** + * Deprecated, use `network.local.port`. + * + * @example 8080 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `network.local.port`. + */ +exports.ATTR_NET_SOCK_HOST_PORT = 'net.sock.host.port'; +/** + * Deprecated, use `network.peer.address`. + * + * @example 192.168.0.1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `network.peer.address`. + */ +exports.ATTR_NET_SOCK_PEER_ADDR = 'net.sock.peer.addr'; +/** + * Deprecated, no replacement at this time. + * + * @example /var/my.sock + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Removed. + */ +exports.ATTR_NET_SOCK_PEER_NAME = 'net.sock.peer.name'; +/** + * Deprecated, use `network.peer.port`. + * + * @example 65531 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `network.peer.port`. + */ +exports.ATTR_NET_SOCK_PEER_PORT = 'net.sock.peer.port'; +/** + * Deprecated, use `network.transport`. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `network.transport`. + */ +exports.ATTR_NET_TRANSPORT = 'net.transport'; +/** + * Enum value "inproc" for attribute {@link ATTR_NET_TRANSPORT}. + */ +exports.NET_TRANSPORT_VALUE_INPROC = "inproc"; +/** + * Enum value "ip_tcp" for attribute {@link ATTR_NET_TRANSPORT}. + */ +exports.NET_TRANSPORT_VALUE_IP_TCP = "ip_tcp"; +/** + * Enum value "ip_udp" for attribute {@link ATTR_NET_TRANSPORT}. + */ +exports.NET_TRANSPORT_VALUE_IP_UDP = "ip_udp"; +/** + * Enum value "other" for attribute {@link ATTR_NET_TRANSPORT}. + */ +exports.NET_TRANSPORT_VALUE_OTHER = "other"; +/** + * Enum value "pipe" for attribute {@link ATTR_NET_TRANSPORT}. + */ +exports.NET_TRANSPORT_VALUE_PIPE = "pipe"; +/** + * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. + * + * @example "DE" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_NETWORK_CARRIER_ICC = 'network.carrier.icc'; +/** + * The mobile carrier country code. + * + * @example "310" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_NETWORK_CARRIER_MCC = 'network.carrier.mcc'; +/** + * The mobile carrier network code. + * + * @example "001" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_NETWORK_CARRIER_MNC = 'network.carrier.mnc'; +/** + * The name of the mobile carrier. + * + * @example "sprint" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_NETWORK_CARRIER_NAME = 'network.carrier.name'; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @example "LTE" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_NETWORK_CONNECTION_SUBTYPE = 'network.connection.subtype'; +/** + * Enum value "cdma" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_CDMA = "cdma"; +/** + * Enum value "cdma2000_1xrtt" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_CDMA2000_1XRTT = "cdma2000_1xrtt"; +/** + * Enum value "edge" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_EDGE = "edge"; +/** + * Enum value "ehrpd" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_EHRPD = "ehrpd"; +/** + * Enum value "evdo_0" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_EVDO_0 = "evdo_0"; +/** + * Enum value "evdo_a" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_EVDO_A = "evdo_a"; +/** + * Enum value "evdo_b" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_EVDO_B = "evdo_b"; +/** + * Enum value "gprs" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_GPRS = "gprs"; +/** + * Enum value "gsm" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_GSM = "gsm"; +/** + * Enum value "hsdpa" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_HSDPA = "hsdpa"; +/** + * Enum value "hspa" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_HSPA = "hspa"; +/** + * Enum value "hspap" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_HSPAP = "hspap"; +/** + * Enum value "hsupa" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_HSUPA = "hsupa"; +/** + * Enum value "iden" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_IDEN = "iden"; +/** + * Enum value "iwlan" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_IWLAN = "iwlan"; +/** + * Enum value "lte" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_LTE = "lte"; +/** + * Enum value "lte_ca" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_LTE_CA = "lte_ca"; +/** + * Enum value "nr" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_NR = "nr"; +/** + * Enum value "nrnsa" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_NRNSA = "nrnsa"; +/** + * Enum value "td_scdma" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_TD_SCDMA = "td_scdma"; +/** + * Enum value "umts" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. + */ +exports.NETWORK_CONNECTION_SUBTYPE_VALUE_UMTS = "umts"; +/** + * The internet connection type. + * + * @example "wifi" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_NETWORK_CONNECTION_TYPE = 'network.connection.type'; +/** + * Enum value "cell" for attribute {@link ATTR_NETWORK_CONNECTION_TYPE}. + */ +exports.NETWORK_CONNECTION_TYPE_VALUE_CELL = "cell"; +/** + * Enum value "unavailable" for attribute {@link ATTR_NETWORK_CONNECTION_TYPE}. + */ +exports.NETWORK_CONNECTION_TYPE_VALUE_UNAVAILABLE = "unavailable"; +/** + * Enum value "unknown" for attribute {@link ATTR_NETWORK_CONNECTION_TYPE}. + */ +exports.NETWORK_CONNECTION_TYPE_VALUE_UNKNOWN = "unknown"; +/** + * Enum value "wifi" for attribute {@link ATTR_NETWORK_CONNECTION_TYPE}. + */ +exports.NETWORK_CONNECTION_TYPE_VALUE_WIFI = "wifi"; +/** + * Enum value "wired" for attribute {@link ATTR_NETWORK_CONNECTION_TYPE}. + */ +exports.NETWORK_CONNECTION_TYPE_VALUE_WIRED = "wired"; +/** + * The network IO operation direction. + * + * @example transmit + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_NETWORK_IO_DIRECTION = 'network.io.direction'; +/** + * Enum value "receive" for attribute {@link ATTR_NETWORK_IO_DIRECTION}. + */ +exports.NETWORK_IO_DIRECTION_VALUE_RECEIVE = "receive"; +/** + * Enum value "transmit" for attribute {@link ATTR_NETWORK_IO_DIRECTION}. + */ +exports.NETWORK_IO_DIRECTION_VALUE_TRANSMIT = "transmit"; +/** + * The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. + * + * @example sha256:e4ca62c0d62f3e886e684806dfe9d4e0cda60d54986898173c1083856cfda0f4 + * + * @note Follows [OCI Image Manifest Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), and specifically the [Digest property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests). + * An example can be found in [Example Image Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_OCI_MANIFEST_DIGEST = 'oci.manifest.digest'; +/** + * Parent-child Reference type + * + * @note The causal relationship between a child Span and a parent Span. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_OPENTRACING_REF_TYPE = 'opentracing.ref_type'; +/** + * Enum value "child_of" for attribute {@link ATTR_OPENTRACING_REF_TYPE}. + */ +exports.OPENTRACING_REF_TYPE_VALUE_CHILD_OF = "child_of"; +/** + * Enum value "follows_from" for attribute {@link ATTR_OPENTRACING_REF_TYPE}. + */ +exports.OPENTRACING_REF_TYPE_VALUE_FOLLOWS_FROM = "follows_from"; +/** + * Unique identifier for a particular build or compilation of the operating system. + * + * @example TQ3C.230805.001.B2 + * + * @example 20E247 + * + * @example 22621 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_OS_BUILD_ID = 'os.build_id'; +/** + * Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. + * + * @example Microsoft Windows [Version 10.0.18363.778] + * + * @example Ubuntu 18.04.1 LTS + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_OS_DESCRIPTION = 'os.description'; +/** + * Human readable operating system name. + * + * @example iOS + * + * @example Android + * + * @example Ubuntu + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_OS_NAME = 'os.name'; +/** + * The operating system type. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_OS_TYPE = 'os.type'; +/** + * Enum value "aix" for attribute {@link ATTR_OS_TYPE}. + */ +exports.OS_TYPE_VALUE_AIX = "aix"; +/** + * Enum value "darwin" for attribute {@link ATTR_OS_TYPE}. + */ +exports.OS_TYPE_VALUE_DARWIN = "darwin"; +/** + * Enum value "dragonflybsd" for attribute {@link ATTR_OS_TYPE}. + */ +exports.OS_TYPE_VALUE_DRAGONFLYBSD = "dragonflybsd"; +/** + * Enum value "freebsd" for attribute {@link ATTR_OS_TYPE}. + */ +exports.OS_TYPE_VALUE_FREEBSD = "freebsd"; +/** + * Enum value "hpux" for attribute {@link ATTR_OS_TYPE}. + */ +exports.OS_TYPE_VALUE_HPUX = "hpux"; +/** + * Enum value "linux" for attribute {@link ATTR_OS_TYPE}. + */ +exports.OS_TYPE_VALUE_LINUX = "linux"; +/** + * Enum value "netbsd" for attribute {@link ATTR_OS_TYPE}. + */ +exports.OS_TYPE_VALUE_NETBSD = "netbsd"; +/** + * Enum value "openbsd" for attribute {@link ATTR_OS_TYPE}. + */ +exports.OS_TYPE_VALUE_OPENBSD = "openbsd"; +/** + * Enum value "solaris" for attribute {@link ATTR_OS_TYPE}. + */ +exports.OS_TYPE_VALUE_SOLARIS = "solaris"; +/** + * Enum value "windows" for attribute {@link ATTR_OS_TYPE}. + */ +exports.OS_TYPE_VALUE_WINDOWS = "windows"; +/** + * Enum value "z_os" for attribute {@link ATTR_OS_TYPE}. + */ +exports.OS_TYPE_VALUE_Z_OS = "z_os"; +/** + * The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). + * + * @example 14.2.1 + * + * @example 18.04.1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_OS_VERSION = 'os.version'; +/** + + * + * @example io.opentelemetry.contrib.mongodb + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * use the `otel.scope.name` attribute. + */ +exports.ATTR_OTEL_LIBRARY_NAME = 'otel.library.name'; +/** + + * + * @example 1.0.0 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * use the `otel.scope.version` attribute. + */ +exports.ATTR_OTEL_LIBRARY_VERSION = 'otel.library.version'; +/** + * The [`service.name`](/docs/resource/README.md#service) of the remote service. **SHOULD** be equal to the actual `service.name` resource attribute of the remote service if any. + * + * @example "AuthTokenCache" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PEER_SERVICE = 'peer.service'; +/** + * Deprecated, use `db.client.connection.pool.name` instead. + * + * @example myDataSource + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.client.connection.pool.name`. + */ +exports.ATTR_POOL_NAME = 'pool.name'; +/** + * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. + * + * @example cmd/otelcol + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_COMMAND = 'process.command'; +/** + * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. + * + * @example cmd/otecol + * + * @example --config=config.yaml + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_COMMAND_ARGS = 'process.command_args'; +/** + * The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. + * + * @example C:\cmd\otecol --config="my directory\config.yaml" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_COMMAND_LINE = 'process.command_line'; +/** + * Specifies whether the context switches for this data point were voluntary or involuntary. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_CONTEXT_SWITCH_TYPE = 'process.context_switch_type'; +/** + * Enum value "involuntary" for attribute {@link ATTR_PROCESS_CONTEXT_SWITCH_TYPE}. + */ +exports.PROCESS_CONTEXT_SWITCH_TYPE_VALUE_INVOLUNTARY = "involuntary"; +/** + * Enum value "voluntary" for attribute {@link ATTR_PROCESS_CONTEXT_SWITCH_TYPE}. + */ +exports.PROCESS_CONTEXT_SWITCH_TYPE_VALUE_VOLUNTARY = "voluntary"; +/** + * Deprecated, use `cpu.mode` instead. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `cpu.mode` + */ +exports.ATTR_PROCESS_CPU_STATE = 'process.cpu.state'; +/** + * Enum value "system" for attribute {@link ATTR_PROCESS_CPU_STATE}. + */ +exports.PROCESS_CPU_STATE_VALUE_SYSTEM = "system"; +/** + * Enum value "user" for attribute {@link ATTR_PROCESS_CPU_STATE}. + */ +exports.PROCESS_CPU_STATE_VALUE_USER = "user"; +/** + * Enum value "wait" for attribute {@link ATTR_PROCESS_CPU_STATE}. + */ +exports.PROCESS_CPU_STATE_VALUE_WAIT = "wait"; +/** + * The date and time the process was created, in ISO 8601 format. + * + * @example 2023-11-21T09:25:34.853Z + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_CREATION_TIME = 'process.creation.time'; +/** + * The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. + * + * @example otelcol + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_EXECUTABLE_NAME = 'process.executable.name'; +/** + * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. + * + * @example /usr/bin/cmd/otelcol + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_EXECUTABLE_PATH = 'process.executable.path'; +/** + * The exit code of the process. + * + * @example 127 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_EXIT_CODE = 'process.exit.code'; +/** + * The date and time the process exited, in ISO 8601 format. + * + * @example 2023-11-21T09:26:12.315Z + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_EXIT_TIME = 'process.exit.time'; +/** + * The PID of the process's group leader. This is also the process group ID (PGID) of the process. + * + * @example 23 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_GROUP_LEADER_PID = 'process.group_leader.pid'; +/** + * Whether the process is connected to an interactive shell. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_INTERACTIVE = 'process.interactive'; +/** + * The username of the user that owns the process. + * + * @example root + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_OWNER = 'process.owner'; +/** + * The type of page fault for this data point. Type `major` is for major/hard page faults, and `minor` is for minor/soft page faults. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_PAGING_FAULT_TYPE = 'process.paging.fault_type'; +/** + * Enum value "major" for attribute {@link ATTR_PROCESS_PAGING_FAULT_TYPE}. + */ +exports.PROCESS_PAGING_FAULT_TYPE_VALUE_MAJOR = "major"; +/** + * Enum value "minor" for attribute {@link ATTR_PROCESS_PAGING_FAULT_TYPE}. + */ +exports.PROCESS_PAGING_FAULT_TYPE_VALUE_MINOR = "minor"; +/** + * Parent Process identifier (PPID). + * + * @example 111 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_PARENT_PID = 'process.parent_pid'; +/** + * Process identifier (PID). + * + * @example 1234 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_PID = 'process.pid'; +/** + * The real user ID (RUID) of the process. + * + * @example 1000 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_REAL_USER_ID = 'process.real_user.id'; +/** + * The username of the real user of the process. + * + * @example operator + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_REAL_USER_NAME = 'process.real_user.name'; +/** + * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. + * + * @example "Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = 'process.runtime.description'; +/** + * The name of the runtime of this process. + * + * @example OpenJDK Runtime Environment + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_RUNTIME_NAME = 'process.runtime.name'; +/** + * The version of the runtime of this process, as returned by the runtime without modification. + * + * @example "14.0.2" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_RUNTIME_VERSION = 'process.runtime.version'; +/** + * The saved user ID (SUID) of the process. + * + * @example 1002 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_SAVED_USER_ID = 'process.saved_user.id'; +/** + * The username of the saved user. + * + * @example operator + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_SAVED_USER_NAME = 'process.saved_user.name'; +/** + * The PID of the process's session leader. This is also the session ID (SID) of the process. + * + * @example 14 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_SESSION_LEADER_PID = 'process.session_leader.pid'; +/** + * The effective user ID (EUID) of the process. + * + * @example 1001 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_USER_ID = 'process.user.id'; +/** + * The username of the effective user of the process. + * + * @example root + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_USER_NAME = 'process.user.name'; +/** + * Virtual process identifier. + * + * @example 12 + * + * @note The process ID within a PID namespace. This is not necessarily unique across all processes on the host but it is unique within the process namespace that the process exists within. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_PROCESS_VPID = 'process.vpid'; +/** + * The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_RPC_CONNECT_RPC_ERROR_CODE = 'rpc.connect_rpc.error_code'; +/** + * Enum value "aborted" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. + */ +exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_ABORTED = "aborted"; +/** + * Enum value "already_exists" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. + */ +exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_ALREADY_EXISTS = "already_exists"; +/** + * Enum value "cancelled" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. + */ +exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_CANCELLED = "cancelled"; +/** + * Enum value "data_loss" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. + */ +exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_DATA_LOSS = "data_loss"; +/** + * Enum value "deadline_exceeded" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. + */ +exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_DEADLINE_EXCEEDED = "deadline_exceeded"; +/** + * Enum value "failed_precondition" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. + */ +exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_FAILED_PRECONDITION = "failed_precondition"; +/** + * Enum value "internal" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. + */ +exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_INTERNAL = "internal"; +/** + * Enum value "invalid_argument" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. + */ +exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_INVALID_ARGUMENT = "invalid_argument"; +/** + * Enum value "not_found" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. + */ +exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_NOT_FOUND = "not_found"; +/** + * Enum value "out_of_range" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. + */ +exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_OUT_OF_RANGE = "out_of_range"; +/** + * Enum value "permission_denied" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. + */ +exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_PERMISSION_DENIED = "permission_denied"; +/** + * Enum value "resource_exhausted" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. + */ +exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_RESOURCE_EXHAUSTED = "resource_exhausted"; +/** + * Enum value "unauthenticated" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. + */ +exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_UNAUTHENTICATED = "unauthenticated"; +/** + * Enum value "unavailable" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. + */ +exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_UNAVAILABLE = "unavailable"; +/** + * Enum value "unimplemented" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. + */ +exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_UNIMPLEMENTED = "unimplemented"; +/** + * Enum value "unknown" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. + */ +exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_UNKNOWN = "unknown"; +/** + * Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. + * + * @example rpc.request.metadata.my-custom-metadata-attribute=["1.2.3.4", "1.2.3.5"] + * + * @note Instrumentations **SHOULD** require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +const ATTR_RPC_CONNECT_RPC_REQUEST_METADATA = (key) => `rpc.connect_rpc.request.metadata.${key}`; +exports.ATTR_RPC_CONNECT_RPC_REQUEST_METADATA = ATTR_RPC_CONNECT_RPC_REQUEST_METADATA; +/** + * Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. + * + * @example rpc.response.metadata.my-custom-metadata-attribute=["attribute_value"] + * + * @note Instrumentations **SHOULD** require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +const ATTR_RPC_CONNECT_RPC_RESPONSE_METADATA = (key) => `rpc.connect_rpc.response.metadata.${key}`; +exports.ATTR_RPC_CONNECT_RPC_RESPONSE_METADATA = ATTR_RPC_CONNECT_RPC_RESPONSE_METADATA; +/** + * gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. + * + * @example rpc.grpc.request.metadata.my-custom-metadata-attribute=["1.2.3.4", "1.2.3.5"] + * + * @note Instrumentations **SHOULD** require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +const ATTR_RPC_GRPC_REQUEST_METADATA = (key) => `rpc.grpc.request.metadata.${key}`; +exports.ATTR_RPC_GRPC_REQUEST_METADATA = ATTR_RPC_GRPC_REQUEST_METADATA; +/** + * gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. + * + * @example rpc.grpc.response.metadata.my-custom-metadata-attribute=["attribute_value"] + * + * @note Instrumentations **SHOULD** require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +const ATTR_RPC_GRPC_RESPONSE_METADATA = (key) => `rpc.grpc.response.metadata.${key}`; +exports.ATTR_RPC_GRPC_RESPONSE_METADATA = ATTR_RPC_GRPC_RESPONSE_METADATA; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_RPC_GRPC_STATUS_CODE = 'rpc.grpc.status_code'; +/** + * Enum value 0 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. + */ +exports.RPC_GRPC_STATUS_CODE_VALUE_OK = 0; +/** + * Enum value 1 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. + */ +exports.RPC_GRPC_STATUS_CODE_VALUE_CANCELLED = 1; +/** + * Enum value 2 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. + */ +exports.RPC_GRPC_STATUS_CODE_VALUE_UNKNOWN = 2; +/** + * Enum value 3 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. + */ +exports.RPC_GRPC_STATUS_CODE_VALUE_INVALID_ARGUMENT = 3; +/** + * Enum value 4 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. + */ +exports.RPC_GRPC_STATUS_CODE_VALUE_DEADLINE_EXCEEDED = 4; +/** + * Enum value 5 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. + */ +exports.RPC_GRPC_STATUS_CODE_VALUE_NOT_FOUND = 5; +/** + * Enum value 6 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. + */ +exports.RPC_GRPC_STATUS_CODE_VALUE_ALREADY_EXISTS = 6; +/** + * Enum value 7 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. + */ +exports.RPC_GRPC_STATUS_CODE_VALUE_PERMISSION_DENIED = 7; +/** + * Enum value 8 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. + */ +exports.RPC_GRPC_STATUS_CODE_VALUE_RESOURCE_EXHAUSTED = 8; +/** + * Enum value 9 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. + */ +exports.RPC_GRPC_STATUS_CODE_VALUE_FAILED_PRECONDITION = 9; +/** + * Enum value 10 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. + */ +exports.RPC_GRPC_STATUS_CODE_VALUE_ABORTED = 10; +/** + * Enum value 11 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. + */ +exports.RPC_GRPC_STATUS_CODE_VALUE_OUT_OF_RANGE = 11; +/** + * Enum value 12 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. + */ +exports.RPC_GRPC_STATUS_CODE_VALUE_UNIMPLEMENTED = 12; +/** + * Enum value 13 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. + */ +exports.RPC_GRPC_STATUS_CODE_VALUE_INTERNAL = 13; +/** + * Enum value 14 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. + */ +exports.RPC_GRPC_STATUS_CODE_VALUE_UNAVAILABLE = 14; +/** + * Enum value 15 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. + */ +exports.RPC_GRPC_STATUS_CODE_VALUE_DATA_LOSS = 15; +/** + * Enum value 16 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. + */ +exports.RPC_GRPC_STATUS_CODE_VALUE_UNAUTHENTICATED = 16; +/** + * `error.code` property of response if it is an error response. + * + * @example -32700 + * + * @example 100 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_RPC_JSONRPC_ERROR_CODE = 'rpc.jsonrpc.error_code'; +/** + * `error.message` property of response if it is an error response. + * + * @example Parse error + * + * @example User already exists + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_RPC_JSONRPC_ERROR_MESSAGE = 'rpc.jsonrpc.error_message'; +/** + * `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. + * + * @example 10 + * + * @example request-7 + * + * @example + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_RPC_JSONRPC_REQUEST_ID = 'rpc.jsonrpc.request_id'; +/** + * Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't specify this, the value can be omitted. + * + * @example 2.0 + * + * @example 1.0 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_RPC_JSONRPC_VERSION = 'rpc.jsonrpc.version'; +/** + * Compressed size of the message in bytes. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_RPC_MESSAGE_COMPRESSED_SIZE = 'rpc.message.compressed_size'; +/** + * **MUST** be calculated as two different counters starting from `1` one for sent messages and one for received message. + * + * @note This way we guarantee that the values will be consistent between different implementations. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_RPC_MESSAGE_ID = 'rpc.message.id'; +/** + * Whether this is a received or sent message. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_RPC_MESSAGE_TYPE = 'rpc.message.type'; +/** + * Enum value "RECEIVED" for attribute {@link ATTR_RPC_MESSAGE_TYPE}. + */ +exports.RPC_MESSAGE_TYPE_VALUE_RECEIVED = "RECEIVED"; +/** + * Enum value "SENT" for attribute {@link ATTR_RPC_MESSAGE_TYPE}. + */ +exports.RPC_MESSAGE_TYPE_VALUE_SENT = "SENT"; +/** + * Uncompressed size of the message in bytes. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_RPC_MESSAGE_UNCOMPRESSED_SIZE = 'rpc.message.uncompressed_size'; +/** + * The name of the (logical) method being called, must be equal to the $method part in the span name. + * + * @example "exampleMethod" + * + * @note This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_RPC_METHOD = 'rpc.method'; +/** + * The full (logical) name of the service being called, including its package name, if applicable. + * + * @example "myservice.EchoService" + * + * @note This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_RPC_SERVICE = 'rpc.service'; +/** + * A string identifying the remoting system. See below for a list of well-known identifiers. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_RPC_SYSTEM = 'rpc.system'; +/** + * Enum value "apache_dubbo" for attribute {@link ATTR_RPC_SYSTEM}. + */ +exports.RPC_SYSTEM_VALUE_APACHE_DUBBO = "apache_dubbo"; +/** + * Enum value "connect_rpc" for attribute {@link ATTR_RPC_SYSTEM}. + */ +exports.RPC_SYSTEM_VALUE_CONNECT_RPC = "connect_rpc"; +/** + * Enum value "dotnet_wcf" for attribute {@link ATTR_RPC_SYSTEM}. + */ +exports.RPC_SYSTEM_VALUE_DOTNET_WCF = "dotnet_wcf"; +/** + * Enum value "grpc" for attribute {@link ATTR_RPC_SYSTEM}. + */ +exports.RPC_SYSTEM_VALUE_GRPC = "grpc"; +/** + * Enum value "java_rmi" for attribute {@link ATTR_RPC_SYSTEM}. + */ +exports.RPC_SYSTEM_VALUE_JAVA_RMI = "java_rmi"; +/** + * The string ID of the service instance. + * + * @example 627cc493-f310-47de-96bd-71410b7dec09 + * + * @note MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words + * `service.namespace,service.name,service.instance.id` triplet **MUST** be globally unique). The ID helps to + * distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled + * service). + * + * Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC + * 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of + * this value if stability is desirable. In that case, the ID **SHOULD** be used as source of a UUID Version 5 and + * SHOULD use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`. + * + * UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is + * needed. Similar to what can be seen in the man page for the + * [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/machine-id.html) file, the underlying + * data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it + * or not via another resource attribute. + * + * For applications running behind an application server (like unicorn), we do not recommend using one identifier + * for all processes participating in the application. Instead, it's recommended each division (e.g. a worker + * thread in unicorn) to have its own instance.id. + * + * It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the + * service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will + * likely be wrong, as the Collector might not know from which container within that pod the telemetry originated. + * However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance + * for that telemetry. This is typically the case for scraping receivers, as they know the target address and + * port. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_SERVICE_INSTANCE_ID = 'service.instance.id'; +/** + * A namespace for `service.name`. + * + * @example Shop + * + * @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. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_SERVICE_NAMESPACE = 'service.namespace'; +/** + * A unique id to identify a session. + * + * @example "00112233-4455-6677-8899-aabbccddeeff" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_SESSION_ID = 'session.id'; +/** + * The previous `session.id` for this user, when known. + * + * @example "00112233-4455-6677-8899-aabbccddeeff" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_SESSION_PREVIOUS_ID = 'session.previous_id'; +/** + * Source address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. + * + * @example source.example.com + * + * @example 10.1.2.80 + * + * @example /tmp/my.sock + * + * @note When observed from the destination side, and when communicating through an intermediary, `source.address` **SHOULD** represent the source address behind any intermediaries, for example proxies, if it's available. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_SOURCE_ADDRESS = 'source.address'; +/** + * Source port number + * + * @example 3389 + * + * @example 2888 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_SOURCE_PORT = 'source.port'; +/** + * Deprecated, use `db.client.connection.state` instead. + * + * @example idle + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.client.connection.state`. + */ +exports.ATTR_STATE = 'state'; +/** + * Enum value "idle" for attribute {@link ATTR_STATE}. + */ +exports.STATE_VALUE_IDLE = "idle"; +/** + * Enum value "used" for attribute {@link ATTR_STATE}. + */ +exports.STATE_VALUE_USED = "used"; +/** + * The logical CPU number [0..n-1] + * + * @example 1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_SYSTEM_CPU_LOGICAL_NUMBER = 'system.cpu.logical_number'; +/** + * Deprecated, use `cpu.mode` instead. + * + * @example idle + * + * @example interrupt + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `cpu.mode` + */ +exports.ATTR_SYSTEM_CPU_STATE = 'system.cpu.state'; +/** + * Enum value "idle" for attribute {@link ATTR_SYSTEM_CPU_STATE}. + */ +exports.SYSTEM_CPU_STATE_VALUE_IDLE = "idle"; +/** + * Enum value "interrupt" for attribute {@link ATTR_SYSTEM_CPU_STATE}. + */ +exports.SYSTEM_CPU_STATE_VALUE_INTERRUPT = "interrupt"; +/** + * Enum value "iowait" for attribute {@link ATTR_SYSTEM_CPU_STATE}. + */ +exports.SYSTEM_CPU_STATE_VALUE_IOWAIT = "iowait"; +/** + * Enum value "nice" for attribute {@link ATTR_SYSTEM_CPU_STATE}. + */ +exports.SYSTEM_CPU_STATE_VALUE_NICE = "nice"; +/** + * Enum value "steal" for attribute {@link ATTR_SYSTEM_CPU_STATE}. + */ +exports.SYSTEM_CPU_STATE_VALUE_STEAL = "steal"; +/** + * Enum value "system" for attribute {@link ATTR_SYSTEM_CPU_STATE}. + */ +exports.SYSTEM_CPU_STATE_VALUE_SYSTEM = "system"; +/** + * Enum value "user" for attribute {@link ATTR_SYSTEM_CPU_STATE}. + */ +exports.SYSTEM_CPU_STATE_VALUE_USER = "user"; +/** + * The device identifier + * + * @example (identifier) + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_SYSTEM_DEVICE = 'system.device'; +/** + * The filesystem mode + * + * @example rw, ro + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_SYSTEM_FILESYSTEM_MODE = 'system.filesystem.mode'; +/** + * The filesystem mount path + * + * @example /mnt/data + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_SYSTEM_FILESYSTEM_MOUNTPOINT = 'system.filesystem.mountpoint'; +/** + * The filesystem state + * + * @example used + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_SYSTEM_FILESYSTEM_STATE = 'system.filesystem.state'; +/** + * Enum value "free" for attribute {@link ATTR_SYSTEM_FILESYSTEM_STATE}. + */ +exports.SYSTEM_FILESYSTEM_STATE_VALUE_FREE = "free"; +/** + * Enum value "reserved" for attribute {@link ATTR_SYSTEM_FILESYSTEM_STATE}. + */ +exports.SYSTEM_FILESYSTEM_STATE_VALUE_RESERVED = "reserved"; +/** + * Enum value "used" for attribute {@link ATTR_SYSTEM_FILESYSTEM_STATE}. + */ +exports.SYSTEM_FILESYSTEM_STATE_VALUE_USED = "used"; +/** + * The filesystem type + * + * @example ext4 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_SYSTEM_FILESYSTEM_TYPE = 'system.filesystem.type'; +/** + * Enum value "exfat" for attribute {@link ATTR_SYSTEM_FILESYSTEM_TYPE}. + */ +exports.SYSTEM_FILESYSTEM_TYPE_VALUE_EXFAT = "exfat"; +/** + * Enum value "ext4" for attribute {@link ATTR_SYSTEM_FILESYSTEM_TYPE}. + */ +exports.SYSTEM_FILESYSTEM_TYPE_VALUE_EXT4 = "ext4"; +/** + * Enum value "fat32" for attribute {@link ATTR_SYSTEM_FILESYSTEM_TYPE}. + */ +exports.SYSTEM_FILESYSTEM_TYPE_VALUE_FAT32 = "fat32"; +/** + * Enum value "hfsplus" for attribute {@link ATTR_SYSTEM_FILESYSTEM_TYPE}. + */ +exports.SYSTEM_FILESYSTEM_TYPE_VALUE_HFSPLUS = "hfsplus"; +/** + * Enum value "ntfs" for attribute {@link ATTR_SYSTEM_FILESYSTEM_TYPE}. + */ +exports.SYSTEM_FILESYSTEM_TYPE_VALUE_NTFS = "ntfs"; +/** + * Enum value "refs" for attribute {@link ATTR_SYSTEM_FILESYSTEM_TYPE}. + */ +exports.SYSTEM_FILESYSTEM_TYPE_VALUE_REFS = "refs"; +/** + * The memory state + * + * @example free + * + * @example cached + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_SYSTEM_MEMORY_STATE = 'system.memory.state'; +/** + * Enum value "buffers" for attribute {@link ATTR_SYSTEM_MEMORY_STATE}. + */ +exports.SYSTEM_MEMORY_STATE_VALUE_BUFFERS = "buffers"; +/** + * Enum value "cached" for attribute {@link ATTR_SYSTEM_MEMORY_STATE}. + */ +exports.SYSTEM_MEMORY_STATE_VALUE_CACHED = "cached"; +/** + * Enum value "free" for attribute {@link ATTR_SYSTEM_MEMORY_STATE}. + */ +exports.SYSTEM_MEMORY_STATE_VALUE_FREE = "free"; +/** + * Enum value "shared" for attribute {@link ATTR_SYSTEM_MEMORY_STATE}. + */ +exports.SYSTEM_MEMORY_STATE_VALUE_SHARED = "shared"; +/** + * Enum value "used" for attribute {@link ATTR_SYSTEM_MEMORY_STATE}. + */ +exports.SYSTEM_MEMORY_STATE_VALUE_USED = "used"; +/** + * A stateless protocol **MUST** **NOT** set this attribute + * + * @example close_wait + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_SYSTEM_NETWORK_STATE = 'system.network.state'; +/** + * Enum value "close" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. + */ +exports.SYSTEM_NETWORK_STATE_VALUE_CLOSE = "close"; +/** + * Enum value "close_wait" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. + */ +exports.SYSTEM_NETWORK_STATE_VALUE_CLOSE_WAIT = "close_wait"; +/** + * Enum value "closing" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. + */ +exports.SYSTEM_NETWORK_STATE_VALUE_CLOSING = "closing"; +/** + * Enum value "delete" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. + */ +exports.SYSTEM_NETWORK_STATE_VALUE_DELETE = "delete"; +/** + * Enum value "established" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. + */ +exports.SYSTEM_NETWORK_STATE_VALUE_ESTABLISHED = "established"; +/** + * Enum value "fin_wait_1" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. + */ +exports.SYSTEM_NETWORK_STATE_VALUE_FIN_WAIT_1 = "fin_wait_1"; +/** + * Enum value "fin_wait_2" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. + */ +exports.SYSTEM_NETWORK_STATE_VALUE_FIN_WAIT_2 = "fin_wait_2"; +/** + * Enum value "last_ack" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. + */ +exports.SYSTEM_NETWORK_STATE_VALUE_LAST_ACK = "last_ack"; +/** + * Enum value "listen" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. + */ +exports.SYSTEM_NETWORK_STATE_VALUE_LISTEN = "listen"; +/** + * Enum value "syn_recv" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. + */ +exports.SYSTEM_NETWORK_STATE_VALUE_SYN_RECV = "syn_recv"; +/** + * Enum value "syn_sent" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. + */ +exports.SYSTEM_NETWORK_STATE_VALUE_SYN_SENT = "syn_sent"; +/** + * Enum value "time_wait" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. + */ +exports.SYSTEM_NETWORK_STATE_VALUE_TIME_WAIT = "time_wait"; +/** + * The paging access direction + * + * @example in + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_SYSTEM_PAGING_DIRECTION = 'system.paging.direction'; +/** + * Enum value "in" for attribute {@link ATTR_SYSTEM_PAGING_DIRECTION}. + */ +exports.SYSTEM_PAGING_DIRECTION_VALUE_IN = "in"; +/** + * Enum value "out" for attribute {@link ATTR_SYSTEM_PAGING_DIRECTION}. + */ +exports.SYSTEM_PAGING_DIRECTION_VALUE_OUT = "out"; +/** + * The memory paging state + * + * @example free + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_SYSTEM_PAGING_STATE = 'system.paging.state'; +/** + * Enum value "free" for attribute {@link ATTR_SYSTEM_PAGING_STATE}. + */ +exports.SYSTEM_PAGING_STATE_VALUE_FREE = "free"; +/** + * Enum value "used" for attribute {@link ATTR_SYSTEM_PAGING_STATE}. + */ +exports.SYSTEM_PAGING_STATE_VALUE_USED = "used"; +/** + * The memory paging type + * + * @example minor + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_SYSTEM_PAGING_TYPE = 'system.paging.type'; +/** + * Enum value "major" for attribute {@link ATTR_SYSTEM_PAGING_TYPE}. + */ +exports.SYSTEM_PAGING_TYPE_VALUE_MAJOR = "major"; +/** + * Enum value "minor" for attribute {@link ATTR_SYSTEM_PAGING_TYPE}. + */ +exports.SYSTEM_PAGING_TYPE_VALUE_MINOR = "minor"; +/** + * The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES) + * + * @example running + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_SYSTEM_PROCESS_STATUS = 'system.process.status'; +/** + * Enum value "defunct" for attribute {@link ATTR_SYSTEM_PROCESS_STATUS}. + */ +exports.SYSTEM_PROCESS_STATUS_VALUE_DEFUNCT = "defunct"; +/** + * Enum value "running" for attribute {@link ATTR_SYSTEM_PROCESS_STATUS}. + */ +exports.SYSTEM_PROCESS_STATUS_VALUE_RUNNING = "running"; +/** + * Enum value "sleeping" for attribute {@link ATTR_SYSTEM_PROCESS_STATUS}. + */ +exports.SYSTEM_PROCESS_STATUS_VALUE_SLEEPING = "sleeping"; +/** + * Enum value "stopped" for attribute {@link ATTR_SYSTEM_PROCESS_STATUS}. + */ +exports.SYSTEM_PROCESS_STATUS_VALUE_STOPPED = "stopped"; +/** + * Deprecated, use `system.process.status` instead. + * + * @example running + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `system.process.status`. + */ +exports.ATTR_SYSTEM_PROCESSES_STATUS = 'system.processes.status'; +/** + * Enum value "defunct" for attribute {@link ATTR_SYSTEM_PROCESSES_STATUS}. + */ +exports.SYSTEM_PROCESSES_STATUS_VALUE_DEFUNCT = "defunct"; +/** + * Enum value "running" for attribute {@link ATTR_SYSTEM_PROCESSES_STATUS}. + */ +exports.SYSTEM_PROCESSES_STATUS_VALUE_RUNNING = "running"; +/** + * Enum value "sleeping" for attribute {@link ATTR_SYSTEM_PROCESSES_STATUS}. + */ +exports.SYSTEM_PROCESSES_STATUS_VALUE_SLEEPING = "sleeping"; +/** + * Enum value "stopped" for attribute {@link ATTR_SYSTEM_PROCESSES_STATUS}. + */ +exports.SYSTEM_PROCESSES_STATUS_VALUE_STOPPED = "stopped"; +/** + * The name of the auto instrumentation agent or distribution, if used. + * + * @example parts-unlimited-java + * + * @note Official auto instrumentation agents and distributions **SHOULD** set the `telemetry.distro.name` attribute to + * a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TELEMETRY_DISTRO_NAME = 'telemetry.distro.name'; +/** + * The version string of the auto instrumentation agent or distribution, if used. + * + * @example 1.2.3 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TELEMETRY_DISTRO_VERSION = 'telemetry.distro.version'; +/** + * The fully qualified human readable name of the [test case](https://en.wikipedia.org/wiki/Test_case). + * + * @example org.example.TestCase1.test1 + * + * @example example/tests/TestCase1.test1 + * + * @example ExampleTestCase1_test1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TEST_CASE_NAME = 'test.case.name'; +/** + * The status of the actual test case result from test execution. + * + * @example pass + * + * @example fail + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TEST_CASE_RESULT_STATUS = 'test.case.result.status'; +/** + * Enum value "fail" for attribute {@link ATTR_TEST_CASE_RESULT_STATUS}. + */ +exports.TEST_CASE_RESULT_STATUS_VALUE_FAIL = "fail"; +/** + * Enum value "pass" for attribute {@link ATTR_TEST_CASE_RESULT_STATUS}. + */ +exports.TEST_CASE_RESULT_STATUS_VALUE_PASS = "pass"; +/** + * The human readable name of a [test suite](https://en.wikipedia.org/wiki/Test_suite). + * + * @example TestSuite1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TEST_SUITE_NAME = 'test.suite.name'; +/** + * The status of the test suite run. + * + * @example success + * + * @example failure + * + * @example skipped + * + * @example aborted + * + * @example timed_out + * + * @example in_progress + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TEST_SUITE_RUN_STATUS = 'test.suite.run.status'; +/** + * Enum value "aborted" for attribute {@link ATTR_TEST_SUITE_RUN_STATUS}. + */ +exports.TEST_SUITE_RUN_STATUS_VALUE_ABORTED = "aborted"; +/** + * Enum value "failure" for attribute {@link ATTR_TEST_SUITE_RUN_STATUS}. + */ +exports.TEST_SUITE_RUN_STATUS_VALUE_FAILURE = "failure"; +/** + * Enum value "in_progress" for attribute {@link ATTR_TEST_SUITE_RUN_STATUS}. + */ +exports.TEST_SUITE_RUN_STATUS_VALUE_IN_PROGRESS = "in_progress"; +/** + * Enum value "skipped" for attribute {@link ATTR_TEST_SUITE_RUN_STATUS}. + */ +exports.TEST_SUITE_RUN_STATUS_VALUE_SKIPPED = "skipped"; +/** + * Enum value "success" for attribute {@link ATTR_TEST_SUITE_RUN_STATUS}. + */ +exports.TEST_SUITE_RUN_STATUS_VALUE_SUCCESS = "success"; +/** + * Enum value "timed_out" for attribute {@link ATTR_TEST_SUITE_RUN_STATUS}. + */ +exports.TEST_SUITE_RUN_STATUS_VALUE_TIMED_OUT = "timed_out"; +/** + * Current "managed" thread ID (as opposed to OS thread ID). + * + * @example 42 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_THREAD_ID = 'thread.id'; +/** + * Current thread name. + * + * @example "main" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_THREAD_NAME = 'thread.name'; +/** + * String indicating the [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used during the current connection. + * + * @example TLS_RSA_WITH_3DES_EDE_CBC_SHA + * + * @example TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + * + * @note The values allowed for `tls.cipher` **MUST** be one of the `Descriptions` of the [registered TLS Cipher Suits](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_CIPHER = 'tls.cipher'; +/** + * PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive of `client.certificate_chain` since this value also exists in that list. + * + * @example MII... + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_CLIENT_CERTIFICATE = 'tls.client.certificate'; +/** + * Array of PEM-encoded certificates that make up the certificate chain offered by the client. This is usually mutually-exclusive of `client.certificate` since that value should be the first certificate in the chain. + * + * @example MII... + * + * @example MI... + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_CLIENT_CERTIFICATE_CHAIN = 'tls.client.certificate_chain'; +/** + * Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. + * + * @example 0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_CLIENT_HASH_MD5 = 'tls.client.hash.md5'; +/** + * Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. + * + * @example 9E393D93138888D288266C2D915214D1D1CCEB2A + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_CLIENT_HASH_SHA1 = 'tls.client.hash.sha1'; +/** + * Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. + * + * @example 0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_CLIENT_HASH_SHA256 = 'tls.client.hash.sha256'; +/** + * Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. + * + * @example CN=Example Root CA, OU=Infrastructure Team, DC=example, DC=com + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_CLIENT_ISSUER = 'tls.client.issuer'; +/** + * A hash that identifies clients based on how they perform an SSL/TLS handshake. + * + * @example d4e5b18d6b55c71272893221c96ba240 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_CLIENT_JA3 = 'tls.client.ja3'; +/** + * Date/Time indicating when client certificate is no longer considered valid. + * + * @example 2021-01-01T00:00:00.000Z + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_CLIENT_NOT_AFTER = 'tls.client.not_after'; +/** + * Date/Time indicating when client certificate is first considered valid. + * + * @example 1970-01-01T00:00:00.000Z + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_CLIENT_NOT_BEFORE = 'tls.client.not_before'; +/** + * Deprecated, use `server.address` instead. + * + * @example opentelemetry.io + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `server.address. + */ +exports.ATTR_TLS_CLIENT_SERVER_NAME = 'tls.client.server_name'; +/** + * Distinguished name of subject of the x.509 certificate presented by the client. + * + * @example CN=myclient, OU=Documentation Team, DC=example, DC=com + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_CLIENT_SUBJECT = 'tls.client.subject'; +/** + * Array of ciphers offered by the client during the client hello. + * + * @example TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + * + * @example TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + * + * @example ... + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_CLIENT_SUPPORTED_CIPHERS = 'tls.client.supported_ciphers'; +/** + * String indicating the curve used for the given cipher, when applicable + * + * @example secp256r1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_CURVE = 'tls.curve'; +/** + * Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted tunnel. + * + * @example true + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_ESTABLISHED = 'tls.established'; +/** + * String indicating the protocol being tunneled. Per the values in the [IANA registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids), this string should be lower case. + * + * @example http/1.1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_NEXT_PROTOCOL = 'tls.next_protocol'; +/** + * Normalized lowercase protocol name parsed from original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES) + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_PROTOCOL_NAME = 'tls.protocol.name'; +/** + * Enum value "ssl" for attribute {@link ATTR_TLS_PROTOCOL_NAME}. + */ +exports.TLS_PROTOCOL_NAME_VALUE_SSL = "ssl"; +/** + * Enum value "tls" for attribute {@link ATTR_TLS_PROTOCOL_NAME}. + */ +exports.TLS_PROTOCOL_NAME_VALUE_TLS = "tls"; +/** + * Numeric part of the version parsed from the original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES) + * + * @example 1.2 + * + * @example 3 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_PROTOCOL_VERSION = 'tls.protocol.version'; +/** + * Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation. + * + * @example true + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_RESUMED = 'tls.resumed'; +/** + * PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive of `server.certificate_chain` since this value also exists in that list. + * + * @example MII... + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_SERVER_CERTIFICATE = 'tls.server.certificate'; +/** + * Array of PEM-encoded certificates that make up the certificate chain offered by the server. This is usually mutually-exclusive of `server.certificate` since that value should be the first certificate in the chain. + * + * @example MII... + * + * @example MI... + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_SERVER_CERTIFICATE_CHAIN = 'tls.server.certificate_chain'; +/** + * Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. + * + * @example 0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_SERVER_HASH_MD5 = 'tls.server.hash.md5'; +/** + * Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. + * + * @example 9E393D93138888D288266C2D915214D1D1CCEB2A + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_SERVER_HASH_SHA1 = 'tls.server.hash.sha1'; +/** + * Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. + * + * @example 0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_SERVER_HASH_SHA256 = 'tls.server.hash.sha256'; +/** + * Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. + * + * @example CN=Example Root CA, OU=Infrastructure Team, DC=example, DC=com + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_SERVER_ISSUER = 'tls.server.issuer'; +/** + * A hash that identifies servers based on how they perform an SSL/TLS handshake. + * + * @example d4e5b18d6b55c71272893221c96ba240 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_SERVER_JA3S = 'tls.server.ja3s'; +/** + * Date/Time indicating when server certificate is no longer considered valid. + * + * @example 2021-01-01T00:00:00.000Z + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_SERVER_NOT_AFTER = 'tls.server.not_after'; +/** + * Date/Time indicating when server certificate is first considered valid. + * + * @example 1970-01-01T00:00:00.000Z + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_SERVER_NOT_BEFORE = 'tls.server.not_before'; +/** + * Distinguished name of subject of the x.509 certificate presented by the server. + * + * @example CN=myserver, OU=Documentation Team, DC=example, DC=com + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_TLS_SERVER_SUBJECT = 'tls.server.subject'; +/** + * Domain extracted from the `url.full`, such as "opentelemetry.io". + * + * @example www.foo.bar + * + * @example opentelemetry.io + * + * @example 3.12.167.2 + * + * @example [1080:0:0:0:8:800:200C:417A] + * + * @note In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, the IP address would go to the domain field. If the URL contains a [literal IPv6 address](https://www.rfc-editor.org/rfc/rfc2732#section-2) enclosed by `[` and `]`, the `[` and `]` characters should also be captured in the domain field. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_URL_DOMAIN = 'url.domain'; +/** + * The file extension extracted from the `url.full`, excluding the leading dot. + * + * @example png + * + * @example gz + * + * @note The file extension is only set if it exists, as not every url has a file extension. When the file name has multiple extensions `example.tar.gz`, only the last one should be captured `gz`, not `tar.gz`. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_URL_EXTENSION = 'url.extension'; +/** + * Unmodified original URL as seen in the event source. + * + * @example https://www.foo.bar/search?q=OpenTelemetry#SemConv + * + * @example search?q=OpenTelemetry + * + * @note In network monitoring, the observed URL may be a full URL, whereas in access logs, the URL is often just represented as a path. This field is meant to represent the URL as it was observed, complete or not. + * `url.original` might contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case password and username **SHOULD** **NOT** be redacted and attribute's value **SHOULD** remain the same. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_URL_ORIGINAL = 'url.original'; +/** + * Port extracted from the `url.full` + * + * @example 443 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_URL_PORT = 'url.port'; +/** + * The highest registered url domain, stripped of the subdomain. + * + * @example example.com + * + * @example foo.co.uk + * + * @note This value can be determined precisely with the [public suffix list](http://publicsuffix.org). For example, the registered domain for `foo.example.com` is `example.com`. Trying to approximate this by simply taking the last two labels will not work well for TLDs such as `co.uk`. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_URL_REGISTERED_DOMAIN = 'url.registered_domain'; +/** + * The subdomain portion of a fully qualified domain name includes all of the names except the host name under the registered_domain. In a partially qualified domain, or if the qualification level of the full name cannot be determined, subdomain contains all of the names below the registered domain. + * + * @example east + * + * @example sub2.sub1 + * + * @note The subdomain portion of `www.east.mydomain.co.uk` is `east`. If the domain has multiple levels of subdomain, such as `sub2.sub1.example.com`, the subdomain field should contain `sub2.sub1`, with no trailing period. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_URL_SUBDOMAIN = 'url.subdomain'; +/** + * The low-cardinality template of an [absolute path reference](https://www.rfc-editor.org/rfc/rfc3986#section-4.2). + * + * @example /users/{id} + * + * @example /users/:id + * + * @example /users?id={id} + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_URL_TEMPLATE = 'url.template'; +/** + * The effective top level domain (eTLD), also known as the domain suffix, is the last part of the domain name. For example, the top level domain for example.com is `com`. + * + * @example com + * + * @example co.uk + * + * @note This value can be determined precisely with the [public suffix list](http://publicsuffix.org). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_URL_TOP_LEVEL_DOMAIN = 'url.top_level_domain'; +/** + * User email address. + * + * @example a.einstein@example.com + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_USER_EMAIL = 'user.email'; +/** + * User's full name + * + * @example Albert Einstein + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_USER_FULL_NAME = 'user.full_name'; +/** + * Unique user hash to correlate information for a user in anonymized form. + * + * @example 364fc68eaf4c8acec74a4e52d7d1feaa + * + * @note Useful if `user.id` or `user.name` contain confidential information and cannot be used. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_USER_HASH = 'user.hash'; +/** + * Unique identifier of the user. + * + * @example S-1-5-21-202424912787-2692429404-2351956786-1000 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_USER_ID = 'user.id'; +/** + * Short name or login/username of the user. + * + * @example a.einstein + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_USER_NAME = 'user.name'; +/** + * Array of user roles at the time of the event. + * + * @example admin + * + * @example reporting_user + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_USER_ROLES = 'user.roles'; +/** + * Name of the user-agent extracted from original. Usually refers to the browser's name. + * + * @example Safari + * + * @example YourApp + * + * @note [Example](https://www.whatsmyua.info) of extracting browser's name from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant name **SHOULD** be selected. In such a scenario it should align with `user_agent.version` + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_USER_AGENT_NAME = 'user_agent.name'; +/** + * Version of the user-agent extracted from original. Usually refers to the browser's version + * + * @example 14.1.2 + * + * @example 1.0.0 + * + * @note [Example](https://www.whatsmyua.info) of extracting browser's version from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant version **SHOULD** be selected. In such a scenario it should align with `user_agent.name` + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_USER_AGENT_VERSION = 'user_agent.version'; +/** + * The type of garbage collection. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_V8JS_GC_TYPE = 'v8js.gc.type'; +/** + * Enum value "incremental" for attribute {@link ATTR_V8JS_GC_TYPE}. + */ +exports.V8JS_GC_TYPE_VALUE_INCREMENTAL = "incremental"; +/** + * Enum value "major" for attribute {@link ATTR_V8JS_GC_TYPE}. + */ +exports.V8JS_GC_TYPE_VALUE_MAJOR = "major"; +/** + * Enum value "minor" for attribute {@link ATTR_V8JS_GC_TYPE}. + */ +exports.V8JS_GC_TYPE_VALUE_MINOR = "minor"; +/** + * Enum value "weakcb" for attribute {@link ATTR_V8JS_GC_TYPE}. + */ +exports.V8JS_GC_TYPE_VALUE_WEAKCB = "weakcb"; +/** + * The name of the space type of heap memory. + * + * @note Value can be retrieved from value `space_name` of [`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics) + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_V8JS_HEAP_SPACE_NAME = 'v8js.heap.space.name'; +/** + * Enum value "code_space" for attribute {@link ATTR_V8JS_HEAP_SPACE_NAME}. + */ +exports.V8JS_HEAP_SPACE_NAME_VALUE_CODE_SPACE = "code_space"; +/** + * Enum value "large_object_space" for attribute {@link ATTR_V8JS_HEAP_SPACE_NAME}. + */ +exports.V8JS_HEAP_SPACE_NAME_VALUE_LARGE_OBJECT_SPACE = "large_object_space"; +/** + * Enum value "map_space" for attribute {@link ATTR_V8JS_HEAP_SPACE_NAME}. + */ +exports.V8JS_HEAP_SPACE_NAME_VALUE_MAP_SPACE = "map_space"; +/** + * Enum value "new_space" for attribute {@link ATTR_V8JS_HEAP_SPACE_NAME}. + */ +exports.V8JS_HEAP_SPACE_NAME_VALUE_NEW_SPACE = "new_space"; +/** + * Enum value "old_space" for attribute {@link ATTR_V8JS_HEAP_SPACE_NAME}. + */ +exports.V8JS_HEAP_SPACE_NAME_VALUE_OLD_SPACE = "old_space"; +/** + * The ID of the change (pull request/merge request) if applicable. This is usually a unique (within repository) identifier generated by the VCS system. + * + * @example 123 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_VCS_REPOSITORY_CHANGE_ID = 'vcs.repository.change.id'; +/** + * The human readable title of the change (pull request/merge request). This title is often a brief summary of the change and may get merged in to a ref as the commit summary. + * + * @example Fixes broken thing + * + * @example feat: add my new feature + * + * @example [chore] update dependency + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_VCS_REPOSITORY_CHANGE_TITLE = 'vcs.repository.change.title'; +/** + * The name of the [reference](https://git-scm.com/docs/gitglossary#def_ref) such as **branch** or **tag** in the repository. + * + * @example my-feature-branch + * + * @example tag-1-test + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_VCS_REPOSITORY_REF_NAME = 'vcs.repository.ref.name'; +/** + * The revision, literally [revised version](https://www.merriam-webster.com/dictionary/revision), The revision most often refers to a commit object in Git, or a revision number in SVN. + * + * @example 9d59409acf479dfa0df1aa568182e43e43df8bbe28d60fcf2bc52e30068802cc + * + * @example main + * + * @example 123 + * + * @example HEAD + * + * @note The revision can be a full [hash value (see glossary)](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf), + * of the recorded change to a ref within a repository pointing to a + * commit [commit](https://git-scm.com/docs/git-commit) object. It does + * not necessarily have to be a hash; it can simply define a + * [revision number](https://svnbook.red-bean.com/en/1.7/svn.tour.revs.specifiers.html) + * which is an integer that is monotonically increasing. In cases where + * it is identical to the `ref.name`, it **SHOULD** still be included. It is + * up to the implementer to decide which value to set as the revision + * based on the VCS system and situational context. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_VCS_REPOSITORY_REF_REVISION = 'vcs.repository.ref.revision'; +/** + * The type of the [reference](https://git-scm.com/docs/gitglossary#def_ref) in the repository. + * + * @example branch + * + * @example tag + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_VCS_REPOSITORY_REF_TYPE = 'vcs.repository.ref.type'; +/** + * Enum value "branch" for attribute {@link ATTR_VCS_REPOSITORY_REF_TYPE}. + */ +exports.VCS_REPOSITORY_REF_TYPE_VALUE_BRANCH = "branch"; +/** + * Enum value "tag" for attribute {@link ATTR_VCS_REPOSITORY_REF_TYPE}. + */ +exports.VCS_REPOSITORY_REF_TYPE_VALUE_TAG = "tag"; +/** + * The [URL](https://en.wikipedia.org/wiki/URL) of the repository providing the complete address in order to locate and identify the repository. + * + * @example https://github.com/opentelemetry/open-telemetry-collector-contrib + * + * @example https://gitlab.com/my-org/my-project/my-projects-project/repo + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_VCS_REPOSITORY_URL_FULL = 'vcs.repository.url.full'; +/** + * Additional description of the web engine (e.g. detailed version and edition information). + * + * @example WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_WEBENGINE_DESCRIPTION = 'webengine.description'; +/** + * The name of the web engine. + * + * @example WildFly + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_WEBENGINE_NAME = 'webengine.name'; +/** + * The version of the web engine. + * + * @example 21.0.0 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_WEBENGINE_VERSION = 'webengine.version'; +//# sourceMappingURL=experimental_attributes.js.map + +/***/ }), + +/***/ 44956: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.METRIC_HTTP_CLIENT_OPEN_CONNECTIONS = exports.METRIC_HTTP_CLIENT_CONNECTION_DURATION = exports.METRIC_HTTP_CLIENT_ACTIVE_REQUESTS = exports.METRIC_GO_SCHEDULE_DURATION = exports.METRIC_GO_PROCESSOR_LIMIT = exports.METRIC_GO_MEMORY_USED = exports.METRIC_GO_MEMORY_LIMIT = exports.METRIC_GO_MEMORY_GC_GOAL = exports.METRIC_GO_MEMORY_ALLOCATIONS = exports.METRIC_GO_MEMORY_ALLOCATED = exports.METRIC_GO_GOROUTINE_COUNT = exports.METRIC_GO_CONFIG_GOGC = exports.METRIC_GEN_AI_SERVER_TIME_TO_FIRST_TOKEN = exports.METRIC_GEN_AI_SERVER_TIME_PER_OUTPUT_TOKEN = exports.METRIC_GEN_AI_SERVER_REQUEST_DURATION = exports.METRIC_GEN_AI_CLIENT_TOKEN_USAGE = exports.METRIC_GEN_AI_CLIENT_OPERATION_DURATION = exports.METRIC_FAAS_TIMEOUTS = exports.METRIC_FAAS_NET_IO = exports.METRIC_FAAS_MEM_USAGE = exports.METRIC_FAAS_INVOKE_DURATION = exports.METRIC_FAAS_INVOCATIONS = exports.METRIC_FAAS_INIT_DURATION = exports.METRIC_FAAS_ERRORS = exports.METRIC_FAAS_CPU_USAGE = exports.METRIC_FAAS_COLDSTARTS = exports.METRIC_DNS_LOOKUP_DURATION = exports.METRIC_DB_CLIENT_OPERATION_DURATION = exports.METRIC_DB_CLIENT_CONNECTIONS_WAIT_TIME = exports.METRIC_DB_CLIENT_CONNECTIONS_USE_TIME = exports.METRIC_DB_CLIENT_CONNECTIONS_USAGE = exports.METRIC_DB_CLIENT_CONNECTIONS_TIMEOUTS = exports.METRIC_DB_CLIENT_CONNECTIONS_PENDING_REQUESTS = exports.METRIC_DB_CLIENT_CONNECTIONS_MAX = exports.METRIC_DB_CLIENT_CONNECTIONS_IDLE_MIN = exports.METRIC_DB_CLIENT_CONNECTIONS_IDLE_MAX = exports.METRIC_DB_CLIENT_CONNECTIONS_CREATE_TIME = exports.METRIC_DB_CLIENT_CONNECTION_WAIT_TIME = exports.METRIC_DB_CLIENT_CONNECTION_USE_TIME = exports.METRIC_DB_CLIENT_CONNECTION_TIMEOUTS = exports.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS = exports.METRIC_DB_CLIENT_CONNECTION_MAX = exports.METRIC_DB_CLIENT_CONNECTION_IDLE_MIN = exports.METRIC_DB_CLIENT_CONNECTION_IDLE_MAX = exports.METRIC_DB_CLIENT_CONNECTION_CREATE_TIME = exports.METRIC_DB_CLIENT_CONNECTION_COUNT = exports.METRIC_CONTAINER_NETWORK_IO = exports.METRIC_CONTAINER_MEMORY_USAGE = exports.METRIC_CONTAINER_DISK_IO = exports.METRIC_CONTAINER_CPU_TIME = void 0; +exports.METRIC_SYSTEM_CPU_FREQUENCY = exports.METRIC_RPC_SERVER_RESPONSES_PER_RPC = exports.METRIC_RPC_SERVER_RESPONSE_SIZE = exports.METRIC_RPC_SERVER_REQUESTS_PER_RPC = exports.METRIC_RPC_SERVER_REQUEST_SIZE = exports.METRIC_RPC_SERVER_DURATION = exports.METRIC_RPC_CLIENT_RESPONSES_PER_RPC = exports.METRIC_RPC_CLIENT_RESPONSE_SIZE = exports.METRIC_RPC_CLIENT_REQUESTS_PER_RPC = exports.METRIC_RPC_CLIENT_REQUEST_SIZE = exports.METRIC_RPC_CLIENT_DURATION = exports.METRIC_PROCESS_THREAD_COUNT = exports.METRIC_PROCESS_PAGING_FAULTS = exports.METRIC_PROCESS_OPEN_FILE_DESCRIPTOR_COUNT = exports.METRIC_PROCESS_NETWORK_IO = exports.METRIC_PROCESS_MEMORY_VIRTUAL = exports.METRIC_PROCESS_MEMORY_USAGE = exports.METRIC_PROCESS_DISK_IO = exports.METRIC_PROCESS_CPU_UTILIZATION = exports.METRIC_PROCESS_CPU_TIME = exports.METRIC_PROCESS_CONTEXT_SWITCHES = exports.METRIC_NODEJS_EVENTLOOP_UTILIZATION = exports.METRIC_NODEJS_EVENTLOOP_DELAY_STDDEV = exports.METRIC_NODEJS_EVENTLOOP_DELAY_P99 = exports.METRIC_NODEJS_EVENTLOOP_DELAY_P90 = exports.METRIC_NODEJS_EVENTLOOP_DELAY_P50 = exports.METRIC_NODEJS_EVENTLOOP_DELAY_MIN = exports.METRIC_NODEJS_EVENTLOOP_DELAY_MEAN = exports.METRIC_NODEJS_EVENTLOOP_DELAY_MAX = exports.METRIC_MESSAGING_RECEIVE_MESSAGES = exports.METRIC_MESSAGING_RECEIVE_DURATION = exports.METRIC_MESSAGING_PUBLISH_MESSAGES = exports.METRIC_MESSAGING_PUBLISH_DURATION = exports.METRIC_MESSAGING_PROCESS_MESSAGES = exports.METRIC_MESSAGING_PROCESS_DURATION = exports.METRIC_MESSAGING_CLIENT_PUBLISHED_MESSAGES = exports.METRIC_MESSAGING_CLIENT_OPERATION_DURATION = exports.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES = exports.METRIC_JVM_SYSTEM_CPU_UTILIZATION = exports.METRIC_JVM_SYSTEM_CPU_LOAD_1M = exports.METRIC_JVM_MEMORY_INIT = exports.METRIC_JVM_BUFFER_MEMORY_USED = exports.METRIC_JVM_BUFFER_MEMORY_USAGE = exports.METRIC_JVM_BUFFER_MEMORY_LIMIT = exports.METRIC_JVM_BUFFER_COUNT = exports.METRIC_HTTP_SERVER_RESPONSE_BODY_SIZE = exports.METRIC_HTTP_SERVER_REQUEST_BODY_SIZE = exports.METRIC_HTTP_SERVER_ACTIVE_REQUESTS = exports.METRIC_HTTP_CLIENT_RESPONSE_BODY_SIZE = exports.METRIC_HTTP_CLIENT_REQUEST_BODY_SIZE = void 0; +exports.METRIC_V8JS_MEMORY_HEAP_USED = exports.METRIC_V8JS_MEMORY_HEAP_LIMIT = exports.METRIC_V8JS_HEAP_SPACE_PHYSICAL_SIZE = exports.METRIC_V8JS_HEAP_SPACE_AVAILABLE_SIZE = exports.METRIC_V8JS_GC_DURATION = exports.METRIC_SYSTEM_PROCESS_CREATED = exports.METRIC_SYSTEM_PROCESS_COUNT = exports.METRIC_SYSTEM_PAGING_UTILIZATION = exports.METRIC_SYSTEM_PAGING_USAGE = exports.METRIC_SYSTEM_PAGING_OPERATIONS = exports.METRIC_SYSTEM_PAGING_FAULTS = exports.METRIC_SYSTEM_NETWORK_PACKETS = exports.METRIC_SYSTEM_NETWORK_IO = exports.METRIC_SYSTEM_NETWORK_ERRORS = exports.METRIC_SYSTEM_NETWORK_DROPPED = exports.METRIC_SYSTEM_NETWORK_CONNECTIONS = exports.METRIC_SYSTEM_MEMORY_UTILIZATION = exports.METRIC_SYSTEM_MEMORY_USAGE = exports.METRIC_SYSTEM_MEMORY_SHARED = exports.METRIC_SYSTEM_MEMORY_LIMIT = exports.METRIC_SYSTEM_LINUX_MEMORY_SLAB_USAGE = exports.METRIC_SYSTEM_LINUX_MEMORY_AVAILABLE = exports.METRIC_SYSTEM_FILESYSTEM_UTILIZATION = exports.METRIC_SYSTEM_FILESYSTEM_USAGE = exports.METRIC_SYSTEM_DISK_OPERATIONS = exports.METRIC_SYSTEM_DISK_OPERATION_TIME = exports.METRIC_SYSTEM_DISK_MERGED = exports.METRIC_SYSTEM_DISK_IO_TIME = exports.METRIC_SYSTEM_DISK_IO = exports.METRIC_SYSTEM_CPU_UTILIZATION = exports.METRIC_SYSTEM_CPU_TIME = exports.METRIC_SYSTEM_CPU_PHYSICAL_COUNT = exports.METRIC_SYSTEM_CPU_LOGICAL_COUNT = void 0; +//---------------------------------------------------------------------------------------------------------- +// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/register/stable/metrics.ts.j2 +//---------------------------------------------------------------------------------------------------------- +/** + * Total CPU time consumed + * + * @note Total CPU time consumed by the specific container on all available CPU cores + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_CONTAINER_CPU_TIME = 'container.cpu.time'; +/** + * Disk bytes for the container. + * + * @note The total number of bytes read/written successfully (aggregated from all disks). + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_CONTAINER_DISK_IO = 'container.disk.io'; +/** + * Memory usage of the container. + * + * @note Memory usage of the container. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_CONTAINER_MEMORY_USAGE = 'container.memory.usage'; +/** + * Network bytes for the container. + * + * @note The number of bytes sent/received on all network interfaces by the container. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_CONTAINER_NETWORK_IO = 'container.network.io'; +/** + * The number of connections that are currently in state described by the `state` attribute + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_DB_CLIENT_CONNECTION_COUNT = 'db.client.connection.count'; +/** + * The time it took to create a new connection + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_DB_CLIENT_CONNECTION_CREATE_TIME = 'db.client.connection.create_time'; +/** + * The maximum number of idle open connections allowed + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_DB_CLIENT_CONNECTION_IDLE_MAX = 'db.client.connection.idle.max'; +/** + * The minimum number of idle open connections allowed + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_DB_CLIENT_CONNECTION_IDLE_MIN = 'db.client.connection.idle.min'; +/** + * The maximum number of open connections allowed + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_DB_CLIENT_CONNECTION_MAX = 'db.client.connection.max'; +/** + * The number of pending requests for an open connection, cumulative for the entire pool + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS = 'db.client.connection.pending_requests'; +/** + * The number of connection timeouts that have occurred trying to obtain a connection from the pool + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_DB_CLIENT_CONNECTION_TIMEOUTS = 'db.client.connection.timeouts'; +/** + * The time between borrowing a connection and returning it to the pool + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_DB_CLIENT_CONNECTION_USE_TIME = 'db.client.connection.use_time'; +/** + * The time it took to obtain an open connection from the pool + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_DB_CLIENT_CONNECTION_WAIT_TIME = 'db.client.connection.wait_time'; +/** + * Deprecated, use `db.client.connection.create_time` instead. Note: the unit also changed from `ms` to `s`. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.client.connection.create_time`. Note: the unit also changed from `ms` to `s`. + */ +exports.METRIC_DB_CLIENT_CONNECTIONS_CREATE_TIME = 'db.client.connections.create_time'; +/** + * Deprecated, use `db.client.connection.idle.max` instead. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.client.connection.idle.max`. + */ +exports.METRIC_DB_CLIENT_CONNECTIONS_IDLE_MAX = 'db.client.connections.idle.max'; +/** + * Deprecated, use `db.client.connection.idle.min` instead. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.client.connection.idle.min`. + */ +exports.METRIC_DB_CLIENT_CONNECTIONS_IDLE_MIN = 'db.client.connections.idle.min'; +/** + * Deprecated, use `db.client.connection.max` instead. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.client.connection.max`. + */ +exports.METRIC_DB_CLIENT_CONNECTIONS_MAX = 'db.client.connections.max'; +/** + * Deprecated, use `db.client.connection.pending_requests` instead. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.client.connection.pending_requests`. + */ +exports.METRIC_DB_CLIENT_CONNECTIONS_PENDING_REQUESTS = 'db.client.connections.pending_requests'; +/** + * Deprecated, use `db.client.connection.timeouts` instead. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.client.connection.timeouts`. + */ +exports.METRIC_DB_CLIENT_CONNECTIONS_TIMEOUTS = 'db.client.connections.timeouts'; +/** + * Deprecated, use `db.client.connection.count` instead. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.client.connection.count`. + */ +exports.METRIC_DB_CLIENT_CONNECTIONS_USAGE = 'db.client.connections.usage'; +/** + * Deprecated, use `db.client.connection.use_time` instead. Note: the unit also changed from `ms` to `s`. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.client.connection.use_time`. Note: the unit also changed from `ms` to `s`. + */ +exports.METRIC_DB_CLIENT_CONNECTIONS_USE_TIME = 'db.client.connections.use_time'; +/** + * Deprecated, use `db.client.connection.wait_time` instead. Note: the unit also changed from `ms` to `s`. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `db.client.connection.wait_time`. Note: the unit also changed from `ms` to `s`. + */ +exports.METRIC_DB_CLIENT_CONNECTIONS_WAIT_TIME = 'db.client.connections.wait_time'; +/** + * Duration of database client operations. + * + * @note Batch operations **SHOULD** be recorded as a single operation. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_DB_CLIENT_OPERATION_DURATION = 'db.client.operation.duration'; +/** + * Measures the time taken to perform a DNS lookup. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_DNS_LOOKUP_DURATION = 'dns.lookup.duration'; +/** + * Number of invocation cold starts + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_FAAS_COLDSTARTS = 'faas.coldstarts'; +/** + * Distribution of CPU usage per invocation + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_FAAS_CPU_USAGE = 'faas.cpu_usage'; +/** + * Number of invocation errors + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_FAAS_ERRORS = 'faas.errors'; +/** + * Measures the duration of the function's initialization, such as a cold start + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_FAAS_INIT_DURATION = 'faas.init_duration'; +/** + * Number of successful invocations + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_FAAS_INVOCATIONS = 'faas.invocations'; +/** + * Measures the duration of the function's logic execution + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_FAAS_INVOKE_DURATION = 'faas.invoke_duration'; +/** + * Distribution of max memory usage per invocation + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_FAAS_MEM_USAGE = 'faas.mem_usage'; +/** + * Distribution of net I/O usage per invocation + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_FAAS_NET_IO = 'faas.net_io'; +/** + * Number of invocation timeouts + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_FAAS_TIMEOUTS = 'faas.timeouts'; +/** + * GenAI operation duration + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_GEN_AI_CLIENT_OPERATION_DURATION = 'gen_ai.client.operation.duration'; +/** + * Measures number of input and output tokens used + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_GEN_AI_CLIENT_TOKEN_USAGE = 'gen_ai.client.token.usage'; +/** + * Generative AI server request duration such as time-to-last byte or last output token + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_GEN_AI_SERVER_REQUEST_DURATION = 'gen_ai.server.request.duration'; +/** + * Time per output token generated after the first token for successful responses + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_GEN_AI_SERVER_TIME_PER_OUTPUT_TOKEN = 'gen_ai.server.time_per_output_token'; +/** + * Time to generate first token for successful responses + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_GEN_AI_SERVER_TIME_TO_FIRST_TOKEN = 'gen_ai.server.time_to_first_token'; +/** + * Heap size target percentage configured by the user, otherwise 100. + * + * @note The value range is [0.0,100.0]. Computed from `/gc/gogc:percent`. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_GO_CONFIG_GOGC = 'go.config.gogc'; +/** + * Count of live goroutines. + * + * @note Computed from `/sched/goroutines:goroutines`. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_GO_GOROUTINE_COUNT = 'go.goroutine.count'; +/** + * Memory allocated to the heap by the application. + * + * @note Computed from `/gc/heap/allocs:bytes`. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_GO_MEMORY_ALLOCATED = 'go.memory.allocated'; +/** + * Count of allocations to the heap by the application. + * + * @note Computed from `/gc/heap/allocs:objects`. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_GO_MEMORY_ALLOCATIONS = 'go.memory.allocations'; +/** + * Heap size target for the end of the GC cycle. + * + * @note Computed from `/gc/heap/goal:bytes`. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_GO_MEMORY_GC_GOAL = 'go.memory.gc.goal'; +/** + * Go runtime memory limit configured by the user, if a limit exists. + * + * @note Computed from `/gc/gomemlimit:bytes`. This metric is excluded if the limit obtained from the Go runtime is math.MaxInt64. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_GO_MEMORY_LIMIT = 'go.memory.limit'; +/** + * Memory used by the Go runtime. + * + * @note Computed from `(/memory/classes/total:bytes - /memory/classes/heap/released:bytes)`. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_GO_MEMORY_USED = 'go.memory.used'; +/** + * The number of OS threads that can execute user-level Go code simultaneously. + * + * @note Computed from `/sched/gomaxprocs:threads`. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_GO_PROCESSOR_LIMIT = 'go.processor.limit'; +/** + * The time goroutines have spent in the scheduler in a runnable state before actually running. + * + * @note Computed from `/sched/latencies:seconds`. Bucket boundaries are provided by the runtime, and are subject to change. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_GO_SCHEDULE_DURATION = 'go.schedule.duration'; +/** + * Number of active HTTP requests. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_HTTP_CLIENT_ACTIVE_REQUESTS = 'http.client.active_requests'; +/** + * The duration of the successfully established outbound HTTP connections. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_HTTP_CLIENT_CONNECTION_DURATION = 'http.client.connection.duration'; +/** + * Number of outbound HTTP connections that are currently active or idle on the client. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_HTTP_CLIENT_OPEN_CONNECTIONS = 'http.client.open_connections'; +/** + * Size of HTTP client request bodies. + * + * @note The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_HTTP_CLIENT_REQUEST_BODY_SIZE = 'http.client.request.body.size'; +/** + * Size of HTTP client response bodies. + * + * @note The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_HTTP_CLIENT_RESPONSE_BODY_SIZE = 'http.client.response.body.size'; +/** + * Number of active HTTP server requests. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_HTTP_SERVER_ACTIVE_REQUESTS = 'http.server.active_requests'; +/** + * Size of HTTP server request bodies. + * + * @note The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_HTTP_SERVER_REQUEST_BODY_SIZE = 'http.server.request.body.size'; +/** + * Size of HTTP server response bodies. + * + * @note The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_HTTP_SERVER_RESPONSE_BODY_SIZE = 'http.server.response.body.size'; +/** + * Number of buffers in the pool. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_JVM_BUFFER_COUNT = 'jvm.buffer.count'; +/** + * Measure of total memory capacity of buffers. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_JVM_BUFFER_MEMORY_LIMIT = 'jvm.buffer.memory.limit'; +/** + * Deprecated, use `jvm.buffer.memory.used` instead. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `jvm.buffer.memory.used`. + */ +exports.METRIC_JVM_BUFFER_MEMORY_USAGE = 'jvm.buffer.memory.usage'; +/** + * Measure of memory used by buffers. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_JVM_BUFFER_MEMORY_USED = 'jvm.buffer.memory.used'; +/** + * Measure of initial memory requested. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_JVM_MEMORY_INIT = 'jvm.memory.init'; +/** + * Average CPU load of the whole system for the last minute as reported by the JVM. + * + * @note The value range is [0,n], where n is the number of CPU cores - or a negative number if the value is not available. This utilization is not defined as being for the specific interval since last measurement (unlike `system.cpu.utilization`). [Reference](https://docs.oracle.com/en/java/javase/17/docs/api/java.management/java/lang/management/OperatingSystemMXBean.html#getSystemLoadAverage()). + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_JVM_SYSTEM_CPU_LOAD_1M = 'jvm.system.cpu.load_1m'; +/** + * Recent CPU utilization for the whole system as reported by the JVM. + * + * @note The value range is [0.0,1.0]. This utilization is not defined as being for the specific interval since last measurement (unlike `system.cpu.utilization`). [Reference](https://docs.oracle.com/en/java/javase/17/docs/api/jdk.management/com/sun/management/OperatingSystemMXBean.html#getCpuLoad()). + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_JVM_SYSTEM_CPU_UTILIZATION = 'jvm.system.cpu.utilization'; +/** + * Number of messages that were delivered to the application. + * + * @note Records the number of messages pulled from the broker or number of messages dispatched to the application in push-based scenarios. + * The metric **SHOULD** be reported once per message delivery. For example, if receiving and processing operations are both instrumented for a single message delivery, this counter is incremented when the message is received and not reported when it is processed. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES = 'messaging.client.consumed.messages'; +/** + * Duration of messaging operation initiated by a producer or consumer client. + * + * @note This metric **SHOULD** **NOT** be used to report processing duration - processing duration is reported in `messaging.process.duration` metric. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_MESSAGING_CLIENT_OPERATION_DURATION = 'messaging.client.operation.duration'; +/** + * Number of messages producer attempted to publish to the broker. + * + * @note This metric **MUST** **NOT** count messages that were created haven't yet been attempted to be published. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_MESSAGING_CLIENT_PUBLISHED_MESSAGES = 'messaging.client.published.messages'; +/** + * Duration of processing operation. + * + * @note This metric **MUST** be reported for operations with `messaging.operation.type` that matches `process`. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_MESSAGING_PROCESS_DURATION = 'messaging.process.duration'; +/** + * Deprecated. Use `messaging.client.consumed.messages` instead. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `messaging.client.consumed.messages`. + */ +exports.METRIC_MESSAGING_PROCESS_MESSAGES = 'messaging.process.messages'; +/** + * Deprecated. Use `messaging.client.operation.duration` instead. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `messaging.client.operation.duration`. + */ +exports.METRIC_MESSAGING_PUBLISH_DURATION = 'messaging.publish.duration'; +/** + * Deprecated. Use `messaging.client.produced.messages` instead. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `messaging.client.produced.messages`. + */ +exports.METRIC_MESSAGING_PUBLISH_MESSAGES = 'messaging.publish.messages'; +/** + * Deprecated. Use `messaging.client.operation.duration` instead. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `messaging.client.operation.duration`. + */ +exports.METRIC_MESSAGING_RECEIVE_DURATION = 'messaging.receive.duration'; +/** + * Deprecated. Use `messaging.client.consumed.messages` instead. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * + * @deprecated * Replaced by `messaging.client.consumed.messages`. + */ +exports.METRIC_MESSAGING_RECEIVE_MESSAGES = 'messaging.receive.messages'; +/** + * Event loop maximum delay. + * + * @note Value can be retrieved from value `histogram.max` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_NODEJS_EVENTLOOP_DELAY_MAX = 'nodejs.eventloop.delay.max'; +/** + * Event loop mean delay. + * + * @note Value can be retrieved from value `histogram.mean` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_NODEJS_EVENTLOOP_DELAY_MEAN = 'nodejs.eventloop.delay.mean'; +/** + * Event loop minimum delay. + * + * @note Value can be retrieved from value `histogram.min` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_NODEJS_EVENTLOOP_DELAY_MIN = 'nodejs.eventloop.delay.min'; +/** + * Event loop 50 percentile delay. + * + * @note Value can be retrieved from value `histogram.percentile(50)` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_NODEJS_EVENTLOOP_DELAY_P50 = 'nodejs.eventloop.delay.p50'; +/** + * Event loop 90 percentile delay. + * + * @note Value can be retrieved from value `histogram.percentile(90)` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_NODEJS_EVENTLOOP_DELAY_P90 = 'nodejs.eventloop.delay.p90'; +/** + * Event loop 99 percentile delay. + * + * @note Value can be retrieved from value `histogram.percentile(99)` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_NODEJS_EVENTLOOP_DELAY_P99 = 'nodejs.eventloop.delay.p99'; +/** + * Event loop standard deviation delay. + * + * @note Value can be retrieved from value `histogram.stddev` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_NODEJS_EVENTLOOP_DELAY_STDDEV = 'nodejs.eventloop.delay.stddev'; +/** + * Event loop utilization. + * + * @note The value range is [0.0,1.0] and can be retrieved from value [`performance.eventLoopUtilization([utilization1[, utilization2]])`](https://nodejs.org/api/perf_hooks.html#performanceeventlooputilizationutilization1-utilization2) + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_NODEJS_EVENTLOOP_UTILIZATION = 'nodejs.eventloop.utilization'; +/** + * Number of times the process has been context switched. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_PROCESS_CONTEXT_SWITCHES = 'process.context_switches'; +/** + * Total CPU seconds broken down by different states. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_PROCESS_CPU_TIME = 'process.cpu.time'; +/** + * Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_PROCESS_CPU_UTILIZATION = 'process.cpu.utilization'; +/** + * Disk bytes transferred. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_PROCESS_DISK_IO = 'process.disk.io'; +/** + * The amount of physical memory in use. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_PROCESS_MEMORY_USAGE = 'process.memory.usage'; +/** + * The amount of committed virtual memory. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_PROCESS_MEMORY_VIRTUAL = 'process.memory.virtual'; +/** + * Network bytes transferred. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_PROCESS_NETWORK_IO = 'process.network.io'; +/** + * Number of file descriptors in use by the process. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_PROCESS_OPEN_FILE_DESCRIPTOR_COUNT = 'process.open_file_descriptor.count'; +/** + * Number of page faults the process has made. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_PROCESS_PAGING_FAULTS = 'process.paging.faults'; +/** + * Process threads count. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_PROCESS_THREAD_COUNT = 'process.thread.count'; +/** + * Measures the duration of outbound RPC. + * + * @note While streaming RPCs may record this metric as start-of-batch + * to end-of-batch, it's hard to interpret in practice. + * + * **Streaming**: N/A. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_RPC_CLIENT_DURATION = 'rpc.client.duration'; +/** + * Measures the size of RPC request messages (uncompressed). + * + * @note **Streaming**: Recorded per message in a streaming batch + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_RPC_CLIENT_REQUEST_SIZE = 'rpc.client.request.size'; +/** + * Measures the number of messages received per RPC. + * + * @note Should be 1 for all non-streaming RPCs. + * + * **Streaming**: This metric is required for server and client streaming RPCs + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_RPC_CLIENT_REQUESTS_PER_RPC = 'rpc.client.requests_per_rpc'; +/** + * Measures the size of RPC response messages (uncompressed). + * + * @note **Streaming**: Recorded per response in a streaming batch + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_RPC_CLIENT_RESPONSE_SIZE = 'rpc.client.response.size'; +/** + * Measures the number of messages sent per RPC. + * + * @note Should be 1 for all non-streaming RPCs. + * + * **Streaming**: This metric is required for server and client streaming RPCs + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_RPC_CLIENT_RESPONSES_PER_RPC = 'rpc.client.responses_per_rpc'; +/** + * Measures the duration of inbound RPC. + * + * @note While streaming RPCs may record this metric as start-of-batch + * to end-of-batch, it's hard to interpret in practice. + * + * **Streaming**: N/A. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_RPC_SERVER_DURATION = 'rpc.server.duration'; +/** + * Measures the size of RPC request messages (uncompressed). + * + * @note **Streaming**: Recorded per message in a streaming batch + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_RPC_SERVER_REQUEST_SIZE = 'rpc.server.request.size'; +/** + * Measures the number of messages received per RPC. + * + * @note Should be 1 for all non-streaming RPCs. + * + * **Streaming** : This metric is required for server and client streaming RPCs + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_RPC_SERVER_REQUESTS_PER_RPC = 'rpc.server.requests_per_rpc'; +/** + * Measures the size of RPC response messages (uncompressed). + * + * @note **Streaming**: Recorded per response in a streaming batch + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_RPC_SERVER_RESPONSE_SIZE = 'rpc.server.response.size'; +/** + * Measures the number of messages sent per RPC. + * + * @note Should be 1 for all non-streaming RPCs. + * + * **Streaming**: This metric is required for server and client streaming RPCs + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_RPC_SERVER_RESPONSES_PER_RPC = 'rpc.server.responses_per_rpc'; +/** + * Reports the current frequency of the CPU in Hz + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_CPU_FREQUENCY = 'system.cpu.frequency'; +/** + * Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_CPU_LOGICAL_COUNT = 'system.cpu.logical.count'; +/** + * Reports the number of actual physical processor cores on the hardware + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_CPU_PHYSICAL_COUNT = 'system.cpu.physical.count'; +/** + * Seconds each logical CPU spent on each mode + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_CPU_TIME = 'system.cpu.time'; +/** + * Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_CPU_UTILIZATION = 'system.cpu.utilization'; +/** + + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_DISK_IO = 'system.disk.io'; +/** + * Time disk spent activated + * + * @note The real elapsed time ("wall clock") used in the I/O path (time from operations running in parallel are not counted). Measured as: + * + * - Linux: Field 13 from [procfs-diskstats](https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats) + * - Windows: The complement of + * ["Disk\% Idle Time"](https://learn.microsoft.com/archive/blogs/askcore/windows-performance-monitor-disk-counters-explained#windows-performance-monitor-disk-counters-explained) + * performance counter: `uptime * (100 - "Disk\% Idle Time") / 100` + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_DISK_IO_TIME = 'system.disk.io_time'; +/** + + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_DISK_MERGED = 'system.disk.merged'; +/** + * Sum of the time each operation took to complete + * + * @note Because it is the sum of time each request took, parallel-issued requests each contribute to make the count grow. Measured as: + * + * - Linux: Fields 7 & 11 from [procfs-diskstats](https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats) + * - Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" perf counter (similar for Writes) + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_DISK_OPERATION_TIME = 'system.disk.operation_time'; +/** + + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_DISK_OPERATIONS = 'system.disk.operations'; +/** + + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_FILESYSTEM_USAGE = 'system.filesystem.usage'; +/** + + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_FILESYSTEM_UTILIZATION = 'system.filesystem.utilization'; +/** + * An estimate of how much memory is available for starting new applications, without causing swapping + * + * @note This is an alternative to `system.memory.usage` metric with `state=free`. + * Linux starting from 3.14 exports "available" memory. It takes "free" memory as a baseline, and then factors in kernel-specific values. + * This is supposed to be more accurate than just "free" memory. + * For reference, see the calculations [here](https://superuser.com/a/980821). + * See also `MemAvailable` in [/proc/meminfo](https://man7.org/linux/man-pages/man5/proc.5.html). + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_LINUX_MEMORY_AVAILABLE = 'system.linux.memory.available'; +/** + * Reports the memory used by the Linux kernel for managing caches of frequently used objects. + * + * @note The sum over the `reclaimable` and `unreclaimable` state values in `linux.memory.slab.usage` **SHOULD** be equal to the total slab memory available on the system. + * Note that the total slab memory is not constant and may vary over time. + * See also the [Slab allocator](https://blogs.oracle.com/linux/post/understanding-linux-kernel-memory-statistics) and `Slab` in [/proc/meminfo](https://man7.org/linux/man-pages/man5/proc.5.html). + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_LINUX_MEMORY_SLAB_USAGE = 'system.linux.memory.slab.usage'; +/** + * Total memory available in the system. + * + * @note Its value **SHOULD** equal the sum of `system.memory.state` over all states. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_MEMORY_LIMIT = 'system.memory.limit'; +/** + * Shared memory used (mostly by tmpfs). + * + * @note Equivalent of `shared` from [`free` command](https://man7.org/linux/man-pages/man1/free.1.html) or + * `Shmem` from [`/proc/meminfo`](https://man7.org/linux/man-pages/man5/proc.5.html)" + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_MEMORY_SHARED = 'system.memory.shared'; +/** + * Reports memory in use by state. + * + * @note The sum over all `system.memory.state` values **SHOULD** equal the total memory + * available on the system, that is `system.memory.limit`. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_MEMORY_USAGE = 'system.memory.usage'; +/** + + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_MEMORY_UTILIZATION = 'system.memory.utilization'; +/** + + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_NETWORK_CONNECTIONS = 'system.network.connections'; +/** + * Count of packets that are dropped or discarded even though there was no error + * + * @note Measured as: + * + * - Linux: the `drop` column in `/proc/dev/net` ([source](https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html)) + * - Windows: [`InDiscards`/`OutDiscards`](https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2) + * from [`GetIfEntry2`](https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2) + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_NETWORK_DROPPED = 'system.network.dropped'; +/** + * Count of network errors detected + * + * @note Measured as: + * + * - Linux: the `errs` column in `/proc/dev/net` ([source](https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html)). + * - Windows: [`InErrors`/`OutErrors`](https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2) + * from [`GetIfEntry2`](https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2). + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_NETWORK_ERRORS = 'system.network.errors'; +/** + + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_NETWORK_IO = 'system.network.io'; +/** + + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_NETWORK_PACKETS = 'system.network.packets'; +/** + + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_PAGING_FAULTS = 'system.paging.faults'; +/** + + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_PAGING_OPERATIONS = 'system.paging.operations'; +/** + * Unix swap or windows pagefile usage + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_PAGING_USAGE = 'system.paging.usage'; +/** + + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_PAGING_UTILIZATION = 'system.paging.utilization'; +/** + * Total number of processes in each state + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_PROCESS_COUNT = 'system.process.count'; +/** + * Total number of processes created over uptime of the host + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_SYSTEM_PROCESS_CREATED = 'system.process.created'; +/** + * Garbage collection duration. + * + * @note The values can be retrieve from [`perf_hooks.PerformanceObserver(...).observe({ entryTypes: ['gc'] })`](https://nodejs.org/api/perf_hooks.html#performanceobserverobserveoptions) + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_V8JS_GC_DURATION = 'v8js.gc.duration'; +/** + * Heap space available size. + * + * @note Value can be retrieved from value `space_available_size` of [`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics) + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_V8JS_HEAP_SPACE_AVAILABLE_SIZE = 'v8js.heap.space.available_size'; +/** + * Committed size of a heap space. + * + * @note Value can be retrieved from value `physical_space_size` of [`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics) + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_V8JS_HEAP_SPACE_PHYSICAL_SIZE = 'v8js.heap.space.physical_size'; +/** + * Total heap memory size pre-allocated. + * + * @note The value can be retrieved from value `space_size` of [`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics) + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_V8JS_MEMORY_HEAP_LIMIT = 'v8js.memory.heap.limit'; +/** + * Heap Memory size allocated. + * + * @note The value can be retrieved from value `space_used_size` of [`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics) + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_V8JS_MEMORY_HEAP_USED = 'v8js.memory.heap.used'; +//# sourceMappingURL=experimental_metrics.js.map + +/***/ }), + +/***/ 65849: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +// Incubating export also contains stable constants in order to maintain +// backward compatibility between minor version releases +__exportStar(__nccwpck_require__(28231), exports); +__exportStar(__nccwpck_require__(67409), exports); +__exportStar(__nccwpck_require__(86219), exports); +__exportStar(__nccwpck_require__(44956), exports); +//# sourceMappingURL=index-incubating.js.map + +/***/ }), + +/***/ 32736: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +/* eslint-disable no-restricted-syntax -- + * These re-exports are only of constants, only two-levels deep, and + * should not cause problems for tree-shakers. + */ +// Deprecated. These are kept around for compatibility purposes +__exportStar(__nccwpck_require__(19887), exports); +__exportStar(__nccwpck_require__(83327), exports); +// Use these instead +__exportStar(__nccwpck_require__(28231), exports); +__exportStar(__nccwpck_require__(67409), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 56803: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createConstMap = void 0; +/** + * Creates a const map from the given values + * @param values - An array of values to be used as keys and values in the map. + * @returns A populated version of the map with the values and keys derived from the values. + */ +/*#__NO_SIDE_EFFECTS__*/ +function createConstMap(values) { + // eslint-disable-next-line prefer-const, @typescript-eslint/no-explicit-any + let res = {}; + const len = values.length; + for (let lp = 0; lp < len; lp++) { + const val = values[lp]; + if (val) { + res[String(val).toUpperCase().replace(/[-.]/g, '_')] = val; + } + } + return res; +} +exports.createConstMap = createConstMap; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 73629: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SEMRESATTRS_K8S_STATEFULSET_NAME = exports.SEMRESATTRS_K8S_STATEFULSET_UID = exports.SEMRESATTRS_K8S_DEPLOYMENT_NAME = exports.SEMRESATTRS_K8S_DEPLOYMENT_UID = exports.SEMRESATTRS_K8S_REPLICASET_NAME = exports.SEMRESATTRS_K8S_REPLICASET_UID = exports.SEMRESATTRS_K8S_CONTAINER_NAME = exports.SEMRESATTRS_K8S_POD_NAME = exports.SEMRESATTRS_K8S_POD_UID = exports.SEMRESATTRS_K8S_NAMESPACE_NAME = exports.SEMRESATTRS_K8S_NODE_UID = exports.SEMRESATTRS_K8S_NODE_NAME = exports.SEMRESATTRS_K8S_CLUSTER_NAME = exports.SEMRESATTRS_HOST_IMAGE_VERSION = exports.SEMRESATTRS_HOST_IMAGE_ID = exports.SEMRESATTRS_HOST_IMAGE_NAME = exports.SEMRESATTRS_HOST_ARCH = exports.SEMRESATTRS_HOST_TYPE = exports.SEMRESATTRS_HOST_NAME = exports.SEMRESATTRS_HOST_ID = exports.SEMRESATTRS_FAAS_MAX_MEMORY = exports.SEMRESATTRS_FAAS_INSTANCE = exports.SEMRESATTRS_FAAS_VERSION = exports.SEMRESATTRS_FAAS_ID = exports.SEMRESATTRS_FAAS_NAME = exports.SEMRESATTRS_DEVICE_MODEL_NAME = exports.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER = exports.SEMRESATTRS_DEVICE_ID = exports.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT = exports.SEMRESATTRS_CONTAINER_IMAGE_TAG = exports.SEMRESATTRS_CONTAINER_IMAGE_NAME = exports.SEMRESATTRS_CONTAINER_RUNTIME = exports.SEMRESATTRS_CONTAINER_ID = exports.SEMRESATTRS_CONTAINER_NAME = exports.SEMRESATTRS_AWS_LOG_STREAM_ARNS = exports.SEMRESATTRS_AWS_LOG_STREAM_NAMES = exports.SEMRESATTRS_AWS_LOG_GROUP_ARNS = exports.SEMRESATTRS_AWS_LOG_GROUP_NAMES = exports.SEMRESATTRS_AWS_EKS_CLUSTER_ARN = exports.SEMRESATTRS_AWS_ECS_TASK_REVISION = exports.SEMRESATTRS_AWS_ECS_TASK_FAMILY = exports.SEMRESATTRS_AWS_ECS_TASK_ARN = exports.SEMRESATTRS_AWS_ECS_LAUNCHTYPE = exports.SEMRESATTRS_AWS_ECS_CLUSTER_ARN = exports.SEMRESATTRS_AWS_ECS_CONTAINER_ARN = exports.SEMRESATTRS_CLOUD_PLATFORM = exports.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE = exports.SEMRESATTRS_CLOUD_REGION = exports.SEMRESATTRS_CLOUD_ACCOUNT_ID = exports.SEMRESATTRS_CLOUD_PROVIDER = void 0; +exports.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = exports.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = exports.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = exports.CLOUDPLATFORMVALUES_AZURE_AKS = exports.CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = exports.CLOUDPLATFORMVALUES_AZURE_VM = exports.CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = exports.CLOUDPLATFORMVALUES_AWS_LAMBDA = exports.CLOUDPLATFORMVALUES_AWS_EKS = exports.CLOUDPLATFORMVALUES_AWS_ECS = exports.CLOUDPLATFORMVALUES_AWS_EC2 = exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = exports.CloudProviderValues = exports.CLOUDPROVIDERVALUES_GCP = exports.CLOUDPROVIDERVALUES_AZURE = exports.CLOUDPROVIDERVALUES_AWS = exports.CLOUDPROVIDERVALUES_ALIBABA_CLOUD = exports.SemanticResourceAttributes = exports.SEMRESATTRS_WEBENGINE_DESCRIPTION = exports.SEMRESATTRS_WEBENGINE_VERSION = exports.SEMRESATTRS_WEBENGINE_NAME = exports.SEMRESATTRS_TELEMETRY_AUTO_VERSION = exports.SEMRESATTRS_TELEMETRY_SDK_VERSION = exports.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE = exports.SEMRESATTRS_TELEMETRY_SDK_NAME = exports.SEMRESATTRS_SERVICE_VERSION = exports.SEMRESATTRS_SERVICE_INSTANCE_ID = exports.SEMRESATTRS_SERVICE_NAMESPACE = exports.SEMRESATTRS_SERVICE_NAME = exports.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION = exports.SEMRESATTRS_PROCESS_RUNTIME_VERSION = exports.SEMRESATTRS_PROCESS_RUNTIME_NAME = exports.SEMRESATTRS_PROCESS_OWNER = exports.SEMRESATTRS_PROCESS_COMMAND_ARGS = exports.SEMRESATTRS_PROCESS_COMMAND_LINE = exports.SEMRESATTRS_PROCESS_COMMAND = exports.SEMRESATTRS_PROCESS_EXECUTABLE_PATH = exports.SEMRESATTRS_PROCESS_EXECUTABLE_NAME = exports.SEMRESATTRS_PROCESS_PID = exports.SEMRESATTRS_OS_VERSION = exports.SEMRESATTRS_OS_NAME = exports.SEMRESATTRS_OS_DESCRIPTION = exports.SEMRESATTRS_OS_TYPE = exports.SEMRESATTRS_K8S_CRONJOB_NAME = exports.SEMRESATTRS_K8S_CRONJOB_UID = exports.SEMRESATTRS_K8S_JOB_NAME = exports.SEMRESATTRS_K8S_JOB_UID = exports.SEMRESATTRS_K8S_DAEMONSET_NAME = exports.SEMRESATTRS_K8S_DAEMONSET_UID = void 0; +exports.TelemetrySdkLanguageValues = exports.TELEMETRYSDKLANGUAGEVALUES_WEBJS = exports.TELEMETRYSDKLANGUAGEVALUES_RUBY = exports.TELEMETRYSDKLANGUAGEVALUES_PYTHON = exports.TELEMETRYSDKLANGUAGEVALUES_PHP = exports.TELEMETRYSDKLANGUAGEVALUES_NODEJS = exports.TELEMETRYSDKLANGUAGEVALUES_JAVA = exports.TELEMETRYSDKLANGUAGEVALUES_GO = exports.TELEMETRYSDKLANGUAGEVALUES_ERLANG = exports.TELEMETRYSDKLANGUAGEVALUES_DOTNET = exports.TELEMETRYSDKLANGUAGEVALUES_CPP = exports.OsTypeValues = exports.OSTYPEVALUES_Z_OS = exports.OSTYPEVALUES_SOLARIS = exports.OSTYPEVALUES_AIX = exports.OSTYPEVALUES_HPUX = exports.OSTYPEVALUES_DRAGONFLYBSD = exports.OSTYPEVALUES_OPENBSD = exports.OSTYPEVALUES_NETBSD = exports.OSTYPEVALUES_FREEBSD = exports.OSTYPEVALUES_DARWIN = exports.OSTYPEVALUES_LINUX = exports.OSTYPEVALUES_WINDOWS = exports.HostArchValues = exports.HOSTARCHVALUES_X86 = exports.HOSTARCHVALUES_PPC64 = exports.HOSTARCHVALUES_PPC32 = exports.HOSTARCHVALUES_IA64 = exports.HOSTARCHVALUES_ARM64 = exports.HOSTARCHVALUES_ARM32 = exports.HOSTARCHVALUES_AMD64 = exports.AwsEcsLaunchtypeValues = exports.AWSECSLAUNCHTYPEVALUES_FARGATE = exports.AWSECSLAUNCHTYPEVALUES_EC2 = exports.CloudPlatformValues = exports.CLOUDPLATFORMVALUES_GCP_APP_ENGINE = exports.CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = exports.CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = exports.CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = void 0; +const utils_1 = __nccwpck_require__(56803); +//---------------------------------------------------------------------------------------------------------- +// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2 +//---------------------------------------------------------------------------------------------------------- +//---------------------------------------------------------------------------------------------------------- +// Constant values for SemanticResourceAttributes +//---------------------------------------------------------------------------------------------------------- +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_CLOUD_PROVIDER = 'cloud.provider'; +const TMP_CLOUD_ACCOUNT_ID = 'cloud.account.id'; +const TMP_CLOUD_REGION = 'cloud.region'; +const TMP_CLOUD_AVAILABILITY_ZONE = 'cloud.availability_zone'; +const TMP_CLOUD_PLATFORM = 'cloud.platform'; +const TMP_AWS_ECS_CONTAINER_ARN = 'aws.ecs.container.arn'; +const TMP_AWS_ECS_CLUSTER_ARN = 'aws.ecs.cluster.arn'; +const TMP_AWS_ECS_LAUNCHTYPE = 'aws.ecs.launchtype'; +const TMP_AWS_ECS_TASK_ARN = 'aws.ecs.task.arn'; +const TMP_AWS_ECS_TASK_FAMILY = 'aws.ecs.task.family'; +const TMP_AWS_ECS_TASK_REVISION = 'aws.ecs.task.revision'; +const TMP_AWS_EKS_CLUSTER_ARN = 'aws.eks.cluster.arn'; +const TMP_AWS_LOG_GROUP_NAMES = 'aws.log.group.names'; +const TMP_AWS_LOG_GROUP_ARNS = 'aws.log.group.arns'; +const TMP_AWS_LOG_STREAM_NAMES = 'aws.log.stream.names'; +const TMP_AWS_LOG_STREAM_ARNS = 'aws.log.stream.arns'; +const TMP_CONTAINER_NAME = 'container.name'; +const TMP_CONTAINER_ID = 'container.id'; +const TMP_CONTAINER_RUNTIME = 'container.runtime'; +const TMP_CONTAINER_IMAGE_NAME = 'container.image.name'; +const TMP_CONTAINER_IMAGE_TAG = 'container.image.tag'; +const TMP_DEPLOYMENT_ENVIRONMENT = 'deployment.environment'; +const TMP_DEVICE_ID = 'device.id'; +const TMP_DEVICE_MODEL_IDENTIFIER = 'device.model.identifier'; +const TMP_DEVICE_MODEL_NAME = 'device.model.name'; +const TMP_FAAS_NAME = 'faas.name'; +const TMP_FAAS_ID = 'faas.id'; +const TMP_FAAS_VERSION = 'faas.version'; +const TMP_FAAS_INSTANCE = 'faas.instance'; +const TMP_FAAS_MAX_MEMORY = 'faas.max_memory'; +const TMP_HOST_ID = 'host.id'; +const TMP_HOST_NAME = 'host.name'; +const TMP_HOST_TYPE = 'host.type'; +const TMP_HOST_ARCH = 'host.arch'; +const TMP_HOST_IMAGE_NAME = 'host.image.name'; +const TMP_HOST_IMAGE_ID = 'host.image.id'; +const TMP_HOST_IMAGE_VERSION = 'host.image.version'; +const TMP_K8S_CLUSTER_NAME = 'k8s.cluster.name'; +const TMP_K8S_NODE_NAME = 'k8s.node.name'; +const TMP_K8S_NODE_UID = 'k8s.node.uid'; +const TMP_K8S_NAMESPACE_NAME = 'k8s.namespace.name'; +const TMP_K8S_POD_UID = 'k8s.pod.uid'; +const TMP_K8S_POD_NAME = 'k8s.pod.name'; +const TMP_K8S_CONTAINER_NAME = 'k8s.container.name'; +const TMP_K8S_REPLICASET_UID = 'k8s.replicaset.uid'; +const TMP_K8S_REPLICASET_NAME = 'k8s.replicaset.name'; +const TMP_K8S_DEPLOYMENT_UID = 'k8s.deployment.uid'; +const TMP_K8S_DEPLOYMENT_NAME = 'k8s.deployment.name'; +const TMP_K8S_STATEFULSET_UID = 'k8s.statefulset.uid'; +const TMP_K8S_STATEFULSET_NAME = 'k8s.statefulset.name'; +const TMP_K8S_DAEMONSET_UID = 'k8s.daemonset.uid'; +const TMP_K8S_DAEMONSET_NAME = 'k8s.daemonset.name'; +const TMP_K8S_JOB_UID = 'k8s.job.uid'; +const TMP_K8S_JOB_NAME = 'k8s.job.name'; +const TMP_K8S_CRONJOB_UID = 'k8s.cronjob.uid'; +const TMP_K8S_CRONJOB_NAME = 'k8s.cronjob.name'; +const TMP_OS_TYPE = 'os.type'; +const TMP_OS_DESCRIPTION = 'os.description'; +const TMP_OS_NAME = 'os.name'; +const TMP_OS_VERSION = 'os.version'; +const TMP_PROCESS_PID = 'process.pid'; +const TMP_PROCESS_EXECUTABLE_NAME = 'process.executable.name'; +const TMP_PROCESS_EXECUTABLE_PATH = 'process.executable.path'; +const TMP_PROCESS_COMMAND = 'process.command'; +const TMP_PROCESS_COMMAND_LINE = 'process.command_line'; +const TMP_PROCESS_COMMAND_ARGS = 'process.command_args'; +const TMP_PROCESS_OWNER = 'process.owner'; +const TMP_PROCESS_RUNTIME_NAME = 'process.runtime.name'; +const TMP_PROCESS_RUNTIME_VERSION = 'process.runtime.version'; +const TMP_PROCESS_RUNTIME_DESCRIPTION = 'process.runtime.description'; +const TMP_SERVICE_NAME = 'service.name'; +const TMP_SERVICE_NAMESPACE = 'service.namespace'; +const TMP_SERVICE_INSTANCE_ID = 'service.instance.id'; +const TMP_SERVICE_VERSION = 'service.version'; +const TMP_TELEMETRY_SDK_NAME = 'telemetry.sdk.name'; +const TMP_TELEMETRY_SDK_LANGUAGE = 'telemetry.sdk.language'; +const TMP_TELEMETRY_SDK_VERSION = 'telemetry.sdk.version'; +const TMP_TELEMETRY_AUTO_VERSION = 'telemetry.auto.version'; +const TMP_WEBENGINE_NAME = 'webengine.name'; +const TMP_WEBENGINE_VERSION = 'webengine.version'; +const TMP_WEBENGINE_DESCRIPTION = 'webengine.description'; +/** + * Name of the cloud provider. + * + * @deprecated use ATTR_CLOUD_PROVIDER + */ +exports.SEMRESATTRS_CLOUD_PROVIDER = TMP_CLOUD_PROVIDER; +/** + * The cloud account ID the resource is assigned to. + * + * @deprecated use ATTR_CLOUD_ACCOUNT_ID + */ +exports.SEMRESATTRS_CLOUD_ACCOUNT_ID = TMP_CLOUD_ACCOUNT_ID; +/** + * The geographical region the resource is running. Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), or [Google Cloud regions](https://cloud.google.com/about/locations). + * + * @deprecated use ATTR_CLOUD_REGION + */ +exports.SEMRESATTRS_CLOUD_REGION = TMP_CLOUD_REGION; +/** + * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. + * + * Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud. + * + * @deprecated use ATTR_CLOUD_AVAILABILITY_ZONE + */ +exports.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE = TMP_CLOUD_AVAILABILITY_ZONE; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated use ATTR_CLOUD_PLATFORM + */ +exports.SEMRESATTRS_CLOUD_PLATFORM = TMP_CLOUD_PLATFORM; +/** + * The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). + * + * @deprecated use ATTR_AWS_ECS_CONTAINER_ARN + */ +exports.SEMRESATTRS_AWS_ECS_CONTAINER_ARN = TMP_AWS_ECS_CONTAINER_ARN; +/** + * The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). + * + * @deprecated use ATTR_AWS_ECS_CLUSTER_ARN + */ +exports.SEMRESATTRS_AWS_ECS_CLUSTER_ARN = TMP_AWS_ECS_CLUSTER_ARN; +/** + * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. + * + * @deprecated use ATTR_AWS_ECS_LAUNCHTYPE + */ +exports.SEMRESATTRS_AWS_ECS_LAUNCHTYPE = TMP_AWS_ECS_LAUNCHTYPE; +/** + * The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). + * + * @deprecated use ATTR_AWS_ECS_TASK_ARN + */ +exports.SEMRESATTRS_AWS_ECS_TASK_ARN = TMP_AWS_ECS_TASK_ARN; +/** + * The task definition family this task definition is a member of. + * + * @deprecated use ATTR_AWS_ECS_TASK_FAMILY + */ +exports.SEMRESATTRS_AWS_ECS_TASK_FAMILY = TMP_AWS_ECS_TASK_FAMILY; +/** + * The revision for this task definition. + * + * @deprecated use ATTR_AWS_ECS_TASK_REVISION + */ +exports.SEMRESATTRS_AWS_ECS_TASK_REVISION = TMP_AWS_ECS_TASK_REVISION; +/** + * The ARN of an EKS cluster. + * + * @deprecated use ATTR_AWS_EKS_CLUSTER_ARN + */ +exports.SEMRESATTRS_AWS_EKS_CLUSTER_ARN = TMP_AWS_EKS_CLUSTER_ARN; +/** + * The name(s) of the AWS log group(s) an application is writing to. + * + * Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. + * + * @deprecated use ATTR_AWS_LOG_GROUP_NAMES + */ +exports.SEMRESATTRS_AWS_LOG_GROUP_NAMES = TMP_AWS_LOG_GROUP_NAMES; +/** + * The Amazon Resource Name(s) (ARN) of the AWS log group(s). + * + * Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). + * + * @deprecated use ATTR_AWS_LOG_GROUP_ARNS + */ +exports.SEMRESATTRS_AWS_LOG_GROUP_ARNS = TMP_AWS_LOG_GROUP_ARNS; +/** + * The name(s) of the AWS log stream(s) an application is writing to. + * + * @deprecated use ATTR_AWS_LOG_STREAM_NAMES + */ +exports.SEMRESATTRS_AWS_LOG_STREAM_NAMES = TMP_AWS_LOG_STREAM_NAMES; +/** + * The ARN(s) of the AWS log stream(s). + * + * Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. + * + * @deprecated use ATTR_AWS_LOG_STREAM_ARNS + */ +exports.SEMRESATTRS_AWS_LOG_STREAM_ARNS = TMP_AWS_LOG_STREAM_ARNS; +/** + * Container name. + * + * @deprecated use ATTR_CONTAINER_NAME + */ +exports.SEMRESATTRS_CONTAINER_NAME = TMP_CONTAINER_NAME; +/** + * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. + * + * @deprecated use ATTR_CONTAINER_ID + */ +exports.SEMRESATTRS_CONTAINER_ID = TMP_CONTAINER_ID; +/** + * The container runtime managing this container. + * + * @deprecated use ATTR_CONTAINER_RUNTIME + */ +exports.SEMRESATTRS_CONTAINER_RUNTIME = TMP_CONTAINER_RUNTIME; +/** + * Name of the image the container was built on. + * + * @deprecated use ATTR_CONTAINER_IMAGE_NAME + */ +exports.SEMRESATTRS_CONTAINER_IMAGE_NAME = TMP_CONTAINER_IMAGE_NAME; +/** + * Container image tag. + * + * @deprecated use ATTR_CONTAINER_IMAGE_TAG + */ +exports.SEMRESATTRS_CONTAINER_IMAGE_TAG = TMP_CONTAINER_IMAGE_TAG; +/** + * Name of the [deployment environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka deployment tier). + * + * @deprecated use ATTR_DEPLOYMENT_ENVIRONMENT + */ +exports.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT = TMP_DEPLOYMENT_ENVIRONMENT; +/** + * A unique identifier representing the device. + * + * Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. + * + * @deprecated use ATTR_DEVICE_ID + */ +exports.SEMRESATTRS_DEVICE_ID = TMP_DEVICE_ID; +/** + * The model identifier for the device. + * + * Note: It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device. + * + * @deprecated use ATTR_DEVICE_MODEL_IDENTIFIER + */ +exports.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER = TMP_DEVICE_MODEL_IDENTIFIER; +/** + * The marketing name for the device model. + * + * Note: It's recommended this value represents a human readable version of the device model rather than a machine readable alternative. + * + * @deprecated use ATTR_DEVICE_MODEL_NAME + */ +exports.SEMRESATTRS_DEVICE_MODEL_NAME = TMP_DEVICE_MODEL_NAME; +/** + * The name of the single function that this runtime instance executes. + * + * Note: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the [`code.namespace`/`code.function`](../../trace/semantic_conventions/span-general.md#source-code-attributes) span attributes). + * + * @deprecated use ATTR_FAAS_NAME + */ +exports.SEMRESATTRS_FAAS_NAME = TMP_FAAS_NAME; +/** +* The unique ID of the single function that this runtime instance executes. +* +* Note: Depending on the cloud provider, use: + +* **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). +Take care not to use the "invoked ARN" directly but replace any +[alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) with the resolved function version, as the same runtime instance may be invokable with multiple +different aliases. +* **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) +* **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id). + +On some providers, it may not be possible to determine the full ID at startup, +which is why this field cannot be made required. For example, on AWS the account ID +part of the ARN is not available without calling another AWS API +which may be deemed too slow for a short-running lambda function. +As an alternative, consider setting `faas.id` as a span attribute instead. +* +* @deprecated use ATTR_FAAS_ID +*/ +exports.SEMRESATTRS_FAAS_ID = TMP_FAAS_ID; +/** +* The immutable version of the function being executed. +* +* Note: Depending on the cloud provider and platform, use: + +* **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) + (an integer represented as a decimal string). +* **Google Cloud Run:** The [revision](https://cloud.google.com/run/docs/managing/revisions) + (i.e., the function name plus the revision suffix). +* **Google Cloud Functions:** The value of the + [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). +* **Azure Functions:** Not applicable. Do not set this attribute. +* +* @deprecated use ATTR_FAAS_VERSION +*/ +exports.SEMRESATTRS_FAAS_VERSION = TMP_FAAS_VERSION; +/** + * The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. + * + * Note: * **AWS Lambda:** Use the (full) log stream name. + * + * @deprecated use ATTR_FAAS_INSTANCE + */ +exports.SEMRESATTRS_FAAS_INSTANCE = TMP_FAAS_INSTANCE; +/** + * The amount of memory available to the serverless function in MiB. + * + * Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information. + * + * @deprecated use ATTR_FAAS_MAX_MEMORY + */ +exports.SEMRESATTRS_FAAS_MAX_MEMORY = TMP_FAAS_MAX_MEMORY; +/** + * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. + * + * @deprecated use ATTR_HOST_ID + */ +exports.SEMRESATTRS_HOST_ID = TMP_HOST_ID; +/** + * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. + * + * @deprecated use ATTR_HOST_NAME + */ +exports.SEMRESATTRS_HOST_NAME = TMP_HOST_NAME; +/** + * Type of host. For Cloud, this must be the machine type. + * + * @deprecated use ATTR_HOST_TYPE + */ +exports.SEMRESATTRS_HOST_TYPE = TMP_HOST_TYPE; +/** + * The CPU architecture the host system is running on. + * + * @deprecated use ATTR_HOST_ARCH + */ +exports.SEMRESATTRS_HOST_ARCH = TMP_HOST_ARCH; +/** + * Name of the VM image or OS install the host was instantiated from. + * + * @deprecated use ATTR_HOST_IMAGE_NAME + */ +exports.SEMRESATTRS_HOST_IMAGE_NAME = TMP_HOST_IMAGE_NAME; +/** + * VM image ID. For Cloud, this value is from the provider. + * + * @deprecated use ATTR_HOST_IMAGE_ID + */ +exports.SEMRESATTRS_HOST_IMAGE_ID = TMP_HOST_IMAGE_ID; +/** + * The version string of the VM image as defined in [Version Attributes](README.md#version-attributes). + * + * @deprecated use ATTR_HOST_IMAGE_VERSION + */ +exports.SEMRESATTRS_HOST_IMAGE_VERSION = TMP_HOST_IMAGE_VERSION; +/** + * The name of the cluster. + * + * @deprecated use ATTR_K8S_CLUSTER_NAME + */ +exports.SEMRESATTRS_K8S_CLUSTER_NAME = TMP_K8S_CLUSTER_NAME; +/** + * The name of the Node. + * + * @deprecated use ATTR_K8S_NODE_NAME + */ +exports.SEMRESATTRS_K8S_NODE_NAME = TMP_K8S_NODE_NAME; +/** + * The UID of the Node. + * + * @deprecated use ATTR_K8S_NODE_UID + */ +exports.SEMRESATTRS_K8S_NODE_UID = TMP_K8S_NODE_UID; +/** + * The name of the namespace that the pod is running in. + * + * @deprecated use ATTR_K8S_NAMESPACE_NAME + */ +exports.SEMRESATTRS_K8S_NAMESPACE_NAME = TMP_K8S_NAMESPACE_NAME; +/** + * The UID of the Pod. + * + * @deprecated use ATTR_K8S_POD_UID + */ +exports.SEMRESATTRS_K8S_POD_UID = TMP_K8S_POD_UID; +/** + * The name of the Pod. + * + * @deprecated use ATTR_K8S_POD_NAME + */ +exports.SEMRESATTRS_K8S_POD_NAME = TMP_K8S_POD_NAME; +/** + * The name of the Container in a Pod template. + * + * @deprecated use ATTR_K8S_CONTAINER_NAME + */ +exports.SEMRESATTRS_K8S_CONTAINER_NAME = TMP_K8S_CONTAINER_NAME; +/** + * The UID of the ReplicaSet. + * + * @deprecated use ATTR_K8S_REPLICASET_UID + */ +exports.SEMRESATTRS_K8S_REPLICASET_UID = TMP_K8S_REPLICASET_UID; +/** + * The name of the ReplicaSet. + * + * @deprecated use ATTR_K8S_REPLICASET_NAME + */ +exports.SEMRESATTRS_K8S_REPLICASET_NAME = TMP_K8S_REPLICASET_NAME; +/** + * The UID of the Deployment. + * + * @deprecated use ATTR_K8S_DEPLOYMENT_UID + */ +exports.SEMRESATTRS_K8S_DEPLOYMENT_UID = TMP_K8S_DEPLOYMENT_UID; +/** + * The name of the Deployment. + * + * @deprecated use ATTR_K8S_DEPLOYMENT_NAME + */ +exports.SEMRESATTRS_K8S_DEPLOYMENT_NAME = TMP_K8S_DEPLOYMENT_NAME; +/** + * The UID of the StatefulSet. + * + * @deprecated use ATTR_K8S_STATEFULSET_UID + */ +exports.SEMRESATTRS_K8S_STATEFULSET_UID = TMP_K8S_STATEFULSET_UID; +/** + * The name of the StatefulSet. + * + * @deprecated use ATTR_K8S_STATEFULSET_NAME + */ +exports.SEMRESATTRS_K8S_STATEFULSET_NAME = TMP_K8S_STATEFULSET_NAME; +/** + * The UID of the DaemonSet. + * + * @deprecated use ATTR_K8S_DAEMONSET_UID + */ +exports.SEMRESATTRS_K8S_DAEMONSET_UID = TMP_K8S_DAEMONSET_UID; +/** + * The name of the DaemonSet. + * + * @deprecated use ATTR_K8S_DAEMONSET_NAME + */ +exports.SEMRESATTRS_K8S_DAEMONSET_NAME = TMP_K8S_DAEMONSET_NAME; +/** + * The UID of the Job. + * + * @deprecated use ATTR_K8S_JOB_UID + */ +exports.SEMRESATTRS_K8S_JOB_UID = TMP_K8S_JOB_UID; +/** + * The name of the Job. + * + * @deprecated use ATTR_K8S_JOB_NAME + */ +exports.SEMRESATTRS_K8S_JOB_NAME = TMP_K8S_JOB_NAME; +/** + * The UID of the CronJob. + * + * @deprecated use ATTR_K8S_CRONJOB_UID + */ +exports.SEMRESATTRS_K8S_CRONJOB_UID = TMP_K8S_CRONJOB_UID; +/** + * The name of the CronJob. + * + * @deprecated use ATTR_K8S_CRONJOB_NAME + */ +exports.SEMRESATTRS_K8S_CRONJOB_NAME = TMP_K8S_CRONJOB_NAME; +/** + * The operating system type. + * + * @deprecated use ATTR_OS_TYPE + */ +exports.SEMRESATTRS_OS_TYPE = TMP_OS_TYPE; +/** + * Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. + * + * @deprecated use ATTR_OS_DESCRIPTION + */ +exports.SEMRESATTRS_OS_DESCRIPTION = TMP_OS_DESCRIPTION; +/** + * Human readable operating system name. + * + * @deprecated use ATTR_OS_NAME + */ +exports.SEMRESATTRS_OS_NAME = TMP_OS_NAME; +/** + * The version string of the operating system as defined in [Version Attributes](../../resource/semantic_conventions/README.md#version-attributes). + * + * @deprecated use ATTR_OS_VERSION + */ +exports.SEMRESATTRS_OS_VERSION = TMP_OS_VERSION; +/** + * Process identifier (PID). + * + * @deprecated use ATTR_PROCESS_PID + */ +exports.SEMRESATTRS_PROCESS_PID = TMP_PROCESS_PID; +/** + * The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. + * + * @deprecated use ATTR_PROCESS_EXECUTABLE_NAME + */ +exports.SEMRESATTRS_PROCESS_EXECUTABLE_NAME = TMP_PROCESS_EXECUTABLE_NAME; +/** + * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. + * + * @deprecated use ATTR_PROCESS_EXECUTABLE_PATH + */ +exports.SEMRESATTRS_PROCESS_EXECUTABLE_PATH = TMP_PROCESS_EXECUTABLE_PATH; +/** + * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. + * + * @deprecated use ATTR_PROCESS_COMMAND + */ +exports.SEMRESATTRS_PROCESS_COMMAND = TMP_PROCESS_COMMAND; +/** + * The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. + * + * @deprecated use ATTR_PROCESS_COMMAND_LINE + */ +exports.SEMRESATTRS_PROCESS_COMMAND_LINE = TMP_PROCESS_COMMAND_LINE; +/** + * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. + * + * @deprecated use ATTR_PROCESS_COMMAND_ARGS + */ +exports.SEMRESATTRS_PROCESS_COMMAND_ARGS = TMP_PROCESS_COMMAND_ARGS; +/** + * The username of the user that owns the process. + * + * @deprecated use ATTR_PROCESS_OWNER + */ +exports.SEMRESATTRS_PROCESS_OWNER = TMP_PROCESS_OWNER; +/** + * The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. + * + * @deprecated use ATTR_PROCESS_RUNTIME_NAME + */ +exports.SEMRESATTRS_PROCESS_RUNTIME_NAME = TMP_PROCESS_RUNTIME_NAME; +/** + * The version of the runtime of this process, as returned by the runtime without modification. + * + * @deprecated use ATTR_PROCESS_RUNTIME_VERSION + */ +exports.SEMRESATTRS_PROCESS_RUNTIME_VERSION = TMP_PROCESS_RUNTIME_VERSION; +/** + * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. + * + * @deprecated use ATTR_PROCESS_RUNTIME_DESCRIPTION + */ +exports.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION = TMP_PROCESS_RUNTIME_DESCRIPTION; +/** + * Logical name of the service. + * + * 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#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. + * + * @deprecated use ATTR_SERVICE_NAME + */ +exports.SEMRESATTRS_SERVICE_NAME = TMP_SERVICE_NAME; +/** + * A namespace for `service.name`. + * + * 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. + * + * @deprecated use ATTR_SERVICE_NAMESPACE + */ +exports.SEMRESATTRS_SERVICE_NAMESPACE = TMP_SERVICE_NAMESPACE; +/** + * The string ID of the service instance. + * + * Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations). + * + * @deprecated use ATTR_SERVICE_INSTANCE_ID + */ +exports.SEMRESATTRS_SERVICE_INSTANCE_ID = TMP_SERVICE_INSTANCE_ID; +/** + * The version string of the service API or implementation. + * + * @deprecated use ATTR_SERVICE_VERSION + */ +exports.SEMRESATTRS_SERVICE_VERSION = TMP_SERVICE_VERSION; +/** + * The name of the telemetry SDK as defined above. + * + * @deprecated use ATTR_TELEMETRY_SDK_NAME + */ +exports.SEMRESATTRS_TELEMETRY_SDK_NAME = TMP_TELEMETRY_SDK_NAME; +/** + * The language of the telemetry SDK. + * + * @deprecated use ATTR_TELEMETRY_SDK_LANGUAGE + */ +exports.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE = TMP_TELEMETRY_SDK_LANGUAGE; +/** + * The version string of the telemetry SDK. + * + * @deprecated use ATTR_TELEMETRY_SDK_VERSION + */ +exports.SEMRESATTRS_TELEMETRY_SDK_VERSION = TMP_TELEMETRY_SDK_VERSION; +/** + * The version string of the auto instrumentation agent, if used. + * + * @deprecated use ATTR_TELEMETRY_AUTO_VERSION + */ +exports.SEMRESATTRS_TELEMETRY_AUTO_VERSION = TMP_TELEMETRY_AUTO_VERSION; +/** + * The name of the web engine. + * + * @deprecated use ATTR_WEBENGINE_NAME + */ +exports.SEMRESATTRS_WEBENGINE_NAME = TMP_WEBENGINE_NAME; +/** + * The version of the web engine. + * + * @deprecated use ATTR_WEBENGINE_VERSION + */ +exports.SEMRESATTRS_WEBENGINE_VERSION = TMP_WEBENGINE_VERSION; +/** + * Additional description of the web engine (e.g. detailed version and edition information). + * + * @deprecated use ATTR_WEBENGINE_DESCRIPTION + */ +exports.SEMRESATTRS_WEBENGINE_DESCRIPTION = TMP_WEBENGINE_DESCRIPTION; +/** + * Create exported Value Map for SemanticResourceAttributes values + * @deprecated Use the SEMRESATTRS_XXXXX constants rather than the SemanticResourceAttributes.XXXXX for bundle minification + */ +exports.SemanticResourceAttributes = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_CLOUD_PROVIDER, + TMP_CLOUD_ACCOUNT_ID, + TMP_CLOUD_REGION, + TMP_CLOUD_AVAILABILITY_ZONE, + TMP_CLOUD_PLATFORM, + TMP_AWS_ECS_CONTAINER_ARN, + TMP_AWS_ECS_CLUSTER_ARN, + TMP_AWS_ECS_LAUNCHTYPE, + TMP_AWS_ECS_TASK_ARN, + TMP_AWS_ECS_TASK_FAMILY, + TMP_AWS_ECS_TASK_REVISION, + TMP_AWS_EKS_CLUSTER_ARN, + TMP_AWS_LOG_GROUP_NAMES, + TMP_AWS_LOG_GROUP_ARNS, + TMP_AWS_LOG_STREAM_NAMES, + TMP_AWS_LOG_STREAM_ARNS, + TMP_CONTAINER_NAME, + TMP_CONTAINER_ID, + TMP_CONTAINER_RUNTIME, + TMP_CONTAINER_IMAGE_NAME, + TMP_CONTAINER_IMAGE_TAG, + TMP_DEPLOYMENT_ENVIRONMENT, + TMP_DEVICE_ID, + TMP_DEVICE_MODEL_IDENTIFIER, + TMP_DEVICE_MODEL_NAME, + TMP_FAAS_NAME, + TMP_FAAS_ID, + TMP_FAAS_VERSION, + TMP_FAAS_INSTANCE, + TMP_FAAS_MAX_MEMORY, + TMP_HOST_ID, + TMP_HOST_NAME, + TMP_HOST_TYPE, + TMP_HOST_ARCH, + TMP_HOST_IMAGE_NAME, + TMP_HOST_IMAGE_ID, + TMP_HOST_IMAGE_VERSION, + TMP_K8S_CLUSTER_NAME, + TMP_K8S_NODE_NAME, + TMP_K8S_NODE_UID, + TMP_K8S_NAMESPACE_NAME, + TMP_K8S_POD_UID, + TMP_K8S_POD_NAME, + TMP_K8S_CONTAINER_NAME, + TMP_K8S_REPLICASET_UID, + TMP_K8S_REPLICASET_NAME, + TMP_K8S_DEPLOYMENT_UID, + TMP_K8S_DEPLOYMENT_NAME, + TMP_K8S_STATEFULSET_UID, + TMP_K8S_STATEFULSET_NAME, + TMP_K8S_DAEMONSET_UID, + TMP_K8S_DAEMONSET_NAME, + TMP_K8S_JOB_UID, + TMP_K8S_JOB_NAME, + TMP_K8S_CRONJOB_UID, + TMP_K8S_CRONJOB_NAME, + TMP_OS_TYPE, + TMP_OS_DESCRIPTION, + TMP_OS_NAME, + TMP_OS_VERSION, + TMP_PROCESS_PID, + TMP_PROCESS_EXECUTABLE_NAME, + TMP_PROCESS_EXECUTABLE_PATH, + TMP_PROCESS_COMMAND, + TMP_PROCESS_COMMAND_LINE, + TMP_PROCESS_COMMAND_ARGS, + TMP_PROCESS_OWNER, + TMP_PROCESS_RUNTIME_NAME, + TMP_PROCESS_RUNTIME_VERSION, + TMP_PROCESS_RUNTIME_DESCRIPTION, + TMP_SERVICE_NAME, + TMP_SERVICE_NAMESPACE, + TMP_SERVICE_INSTANCE_ID, + TMP_SERVICE_VERSION, + TMP_TELEMETRY_SDK_NAME, + TMP_TELEMETRY_SDK_LANGUAGE, + TMP_TELEMETRY_SDK_VERSION, + TMP_TELEMETRY_AUTO_VERSION, + TMP_WEBENGINE_NAME, + TMP_WEBENGINE_VERSION, + TMP_WEBENGINE_DESCRIPTION, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for CloudProviderValues enum definition + * + * Name of the cloud provider. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD = 'alibaba_cloud'; +const TMP_CLOUDPROVIDERVALUES_AWS = 'aws'; +const TMP_CLOUDPROVIDERVALUES_AZURE = 'azure'; +const TMP_CLOUDPROVIDERVALUES_GCP = 'gcp'; +/** + * Name of the cloud provider. + * + * @deprecated Use CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD. + */ +exports.CLOUDPROVIDERVALUES_ALIBABA_CLOUD = TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD; +/** + * Name of the cloud provider. + * + * @deprecated Use CLOUD_PROVIDER_VALUE_AWS. + */ +exports.CLOUDPROVIDERVALUES_AWS = TMP_CLOUDPROVIDERVALUES_AWS; +/** + * Name of the cloud provider. + * + * @deprecated Use CLOUD_PROVIDER_VALUE_AZURE. + */ +exports.CLOUDPROVIDERVALUES_AZURE = TMP_CLOUDPROVIDERVALUES_AZURE; +/** + * Name of the cloud provider. + * + * @deprecated Use CLOUD_PROVIDER_VALUE_GCP. + */ +exports.CLOUDPROVIDERVALUES_GCP = TMP_CLOUDPROVIDERVALUES_GCP; +/** + * The constant map of values for CloudProviderValues. + * @deprecated Use the CLOUDPROVIDERVALUES_XXXXX constants rather than the CloudProviderValues.XXXXX for bundle minification. + */ +exports.CloudProviderValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD, + TMP_CLOUDPROVIDERVALUES_AWS, + TMP_CLOUDPROVIDERVALUES_AZURE, + TMP_CLOUDPROVIDERVALUES_GCP, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for CloudPlatformValues enum definition + * + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = 'alibaba_cloud_ecs'; +const TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = 'alibaba_cloud_fc'; +const TMP_CLOUDPLATFORMVALUES_AWS_EC2 = 'aws_ec2'; +const TMP_CLOUDPLATFORMVALUES_AWS_ECS = 'aws_ecs'; +const TMP_CLOUDPLATFORMVALUES_AWS_EKS = 'aws_eks'; +const TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA = 'aws_lambda'; +const TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = 'aws_elastic_beanstalk'; +const TMP_CLOUDPLATFORMVALUES_AZURE_VM = 'azure_vm'; +const TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = 'azure_container_instances'; +const TMP_CLOUDPLATFORMVALUES_AZURE_AKS = 'azure_aks'; +const TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = 'azure_functions'; +const TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = 'azure_app_service'; +const TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = 'gcp_compute_engine'; +const TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = 'gcp_cloud_run'; +const TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = 'gcp_kubernetes_engine'; +const TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = 'gcp_cloud_functions'; +const TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE = 'gcp_app_engine'; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS. + */ +exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_FC. + */ +exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_AWS_EC2. + */ +exports.CLOUDPLATFORMVALUES_AWS_EC2 = TMP_CLOUDPLATFORMVALUES_AWS_EC2; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_AWS_ECS. + */ +exports.CLOUDPLATFORMVALUES_AWS_ECS = TMP_CLOUDPLATFORMVALUES_AWS_ECS; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_AWS_EKS. + */ +exports.CLOUDPLATFORMVALUES_AWS_EKS = TMP_CLOUDPLATFORMVALUES_AWS_EKS; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_AWS_LAMBDA. + */ +exports.CLOUDPLATFORMVALUES_AWS_LAMBDA = TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_AWS_ELASTIC_BEANSTALK. + */ +exports.CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_AZURE_VM. + */ +exports.CLOUDPLATFORMVALUES_AZURE_VM = TMP_CLOUDPLATFORMVALUES_AZURE_VM; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_AZURE_CONTAINER_INSTANCES. + */ +exports.CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_AZURE_AKS. + */ +exports.CLOUDPLATFORMVALUES_AZURE_AKS = TMP_CLOUDPLATFORMVALUES_AZURE_AKS; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_AZURE_FUNCTIONS. + */ +exports.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_AZURE_APP_SERVICE. + */ +exports.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_GCP_COMPUTE_ENGINE. + */ +exports.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_GCP_CLOUD_RUN. + */ +exports.CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_GCP_KUBERNETES_ENGINE. + */ +exports.CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_GCP_CLOUD_FUNCTIONS. + */ +exports.CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_GCP_APP_ENGINE. + */ +exports.CLOUDPLATFORMVALUES_GCP_APP_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE; +/** + * The constant map of values for CloudPlatformValues. + * @deprecated Use the CLOUDPLATFORMVALUES_XXXXX constants rather than the CloudPlatformValues.XXXXX for bundle minification. + */ +exports.CloudPlatformValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS, + TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC, + TMP_CLOUDPLATFORMVALUES_AWS_EC2, + TMP_CLOUDPLATFORMVALUES_AWS_ECS, + TMP_CLOUDPLATFORMVALUES_AWS_EKS, + TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA, + TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK, + TMP_CLOUDPLATFORMVALUES_AZURE_VM, + TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES, + TMP_CLOUDPLATFORMVALUES_AZURE_AKS, + TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS, + TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE, + TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE, + TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN, + TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE, + TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS, + TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for AwsEcsLaunchtypeValues enum definition + * + * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_AWSECSLAUNCHTYPEVALUES_EC2 = 'ec2'; +const TMP_AWSECSLAUNCHTYPEVALUES_FARGATE = 'fargate'; +/** + * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. + * + * @deprecated Use AWS_ECS_LAUNCHTYPE_VALUE_EC2. + */ +exports.AWSECSLAUNCHTYPEVALUES_EC2 = TMP_AWSECSLAUNCHTYPEVALUES_EC2; +/** + * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. + * + * @deprecated Use AWS_ECS_LAUNCHTYPE_VALUE_FARGATE. + */ +exports.AWSECSLAUNCHTYPEVALUES_FARGATE = TMP_AWSECSLAUNCHTYPEVALUES_FARGATE; +/** + * The constant map of values for AwsEcsLaunchtypeValues. + * @deprecated Use the AWSECSLAUNCHTYPEVALUES_XXXXX constants rather than the AwsEcsLaunchtypeValues.XXXXX for bundle minification. + */ +exports.AwsEcsLaunchtypeValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_AWSECSLAUNCHTYPEVALUES_EC2, + TMP_AWSECSLAUNCHTYPEVALUES_FARGATE, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for HostArchValues enum definition + * + * The CPU architecture the host system is running on. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_HOSTARCHVALUES_AMD64 = 'amd64'; +const TMP_HOSTARCHVALUES_ARM32 = 'arm32'; +const TMP_HOSTARCHVALUES_ARM64 = 'arm64'; +const TMP_HOSTARCHVALUES_IA64 = 'ia64'; +const TMP_HOSTARCHVALUES_PPC32 = 'ppc32'; +const TMP_HOSTARCHVALUES_PPC64 = 'ppc64'; +const TMP_HOSTARCHVALUES_X86 = 'x86'; +/** + * The CPU architecture the host system is running on. + * + * @deprecated Use HOST_ARCH_VALUE_AMD64. + */ +exports.HOSTARCHVALUES_AMD64 = TMP_HOSTARCHVALUES_AMD64; +/** + * The CPU architecture the host system is running on. + * + * @deprecated Use HOST_ARCH_VALUE_ARM32. + */ +exports.HOSTARCHVALUES_ARM32 = TMP_HOSTARCHVALUES_ARM32; +/** + * The CPU architecture the host system is running on. + * + * @deprecated Use HOST_ARCH_VALUE_ARM64. + */ +exports.HOSTARCHVALUES_ARM64 = TMP_HOSTARCHVALUES_ARM64; +/** + * The CPU architecture the host system is running on. + * + * @deprecated Use HOST_ARCH_VALUE_IA64. + */ +exports.HOSTARCHVALUES_IA64 = TMP_HOSTARCHVALUES_IA64; +/** + * The CPU architecture the host system is running on. + * + * @deprecated Use HOST_ARCH_VALUE_PPC32. + */ +exports.HOSTARCHVALUES_PPC32 = TMP_HOSTARCHVALUES_PPC32; +/** + * The CPU architecture the host system is running on. + * + * @deprecated Use HOST_ARCH_VALUE_PPC64. + */ +exports.HOSTARCHVALUES_PPC64 = TMP_HOSTARCHVALUES_PPC64; +/** + * The CPU architecture the host system is running on. + * + * @deprecated Use HOST_ARCH_VALUE_X86. + */ +exports.HOSTARCHVALUES_X86 = TMP_HOSTARCHVALUES_X86; +/** + * The constant map of values for HostArchValues. + * @deprecated Use the HOSTARCHVALUES_XXXXX constants rather than the HostArchValues.XXXXX for bundle minification. + */ +exports.HostArchValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_HOSTARCHVALUES_AMD64, + TMP_HOSTARCHVALUES_ARM32, + TMP_HOSTARCHVALUES_ARM64, + TMP_HOSTARCHVALUES_IA64, + TMP_HOSTARCHVALUES_PPC32, + TMP_HOSTARCHVALUES_PPC64, + TMP_HOSTARCHVALUES_X86, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for OsTypeValues enum definition + * + * The operating system type. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_OSTYPEVALUES_WINDOWS = 'windows'; +const TMP_OSTYPEVALUES_LINUX = 'linux'; +const TMP_OSTYPEVALUES_DARWIN = 'darwin'; +const TMP_OSTYPEVALUES_FREEBSD = 'freebsd'; +const TMP_OSTYPEVALUES_NETBSD = 'netbsd'; +const TMP_OSTYPEVALUES_OPENBSD = 'openbsd'; +const TMP_OSTYPEVALUES_DRAGONFLYBSD = 'dragonflybsd'; +const TMP_OSTYPEVALUES_HPUX = 'hpux'; +const TMP_OSTYPEVALUES_AIX = 'aix'; +const TMP_OSTYPEVALUES_SOLARIS = 'solaris'; +const TMP_OSTYPEVALUES_Z_OS = 'z_os'; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_WINDOWS. + */ +exports.OSTYPEVALUES_WINDOWS = TMP_OSTYPEVALUES_WINDOWS; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_LINUX. + */ +exports.OSTYPEVALUES_LINUX = TMP_OSTYPEVALUES_LINUX; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_DARWIN. + */ +exports.OSTYPEVALUES_DARWIN = TMP_OSTYPEVALUES_DARWIN; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_FREEBSD. + */ +exports.OSTYPEVALUES_FREEBSD = TMP_OSTYPEVALUES_FREEBSD; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_NETBSD. + */ +exports.OSTYPEVALUES_NETBSD = TMP_OSTYPEVALUES_NETBSD; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_OPENBSD. + */ +exports.OSTYPEVALUES_OPENBSD = TMP_OSTYPEVALUES_OPENBSD; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_DRAGONFLYBSD. + */ +exports.OSTYPEVALUES_DRAGONFLYBSD = TMP_OSTYPEVALUES_DRAGONFLYBSD; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_HPUX. + */ +exports.OSTYPEVALUES_HPUX = TMP_OSTYPEVALUES_HPUX; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_AIX. + */ +exports.OSTYPEVALUES_AIX = TMP_OSTYPEVALUES_AIX; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_SOLARIS. + */ +exports.OSTYPEVALUES_SOLARIS = TMP_OSTYPEVALUES_SOLARIS; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_Z_OS. + */ +exports.OSTYPEVALUES_Z_OS = TMP_OSTYPEVALUES_Z_OS; +/** + * The constant map of values for OsTypeValues. + * @deprecated Use the OSTYPEVALUES_XXXXX constants rather than the OsTypeValues.XXXXX for bundle minification. + */ +exports.OsTypeValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_OSTYPEVALUES_WINDOWS, + TMP_OSTYPEVALUES_LINUX, + TMP_OSTYPEVALUES_DARWIN, + TMP_OSTYPEVALUES_FREEBSD, + TMP_OSTYPEVALUES_NETBSD, + TMP_OSTYPEVALUES_OPENBSD, + TMP_OSTYPEVALUES_DRAGONFLYBSD, + TMP_OSTYPEVALUES_HPUX, + TMP_OSTYPEVALUES_AIX, + TMP_OSTYPEVALUES_SOLARIS, + TMP_OSTYPEVALUES_Z_OS, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for TelemetrySdkLanguageValues enum definition + * + * The language of the telemetry SDK. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_TELEMETRYSDKLANGUAGEVALUES_CPP = 'cpp'; +const TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET = 'dotnet'; +const TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG = 'erlang'; +const TMP_TELEMETRYSDKLANGUAGEVALUES_GO = 'go'; +const TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA = 'java'; +const TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS = 'nodejs'; +const TMP_TELEMETRYSDKLANGUAGEVALUES_PHP = 'php'; +const TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON = 'python'; +const TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY = 'ruby'; +const TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS = 'webjs'; +/** + * The language of the telemetry SDK. + * + * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_CPP. + */ +exports.TELEMETRYSDKLANGUAGEVALUES_CPP = TMP_TELEMETRYSDKLANGUAGEVALUES_CPP; +/** + * The language of the telemetry SDK. + * + * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET. + */ +exports.TELEMETRYSDKLANGUAGEVALUES_DOTNET = TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET; +/** + * The language of the telemetry SDK. + * + * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG. + */ +exports.TELEMETRYSDKLANGUAGEVALUES_ERLANG = TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG; +/** + * The language of the telemetry SDK. + * + * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_GO. + */ +exports.TELEMETRYSDKLANGUAGEVALUES_GO = TMP_TELEMETRYSDKLANGUAGEVALUES_GO; +/** + * The language of the telemetry SDK. + * + * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_JAVA. + */ +exports.TELEMETRYSDKLANGUAGEVALUES_JAVA = TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA; +/** + * The language of the telemetry SDK. + * + * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS. + */ +exports.TELEMETRYSDKLANGUAGEVALUES_NODEJS = TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS; +/** + * The language of the telemetry SDK. + * + * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_PHP. + */ +exports.TELEMETRYSDKLANGUAGEVALUES_PHP = TMP_TELEMETRYSDKLANGUAGEVALUES_PHP; +/** + * The language of the telemetry SDK. + * + * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON. + */ +exports.TELEMETRYSDKLANGUAGEVALUES_PYTHON = TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON; +/** + * The language of the telemetry SDK. + * + * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_RUBY. + */ +exports.TELEMETRYSDKLANGUAGEVALUES_RUBY = TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY; +/** + * The language of the telemetry SDK. + * + * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS. + */ +exports.TELEMETRYSDKLANGUAGEVALUES_WEBJS = TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS; +/** + * The constant map of values for TelemetrySdkLanguageValues. + * @deprecated Use the TELEMETRYSDKLANGUAGEVALUES_XXXXX constants rather than the TelemetrySdkLanguageValues.XXXXX for bundle minification. + */ +exports.TelemetrySdkLanguageValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_TELEMETRYSDKLANGUAGEVALUES_CPP, + TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET, + TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG, + TMP_TELEMETRYSDKLANGUAGEVALUES_GO, + TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA, + TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS, + TMP_TELEMETRYSDKLANGUAGEVALUES_PHP, + TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON, + TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY, + TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS, +]); +//# sourceMappingURL=SemanticResourceAttributes.js.map + +/***/ }), + +/***/ 83327: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +/* eslint-disable no-restricted-syntax -- + * These re-exports are only of constants, only one-level deep at this point, + * and should not cause problems for tree-shakers. + */ +__exportStar(__nccwpck_require__(73629), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 28231: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.HTTP_REQUEST_METHOD_VALUE_POST = exports.HTTP_REQUEST_METHOD_VALUE_PATCH = exports.HTTP_REQUEST_METHOD_VALUE_OPTIONS = exports.HTTP_REQUEST_METHOD_VALUE_HEAD = exports.HTTP_REQUEST_METHOD_VALUE_GET = exports.HTTP_REQUEST_METHOD_VALUE_DELETE = exports.HTTP_REQUEST_METHOD_VALUE_CONNECT = exports.HTTP_REQUEST_METHOD_VALUE_OTHER = exports.ATTR_HTTP_REQUEST_METHOD = exports.ATTR_HTTP_REQUEST_HEADER = exports.ATTR_EXCEPTION_TYPE = exports.ATTR_EXCEPTION_STACKTRACE = exports.ATTR_EXCEPTION_MESSAGE = exports.ATTR_EXCEPTION_ESCAPED = exports.ERROR_TYPE_VALUE_OTHER = exports.ATTR_ERROR_TYPE = exports.ATTR_CLIENT_PORT = exports.ATTR_CLIENT_ADDRESS = exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = exports.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = exports.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = exports.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED = exports.ATTR_ASPNETCORE_RATE_LIMITING_POLICY = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = exports.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = exports.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = exports.ATTR_TELEMETRY_SDK_VERSION = exports.ATTR_TELEMETRY_SDK_NAME = exports.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = exports.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUST = exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = exports.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = exports.TELEMETRY_SDK_LANGUAGE_VALUE_PHP = exports.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = exports.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = exports.TELEMETRY_SDK_LANGUAGE_VALUE_GO = exports.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = exports.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = exports.TELEMETRY_SDK_LANGUAGE_VALUE_CPP = exports.ATTR_TELEMETRY_SDK_LANGUAGE = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = exports.ATTR_ASPNETCORE_RATE_LIMITING_RESULT = void 0; +exports.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = exports.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = exports.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = exports.ATTR_SIGNALR_CONNECTION_STATUS = exports.ATTR_SERVICE_VERSION = exports.ATTR_SERVICE_NAME = exports.ATTR_SERVER_PORT = exports.ATTR_SERVER_ADDRESS = exports.ATTR_OTEL_STATUS_DESCRIPTION = exports.OTEL_STATUS_CODE_VALUE_OK = exports.OTEL_STATUS_CODE_VALUE_ERROR = exports.ATTR_OTEL_STATUS_CODE = exports.ATTR_OTEL_SCOPE_VERSION = exports.ATTR_OTEL_SCOPE_NAME = exports.NETWORK_TYPE_VALUE_IPV6 = exports.NETWORK_TYPE_VALUE_IPV4 = exports.ATTR_NETWORK_TYPE = exports.NETWORK_TRANSPORT_VALUE_UNIX = exports.NETWORK_TRANSPORT_VALUE_UDP = exports.NETWORK_TRANSPORT_VALUE_TCP = exports.NETWORK_TRANSPORT_VALUE_QUIC = exports.NETWORK_TRANSPORT_VALUE_PIPE = exports.ATTR_NETWORK_TRANSPORT = exports.ATTR_NETWORK_PROTOCOL_VERSION = exports.ATTR_NETWORK_PROTOCOL_NAME = exports.ATTR_NETWORK_PEER_PORT = exports.ATTR_NETWORK_PEER_ADDRESS = exports.ATTR_NETWORK_LOCAL_PORT = exports.ATTR_NETWORK_LOCAL_ADDRESS = exports.JVM_THREAD_STATE_VALUE_WAITING = exports.JVM_THREAD_STATE_VALUE_TIMED_WAITING = exports.JVM_THREAD_STATE_VALUE_TERMINATED = exports.JVM_THREAD_STATE_VALUE_RUNNABLE = exports.JVM_THREAD_STATE_VALUE_NEW = exports.JVM_THREAD_STATE_VALUE_BLOCKED = exports.ATTR_JVM_THREAD_STATE = exports.ATTR_JVM_THREAD_DAEMON = exports.JVM_MEMORY_TYPE_VALUE_NON_HEAP = exports.JVM_MEMORY_TYPE_VALUE_HEAP = exports.ATTR_JVM_MEMORY_TYPE = exports.ATTR_JVM_MEMORY_POOL_NAME = exports.ATTR_JVM_GC_NAME = exports.ATTR_JVM_GC_ACTION = exports.ATTR_HTTP_ROUTE = exports.ATTR_HTTP_RESPONSE_STATUS_CODE = exports.ATTR_HTTP_RESPONSE_HEADER = exports.ATTR_HTTP_REQUEST_RESEND_COUNT = exports.ATTR_HTTP_REQUEST_METHOD_ORIGINAL = exports.HTTP_REQUEST_METHOD_VALUE_TRACE = exports.HTTP_REQUEST_METHOD_VALUE_PUT = void 0; +exports.ATTR_USER_AGENT_ORIGINAL = exports.ATTR_URL_SCHEME = exports.ATTR_URL_QUERY = exports.ATTR_URL_PATH = exports.ATTR_URL_FULL = exports.ATTR_URL_FRAGMENT = exports.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = exports.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = exports.SIGNALR_TRANSPORT_VALUE_LONG_POLLING = exports.ATTR_SIGNALR_TRANSPORT = void 0; +//---------------------------------------------------------------------------------------------------------- +// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/registry/stable/attributes.ts.j2 +//---------------------------------------------------------------------------------------------------------- +/** + * Rate-limiting result, shows whether the lease was acquired or contains a rejection reason + * + * @example acquired + * + * @example request_canceled + */ +exports.ATTR_ASPNETCORE_RATE_LIMITING_RESULT = 'aspnetcore.rate_limiting.result'; +/** + * Enum value "acquired" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}. + */ +exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = "acquired"; +/** + * Enum value "endpoint_limiter" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}. + */ +exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = "endpoint_limiter"; +/** + * Enum value "global_limiter" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}. + */ +exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = "global_limiter"; +/** + * Enum value "request_canceled" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}. + */ +exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = "request_canceled"; +/** + * The language of the telemetry SDK. + */ +exports.ATTR_TELEMETRY_SDK_LANGUAGE = 'telemetry.sdk.language'; +/** + * Enum value "cpp" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_CPP = "cpp"; +/** + * Enum value "dotnet" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = "dotnet"; +/** + * Enum value "erlang" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = "erlang"; +/** + * Enum value "go" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_GO = "go"; +/** + * Enum value "java" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = "java"; +/** + * Enum value "nodejs" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = "nodejs"; +/** + * Enum value "php" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_PHP = "php"; +/** + * Enum value "python" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = "python"; +/** + * Enum value "ruby" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = "ruby"; +/** + * Enum value "rust" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUST = "rust"; +/** + * Enum value "swift" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = "swift"; +/** + * Enum value "webjs" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = "webjs"; +/** + * The name of the telemetry SDK as defined above. + * + * @example opentelemetry + * + * @note The OpenTelemetry SDK **MUST** set the `telemetry.sdk.name` attribute to `opentelemetry`. + * If another SDK, like a fork or a vendor-provided implementation, is used, this SDK **MUST** set the + * `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point + * or another suitable identifier depending on the language. + * The identifier `opentelemetry` is reserved and **MUST** **NOT** be used in this case. + * All custom identifiers **SHOULD** be stable across different versions of an implementation. + */ +exports.ATTR_TELEMETRY_SDK_NAME = 'telemetry.sdk.name'; +/** + * The version string of the telemetry SDK. + * + * @example 1.2.3 + */ +exports.ATTR_TELEMETRY_SDK_VERSION = 'telemetry.sdk.version'; +/** + * Full type name of the [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. + * + * @example Contoso.MyHandler + */ +exports.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = 'aspnetcore.diagnostics.handler.type'; +/** + * ASP.NET Core exception middleware handling result + * + * @example handled + * + * @example unhandled + */ +exports.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = 'aspnetcore.diagnostics.exception.result'; +/** + * Enum value "aborted" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}. + */ +exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = "aborted"; +/** + * Enum value "handled" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}. + */ +exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = "handled"; +/** + * Enum value "skipped" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}. + */ +exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = "skipped"; +/** + * Enum value "unhandled" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}. + */ +exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = "unhandled"; +/** + * Rate limiting policy name. + * + * @example fixed + * + * @example sliding + * + * @example token + */ +exports.ATTR_ASPNETCORE_RATE_LIMITING_POLICY = 'aspnetcore.rate_limiting.policy'; +/** + * Flag indicating if request was handled by the application pipeline. + * + * @example true + */ +exports.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED = 'aspnetcore.request.is_unhandled'; +/** + * A value that indicates whether the matched route is a fallback route. + * + * @example true + */ +exports.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = 'aspnetcore.routing.is_fallback'; +/** + * Match result - success or failure + * + * @example success + * + * @example failure + */ +exports.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = 'aspnetcore.routing.match_status'; +/** + * Enum value "failure" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}. + */ +exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = "failure"; +/** + * Enum value "success" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}. + */ +exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = "success"; +/** + * Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. + * + * @example client.example.com + * + * @example 10.1.2.80 + * + * @example /tmp/my.sock + * + * @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. + */ +exports.ATTR_CLIENT_ADDRESS = 'client.address'; +/** + * Client port number. + * + * @example 65123 + * + * @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. + */ +exports.ATTR_CLIENT_PORT = 'client.port'; +/** + * Describes a class of error the operation ended with. + * + * @example timeout + * + * @example java.net.UnknownHostException + * + * @example server_certificate_invalid + * + * @example 500 + * + * @note The `error.type` **SHOULD** be predictable, and **SHOULD** have low cardinality. + * + * When `error.type` is set to a type (e.g., an exception type), its + * canonical class name identifying the type within the artifact **SHOULD** be used. + * + * Instrumentations **SHOULD** document the list of errors they report. + * + * The cardinality of `error.type` within one instrumentation library **SHOULD** be low. + * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications + * should be prepared for `error.type` to have high cardinality at query time when no + * additional filters are applied. + * + * If the operation has completed successfully, instrumentations **SHOULD** **NOT** set `error.type`. + * + * If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes), + * it's RECOMMENDED to: + * + * * Use a domain-specific attribute + * * Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not. + */ +exports.ATTR_ERROR_TYPE = 'error.type'; +/** + * Enum value "_OTHER" for attribute {@link ATTR_ERROR_TYPE}. + */ +exports.ERROR_TYPE_VALUE_OTHER = "_OTHER"; +/** + * **SHOULD** be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. + * + * @note An exception is considered to have escaped (or left) the scope of a span, + * if that span is ended while the exception is still logically "in flight". + * This may be actually "in flight" in some languages (e.g. if the exception + * is passed to a Context manager's `__exit__` method in Python) but will + * usually be caught at the point of recording the exception in most languages. + * + * It is usually not possible to determine at the point where an exception is thrown + * whether it will escape the scope of a span. + * However, it is trivial to know that an exception + * will escape, if one checks for an active exception just before ending the span, + * as done in the [example for recording span exceptions](https://opentelemetry.io/docs/specs/semconv/exceptions/exceptions-spans/#recording-an-exception). + * + * It follows that an exception may still escape the scope of the span + * even if the `exception.escaped` attribute was not set or set to false, + * since the event might have been recorded at a time where it was not + * clear whether the exception will escape. + */ +exports.ATTR_EXCEPTION_ESCAPED = 'exception.escaped'; +/** + * The exception message. + * + * @example Division by zero + * + * @example Can't convert 'int' object to str implicitly + */ +exports.ATTR_EXCEPTION_MESSAGE = 'exception.message'; +/** + * 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. + * + * @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)" + */ +exports.ATTR_EXCEPTION_STACKTRACE = 'exception.stacktrace'; +/** + * 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. + * + * @example java.net.ConnectException + * + * @example OSError + */ +exports.ATTR_EXCEPTION_TYPE = 'exception.type'; +/** + * HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. + * + * @example http.request.header.content-type=["application/json"] + * + * @example http.request.header.x-forwarded-for=["1.2.3.4", "1.2.3.5"] + * + * @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. + * The `User-Agent` header is already captured in the `user_agent.original` attribute. Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended. + * The attribute value **MUST** consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. + */ +const ATTR_HTTP_REQUEST_HEADER = (key) => `http.request.header.${key}`; +exports.ATTR_HTTP_REQUEST_HEADER = ATTR_HTTP_REQUEST_HEADER; +/** + * HTTP request method. + * + * @example GET + * + * @example POST + * + * @example HEAD + * + * @note HTTP request method value **SHOULD** be "known" to the instrumentation. + * By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) + * and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). + * + * If the HTTP request method is not known to instrumentation, it **MUST** set the `http.request.method` attribute to `_OTHER`. + * + * If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it **MUST** provide a way to override + * the list of known HTTP methods. If this override is done via environment variable, then the environment variable **MUST** be named + * OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods + * (this list **MUST** be a full override of the default known method, it is not a list of known methods in addition to the defaults). + * + * HTTP method names are case-sensitive and `http.request.method` attribute value **MUST** match a known HTTP method name exactly. + * Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, **SHOULD** populate a canonical equivalent. + * Tracing instrumentations that do so, **MUST** also set `http.request.method_original` to the original value. + */ +exports.ATTR_HTTP_REQUEST_METHOD = 'http.request.method'; +/** + * Enum value "_OTHER" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + */ +exports.HTTP_REQUEST_METHOD_VALUE_OTHER = "_OTHER"; +/** + * Enum value "CONNECT" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + */ +exports.HTTP_REQUEST_METHOD_VALUE_CONNECT = "CONNECT"; +/** + * Enum value "DELETE" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + */ +exports.HTTP_REQUEST_METHOD_VALUE_DELETE = "DELETE"; +/** + * Enum value "GET" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + */ +exports.HTTP_REQUEST_METHOD_VALUE_GET = "GET"; +/** + * Enum value "HEAD" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + */ +exports.HTTP_REQUEST_METHOD_VALUE_HEAD = "HEAD"; +/** + * Enum value "OPTIONS" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + */ +exports.HTTP_REQUEST_METHOD_VALUE_OPTIONS = "OPTIONS"; +/** + * Enum value "PATCH" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + */ +exports.HTTP_REQUEST_METHOD_VALUE_PATCH = "PATCH"; +/** + * Enum value "POST" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + */ +exports.HTTP_REQUEST_METHOD_VALUE_POST = "POST"; +/** + * Enum value "PUT" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + */ +exports.HTTP_REQUEST_METHOD_VALUE_PUT = "PUT"; +/** + * Enum value "TRACE" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + */ +exports.HTTP_REQUEST_METHOD_VALUE_TRACE = "TRACE"; +/** + * Original HTTP method sent by the client in the request line. + * + * @example GeT + * + * @example ACL + * + * @example foo + */ +exports.ATTR_HTTP_REQUEST_METHOD_ORIGINAL = 'http.request.method_original'; +/** + * The ordinal number of request resending attempt (for any reason, including redirects). + * + * @example 3 + * + * @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). + */ +exports.ATTR_HTTP_REQUEST_RESEND_COUNT = 'http.request.resend_count'; +/** + * HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. + * + * @example http.response.header.content-type=["application/json"] + * + * @example http.response.header.my-custom-header=["abc", "def"] + * + * @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. + * Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended. + * The attribute value **MUST** consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. + */ +const ATTR_HTTP_RESPONSE_HEADER = (key) => `http.response.header.${key}`; +exports.ATTR_HTTP_RESPONSE_HEADER = ATTR_HTTP_RESPONSE_HEADER; +/** + * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). + * + * @example 200 + */ +exports.ATTR_HTTP_RESPONSE_STATUS_CODE = 'http.response.status_code'; +/** + * The matched route, that is, the path template in the format used by the respective server framework. + * + * @example /users/:userID? + * + * @example {controller}/{action}/{id?} + * + * @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. + * SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. + */ +exports.ATTR_HTTP_ROUTE = 'http.route'; +/** + * Name of the garbage collector action. + * + * @example end of minor GC + * + * @example end of major GC + * + * @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()). + */ +exports.ATTR_JVM_GC_ACTION = 'jvm.gc.action'; +/** + * Name of the garbage collector. + * + * @example G1 Young Generation + * + * @example G1 Old Generation + * + * @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()). + */ +exports.ATTR_JVM_GC_NAME = 'jvm.gc.name'; +/** + * Name of the memory pool. + * + * @example G1 Old Gen + * + * @example G1 Eden space + * + * @example G1 Survivor Space + * + * @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()). + */ +exports.ATTR_JVM_MEMORY_POOL_NAME = 'jvm.memory.pool.name'; +/** + * The type of memory. + * + * @example heap + * + * @example non_heap + */ +exports.ATTR_JVM_MEMORY_TYPE = 'jvm.memory.type'; +/** + * Enum value "heap" for attribute {@link ATTR_JVM_MEMORY_TYPE}. + */ +exports.JVM_MEMORY_TYPE_VALUE_HEAP = "heap"; +/** + * Enum value "non_heap" for attribute {@link ATTR_JVM_MEMORY_TYPE}. + */ +exports.JVM_MEMORY_TYPE_VALUE_NON_HEAP = "non_heap"; +/** + * Whether the thread is daemon or not. + */ +exports.ATTR_JVM_THREAD_DAEMON = 'jvm.thread.daemon'; +/** + * State of the thread. + * + * @example runnable + * + * @example blocked + */ +exports.ATTR_JVM_THREAD_STATE = 'jvm.thread.state'; +/** + * Enum value "blocked" for attribute {@link ATTR_JVM_THREAD_STATE}. + */ +exports.JVM_THREAD_STATE_VALUE_BLOCKED = "blocked"; +/** + * Enum value "new" for attribute {@link ATTR_JVM_THREAD_STATE}. + */ +exports.JVM_THREAD_STATE_VALUE_NEW = "new"; +/** + * Enum value "runnable" for attribute {@link ATTR_JVM_THREAD_STATE}. + */ +exports.JVM_THREAD_STATE_VALUE_RUNNABLE = "runnable"; +/** + * Enum value "terminated" for attribute {@link ATTR_JVM_THREAD_STATE}. + */ +exports.JVM_THREAD_STATE_VALUE_TERMINATED = "terminated"; +/** + * Enum value "timed_waiting" for attribute {@link ATTR_JVM_THREAD_STATE}. + */ +exports.JVM_THREAD_STATE_VALUE_TIMED_WAITING = "timed_waiting"; +/** + * Enum value "waiting" for attribute {@link ATTR_JVM_THREAD_STATE}. + */ +exports.JVM_THREAD_STATE_VALUE_WAITING = "waiting"; +/** + * Local address of the network connection - IP address or Unix domain socket name. + * + * @example 10.1.2.80 + * + * @example /tmp/my.sock + */ +exports.ATTR_NETWORK_LOCAL_ADDRESS = 'network.local.address'; +/** + * Local port number of the network connection. + * + * @example 65123 + */ +exports.ATTR_NETWORK_LOCAL_PORT = 'network.local.port'; +/** + * Peer address of the network connection - IP address or Unix domain socket name. + * + * @example 10.1.2.80 + * + * @example /tmp/my.sock + */ +exports.ATTR_NETWORK_PEER_ADDRESS = 'network.peer.address'; +/** + * Peer port number of the network connection. + * + * @example 65123 + */ +exports.ATTR_NETWORK_PEER_PORT = 'network.peer.port'; +/** + * [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. + * + * @example amqp + * + * @example http + * + * @example mqtt + * + * @note The value **SHOULD** be normalized to lowercase. + */ +exports.ATTR_NETWORK_PROTOCOL_NAME = 'network.protocol.name'; +/** + * The actual version of the protocol used for network communication. + * + * @example 1.1 + * + * @example 2 + * + * @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. + */ +exports.ATTR_NETWORK_PROTOCOL_VERSION = 'network.protocol.version'; +/** + * [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). + * + * @example tcp + * + * @example udp + * + * @note The value **SHOULD** be normalized to lowercase. + * + * Consider always setting the transport when setting a port number, since + * a port number is ambiguous without knowing the transport. For example + * different processes could be listening on TCP port 12345 and UDP port 12345. + */ +exports.ATTR_NETWORK_TRANSPORT = 'network.transport'; +/** + * Enum value "pipe" for attribute {@link ATTR_NETWORK_TRANSPORT}. + */ +exports.NETWORK_TRANSPORT_VALUE_PIPE = "pipe"; +/** + * Enum value "quic" for attribute {@link ATTR_NETWORK_TRANSPORT}. + */ +exports.NETWORK_TRANSPORT_VALUE_QUIC = "quic"; +/** + * Enum value "tcp" for attribute {@link ATTR_NETWORK_TRANSPORT}. + */ +exports.NETWORK_TRANSPORT_VALUE_TCP = "tcp"; +/** + * Enum value "udp" for attribute {@link ATTR_NETWORK_TRANSPORT}. + */ +exports.NETWORK_TRANSPORT_VALUE_UDP = "udp"; +/** + * Enum value "unix" for attribute {@link ATTR_NETWORK_TRANSPORT}. + */ +exports.NETWORK_TRANSPORT_VALUE_UNIX = "unix"; +/** + * [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. + * + * @example ipv4 + * + * @example ipv6 + * + * @note The value **SHOULD** be normalized to lowercase. + */ +exports.ATTR_NETWORK_TYPE = 'network.type'; +/** + * Enum value "ipv4" for attribute {@link ATTR_NETWORK_TYPE}. + */ +exports.NETWORK_TYPE_VALUE_IPV4 = "ipv4"; +/** + * Enum value "ipv6" for attribute {@link ATTR_NETWORK_TYPE}. + */ +exports.NETWORK_TYPE_VALUE_IPV6 = "ipv6"; +/** + * The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). + * + * @example io.opentelemetry.contrib.mongodb + */ +exports.ATTR_OTEL_SCOPE_NAME = 'otel.scope.name'; +/** + * The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). + * + * @example 1.0.0 + */ +exports.ATTR_OTEL_SCOPE_VERSION = 'otel.scope.version'; +/** + * Name of the code, either "OK" or "ERROR". **MUST** **NOT** be set if the status code is UNSET. + */ +exports.ATTR_OTEL_STATUS_CODE = 'otel.status_code'; +/** + * Enum value "ERROR" for attribute {@link ATTR_OTEL_STATUS_CODE}. + */ +exports.OTEL_STATUS_CODE_VALUE_ERROR = "ERROR"; +/** + * Enum value "OK" for attribute {@link ATTR_OTEL_STATUS_CODE}. + */ +exports.OTEL_STATUS_CODE_VALUE_OK = "OK"; +/** + * Description of the Status if it has a value, otherwise not set. + * + * @example resource not found + */ +exports.ATTR_OTEL_STATUS_DESCRIPTION = 'otel.status_description'; +/** + * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. + * + * @example example.com + * + * @example 10.1.2.80 + * + * @example /tmp/my.sock + * + * @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. + */ +exports.ATTR_SERVER_ADDRESS = 'server.address'; +/** + * Server port number. + * + * @example 80 + * + * @example 8080 + * + * @example 443 + * + * @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. + */ +exports.ATTR_SERVER_PORT = 'server.port'; +/** + * Logical name of the service. + * + * @example shoppingcart + * + * @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`. + */ +exports.ATTR_SERVICE_NAME = 'service.name'; +/** + * The version string of the service API or implementation. The format is not defined by these conventions. + * + * @example 2.0.0 + * + * @example a01dbef8a + */ +exports.ATTR_SERVICE_VERSION = 'service.version'; +/** + * SignalR HTTP connection closure status. + * + * @example app_shutdown + * + * @example timeout + */ +exports.ATTR_SIGNALR_CONNECTION_STATUS = 'signalr.connection.status'; +/** + * Enum value "app_shutdown" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}. + */ +exports.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = "app_shutdown"; +/** + * Enum value "normal_closure" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}. + */ +exports.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = "normal_closure"; +/** + * Enum value "timeout" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}. + */ +exports.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = "timeout"; +/** + * [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md) + * + * @example web_sockets + * + * @example long_polling + */ +exports.ATTR_SIGNALR_TRANSPORT = 'signalr.transport'; +/** + * Enum value "long_polling" for attribute {@link ATTR_SIGNALR_TRANSPORT}. + */ +exports.SIGNALR_TRANSPORT_VALUE_LONG_POLLING = "long_polling"; +/** + * Enum value "server_sent_events" for attribute {@link ATTR_SIGNALR_TRANSPORT}. + */ +exports.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = "server_sent_events"; +/** + * Enum value "web_sockets" for attribute {@link ATTR_SIGNALR_TRANSPORT}. + */ +exports.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = "web_sockets"; +/** + * The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component + * + * @example SemConv + */ +exports.ATTR_URL_FRAGMENT = 'url.fragment'; +/** + * Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) + * + * @example https://www.foo.bar/search?q=OpenTelemetry#SemConv + * + * @example //localhost + * + * @note For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it **SHOULD** be included nevertheless. + * `url.full` **MUST** **NOT** contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password **SHOULD** be redacted and attribute's value **SHOULD** be `https://REDACTED:REDACTED@www.example.com/`. + * `url.full` **SHOULD** capture the absolute URL when it is available (or can be reconstructed). Sensitive content provided in `url.full` **SHOULD** be scrubbed when instrumentations can identify it. + */ +exports.ATTR_URL_FULL = 'url.full'; +/** + * The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component + * + * @example /search + * + * @note Sensitive content provided in `url.path` **SHOULD** be scrubbed when instrumentations can identify it. + */ +exports.ATTR_URL_PATH = 'url.path'; +/** + * The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component + * + * @example q=OpenTelemetry + * + * @note Sensitive content provided in `url.query` **SHOULD** be scrubbed when instrumentations can identify it. + */ +exports.ATTR_URL_QUERY = 'url.query'; +/** + * The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. + * + * @example https + * + * @example ftp + * + * @example telnet + */ +exports.ATTR_URL_SCHEME = 'url.scheme'; +/** + * Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. + * + * @example CERN-LineMode/2.15 libwww/2.17b3 + * + * @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 + * + * @example YourApp/1.0.0 grpc-java-okhttp/1.27.2 + */ +exports.ATTR_USER_AGENT_ORIGINAL = 'user_agent.original'; +//# sourceMappingURL=stable_attributes.js.map + +/***/ }), + +/***/ 67409: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.METRIC_SIGNALR_SERVER_CONNECTION_DURATION = exports.METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS = exports.METRIC_KESTREL_UPGRADED_CONNECTIONS = exports.METRIC_KESTREL_TLS_HANDSHAKE_DURATION = exports.METRIC_KESTREL_REJECTED_CONNECTIONS = exports.METRIC_KESTREL_QUEUED_REQUESTS = exports.METRIC_KESTREL_QUEUED_CONNECTIONS = exports.METRIC_KESTREL_CONNECTION_DURATION = exports.METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES = exports.METRIC_KESTREL_ACTIVE_CONNECTIONS = exports.METRIC_JVM_THREAD_COUNT = exports.METRIC_JVM_MEMORY_USED_AFTER_LAST_GC = exports.METRIC_JVM_MEMORY_USED = exports.METRIC_JVM_MEMORY_LIMIT = exports.METRIC_JVM_MEMORY_COMMITTED = exports.METRIC_JVM_GC_DURATION = exports.METRIC_JVM_CPU_TIME = exports.METRIC_JVM_CPU_RECENT_UTILIZATION = exports.METRIC_JVM_CPU_COUNT = exports.METRIC_JVM_CLASS_UNLOADED = exports.METRIC_JVM_CLASS_LOADED = exports.METRIC_JVM_CLASS_COUNT = exports.METRIC_HTTP_SERVER_REQUEST_DURATION = exports.METRIC_HTTP_CLIENT_REQUEST_DURATION = exports.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS = exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS = exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION = exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE = exports.METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS = exports.METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES = exports.METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS = void 0; +//---------------------------------------------------------------------------------------------------------- +// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/register/stable/metrics.ts.j2 +//---------------------------------------------------------------------------------------------------------- +/** + * Number of exceptions caught by exception handling middleware. + * + * @note Meter name: `Microsoft.AspNetCore.Diagnostics`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS = 'aspnetcore.diagnostics.exceptions'; +/** + * Number of requests that are currently active on the server that hold a rate limiting lease. + * + * @note Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES = 'aspnetcore.rate_limiting.active_request_leases'; +/** + * Number of requests that are currently queued, waiting to acquire a rate limiting lease. + * + * @note Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS = 'aspnetcore.rate_limiting.queued_requests'; +/** + * The time the request spent in a queue waiting to acquire a rate limiting lease. + * + * @note Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE = 'aspnetcore.rate_limiting.request.time_in_queue'; +/** + * The duration of rate limiting lease held by requests on the server. + * + * @note Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION = 'aspnetcore.rate_limiting.request_lease.duration'; +/** + * Number of requests that tried to acquire a rate limiting lease. + * + * @note Requests could be: + * + * * Rejected by global or endpoint rate limiting policies + * * Canceled while waiting for the lease. + * + * Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS = 'aspnetcore.rate_limiting.requests'; +/** + * Number of requests that were attempted to be matched to an endpoint. + * + * @note Meter name: `Microsoft.AspNetCore.Routing`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS = 'aspnetcore.routing.match_attempts'; +/** + * Duration of HTTP client requests. + */ +exports.METRIC_HTTP_CLIENT_REQUEST_DURATION = 'http.client.request.duration'; +/** + * Duration of HTTP server requests. + */ +exports.METRIC_HTTP_SERVER_REQUEST_DURATION = 'http.server.request.duration'; +/** + * Number of classes currently loaded. + */ +exports.METRIC_JVM_CLASS_COUNT = 'jvm.class.count'; +/** + * Number of classes loaded since JVM start. + */ +exports.METRIC_JVM_CLASS_LOADED = 'jvm.class.loaded'; +/** + * Number of classes unloaded since JVM start. + */ +exports.METRIC_JVM_CLASS_UNLOADED = 'jvm.class.unloaded'; +/** + * Number of processors available to the Java virtual machine. + */ +exports.METRIC_JVM_CPU_COUNT = 'jvm.cpu.count'; +/** + * Recent CPU utilization for the process as reported by the JVM. + * + * @note The value range is [0.0,1.0]. This utilization is not defined as being for the specific interval since last measurement (unlike `system.cpu.utilization`). [Reference](https://docs.oracle.com/en/java/javase/17/docs/api/jdk.management/com/sun/management/OperatingSystemMXBean.html#getProcessCpuLoad()). + */ +exports.METRIC_JVM_CPU_RECENT_UTILIZATION = 'jvm.cpu.recent_utilization'; +/** + * CPU time used by the process as reported by the JVM. + */ +exports.METRIC_JVM_CPU_TIME = 'jvm.cpu.time'; +/** + * Duration of JVM garbage collection actions. + */ +exports.METRIC_JVM_GC_DURATION = 'jvm.gc.duration'; +/** + * Measure of memory committed. + */ +exports.METRIC_JVM_MEMORY_COMMITTED = 'jvm.memory.committed'; +/** + * Measure of max obtainable memory. + */ +exports.METRIC_JVM_MEMORY_LIMIT = 'jvm.memory.limit'; +/** + * Measure of memory used. + */ +exports.METRIC_JVM_MEMORY_USED = 'jvm.memory.used'; +/** + * Measure of memory used, as measured after the most recent garbage collection event on this pool. + */ +exports.METRIC_JVM_MEMORY_USED_AFTER_LAST_GC = 'jvm.memory.used_after_last_gc'; +/** + * Number of executing platform threads. + */ +exports.METRIC_JVM_THREAD_COUNT = 'jvm.thread.count'; +/** + * Number of connections that are currently active on the server. + * + * @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_KESTREL_ACTIVE_CONNECTIONS = 'kestrel.active_connections'; +/** + * Number of TLS handshakes that are currently in progress on the server. + * + * @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES = 'kestrel.active_tls_handshakes'; +/** + * The duration of connections on the server. + * + * @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_KESTREL_CONNECTION_DURATION = 'kestrel.connection.duration'; +/** + * Number of connections that are currently queued and are waiting to start. + * + * @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_KESTREL_QUEUED_CONNECTIONS = 'kestrel.queued_connections'; +/** + * Number of HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are currently queued and are waiting to start. + * + * @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_KESTREL_QUEUED_REQUESTS = 'kestrel.queued_requests'; +/** + * Number of connections rejected by the server. + * + * @note Connections are rejected when the currently active count exceeds the value configured with `MaxConcurrentConnections`. + * Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_KESTREL_REJECTED_CONNECTIONS = 'kestrel.rejected_connections'; +/** + * The duration of TLS handshakes on the server. + * + * @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_KESTREL_TLS_HANDSHAKE_DURATION = 'kestrel.tls_handshake.duration'; +/** + * Number of connections that are currently upgraded (WebSockets). . + * + * @note The counter only tracks HTTP/1.1 connections. + * + * Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_KESTREL_UPGRADED_CONNECTIONS = 'kestrel.upgraded_connections'; +/** + * Number of connections that are currently active on the server. + * + * @note Meter name: `Microsoft.AspNetCore.Http.Connections`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS = 'signalr.server.active_connections'; +/** + * The duration of connections on the server. + * + * @note Meter name: `Microsoft.AspNetCore.Http.Connections`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_SIGNALR_SERVER_CONNECTION_DURATION = 'signalr.server.connection.duration'; +//# sourceMappingURL=stable_metrics.js.map + +/***/ }), + +/***/ 98999: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SEMATTRS_NET_HOST_CARRIER_ICC = exports.SEMATTRS_NET_HOST_CARRIER_MNC = exports.SEMATTRS_NET_HOST_CARRIER_MCC = exports.SEMATTRS_NET_HOST_CARRIER_NAME = exports.SEMATTRS_NET_HOST_CONNECTION_SUBTYPE = exports.SEMATTRS_NET_HOST_CONNECTION_TYPE = exports.SEMATTRS_NET_HOST_NAME = exports.SEMATTRS_NET_HOST_PORT = exports.SEMATTRS_NET_HOST_IP = exports.SEMATTRS_NET_PEER_NAME = exports.SEMATTRS_NET_PEER_PORT = exports.SEMATTRS_NET_PEER_IP = exports.SEMATTRS_NET_TRANSPORT = exports.SEMATTRS_FAAS_INVOKED_REGION = exports.SEMATTRS_FAAS_INVOKED_PROVIDER = exports.SEMATTRS_FAAS_INVOKED_NAME = exports.SEMATTRS_FAAS_COLDSTART = exports.SEMATTRS_FAAS_CRON = exports.SEMATTRS_FAAS_TIME = exports.SEMATTRS_FAAS_DOCUMENT_NAME = exports.SEMATTRS_FAAS_DOCUMENT_TIME = exports.SEMATTRS_FAAS_DOCUMENT_OPERATION = exports.SEMATTRS_FAAS_DOCUMENT_COLLECTION = exports.SEMATTRS_FAAS_EXECUTION = exports.SEMATTRS_FAAS_TRIGGER = exports.SEMATTRS_EXCEPTION_ESCAPED = exports.SEMATTRS_EXCEPTION_STACKTRACE = exports.SEMATTRS_EXCEPTION_MESSAGE = exports.SEMATTRS_EXCEPTION_TYPE = exports.SEMATTRS_DB_SQL_TABLE = exports.SEMATTRS_DB_MONGODB_COLLECTION = exports.SEMATTRS_DB_REDIS_DATABASE_INDEX = exports.SEMATTRS_DB_HBASE_NAMESPACE = exports.SEMATTRS_DB_CASSANDRA_COORDINATOR_DC = exports.SEMATTRS_DB_CASSANDRA_COORDINATOR_ID = exports.SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = exports.SEMATTRS_DB_CASSANDRA_IDEMPOTENCE = exports.SEMATTRS_DB_CASSANDRA_TABLE = exports.SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL = exports.SEMATTRS_DB_CASSANDRA_PAGE_SIZE = exports.SEMATTRS_DB_CASSANDRA_KEYSPACE = exports.SEMATTRS_DB_MSSQL_INSTANCE_NAME = exports.SEMATTRS_DB_OPERATION = exports.SEMATTRS_DB_STATEMENT = exports.SEMATTRS_DB_NAME = exports.SEMATTRS_DB_JDBC_DRIVER_CLASSNAME = exports.SEMATTRS_DB_USER = exports.SEMATTRS_DB_CONNECTION_STRING = exports.SEMATTRS_DB_SYSTEM = exports.SEMATTRS_AWS_LAMBDA_INVOKED_ARN = void 0; +exports.SEMATTRS_MESSAGING_DESTINATION_KIND = exports.SEMATTRS_MESSAGING_DESTINATION = exports.SEMATTRS_MESSAGING_SYSTEM = exports.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = exports.SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = exports.SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT = exports.SEMATTRS_AWS_DYNAMODB_COUNT = exports.SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS = exports.SEMATTRS_AWS_DYNAMODB_SEGMENT = exports.SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD = exports.SEMATTRS_AWS_DYNAMODB_TABLE_COUNT = exports.SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = exports.SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = exports.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = exports.SEMATTRS_AWS_DYNAMODB_SELECT = exports.SEMATTRS_AWS_DYNAMODB_INDEX_NAME = exports.SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET = exports.SEMATTRS_AWS_DYNAMODB_LIMIT = exports.SEMATTRS_AWS_DYNAMODB_PROJECTION = exports.SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ = exports.SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = exports.SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = exports.SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = exports.SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY = exports.SEMATTRS_AWS_DYNAMODB_TABLE_NAMES = exports.SEMATTRS_HTTP_CLIENT_IP = exports.SEMATTRS_HTTP_ROUTE = exports.SEMATTRS_HTTP_SERVER_NAME = exports.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = exports.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH = exports.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = exports.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH = exports.SEMATTRS_HTTP_USER_AGENT = exports.SEMATTRS_HTTP_FLAVOR = exports.SEMATTRS_HTTP_STATUS_CODE = exports.SEMATTRS_HTTP_SCHEME = exports.SEMATTRS_HTTP_HOST = exports.SEMATTRS_HTTP_TARGET = exports.SEMATTRS_HTTP_URL = exports.SEMATTRS_HTTP_METHOD = exports.SEMATTRS_CODE_LINENO = exports.SEMATTRS_CODE_FILEPATH = exports.SEMATTRS_CODE_NAMESPACE = exports.SEMATTRS_CODE_FUNCTION = exports.SEMATTRS_THREAD_NAME = exports.SEMATTRS_THREAD_ID = exports.SEMATTRS_ENDUSER_SCOPE = exports.SEMATTRS_ENDUSER_ROLE = exports.SEMATTRS_ENDUSER_ID = exports.SEMATTRS_PEER_SERVICE = void 0; +exports.DBSYSTEMVALUES_FILEMAKER = exports.DBSYSTEMVALUES_DERBY = exports.DBSYSTEMVALUES_FIREBIRD = exports.DBSYSTEMVALUES_ADABAS = exports.DBSYSTEMVALUES_CACHE = exports.DBSYSTEMVALUES_EDB = exports.DBSYSTEMVALUES_FIRSTSQL = exports.DBSYSTEMVALUES_INGRES = exports.DBSYSTEMVALUES_HANADB = exports.DBSYSTEMVALUES_MAXDB = exports.DBSYSTEMVALUES_PROGRESS = exports.DBSYSTEMVALUES_HSQLDB = exports.DBSYSTEMVALUES_CLOUDSCAPE = exports.DBSYSTEMVALUES_HIVE = exports.DBSYSTEMVALUES_REDSHIFT = exports.DBSYSTEMVALUES_POSTGRESQL = exports.DBSYSTEMVALUES_DB2 = exports.DBSYSTEMVALUES_ORACLE = exports.DBSYSTEMVALUES_MYSQL = exports.DBSYSTEMVALUES_MSSQL = exports.DBSYSTEMVALUES_OTHER_SQL = exports.SemanticAttributes = exports.SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE = exports.SEMATTRS_MESSAGE_COMPRESSED_SIZE = exports.SEMATTRS_MESSAGE_ID = exports.SEMATTRS_MESSAGE_TYPE = exports.SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE = exports.SEMATTRS_RPC_JSONRPC_ERROR_CODE = exports.SEMATTRS_RPC_JSONRPC_REQUEST_ID = exports.SEMATTRS_RPC_JSONRPC_VERSION = exports.SEMATTRS_RPC_GRPC_STATUS_CODE = exports.SEMATTRS_RPC_METHOD = exports.SEMATTRS_RPC_SERVICE = exports.SEMATTRS_RPC_SYSTEM = exports.SEMATTRS_MESSAGING_KAFKA_TOMBSTONE = exports.SEMATTRS_MESSAGING_KAFKA_PARTITION = exports.SEMATTRS_MESSAGING_KAFKA_CLIENT_ID = exports.SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP = exports.SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY = exports.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY = exports.SEMATTRS_MESSAGING_CONSUMER_ID = exports.SEMATTRS_MESSAGING_OPERATION = exports.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = exports.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = exports.SEMATTRS_MESSAGING_CONVERSATION_ID = exports.SEMATTRS_MESSAGING_MESSAGE_ID = exports.SEMATTRS_MESSAGING_URL = exports.SEMATTRS_MESSAGING_PROTOCOL_VERSION = exports.SEMATTRS_MESSAGING_PROTOCOL = exports.SEMATTRS_MESSAGING_TEMP_DESTINATION = void 0; +exports.FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = exports.FaasDocumentOperationValues = exports.FAASDOCUMENTOPERATIONVALUES_DELETE = exports.FAASDOCUMENTOPERATIONVALUES_EDIT = exports.FAASDOCUMENTOPERATIONVALUES_INSERT = exports.FaasTriggerValues = exports.FAASTRIGGERVALUES_OTHER = exports.FAASTRIGGERVALUES_TIMER = exports.FAASTRIGGERVALUES_PUBSUB = exports.FAASTRIGGERVALUES_HTTP = exports.FAASTRIGGERVALUES_DATASOURCE = exports.DbCassandraConsistencyLevelValues = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = exports.DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ANY = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_THREE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_TWO = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ONE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ALL = exports.DbSystemValues = exports.DBSYSTEMVALUES_COCKROACHDB = exports.DBSYSTEMVALUES_MEMCACHED = exports.DBSYSTEMVALUES_ELASTICSEARCH = exports.DBSYSTEMVALUES_GEODE = exports.DBSYSTEMVALUES_NEO4J = exports.DBSYSTEMVALUES_DYNAMODB = exports.DBSYSTEMVALUES_COSMOSDB = exports.DBSYSTEMVALUES_COUCHDB = exports.DBSYSTEMVALUES_COUCHBASE = exports.DBSYSTEMVALUES_REDIS = exports.DBSYSTEMVALUES_MONGODB = exports.DBSYSTEMVALUES_HBASE = exports.DBSYSTEMVALUES_CASSANDRA = exports.DBSYSTEMVALUES_COLDFUSION = exports.DBSYSTEMVALUES_H2 = exports.DBSYSTEMVALUES_VERTICA = exports.DBSYSTEMVALUES_TERADATA = exports.DBSYSTEMVALUES_SYBASE = exports.DBSYSTEMVALUES_SQLITE = exports.DBSYSTEMVALUES_POINTBASE = exports.DBSYSTEMVALUES_PERVASIVE = exports.DBSYSTEMVALUES_NETEZZA = exports.DBSYSTEMVALUES_MARIADB = exports.DBSYSTEMVALUES_INTERBASE = exports.DBSYSTEMVALUES_INSTANTDB = exports.DBSYSTEMVALUES_INFORMIX = void 0; +exports.MESSAGINGOPERATIONVALUES_RECEIVE = exports.MessagingDestinationKindValues = exports.MESSAGINGDESTINATIONKINDVALUES_TOPIC = exports.MESSAGINGDESTINATIONKINDVALUES_QUEUE = exports.HttpFlavorValues = exports.HTTPFLAVORVALUES_QUIC = exports.HTTPFLAVORVALUES_SPDY = exports.HTTPFLAVORVALUES_HTTP_2_0 = exports.HTTPFLAVORVALUES_HTTP_1_1 = exports.HTTPFLAVORVALUES_HTTP_1_0 = exports.NetHostConnectionSubtypeValues = exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_NR = exports.NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = exports.NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_GSM = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = exports.NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = exports.NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = exports.NetHostConnectionTypeValues = exports.NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = exports.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = exports.NETHOSTCONNECTIONTYPEVALUES_CELL = exports.NETHOSTCONNECTIONTYPEVALUES_WIRED = exports.NETHOSTCONNECTIONTYPEVALUES_WIFI = exports.NetTransportValues = exports.NETTRANSPORTVALUES_OTHER = exports.NETTRANSPORTVALUES_INPROC = exports.NETTRANSPORTVALUES_PIPE = exports.NETTRANSPORTVALUES_UNIX = exports.NETTRANSPORTVALUES_IP = exports.NETTRANSPORTVALUES_IP_UDP = exports.NETTRANSPORTVALUES_IP_TCP = exports.FaasInvokedProviderValues = exports.FAASINVOKEDPROVIDERVALUES_GCP = exports.FAASINVOKEDPROVIDERVALUES_AZURE = exports.FAASINVOKEDPROVIDERVALUES_AWS = void 0; +exports.MessageTypeValues = exports.MESSAGETYPEVALUES_RECEIVED = exports.MESSAGETYPEVALUES_SENT = exports.RpcGrpcStatusCodeValues = exports.RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = exports.RPCGRPCSTATUSCODEVALUES_DATA_LOSS = exports.RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = exports.RPCGRPCSTATUSCODEVALUES_INTERNAL = exports.RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = exports.RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = exports.RPCGRPCSTATUSCODEVALUES_ABORTED = exports.RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = exports.RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = exports.RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = exports.RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = exports.RPCGRPCSTATUSCODEVALUES_NOT_FOUND = exports.RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = exports.RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = exports.RPCGRPCSTATUSCODEVALUES_UNKNOWN = exports.RPCGRPCSTATUSCODEVALUES_CANCELLED = exports.RPCGRPCSTATUSCODEVALUES_OK = exports.MessagingOperationValues = exports.MESSAGINGOPERATIONVALUES_PROCESS = void 0; +const utils_1 = __nccwpck_require__(56803); +//---------------------------------------------------------------------------------------------------------- +// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2 +//---------------------------------------------------------------------------------------------------------- +//---------------------------------------------------------------------------------------------------------- +// Constant values for SemanticAttributes +//---------------------------------------------------------------------------------------------------------- +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_AWS_LAMBDA_INVOKED_ARN = 'aws.lambda.invoked_arn'; +const TMP_DB_SYSTEM = 'db.system'; +const TMP_DB_CONNECTION_STRING = 'db.connection_string'; +const TMP_DB_USER = 'db.user'; +const TMP_DB_JDBC_DRIVER_CLASSNAME = 'db.jdbc.driver_classname'; +const TMP_DB_NAME = 'db.name'; +const TMP_DB_STATEMENT = 'db.statement'; +const TMP_DB_OPERATION = 'db.operation'; +const TMP_DB_MSSQL_INSTANCE_NAME = 'db.mssql.instance_name'; +const TMP_DB_CASSANDRA_KEYSPACE = 'db.cassandra.keyspace'; +const TMP_DB_CASSANDRA_PAGE_SIZE = 'db.cassandra.page_size'; +const TMP_DB_CASSANDRA_CONSISTENCY_LEVEL = 'db.cassandra.consistency_level'; +const TMP_DB_CASSANDRA_TABLE = 'db.cassandra.table'; +const TMP_DB_CASSANDRA_IDEMPOTENCE = 'db.cassandra.idempotence'; +const TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = 'db.cassandra.speculative_execution_count'; +const TMP_DB_CASSANDRA_COORDINATOR_ID = 'db.cassandra.coordinator.id'; +const TMP_DB_CASSANDRA_COORDINATOR_DC = 'db.cassandra.coordinator.dc'; +const TMP_DB_HBASE_NAMESPACE = 'db.hbase.namespace'; +const TMP_DB_REDIS_DATABASE_INDEX = 'db.redis.database_index'; +const TMP_DB_MONGODB_COLLECTION = 'db.mongodb.collection'; +const TMP_DB_SQL_TABLE = 'db.sql.table'; +const TMP_EXCEPTION_TYPE = 'exception.type'; +const TMP_EXCEPTION_MESSAGE = 'exception.message'; +const TMP_EXCEPTION_STACKTRACE = 'exception.stacktrace'; +const TMP_EXCEPTION_ESCAPED = 'exception.escaped'; +const TMP_FAAS_TRIGGER = 'faas.trigger'; +const TMP_FAAS_EXECUTION = 'faas.execution'; +const TMP_FAAS_DOCUMENT_COLLECTION = 'faas.document.collection'; +const TMP_FAAS_DOCUMENT_OPERATION = 'faas.document.operation'; +const TMP_FAAS_DOCUMENT_TIME = 'faas.document.time'; +const TMP_FAAS_DOCUMENT_NAME = 'faas.document.name'; +const TMP_FAAS_TIME = 'faas.time'; +const TMP_FAAS_CRON = 'faas.cron'; +const TMP_FAAS_COLDSTART = 'faas.coldstart'; +const TMP_FAAS_INVOKED_NAME = 'faas.invoked_name'; +const TMP_FAAS_INVOKED_PROVIDER = 'faas.invoked_provider'; +const TMP_FAAS_INVOKED_REGION = 'faas.invoked_region'; +const TMP_NET_TRANSPORT = 'net.transport'; +const TMP_NET_PEER_IP = 'net.peer.ip'; +const TMP_NET_PEER_PORT = 'net.peer.port'; +const TMP_NET_PEER_NAME = 'net.peer.name'; +const TMP_NET_HOST_IP = 'net.host.ip'; +const TMP_NET_HOST_PORT = 'net.host.port'; +const TMP_NET_HOST_NAME = 'net.host.name'; +const TMP_NET_HOST_CONNECTION_TYPE = 'net.host.connection.type'; +const TMP_NET_HOST_CONNECTION_SUBTYPE = 'net.host.connection.subtype'; +const TMP_NET_HOST_CARRIER_NAME = 'net.host.carrier.name'; +const TMP_NET_HOST_CARRIER_MCC = 'net.host.carrier.mcc'; +const TMP_NET_HOST_CARRIER_MNC = 'net.host.carrier.mnc'; +const TMP_NET_HOST_CARRIER_ICC = 'net.host.carrier.icc'; +const TMP_PEER_SERVICE = 'peer.service'; +const TMP_ENDUSER_ID = 'enduser.id'; +const TMP_ENDUSER_ROLE = 'enduser.role'; +const TMP_ENDUSER_SCOPE = 'enduser.scope'; +const TMP_THREAD_ID = 'thread.id'; +const TMP_THREAD_NAME = 'thread.name'; +const TMP_CODE_FUNCTION = 'code.function'; +const TMP_CODE_NAMESPACE = 'code.namespace'; +const TMP_CODE_FILEPATH = 'code.filepath'; +const TMP_CODE_LINENO = 'code.lineno'; +const TMP_HTTP_METHOD = 'http.method'; +const TMP_HTTP_URL = 'http.url'; +const TMP_HTTP_TARGET = 'http.target'; +const TMP_HTTP_HOST = 'http.host'; +const TMP_HTTP_SCHEME = 'http.scheme'; +const TMP_HTTP_STATUS_CODE = 'http.status_code'; +const TMP_HTTP_FLAVOR = 'http.flavor'; +const TMP_HTTP_USER_AGENT = 'http.user_agent'; +const TMP_HTTP_REQUEST_CONTENT_LENGTH = 'http.request_content_length'; +const TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = 'http.request_content_length_uncompressed'; +const TMP_HTTP_RESPONSE_CONTENT_LENGTH = 'http.response_content_length'; +const TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = 'http.response_content_length_uncompressed'; +const TMP_HTTP_SERVER_NAME = 'http.server_name'; +const TMP_HTTP_ROUTE = 'http.route'; +const TMP_HTTP_CLIENT_IP = 'http.client_ip'; +const TMP_AWS_DYNAMODB_TABLE_NAMES = 'aws.dynamodb.table_names'; +const TMP_AWS_DYNAMODB_CONSUMED_CAPACITY = 'aws.dynamodb.consumed_capacity'; +const TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = 'aws.dynamodb.item_collection_metrics'; +const TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = 'aws.dynamodb.provisioned_read_capacity'; +const TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = 'aws.dynamodb.provisioned_write_capacity'; +const TMP_AWS_DYNAMODB_CONSISTENT_READ = 'aws.dynamodb.consistent_read'; +const TMP_AWS_DYNAMODB_PROJECTION = 'aws.dynamodb.projection'; +const TMP_AWS_DYNAMODB_LIMIT = 'aws.dynamodb.limit'; +const TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET = 'aws.dynamodb.attributes_to_get'; +const TMP_AWS_DYNAMODB_INDEX_NAME = 'aws.dynamodb.index_name'; +const TMP_AWS_DYNAMODB_SELECT = 'aws.dynamodb.select'; +const TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = 'aws.dynamodb.global_secondary_indexes'; +const TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = 'aws.dynamodb.local_secondary_indexes'; +const TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = 'aws.dynamodb.exclusive_start_table'; +const TMP_AWS_DYNAMODB_TABLE_COUNT = 'aws.dynamodb.table_count'; +const TMP_AWS_DYNAMODB_SCAN_FORWARD = 'aws.dynamodb.scan_forward'; +const TMP_AWS_DYNAMODB_SEGMENT = 'aws.dynamodb.segment'; +const TMP_AWS_DYNAMODB_TOTAL_SEGMENTS = 'aws.dynamodb.total_segments'; +const TMP_AWS_DYNAMODB_COUNT = 'aws.dynamodb.count'; +const TMP_AWS_DYNAMODB_SCANNED_COUNT = 'aws.dynamodb.scanned_count'; +const TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = 'aws.dynamodb.attribute_definitions'; +const TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = 'aws.dynamodb.global_secondary_index_updates'; +const TMP_MESSAGING_SYSTEM = 'messaging.system'; +const TMP_MESSAGING_DESTINATION = 'messaging.destination'; +const TMP_MESSAGING_DESTINATION_KIND = 'messaging.destination_kind'; +const TMP_MESSAGING_TEMP_DESTINATION = 'messaging.temp_destination'; +const TMP_MESSAGING_PROTOCOL = 'messaging.protocol'; +const TMP_MESSAGING_PROTOCOL_VERSION = 'messaging.protocol_version'; +const TMP_MESSAGING_URL = 'messaging.url'; +const TMP_MESSAGING_MESSAGE_ID = 'messaging.message_id'; +const TMP_MESSAGING_CONVERSATION_ID = 'messaging.conversation_id'; +const TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = 'messaging.message_payload_size_bytes'; +const TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = 'messaging.message_payload_compressed_size_bytes'; +const TMP_MESSAGING_OPERATION = 'messaging.operation'; +const TMP_MESSAGING_CONSUMER_ID = 'messaging.consumer_id'; +const TMP_MESSAGING_RABBITMQ_ROUTING_KEY = 'messaging.rabbitmq.routing_key'; +const TMP_MESSAGING_KAFKA_MESSAGE_KEY = 'messaging.kafka.message_key'; +const TMP_MESSAGING_KAFKA_CONSUMER_GROUP = 'messaging.kafka.consumer_group'; +const TMP_MESSAGING_KAFKA_CLIENT_ID = 'messaging.kafka.client_id'; +const TMP_MESSAGING_KAFKA_PARTITION = 'messaging.kafka.partition'; +const TMP_MESSAGING_KAFKA_TOMBSTONE = 'messaging.kafka.tombstone'; +const TMP_RPC_SYSTEM = 'rpc.system'; +const TMP_RPC_SERVICE = 'rpc.service'; +const TMP_RPC_METHOD = 'rpc.method'; +const TMP_RPC_GRPC_STATUS_CODE = 'rpc.grpc.status_code'; +const TMP_RPC_JSONRPC_VERSION = 'rpc.jsonrpc.version'; +const TMP_RPC_JSONRPC_REQUEST_ID = 'rpc.jsonrpc.request_id'; +const TMP_RPC_JSONRPC_ERROR_CODE = 'rpc.jsonrpc.error_code'; +const TMP_RPC_JSONRPC_ERROR_MESSAGE = 'rpc.jsonrpc.error_message'; +const TMP_MESSAGE_TYPE = 'message.type'; +const TMP_MESSAGE_ID = 'message.id'; +const TMP_MESSAGE_COMPRESSED_SIZE = 'message.compressed_size'; +const TMP_MESSAGE_UNCOMPRESSED_SIZE = 'message.uncompressed_size'; +/** + * The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). + * + * Note: This may be different from `faas.id` if an alias is involved. + * + * @deprecated use ATTR_AWS_LAMBDA_INVOKED_ARN + */ +exports.SEMATTRS_AWS_LAMBDA_INVOKED_ARN = TMP_AWS_LAMBDA_INVOKED_ARN; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated use ATTR_DB_SYSTEM + */ +exports.SEMATTRS_DB_SYSTEM = TMP_DB_SYSTEM; +/** + * The connection string used to connect to the database. It is recommended to remove embedded credentials. + * + * @deprecated use ATTR_DB_CONNECTION_STRING + */ +exports.SEMATTRS_DB_CONNECTION_STRING = TMP_DB_CONNECTION_STRING; +/** + * Username for accessing the database. + * + * @deprecated use ATTR_DB_USER + */ +exports.SEMATTRS_DB_USER = TMP_DB_USER; +/** + * The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. + * + * @deprecated use ATTR_DB_JDBC_DRIVER_CLASSNAME + */ +exports.SEMATTRS_DB_JDBC_DRIVER_CLASSNAME = TMP_DB_JDBC_DRIVER_CLASSNAME; +/** + * If no [tech-specific attribute](#call-level-attributes-for-specific-technologies) is defined, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). + * + * Note: In some SQL databases, the database name to be used is called "schema name". + * + * @deprecated use ATTR_DB_NAME + */ +exports.SEMATTRS_DB_NAME = TMP_DB_NAME; +/** + * The database statement being executed. + * + * Note: The value may be sanitized to exclude sensitive information. + * + * @deprecated use ATTR_DB_STATEMENT + */ +exports.SEMATTRS_DB_STATEMENT = TMP_DB_STATEMENT; +/** + * The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. + * + * Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. + * + * @deprecated use ATTR_DB_OPERATION + */ +exports.SEMATTRS_DB_OPERATION = TMP_DB_OPERATION; +/** + * The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. + * + * Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard). + * + * @deprecated use ATTR_DB_MSSQL_INSTANCE_NAME + */ +exports.SEMATTRS_DB_MSSQL_INSTANCE_NAME = TMP_DB_MSSQL_INSTANCE_NAME; +/** + * The name of the keyspace being accessed. To be used instead of the generic `db.name` attribute. + * + * @deprecated use ATTR_DB_CASSANDRA_KEYSPACE + */ +exports.SEMATTRS_DB_CASSANDRA_KEYSPACE = TMP_DB_CASSANDRA_KEYSPACE; +/** + * The fetch size used for paging, i.e. how many rows will be returned at once. + * + * @deprecated use ATTR_DB_CASSANDRA_PAGE_SIZE + */ +exports.SEMATTRS_DB_CASSANDRA_PAGE_SIZE = TMP_DB_CASSANDRA_PAGE_SIZE; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated use ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL + */ +exports.SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL = TMP_DB_CASSANDRA_CONSISTENCY_LEVEL; +/** + * The name of the primary table that the operation is acting upon, including the schema name (if applicable). + * + * Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. + * + * @deprecated use ATTR_DB_CASSANDRA_TABLE + */ +exports.SEMATTRS_DB_CASSANDRA_TABLE = TMP_DB_CASSANDRA_TABLE; +/** + * Whether or not the query is idempotent. + * + * @deprecated use ATTR_DB_CASSANDRA_IDEMPOTENCE + */ +exports.SEMATTRS_DB_CASSANDRA_IDEMPOTENCE = TMP_DB_CASSANDRA_IDEMPOTENCE; +/** + * The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. + * + * @deprecated use ATTR_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT + */ +exports.SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT; +/** + * The ID of the coordinating node for a query. + * + * @deprecated use ATTR_DB_CASSANDRA_COORDINATOR_ID + */ +exports.SEMATTRS_DB_CASSANDRA_COORDINATOR_ID = TMP_DB_CASSANDRA_COORDINATOR_ID; +/** + * The data center of the coordinating node for a query. + * + * @deprecated use ATTR_DB_CASSANDRA_COORDINATOR_DC + */ +exports.SEMATTRS_DB_CASSANDRA_COORDINATOR_DC = TMP_DB_CASSANDRA_COORDINATOR_DC; +/** + * The [HBase namespace](https://hbase.apache.org/book.html#_namespace) being accessed. To be used instead of the generic `db.name` attribute. + * + * @deprecated use ATTR_DB_HBASE_NAMESPACE + */ +exports.SEMATTRS_DB_HBASE_NAMESPACE = TMP_DB_HBASE_NAMESPACE; +/** + * The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. + * + * @deprecated use ATTR_DB_REDIS_DATABASE_INDEX + */ +exports.SEMATTRS_DB_REDIS_DATABASE_INDEX = TMP_DB_REDIS_DATABASE_INDEX; +/** + * The collection being accessed within the database stated in `db.name`. + * + * @deprecated use ATTR_DB_MONGODB_COLLECTION + */ +exports.SEMATTRS_DB_MONGODB_COLLECTION = TMP_DB_MONGODB_COLLECTION; +/** + * The name of the primary table that the operation is acting upon, including the schema name (if applicable). + * + * Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. + * + * @deprecated use ATTR_DB_SQL_TABLE + */ +exports.SEMATTRS_DB_SQL_TABLE = TMP_DB_SQL_TABLE; +/** + * 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. + * + * @deprecated use ATTR_EXCEPTION_TYPE + */ +exports.SEMATTRS_EXCEPTION_TYPE = TMP_EXCEPTION_TYPE; +/** + * The exception message. + * + * @deprecated use ATTR_EXCEPTION_MESSAGE + */ +exports.SEMATTRS_EXCEPTION_MESSAGE = TMP_EXCEPTION_MESSAGE; +/** + * 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. + * + * @deprecated use ATTR_EXCEPTION_STACKTRACE + */ +exports.SEMATTRS_EXCEPTION_STACKTRACE = TMP_EXCEPTION_STACKTRACE; +/** +* SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. +* +* Note: An exception is considered to have escaped (or left) the scope of a span, +if that span is ended while the exception is still logically "in flight". +This may be actually "in flight" in some languages (e.g. if the exception +is passed to a Context manager's `__exit__` method in Python) but will +usually be caught at the point of recording the exception in most languages. + +It is usually not possible to determine at the point where an exception is thrown +whether it will escape the scope of a span. +However, it is trivial to know that an exception +will escape, if one checks for an active exception just before ending the span, +as done in the [example above](#exception-end-example). + +It follows that an exception may still escape the scope of the span +even if the `exception.escaped` attribute was not set or set to false, +since the event might have been recorded at a time where it was not +clear whether the exception will escape. +* +* @deprecated use ATTR_EXCEPTION_ESCAPED +*/ +exports.SEMATTRS_EXCEPTION_ESCAPED = TMP_EXCEPTION_ESCAPED; +/** + * Type of the trigger on which the function is executed. + * + * @deprecated use ATTR_FAAS_TRIGGER + */ +exports.SEMATTRS_FAAS_TRIGGER = TMP_FAAS_TRIGGER; +/** + * The execution ID of the current function execution. + * + * @deprecated use ATTR_FAAS_EXECUTION + */ +exports.SEMATTRS_FAAS_EXECUTION = TMP_FAAS_EXECUTION; +/** + * The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. + * + * @deprecated use ATTR_FAAS_DOCUMENT_COLLECTION + */ +exports.SEMATTRS_FAAS_DOCUMENT_COLLECTION = TMP_FAAS_DOCUMENT_COLLECTION; +/** + * Describes the type of the operation that was performed on the data. + * + * @deprecated use ATTR_FAAS_DOCUMENT_OPERATION + */ +exports.SEMATTRS_FAAS_DOCUMENT_OPERATION = TMP_FAAS_DOCUMENT_OPERATION; +/** + * A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). + * + * @deprecated use ATTR_FAAS_DOCUMENT_TIME + */ +exports.SEMATTRS_FAAS_DOCUMENT_TIME = TMP_FAAS_DOCUMENT_TIME; +/** + * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. + * + * @deprecated use ATTR_FAAS_DOCUMENT_NAME + */ +exports.SEMATTRS_FAAS_DOCUMENT_NAME = TMP_FAAS_DOCUMENT_NAME; +/** + * A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). + * + * @deprecated use ATTR_FAAS_TIME + */ +exports.SEMATTRS_FAAS_TIME = TMP_FAAS_TIME; +/** + * A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). + * + * @deprecated use ATTR_FAAS_CRON + */ +exports.SEMATTRS_FAAS_CRON = TMP_FAAS_CRON; +/** + * A boolean that is true if the serverless function is executed for the first time (aka cold-start). + * + * @deprecated use ATTR_FAAS_COLDSTART + */ +exports.SEMATTRS_FAAS_COLDSTART = TMP_FAAS_COLDSTART; +/** + * The name of the invoked function. + * + * Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. + * + * @deprecated use ATTR_FAAS_INVOKED_NAME + */ +exports.SEMATTRS_FAAS_INVOKED_NAME = TMP_FAAS_INVOKED_NAME; +/** + * The cloud provider of the invoked function. + * + * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. + * + * @deprecated use ATTR_FAAS_INVOKED_PROVIDER + */ +exports.SEMATTRS_FAAS_INVOKED_PROVIDER = TMP_FAAS_INVOKED_PROVIDER; +/** + * The cloud region of the invoked function. + * + * Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. + * + * @deprecated use ATTR_FAAS_INVOKED_REGION + */ +exports.SEMATTRS_FAAS_INVOKED_REGION = TMP_FAAS_INVOKED_REGION; +/** + * Transport protocol used. See note below. + * + * @deprecated use ATTR_NET_TRANSPORT + */ +exports.SEMATTRS_NET_TRANSPORT = TMP_NET_TRANSPORT; +/** + * Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6). + * + * @deprecated use ATTR_NET_PEER_IP + */ +exports.SEMATTRS_NET_PEER_IP = TMP_NET_PEER_IP; +/** + * Remote port number. + * + * @deprecated use ATTR_NET_PEER_PORT + */ +exports.SEMATTRS_NET_PEER_PORT = TMP_NET_PEER_PORT; +/** + * Remote hostname or similar, see note below. + * + * @deprecated use ATTR_NET_PEER_NAME + */ +exports.SEMATTRS_NET_PEER_NAME = TMP_NET_PEER_NAME; +/** + * Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host. + * + * @deprecated use ATTR_NET_HOST_IP + */ +exports.SEMATTRS_NET_HOST_IP = TMP_NET_HOST_IP; +/** + * Like `net.peer.port` but for the host port. + * + * @deprecated use ATTR_NET_HOST_PORT + */ +exports.SEMATTRS_NET_HOST_PORT = TMP_NET_HOST_PORT; +/** + * Local hostname or similar, see note below. + * + * @deprecated use ATTR_NET_HOST_NAME + */ +exports.SEMATTRS_NET_HOST_NAME = TMP_NET_HOST_NAME; +/** + * The internet connection type currently being used by the host. + * + * @deprecated use ATTR_NET_HOST_CONNECTION_TYPE + */ +exports.SEMATTRS_NET_HOST_CONNECTION_TYPE = TMP_NET_HOST_CONNECTION_TYPE; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated use ATTR_NET_HOST_CONNECTION_SUBTYPE + */ +exports.SEMATTRS_NET_HOST_CONNECTION_SUBTYPE = TMP_NET_HOST_CONNECTION_SUBTYPE; +/** + * The name of the mobile carrier. + * + * @deprecated use ATTR_NET_HOST_CARRIER_NAME + */ +exports.SEMATTRS_NET_HOST_CARRIER_NAME = TMP_NET_HOST_CARRIER_NAME; +/** + * The mobile carrier country code. + * + * @deprecated use ATTR_NET_HOST_CARRIER_MCC + */ +exports.SEMATTRS_NET_HOST_CARRIER_MCC = TMP_NET_HOST_CARRIER_MCC; +/** + * The mobile carrier network code. + * + * @deprecated use ATTR_NET_HOST_CARRIER_MNC + */ +exports.SEMATTRS_NET_HOST_CARRIER_MNC = TMP_NET_HOST_CARRIER_MNC; +/** + * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. + * + * @deprecated use ATTR_NET_HOST_CARRIER_ICC + */ +exports.SEMATTRS_NET_HOST_CARRIER_ICC = TMP_NET_HOST_CARRIER_ICC; +/** + * The [`service.name`](../../resource/semantic_conventions/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. + * + * @deprecated use ATTR_PEER_SERVICE + */ +exports.SEMATTRS_PEER_SERVICE = TMP_PEER_SERVICE; +/** + * Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. + * + * @deprecated use ATTR_ENDUSER_ID + */ +exports.SEMATTRS_ENDUSER_ID = TMP_ENDUSER_ID; +/** + * Actual/assumed role the client is making the request under extracted from token or application security context. + * + * @deprecated use ATTR_ENDUSER_ROLE + */ +exports.SEMATTRS_ENDUSER_ROLE = TMP_ENDUSER_ROLE; +/** + * Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). + * + * @deprecated use ATTR_ENDUSER_SCOPE + */ +exports.SEMATTRS_ENDUSER_SCOPE = TMP_ENDUSER_SCOPE; +/** + * Current "managed" thread ID (as opposed to OS thread ID). + * + * @deprecated use ATTR_THREAD_ID + */ +exports.SEMATTRS_THREAD_ID = TMP_THREAD_ID; +/** + * Current thread name. + * + * @deprecated use ATTR_THREAD_NAME + */ +exports.SEMATTRS_THREAD_NAME = TMP_THREAD_NAME; +/** + * The method or function name, or equivalent (usually rightmost part of the code unit's name). + * + * @deprecated use ATTR_CODE_FUNCTION + */ +exports.SEMATTRS_CODE_FUNCTION = TMP_CODE_FUNCTION; +/** + * The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. + * + * @deprecated use ATTR_CODE_NAMESPACE + */ +exports.SEMATTRS_CODE_NAMESPACE = TMP_CODE_NAMESPACE; +/** + * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). + * + * @deprecated use ATTR_CODE_FILEPATH + */ +exports.SEMATTRS_CODE_FILEPATH = TMP_CODE_FILEPATH; +/** + * The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. + * + * @deprecated use ATTR_CODE_LINENO + */ +exports.SEMATTRS_CODE_LINENO = TMP_CODE_LINENO; +/** + * HTTP request method. + * + * @deprecated use ATTR_HTTP_METHOD + */ +exports.SEMATTRS_HTTP_METHOD = TMP_HTTP_METHOD; +/** + * Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. + * + * Note: `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute's value should be `https://www.example.com/`. + * + * @deprecated use ATTR_HTTP_URL + */ +exports.SEMATTRS_HTTP_URL = TMP_HTTP_URL; +/** + * The full request target as passed in a HTTP request line or equivalent. + * + * @deprecated use ATTR_HTTP_TARGET + */ +exports.SEMATTRS_HTTP_TARGET = TMP_HTTP_TARGET; +/** + * The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). An empty Host header should also be reported, see note. + * + * Note: When the header is present but empty the attribute SHOULD be set to the empty string. Note that this is a valid situation that is expected in certain cases, according the aforementioned [section of RFC 7230](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is not set the attribute MUST NOT be set. + * + * @deprecated use ATTR_HTTP_HOST + */ +exports.SEMATTRS_HTTP_HOST = TMP_HTTP_HOST; +/** + * The URI scheme identifying the used protocol. + * + * @deprecated use ATTR_HTTP_SCHEME + */ +exports.SEMATTRS_HTTP_SCHEME = TMP_HTTP_SCHEME; +/** + * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). + * + * @deprecated use ATTR_HTTP_STATUS_CODE + */ +exports.SEMATTRS_HTTP_STATUS_CODE = TMP_HTTP_STATUS_CODE; +/** + * Kind of HTTP protocol used. + * + * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. + * + * @deprecated use ATTR_HTTP_FLAVOR + */ +exports.SEMATTRS_HTTP_FLAVOR = TMP_HTTP_FLAVOR; +/** + * Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. + * + * @deprecated use ATTR_HTTP_USER_AGENT + */ +exports.SEMATTRS_HTTP_USER_AGENT = TMP_HTTP_USER_AGENT; +/** + * The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size. + * + * @deprecated use ATTR_HTTP_REQUEST_CONTENT_LENGTH + */ +exports.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH = TMP_HTTP_REQUEST_CONTENT_LENGTH; +/** + * The size of the uncompressed request payload body after transport decoding. Not set if transport encoding not used. + * + * @deprecated use ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED + */ +exports.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED; +/** + * The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size. + * + * @deprecated use ATTR_HTTP_RESPONSE_CONTENT_LENGTH + */ +exports.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH = TMP_HTTP_RESPONSE_CONTENT_LENGTH; +/** + * The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used. + * + * @deprecated use ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED + */ +exports.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED; +/** + * The primary server name of the matched virtual host. This should be obtained via configuration. If no such configuration can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead). + * + * Note: `http.url` is usually not readily available on the server side but would have to be assembled in a cumbersome and sometimes lossy process from other information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus preferred to supply the raw data that is available. + * + * @deprecated use ATTR_HTTP_SERVER_NAME + */ +exports.SEMATTRS_HTTP_SERVER_NAME = TMP_HTTP_SERVER_NAME; +/** + * The matched route (path template). + * + * @deprecated use ATTR_HTTP_ROUTE + */ +exports.SEMATTRS_HTTP_ROUTE = TMP_HTTP_ROUTE; +/** +* The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). +* +* Note: This is not necessarily the same as `net.peer.ip`, which would +identify the network-level peer, which may be a proxy. + +This attribute should be set when a source of information different +from the one used for `net.peer.ip`, is available even if that other +source just confirms the same value as `net.peer.ip`. +Rationale: For `net.peer.ip`, one typically does not know if it +comes from a proxy, reverse proxy, or the actual client. Setting +`http.client_ip` when it's the same as `net.peer.ip` means that +one is at least somewhat confident that the address is not that of +the closest proxy. +* +* @deprecated use ATTR_HTTP_CLIENT_IP +*/ +exports.SEMATTRS_HTTP_CLIENT_IP = TMP_HTTP_CLIENT_IP; +/** + * The keys in the `RequestItems` object field. + * + * @deprecated use ATTR_AWS_DYNAMODB_TABLE_NAMES + */ +exports.SEMATTRS_AWS_DYNAMODB_TABLE_NAMES = TMP_AWS_DYNAMODB_TABLE_NAMES; +/** + * The JSON-serialized value of each item in the `ConsumedCapacity` response field. + * + * @deprecated use ATTR_AWS_DYNAMODB_CONSUMED_CAPACITY + */ +exports.SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY = TMP_AWS_DYNAMODB_CONSUMED_CAPACITY; +/** + * The JSON-serialized value of the `ItemCollectionMetrics` response field. + * + * @deprecated use ATTR_AWS_DYNAMODB_ITEM_COLLECTION_METRICS + */ +exports.SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS; +/** + * The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. + * + * @deprecated use ATTR_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY + */ +exports.SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY; +/** + * The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. + * + * @deprecated use ATTR_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY + */ +exports.SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY; +/** + * The value of the `ConsistentRead` request parameter. + * + * @deprecated use ATTR_AWS_DYNAMODB_CONSISTENT_READ + */ +exports.SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ = TMP_AWS_DYNAMODB_CONSISTENT_READ; +/** + * The value of the `ProjectionExpression` request parameter. + * + * @deprecated use ATTR_AWS_DYNAMODB_PROJECTION + */ +exports.SEMATTRS_AWS_DYNAMODB_PROJECTION = TMP_AWS_DYNAMODB_PROJECTION; +/** + * The value of the `Limit` request parameter. + * + * @deprecated use ATTR_AWS_DYNAMODB_LIMIT + */ +exports.SEMATTRS_AWS_DYNAMODB_LIMIT = TMP_AWS_DYNAMODB_LIMIT; +/** + * The value of the `AttributesToGet` request parameter. + * + * @deprecated use ATTR_AWS_DYNAMODB_ATTRIBUTES_TO_GET + */ +exports.SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET = TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET; +/** + * The value of the `IndexName` request parameter. + * + * @deprecated use ATTR_AWS_DYNAMODB_INDEX_NAME + */ +exports.SEMATTRS_AWS_DYNAMODB_INDEX_NAME = TMP_AWS_DYNAMODB_INDEX_NAME; +/** + * The value of the `Select` request parameter. + * + * @deprecated use ATTR_AWS_DYNAMODB_SELECT + */ +exports.SEMATTRS_AWS_DYNAMODB_SELECT = TMP_AWS_DYNAMODB_SELECT; +/** + * The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. + * + * @deprecated use ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES + */ +exports.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES; +/** + * The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. + * + * @deprecated use ATTR_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES + */ +exports.SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES; +/** + * The value of the `ExclusiveStartTableName` request parameter. + * + * @deprecated use ATTR_AWS_DYNAMODB_EXCLUSIVE_START_TABLE + */ +exports.SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE; +/** + * The the number of items in the `TableNames` response parameter. + * + * @deprecated use ATTR_AWS_DYNAMODB_TABLE_COUNT + */ +exports.SEMATTRS_AWS_DYNAMODB_TABLE_COUNT = TMP_AWS_DYNAMODB_TABLE_COUNT; +/** + * The value of the `ScanIndexForward` request parameter. + * + * @deprecated use ATTR_AWS_DYNAMODB_SCAN_FORWARD + */ +exports.SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD = TMP_AWS_DYNAMODB_SCAN_FORWARD; +/** + * The value of the `Segment` request parameter. + * + * @deprecated use ATTR_AWS_DYNAMODB_SEGMENT + */ +exports.SEMATTRS_AWS_DYNAMODB_SEGMENT = TMP_AWS_DYNAMODB_SEGMENT; +/** + * The value of the `TotalSegments` request parameter. + * + * @deprecated use ATTR_AWS_DYNAMODB_TOTAL_SEGMENTS + */ +exports.SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS = TMP_AWS_DYNAMODB_TOTAL_SEGMENTS; +/** + * The value of the `Count` response parameter. + * + * @deprecated use ATTR_AWS_DYNAMODB_COUNT + */ +exports.SEMATTRS_AWS_DYNAMODB_COUNT = TMP_AWS_DYNAMODB_COUNT; +/** + * The value of the `ScannedCount` response parameter. + * + * @deprecated use ATTR_AWS_DYNAMODB_SCANNED_COUNT + */ +exports.SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT = TMP_AWS_DYNAMODB_SCANNED_COUNT; +/** + * The JSON-serialized value of each item in the `AttributeDefinitions` request field. + * + * @deprecated use ATTR_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS + */ +exports.SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS; +/** + * The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. + * + * @deprecated use ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES + */ +exports.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES; +/** + * A string identifying the messaging system. + * + * @deprecated use ATTR_MESSAGING_SYSTEM + */ +exports.SEMATTRS_MESSAGING_SYSTEM = TMP_MESSAGING_SYSTEM; +/** + * The message destination name. This might be equal to the span name but is required nevertheless. + * + * @deprecated use ATTR_MESSAGING_DESTINATION + */ +exports.SEMATTRS_MESSAGING_DESTINATION = TMP_MESSAGING_DESTINATION; +/** + * The kind of message destination. + * + * @deprecated use ATTR_MESSAGING_DESTINATION_KIND + */ +exports.SEMATTRS_MESSAGING_DESTINATION_KIND = TMP_MESSAGING_DESTINATION_KIND; +/** + * A boolean that is true if the message destination is temporary. + * + * @deprecated use ATTR_MESSAGING_TEMP_DESTINATION + */ +exports.SEMATTRS_MESSAGING_TEMP_DESTINATION = TMP_MESSAGING_TEMP_DESTINATION; +/** + * The name of the transport protocol. + * + * @deprecated use ATTR_MESSAGING_PROTOCOL + */ +exports.SEMATTRS_MESSAGING_PROTOCOL = TMP_MESSAGING_PROTOCOL; +/** + * The version of the transport protocol. + * + * @deprecated use ATTR_MESSAGING_PROTOCOL_VERSION + */ +exports.SEMATTRS_MESSAGING_PROTOCOL_VERSION = TMP_MESSAGING_PROTOCOL_VERSION; +/** + * Connection string. + * + * @deprecated use ATTR_MESSAGING_URL + */ +exports.SEMATTRS_MESSAGING_URL = TMP_MESSAGING_URL; +/** + * A value used by the messaging system as an identifier for the message, represented as a string. + * + * @deprecated use ATTR_MESSAGING_MESSAGE_ID + */ +exports.SEMATTRS_MESSAGING_MESSAGE_ID = TMP_MESSAGING_MESSAGE_ID; +/** + * The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". + * + * @deprecated use ATTR_MESSAGING_CONVERSATION_ID + */ +exports.SEMATTRS_MESSAGING_CONVERSATION_ID = TMP_MESSAGING_CONVERSATION_ID; +/** + * The (uncompressed) size of the message payload in bytes. Also use this attribute if it is unknown whether the compressed or uncompressed payload size is reported. + * + * @deprecated use ATTR_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES + */ +exports.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES; +/** + * The compressed size of the message payload in bytes. + * + * @deprecated use ATTR_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES + */ +exports.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES; +/** + * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case. + * + * @deprecated use ATTR_MESSAGING_OPERATION + */ +exports.SEMATTRS_MESSAGING_OPERATION = TMP_MESSAGING_OPERATION; +/** + * The identifier for the consumer receiving a message. For Kafka, set it to `{messaging.kafka.consumer_group} - {messaging.kafka.client_id}`, if both are present, or only `messaging.kafka.consumer_group`. For brokers, such as RabbitMQ and Artemis, set it to the `client_id` of the client consuming the message. + * + * @deprecated use ATTR_MESSAGING_CONSUMER_ID + */ +exports.SEMATTRS_MESSAGING_CONSUMER_ID = TMP_MESSAGING_CONSUMER_ID; +/** + * RabbitMQ message routing key. + * + * @deprecated use ATTR_MESSAGING_RABBITMQ_ROUTING_KEY + */ +exports.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY = TMP_MESSAGING_RABBITMQ_ROUTING_KEY; +/** + * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message_id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. + * + * Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. + * + * @deprecated use ATTR_MESSAGING_KAFKA_MESSAGE_KEY + */ +exports.SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY = TMP_MESSAGING_KAFKA_MESSAGE_KEY; +/** + * Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. + * + * @deprecated use ATTR_MESSAGING_KAFKA_CONSUMER_GROUP + */ +exports.SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP = TMP_MESSAGING_KAFKA_CONSUMER_GROUP; +/** + * Client Id for the Consumer or Producer that is handling the message. + * + * @deprecated use ATTR_MESSAGING_KAFKA_CLIENT_ID + */ +exports.SEMATTRS_MESSAGING_KAFKA_CLIENT_ID = TMP_MESSAGING_KAFKA_CLIENT_ID; +/** + * Partition the message is sent to. + * + * @deprecated use ATTR_MESSAGING_KAFKA_PARTITION + */ +exports.SEMATTRS_MESSAGING_KAFKA_PARTITION = TMP_MESSAGING_KAFKA_PARTITION; +/** + * A boolean that is true if the message is a tombstone. + * + * @deprecated use ATTR_MESSAGING_KAFKA_TOMBSTONE + */ +exports.SEMATTRS_MESSAGING_KAFKA_TOMBSTONE = TMP_MESSAGING_KAFKA_TOMBSTONE; +/** + * A string identifying the remoting system. + * + * @deprecated use ATTR_RPC_SYSTEM + */ +exports.SEMATTRS_RPC_SYSTEM = TMP_RPC_SYSTEM; +/** + * The full (logical) name of the service being called, including its package name, if applicable. + * + * Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). + * + * @deprecated use ATTR_RPC_SERVICE + */ +exports.SEMATTRS_RPC_SERVICE = TMP_RPC_SERVICE; +/** + * The name of the (logical) method being called, must be equal to the $method part in the span name. + * + * Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). + * + * @deprecated use ATTR_RPC_METHOD + */ +exports.SEMATTRS_RPC_METHOD = TMP_RPC_METHOD; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated use ATTR_RPC_GRPC_STATUS_CODE + */ +exports.SEMATTRS_RPC_GRPC_STATUS_CODE = TMP_RPC_GRPC_STATUS_CODE; +/** + * Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 does not specify this, the value can be omitted. + * + * @deprecated use ATTR_RPC_JSONRPC_VERSION + */ +exports.SEMATTRS_RPC_JSONRPC_VERSION = TMP_RPC_JSONRPC_VERSION; +/** + * `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. + * + * @deprecated use ATTR_RPC_JSONRPC_REQUEST_ID + */ +exports.SEMATTRS_RPC_JSONRPC_REQUEST_ID = TMP_RPC_JSONRPC_REQUEST_ID; +/** + * `error.code` property of response if it is an error response. + * + * @deprecated use ATTR_RPC_JSONRPC_ERROR_CODE + */ +exports.SEMATTRS_RPC_JSONRPC_ERROR_CODE = TMP_RPC_JSONRPC_ERROR_CODE; +/** + * `error.message` property of response if it is an error response. + * + * @deprecated use ATTR_RPC_JSONRPC_ERROR_MESSAGE + */ +exports.SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE = TMP_RPC_JSONRPC_ERROR_MESSAGE; +/** + * Whether this is a received or sent message. + * + * @deprecated use ATTR_MESSAGE_TYPE + */ +exports.SEMATTRS_MESSAGE_TYPE = TMP_MESSAGE_TYPE; +/** + * MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. + * + * Note: This way we guarantee that the values will be consistent between different implementations. + * + * @deprecated use ATTR_MESSAGE_ID + */ +exports.SEMATTRS_MESSAGE_ID = TMP_MESSAGE_ID; +/** + * Compressed size of the message in bytes. + * + * @deprecated use ATTR_MESSAGE_COMPRESSED_SIZE + */ +exports.SEMATTRS_MESSAGE_COMPRESSED_SIZE = TMP_MESSAGE_COMPRESSED_SIZE; +/** + * Uncompressed size of the message in bytes. + * + * @deprecated use ATTR_MESSAGE_UNCOMPRESSED_SIZE + */ +exports.SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE = TMP_MESSAGE_UNCOMPRESSED_SIZE; +/** + * Create exported Value Map for SemanticAttributes values + * @deprecated Use the SEMATTRS_XXXXX constants rather than the SemanticAttributes.XXXXX for bundle minification + */ +exports.SemanticAttributes = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_AWS_LAMBDA_INVOKED_ARN, + TMP_DB_SYSTEM, + TMP_DB_CONNECTION_STRING, + TMP_DB_USER, + TMP_DB_JDBC_DRIVER_CLASSNAME, + TMP_DB_NAME, + TMP_DB_STATEMENT, + TMP_DB_OPERATION, + TMP_DB_MSSQL_INSTANCE_NAME, + TMP_DB_CASSANDRA_KEYSPACE, + TMP_DB_CASSANDRA_PAGE_SIZE, + TMP_DB_CASSANDRA_CONSISTENCY_LEVEL, + TMP_DB_CASSANDRA_TABLE, + TMP_DB_CASSANDRA_IDEMPOTENCE, + TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT, + TMP_DB_CASSANDRA_COORDINATOR_ID, + TMP_DB_CASSANDRA_COORDINATOR_DC, + TMP_DB_HBASE_NAMESPACE, + TMP_DB_REDIS_DATABASE_INDEX, + TMP_DB_MONGODB_COLLECTION, + TMP_DB_SQL_TABLE, + TMP_EXCEPTION_TYPE, + TMP_EXCEPTION_MESSAGE, + TMP_EXCEPTION_STACKTRACE, + TMP_EXCEPTION_ESCAPED, + TMP_FAAS_TRIGGER, + TMP_FAAS_EXECUTION, + TMP_FAAS_DOCUMENT_COLLECTION, + TMP_FAAS_DOCUMENT_OPERATION, + TMP_FAAS_DOCUMENT_TIME, + TMP_FAAS_DOCUMENT_NAME, + TMP_FAAS_TIME, + TMP_FAAS_CRON, + TMP_FAAS_COLDSTART, + TMP_FAAS_INVOKED_NAME, + TMP_FAAS_INVOKED_PROVIDER, + TMP_FAAS_INVOKED_REGION, + TMP_NET_TRANSPORT, + TMP_NET_PEER_IP, + TMP_NET_PEER_PORT, + TMP_NET_PEER_NAME, + TMP_NET_HOST_IP, + TMP_NET_HOST_PORT, + TMP_NET_HOST_NAME, + TMP_NET_HOST_CONNECTION_TYPE, + TMP_NET_HOST_CONNECTION_SUBTYPE, + TMP_NET_HOST_CARRIER_NAME, + TMP_NET_HOST_CARRIER_MCC, + TMP_NET_HOST_CARRIER_MNC, + TMP_NET_HOST_CARRIER_ICC, + TMP_PEER_SERVICE, + TMP_ENDUSER_ID, + TMP_ENDUSER_ROLE, + TMP_ENDUSER_SCOPE, + TMP_THREAD_ID, + TMP_THREAD_NAME, + TMP_CODE_FUNCTION, + TMP_CODE_NAMESPACE, + TMP_CODE_FILEPATH, + TMP_CODE_LINENO, + TMP_HTTP_METHOD, + TMP_HTTP_URL, + TMP_HTTP_TARGET, + TMP_HTTP_HOST, + TMP_HTTP_SCHEME, + TMP_HTTP_STATUS_CODE, + TMP_HTTP_FLAVOR, + TMP_HTTP_USER_AGENT, + TMP_HTTP_REQUEST_CONTENT_LENGTH, + TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED, + TMP_HTTP_RESPONSE_CONTENT_LENGTH, + TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED, + TMP_HTTP_SERVER_NAME, + TMP_HTTP_ROUTE, + TMP_HTTP_CLIENT_IP, + TMP_AWS_DYNAMODB_TABLE_NAMES, + TMP_AWS_DYNAMODB_CONSUMED_CAPACITY, + TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS, + TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY, + TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY, + TMP_AWS_DYNAMODB_CONSISTENT_READ, + TMP_AWS_DYNAMODB_PROJECTION, + TMP_AWS_DYNAMODB_LIMIT, + TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET, + TMP_AWS_DYNAMODB_INDEX_NAME, + TMP_AWS_DYNAMODB_SELECT, + TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES, + TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES, + TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE, + TMP_AWS_DYNAMODB_TABLE_COUNT, + TMP_AWS_DYNAMODB_SCAN_FORWARD, + TMP_AWS_DYNAMODB_SEGMENT, + TMP_AWS_DYNAMODB_TOTAL_SEGMENTS, + TMP_AWS_DYNAMODB_COUNT, + TMP_AWS_DYNAMODB_SCANNED_COUNT, + TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS, + TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES, + TMP_MESSAGING_SYSTEM, + TMP_MESSAGING_DESTINATION, + TMP_MESSAGING_DESTINATION_KIND, + TMP_MESSAGING_TEMP_DESTINATION, + TMP_MESSAGING_PROTOCOL, + TMP_MESSAGING_PROTOCOL_VERSION, + TMP_MESSAGING_URL, + TMP_MESSAGING_MESSAGE_ID, + TMP_MESSAGING_CONVERSATION_ID, + TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, + TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES, + TMP_MESSAGING_OPERATION, + TMP_MESSAGING_CONSUMER_ID, + TMP_MESSAGING_RABBITMQ_ROUTING_KEY, + TMP_MESSAGING_KAFKA_MESSAGE_KEY, + TMP_MESSAGING_KAFKA_CONSUMER_GROUP, + TMP_MESSAGING_KAFKA_CLIENT_ID, + TMP_MESSAGING_KAFKA_PARTITION, + TMP_MESSAGING_KAFKA_TOMBSTONE, + TMP_RPC_SYSTEM, + TMP_RPC_SERVICE, + TMP_RPC_METHOD, + TMP_RPC_GRPC_STATUS_CODE, + TMP_RPC_JSONRPC_VERSION, + TMP_RPC_JSONRPC_REQUEST_ID, + TMP_RPC_JSONRPC_ERROR_CODE, + TMP_RPC_JSONRPC_ERROR_MESSAGE, + TMP_MESSAGE_TYPE, + TMP_MESSAGE_ID, + TMP_MESSAGE_COMPRESSED_SIZE, + TMP_MESSAGE_UNCOMPRESSED_SIZE, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for DbSystemValues enum definition + * + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_DBSYSTEMVALUES_OTHER_SQL = 'other_sql'; +const TMP_DBSYSTEMVALUES_MSSQL = 'mssql'; +const TMP_DBSYSTEMVALUES_MYSQL = 'mysql'; +const TMP_DBSYSTEMVALUES_ORACLE = 'oracle'; +const TMP_DBSYSTEMVALUES_DB2 = 'db2'; +const TMP_DBSYSTEMVALUES_POSTGRESQL = 'postgresql'; +const TMP_DBSYSTEMVALUES_REDSHIFT = 'redshift'; +const TMP_DBSYSTEMVALUES_HIVE = 'hive'; +const TMP_DBSYSTEMVALUES_CLOUDSCAPE = 'cloudscape'; +const TMP_DBSYSTEMVALUES_HSQLDB = 'hsqldb'; +const TMP_DBSYSTEMVALUES_PROGRESS = 'progress'; +const TMP_DBSYSTEMVALUES_MAXDB = 'maxdb'; +const TMP_DBSYSTEMVALUES_HANADB = 'hanadb'; +const TMP_DBSYSTEMVALUES_INGRES = 'ingres'; +const TMP_DBSYSTEMVALUES_FIRSTSQL = 'firstsql'; +const TMP_DBSYSTEMVALUES_EDB = 'edb'; +const TMP_DBSYSTEMVALUES_CACHE = 'cache'; +const TMP_DBSYSTEMVALUES_ADABAS = 'adabas'; +const TMP_DBSYSTEMVALUES_FIREBIRD = 'firebird'; +const TMP_DBSYSTEMVALUES_DERBY = 'derby'; +const TMP_DBSYSTEMVALUES_FILEMAKER = 'filemaker'; +const TMP_DBSYSTEMVALUES_INFORMIX = 'informix'; +const TMP_DBSYSTEMVALUES_INSTANTDB = 'instantdb'; +const TMP_DBSYSTEMVALUES_INTERBASE = 'interbase'; +const TMP_DBSYSTEMVALUES_MARIADB = 'mariadb'; +const TMP_DBSYSTEMVALUES_NETEZZA = 'netezza'; +const TMP_DBSYSTEMVALUES_PERVASIVE = 'pervasive'; +const TMP_DBSYSTEMVALUES_POINTBASE = 'pointbase'; +const TMP_DBSYSTEMVALUES_SQLITE = 'sqlite'; +const TMP_DBSYSTEMVALUES_SYBASE = 'sybase'; +const TMP_DBSYSTEMVALUES_TERADATA = 'teradata'; +const TMP_DBSYSTEMVALUES_VERTICA = 'vertica'; +const TMP_DBSYSTEMVALUES_H2 = 'h2'; +const TMP_DBSYSTEMVALUES_COLDFUSION = 'coldfusion'; +const TMP_DBSYSTEMVALUES_CASSANDRA = 'cassandra'; +const TMP_DBSYSTEMVALUES_HBASE = 'hbase'; +const TMP_DBSYSTEMVALUES_MONGODB = 'mongodb'; +const TMP_DBSYSTEMVALUES_REDIS = 'redis'; +const TMP_DBSYSTEMVALUES_COUCHBASE = 'couchbase'; +const TMP_DBSYSTEMVALUES_COUCHDB = 'couchdb'; +const TMP_DBSYSTEMVALUES_COSMOSDB = 'cosmosdb'; +const TMP_DBSYSTEMVALUES_DYNAMODB = 'dynamodb'; +const TMP_DBSYSTEMVALUES_NEO4J = 'neo4j'; +const TMP_DBSYSTEMVALUES_GEODE = 'geode'; +const TMP_DBSYSTEMVALUES_ELASTICSEARCH = 'elasticsearch'; +const TMP_DBSYSTEMVALUES_MEMCACHED = 'memcached'; +const TMP_DBSYSTEMVALUES_COCKROACHDB = 'cockroachdb'; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_OTHER_SQL. + */ +exports.DBSYSTEMVALUES_OTHER_SQL = TMP_DBSYSTEMVALUES_OTHER_SQL; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_MSSQL. + */ +exports.DBSYSTEMVALUES_MSSQL = TMP_DBSYSTEMVALUES_MSSQL; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_MYSQL. + */ +exports.DBSYSTEMVALUES_MYSQL = TMP_DBSYSTEMVALUES_MYSQL; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_ORACLE. + */ +exports.DBSYSTEMVALUES_ORACLE = TMP_DBSYSTEMVALUES_ORACLE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_DB2. + */ +exports.DBSYSTEMVALUES_DB2 = TMP_DBSYSTEMVALUES_DB2; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_POSTGRESQL. + */ +exports.DBSYSTEMVALUES_POSTGRESQL = TMP_DBSYSTEMVALUES_POSTGRESQL; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_REDSHIFT. + */ +exports.DBSYSTEMVALUES_REDSHIFT = TMP_DBSYSTEMVALUES_REDSHIFT; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_HIVE. + */ +exports.DBSYSTEMVALUES_HIVE = TMP_DBSYSTEMVALUES_HIVE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_CLOUDSCAPE. + */ +exports.DBSYSTEMVALUES_CLOUDSCAPE = TMP_DBSYSTEMVALUES_CLOUDSCAPE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_HSQLDB. + */ +exports.DBSYSTEMVALUES_HSQLDB = TMP_DBSYSTEMVALUES_HSQLDB; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_PROGRESS. + */ +exports.DBSYSTEMVALUES_PROGRESS = TMP_DBSYSTEMVALUES_PROGRESS; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_MAXDB. + */ +exports.DBSYSTEMVALUES_MAXDB = TMP_DBSYSTEMVALUES_MAXDB; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_HANADB. + */ +exports.DBSYSTEMVALUES_HANADB = TMP_DBSYSTEMVALUES_HANADB; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_INGRES. + */ +exports.DBSYSTEMVALUES_INGRES = TMP_DBSYSTEMVALUES_INGRES; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_FIRSTSQL. + */ +exports.DBSYSTEMVALUES_FIRSTSQL = TMP_DBSYSTEMVALUES_FIRSTSQL; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_EDB. + */ +exports.DBSYSTEMVALUES_EDB = TMP_DBSYSTEMVALUES_EDB; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_CACHE. + */ +exports.DBSYSTEMVALUES_CACHE = TMP_DBSYSTEMVALUES_CACHE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_ADABAS. + */ +exports.DBSYSTEMVALUES_ADABAS = TMP_DBSYSTEMVALUES_ADABAS; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_FIREBIRD. + */ +exports.DBSYSTEMVALUES_FIREBIRD = TMP_DBSYSTEMVALUES_FIREBIRD; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_DERBY. + */ +exports.DBSYSTEMVALUES_DERBY = TMP_DBSYSTEMVALUES_DERBY; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_FILEMAKER. + */ +exports.DBSYSTEMVALUES_FILEMAKER = TMP_DBSYSTEMVALUES_FILEMAKER; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_INFORMIX. + */ +exports.DBSYSTEMVALUES_INFORMIX = TMP_DBSYSTEMVALUES_INFORMIX; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_INSTANTDB. + */ +exports.DBSYSTEMVALUES_INSTANTDB = TMP_DBSYSTEMVALUES_INSTANTDB; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_INTERBASE. + */ +exports.DBSYSTEMVALUES_INTERBASE = TMP_DBSYSTEMVALUES_INTERBASE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_MARIADB. + */ +exports.DBSYSTEMVALUES_MARIADB = TMP_DBSYSTEMVALUES_MARIADB; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_NETEZZA. + */ +exports.DBSYSTEMVALUES_NETEZZA = TMP_DBSYSTEMVALUES_NETEZZA; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_PERVASIVE. + */ +exports.DBSYSTEMVALUES_PERVASIVE = TMP_DBSYSTEMVALUES_PERVASIVE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_POINTBASE. + */ +exports.DBSYSTEMVALUES_POINTBASE = TMP_DBSYSTEMVALUES_POINTBASE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_SQLITE. + */ +exports.DBSYSTEMVALUES_SQLITE = TMP_DBSYSTEMVALUES_SQLITE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_SYBASE. + */ +exports.DBSYSTEMVALUES_SYBASE = TMP_DBSYSTEMVALUES_SYBASE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_TERADATA. + */ +exports.DBSYSTEMVALUES_TERADATA = TMP_DBSYSTEMVALUES_TERADATA; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_VERTICA. + */ +exports.DBSYSTEMVALUES_VERTICA = TMP_DBSYSTEMVALUES_VERTICA; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_H2. + */ +exports.DBSYSTEMVALUES_H2 = TMP_DBSYSTEMVALUES_H2; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_COLDFUSION. + */ +exports.DBSYSTEMVALUES_COLDFUSION = TMP_DBSYSTEMVALUES_COLDFUSION; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_CASSANDRA. + */ +exports.DBSYSTEMVALUES_CASSANDRA = TMP_DBSYSTEMVALUES_CASSANDRA; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_HBASE. + */ +exports.DBSYSTEMVALUES_HBASE = TMP_DBSYSTEMVALUES_HBASE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_MONGODB. + */ +exports.DBSYSTEMVALUES_MONGODB = TMP_DBSYSTEMVALUES_MONGODB; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_REDIS. + */ +exports.DBSYSTEMVALUES_REDIS = TMP_DBSYSTEMVALUES_REDIS; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_COUCHBASE. + */ +exports.DBSYSTEMVALUES_COUCHBASE = TMP_DBSYSTEMVALUES_COUCHBASE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_COUCHDB. + */ +exports.DBSYSTEMVALUES_COUCHDB = TMP_DBSYSTEMVALUES_COUCHDB; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_COSMOSDB. + */ +exports.DBSYSTEMVALUES_COSMOSDB = TMP_DBSYSTEMVALUES_COSMOSDB; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_DYNAMODB. + */ +exports.DBSYSTEMVALUES_DYNAMODB = TMP_DBSYSTEMVALUES_DYNAMODB; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_NEO4J. + */ +exports.DBSYSTEMVALUES_NEO4J = TMP_DBSYSTEMVALUES_NEO4J; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_GEODE. + */ +exports.DBSYSTEMVALUES_GEODE = TMP_DBSYSTEMVALUES_GEODE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_ELASTICSEARCH. + */ +exports.DBSYSTEMVALUES_ELASTICSEARCH = TMP_DBSYSTEMVALUES_ELASTICSEARCH; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_MEMCACHED. + */ +exports.DBSYSTEMVALUES_MEMCACHED = TMP_DBSYSTEMVALUES_MEMCACHED; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_COCKROACHDB. + */ +exports.DBSYSTEMVALUES_COCKROACHDB = TMP_DBSYSTEMVALUES_COCKROACHDB; +/** + * The constant map of values for DbSystemValues. + * @deprecated Use the DBSYSTEMVALUES_XXXXX constants rather than the DbSystemValues.XXXXX for bundle minification. + */ +exports.DbSystemValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_DBSYSTEMVALUES_OTHER_SQL, + TMP_DBSYSTEMVALUES_MSSQL, + TMP_DBSYSTEMVALUES_MYSQL, + TMP_DBSYSTEMVALUES_ORACLE, + TMP_DBSYSTEMVALUES_DB2, + TMP_DBSYSTEMVALUES_POSTGRESQL, + TMP_DBSYSTEMVALUES_REDSHIFT, + TMP_DBSYSTEMVALUES_HIVE, + TMP_DBSYSTEMVALUES_CLOUDSCAPE, + TMP_DBSYSTEMVALUES_HSQLDB, + TMP_DBSYSTEMVALUES_PROGRESS, + TMP_DBSYSTEMVALUES_MAXDB, + TMP_DBSYSTEMVALUES_HANADB, + TMP_DBSYSTEMVALUES_INGRES, + TMP_DBSYSTEMVALUES_FIRSTSQL, + TMP_DBSYSTEMVALUES_EDB, + TMP_DBSYSTEMVALUES_CACHE, + TMP_DBSYSTEMVALUES_ADABAS, + TMP_DBSYSTEMVALUES_FIREBIRD, + TMP_DBSYSTEMVALUES_DERBY, + TMP_DBSYSTEMVALUES_FILEMAKER, + TMP_DBSYSTEMVALUES_INFORMIX, + TMP_DBSYSTEMVALUES_INSTANTDB, + TMP_DBSYSTEMVALUES_INTERBASE, + TMP_DBSYSTEMVALUES_MARIADB, + TMP_DBSYSTEMVALUES_NETEZZA, + TMP_DBSYSTEMVALUES_PERVASIVE, + TMP_DBSYSTEMVALUES_POINTBASE, + TMP_DBSYSTEMVALUES_SQLITE, + TMP_DBSYSTEMVALUES_SYBASE, + TMP_DBSYSTEMVALUES_TERADATA, + TMP_DBSYSTEMVALUES_VERTICA, + TMP_DBSYSTEMVALUES_H2, + TMP_DBSYSTEMVALUES_COLDFUSION, + TMP_DBSYSTEMVALUES_CASSANDRA, + TMP_DBSYSTEMVALUES_HBASE, + TMP_DBSYSTEMVALUES_MONGODB, + TMP_DBSYSTEMVALUES_REDIS, + TMP_DBSYSTEMVALUES_COUCHBASE, + TMP_DBSYSTEMVALUES_COUCHDB, + TMP_DBSYSTEMVALUES_COSMOSDB, + TMP_DBSYSTEMVALUES_DYNAMODB, + TMP_DBSYSTEMVALUES_NEO4J, + TMP_DBSYSTEMVALUES_GEODE, + TMP_DBSYSTEMVALUES_ELASTICSEARCH, + TMP_DBSYSTEMVALUES_MEMCACHED, + TMP_DBSYSTEMVALUES_COCKROACHDB, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for DbCassandraConsistencyLevelValues enum definition + * + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL = 'all'; +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = 'each_quorum'; +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = 'quorum'; +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = 'local_quorum'; +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE = 'one'; +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO = 'two'; +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE = 'three'; +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = 'local_one'; +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY = 'any'; +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = 'serial'; +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = 'local_serial'; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ALL. + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_ALL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_EACH_QUORUM. + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_QUORUM. + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_QUORUM. + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ONE. + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_ONE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_TWO. + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_TWO = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_THREE. + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_THREE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_ONE. + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ANY. + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_ANY = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_SERIAL. + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_SERIAL. + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL; +/** + * The constant map of values for DbCassandraConsistencyLevelValues. + * @deprecated Use the DBCASSANDRACONSISTENCYLEVELVALUES_XXXXX constants rather than the DbCassandraConsistencyLevelValues.XXXXX for bundle minification. + */ +exports.DbCassandraConsistencyLevelValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for FaasTriggerValues enum definition + * + * Type of the trigger on which the function is executed. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_FAASTRIGGERVALUES_DATASOURCE = 'datasource'; +const TMP_FAASTRIGGERVALUES_HTTP = 'http'; +const TMP_FAASTRIGGERVALUES_PUBSUB = 'pubsub'; +const TMP_FAASTRIGGERVALUES_TIMER = 'timer'; +const TMP_FAASTRIGGERVALUES_OTHER = 'other'; +/** + * Type of the trigger on which the function is executed. + * + * @deprecated Use FAAS_TRIGGER_VALUE_DATASOURCE. + */ +exports.FAASTRIGGERVALUES_DATASOURCE = TMP_FAASTRIGGERVALUES_DATASOURCE; +/** + * Type of the trigger on which the function is executed. + * + * @deprecated Use FAAS_TRIGGER_VALUE_HTTP. + */ +exports.FAASTRIGGERVALUES_HTTP = TMP_FAASTRIGGERVALUES_HTTP; +/** + * Type of the trigger on which the function is executed. + * + * @deprecated Use FAAS_TRIGGER_VALUE_PUBSUB. + */ +exports.FAASTRIGGERVALUES_PUBSUB = TMP_FAASTRIGGERVALUES_PUBSUB; +/** + * Type of the trigger on which the function is executed. + * + * @deprecated Use FAAS_TRIGGER_VALUE_TIMER. + */ +exports.FAASTRIGGERVALUES_TIMER = TMP_FAASTRIGGERVALUES_TIMER; +/** + * Type of the trigger on which the function is executed. + * + * @deprecated Use FAAS_TRIGGER_VALUE_OTHER. + */ +exports.FAASTRIGGERVALUES_OTHER = TMP_FAASTRIGGERVALUES_OTHER; +/** + * The constant map of values for FaasTriggerValues. + * @deprecated Use the FAASTRIGGERVALUES_XXXXX constants rather than the FaasTriggerValues.XXXXX for bundle minification. + */ +exports.FaasTriggerValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_FAASTRIGGERVALUES_DATASOURCE, + TMP_FAASTRIGGERVALUES_HTTP, + TMP_FAASTRIGGERVALUES_PUBSUB, + TMP_FAASTRIGGERVALUES_TIMER, + TMP_FAASTRIGGERVALUES_OTHER, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for FaasDocumentOperationValues enum definition + * + * Describes the type of the operation that was performed on the data. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_FAASDOCUMENTOPERATIONVALUES_INSERT = 'insert'; +const TMP_FAASDOCUMENTOPERATIONVALUES_EDIT = 'edit'; +const TMP_FAASDOCUMENTOPERATIONVALUES_DELETE = 'delete'; +/** + * Describes the type of the operation that was performed on the data. + * + * @deprecated Use FAAS_DOCUMENT_OPERATION_VALUE_INSERT. + */ +exports.FAASDOCUMENTOPERATIONVALUES_INSERT = TMP_FAASDOCUMENTOPERATIONVALUES_INSERT; +/** + * Describes the type of the operation that was performed on the data. + * + * @deprecated Use FAAS_DOCUMENT_OPERATION_VALUE_EDIT. + */ +exports.FAASDOCUMENTOPERATIONVALUES_EDIT = TMP_FAASDOCUMENTOPERATIONVALUES_EDIT; +/** + * Describes the type of the operation that was performed on the data. + * + * @deprecated Use FAAS_DOCUMENT_OPERATION_VALUE_DELETE. + */ +exports.FAASDOCUMENTOPERATIONVALUES_DELETE = TMP_FAASDOCUMENTOPERATIONVALUES_DELETE; +/** + * The constant map of values for FaasDocumentOperationValues. + * @deprecated Use the FAASDOCUMENTOPERATIONVALUES_XXXXX constants rather than the FaasDocumentOperationValues.XXXXX for bundle minification. + */ +exports.FaasDocumentOperationValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_FAASDOCUMENTOPERATIONVALUES_INSERT, + TMP_FAASDOCUMENTOPERATIONVALUES_EDIT, + TMP_FAASDOCUMENTOPERATIONVALUES_DELETE, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for FaasInvokedProviderValues enum definition + * + * The cloud provider of the invoked function. + * + * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = 'alibaba_cloud'; +const TMP_FAASINVOKEDPROVIDERVALUES_AWS = 'aws'; +const TMP_FAASINVOKEDPROVIDERVALUES_AZURE = 'azure'; +const TMP_FAASINVOKEDPROVIDERVALUES_GCP = 'gcp'; +/** + * The cloud provider of the invoked function. + * + * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. + * + * @deprecated Use FAAS_INVOKED_PROVIDER_VALUE_ALIBABA_CLOUD. + */ +exports.FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD; +/** + * The cloud provider of the invoked function. + * + * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. + * + * @deprecated Use FAAS_INVOKED_PROVIDER_VALUE_AWS. + */ +exports.FAASINVOKEDPROVIDERVALUES_AWS = TMP_FAASINVOKEDPROVIDERVALUES_AWS; +/** + * The cloud provider of the invoked function. + * + * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. + * + * @deprecated Use FAAS_INVOKED_PROVIDER_VALUE_AZURE. + */ +exports.FAASINVOKEDPROVIDERVALUES_AZURE = TMP_FAASINVOKEDPROVIDERVALUES_AZURE; +/** + * The cloud provider of the invoked function. + * + * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. + * + * @deprecated Use FAAS_INVOKED_PROVIDER_VALUE_GCP. + */ +exports.FAASINVOKEDPROVIDERVALUES_GCP = TMP_FAASINVOKEDPROVIDERVALUES_GCP; +/** + * The constant map of values for FaasInvokedProviderValues. + * @deprecated Use the FAASINVOKEDPROVIDERVALUES_XXXXX constants rather than the FaasInvokedProviderValues.XXXXX for bundle minification. + */ +exports.FaasInvokedProviderValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD, + TMP_FAASINVOKEDPROVIDERVALUES_AWS, + TMP_FAASINVOKEDPROVIDERVALUES_AZURE, + TMP_FAASINVOKEDPROVIDERVALUES_GCP, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for NetTransportValues enum definition + * + * Transport protocol used. See note below. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_NETTRANSPORTVALUES_IP_TCP = 'ip_tcp'; +const TMP_NETTRANSPORTVALUES_IP_UDP = 'ip_udp'; +const TMP_NETTRANSPORTVALUES_IP = 'ip'; +const TMP_NETTRANSPORTVALUES_UNIX = 'unix'; +const TMP_NETTRANSPORTVALUES_PIPE = 'pipe'; +const TMP_NETTRANSPORTVALUES_INPROC = 'inproc'; +const TMP_NETTRANSPORTVALUES_OTHER = 'other'; +/** + * Transport protocol used. See note below. + * + * @deprecated Use NET_TRANSPORT_VALUE_IP_TCP. + */ +exports.NETTRANSPORTVALUES_IP_TCP = TMP_NETTRANSPORTVALUES_IP_TCP; +/** + * Transport protocol used. See note below. + * + * @deprecated Use NET_TRANSPORT_VALUE_IP_UDP. + */ +exports.NETTRANSPORTVALUES_IP_UDP = TMP_NETTRANSPORTVALUES_IP_UDP; +/** + * Transport protocol used. See note below. + * + * @deprecated Use NET_TRANSPORT_VALUE_IP. + */ +exports.NETTRANSPORTVALUES_IP = TMP_NETTRANSPORTVALUES_IP; +/** + * Transport protocol used. See note below. + * + * @deprecated Use NET_TRANSPORT_VALUE_UNIX. + */ +exports.NETTRANSPORTVALUES_UNIX = TMP_NETTRANSPORTVALUES_UNIX; +/** + * Transport protocol used. See note below. + * + * @deprecated Use NET_TRANSPORT_VALUE_PIPE. + */ +exports.NETTRANSPORTVALUES_PIPE = TMP_NETTRANSPORTVALUES_PIPE; +/** + * Transport protocol used. See note below. + * + * @deprecated Use NET_TRANSPORT_VALUE_INPROC. + */ +exports.NETTRANSPORTVALUES_INPROC = TMP_NETTRANSPORTVALUES_INPROC; +/** + * Transport protocol used. See note below. + * + * @deprecated Use NET_TRANSPORT_VALUE_OTHER. + */ +exports.NETTRANSPORTVALUES_OTHER = TMP_NETTRANSPORTVALUES_OTHER; +/** + * The constant map of values for NetTransportValues. + * @deprecated Use the NETTRANSPORTVALUES_XXXXX constants rather than the NetTransportValues.XXXXX for bundle minification. + */ +exports.NetTransportValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_NETTRANSPORTVALUES_IP_TCP, + TMP_NETTRANSPORTVALUES_IP_UDP, + TMP_NETTRANSPORTVALUES_IP, + TMP_NETTRANSPORTVALUES_UNIX, + TMP_NETTRANSPORTVALUES_PIPE, + TMP_NETTRANSPORTVALUES_INPROC, + TMP_NETTRANSPORTVALUES_OTHER, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for NetHostConnectionTypeValues enum definition + * + * The internet connection type currently being used by the host. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI = 'wifi'; +const TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED = 'wired'; +const TMP_NETHOSTCONNECTIONTYPEVALUES_CELL = 'cell'; +const TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = 'unavailable'; +const TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = 'unknown'; +/** + * The internet connection type currently being used by the host. + * + * @deprecated Use NET_HOST_CONNECTION_TYPE_VALUE_WIFI. + */ +exports.NETHOSTCONNECTIONTYPEVALUES_WIFI = TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI; +/** + * The internet connection type currently being used by the host. + * + * @deprecated Use NET_HOST_CONNECTION_TYPE_VALUE_WIRED. + */ +exports.NETHOSTCONNECTIONTYPEVALUES_WIRED = TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED; +/** + * The internet connection type currently being used by the host. + * + * @deprecated Use NET_HOST_CONNECTION_TYPE_VALUE_CELL. + */ +exports.NETHOSTCONNECTIONTYPEVALUES_CELL = TMP_NETHOSTCONNECTIONTYPEVALUES_CELL; +/** + * The internet connection type currently being used by the host. + * + * @deprecated Use NET_HOST_CONNECTION_TYPE_VALUE_UNAVAILABLE. + */ +exports.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE; +/** + * The internet connection type currently being used by the host. + * + * @deprecated Use NET_HOST_CONNECTION_TYPE_VALUE_UNKNOWN. + */ +exports.NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN; +/** + * The constant map of values for NetHostConnectionTypeValues. + * @deprecated Use the NETHOSTCONNECTIONTYPEVALUES_XXXXX constants rather than the NetHostConnectionTypeValues.XXXXX for bundle minification. + */ +exports.NetHostConnectionTypeValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI, + TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED, + TMP_NETHOSTCONNECTIONTYPEVALUES_CELL, + TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE, + TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for NetHostConnectionSubtypeValues enum definition + * + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = 'gprs'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = 'edge'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = 'umts'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = 'cdma'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = 'evdo_0'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = 'evdo_a'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = 'cdma2000_1xrtt'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = 'hsdpa'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = 'hsupa'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = 'hspa'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = 'iden'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = 'evdo_b'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE = 'lte'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = 'ehrpd'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = 'hspap'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM = 'gsm'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = 'td_scdma'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = 'iwlan'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR = 'nr'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = 'nrnsa'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = 'lte_ca'; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_GPRS. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_EDGE. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_UMTS. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_CDMA. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_EVDO_0. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_EVDO_A. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_CDMA2000_1XRTT. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_HSDPA. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_HSUPA. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_HSPA. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_IDEN. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_EVDO_B. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_LTE. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_EHRPD. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_HSPAP. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_GSM. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_GSM = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_TD_SCDMA. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_IWLAN. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_NR. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_NR = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_NRNSA. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_LTE_CA. + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA; +/** + * The constant map of values for NetHostConnectionSubtypeValues. + * @deprecated Use the NETHOSTCONNECTIONSUBTYPEVALUES_XXXXX constants rather than the NetHostConnectionSubtypeValues.XXXXX for bundle minification. + */ +exports.NetHostConnectionSubtypeValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for HttpFlavorValues enum definition + * + * Kind of HTTP protocol used. + * + * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_HTTPFLAVORVALUES_HTTP_1_0 = '1.0'; +const TMP_HTTPFLAVORVALUES_HTTP_1_1 = '1.1'; +const TMP_HTTPFLAVORVALUES_HTTP_2_0 = '2.0'; +const TMP_HTTPFLAVORVALUES_SPDY = 'SPDY'; +const TMP_HTTPFLAVORVALUES_QUIC = 'QUIC'; +/** + * Kind of HTTP protocol used. + * + * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. + * + * @deprecated Use HTTP_FLAVOR_VALUE_HTTP_1_0. + */ +exports.HTTPFLAVORVALUES_HTTP_1_0 = TMP_HTTPFLAVORVALUES_HTTP_1_0; +/** + * Kind of HTTP protocol used. + * + * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. + * + * @deprecated Use HTTP_FLAVOR_VALUE_HTTP_1_1. + */ +exports.HTTPFLAVORVALUES_HTTP_1_1 = TMP_HTTPFLAVORVALUES_HTTP_1_1; +/** + * Kind of HTTP protocol used. + * + * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. + * + * @deprecated Use HTTP_FLAVOR_VALUE_HTTP_2_0. + */ +exports.HTTPFLAVORVALUES_HTTP_2_0 = TMP_HTTPFLAVORVALUES_HTTP_2_0; +/** + * Kind of HTTP protocol used. + * + * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. + * + * @deprecated Use HTTP_FLAVOR_VALUE_SPDY. + */ +exports.HTTPFLAVORVALUES_SPDY = TMP_HTTPFLAVORVALUES_SPDY; +/** + * Kind of HTTP protocol used. + * + * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. + * + * @deprecated Use HTTP_FLAVOR_VALUE_QUIC. + */ +exports.HTTPFLAVORVALUES_QUIC = TMP_HTTPFLAVORVALUES_QUIC; +/** + * The constant map of values for HttpFlavorValues. + * @deprecated Use the HTTPFLAVORVALUES_XXXXX constants rather than the HttpFlavorValues.XXXXX for bundle minification. + */ +exports.HttpFlavorValues = { + HTTP_1_0: TMP_HTTPFLAVORVALUES_HTTP_1_0, + HTTP_1_1: TMP_HTTPFLAVORVALUES_HTTP_1_1, + HTTP_2_0: TMP_HTTPFLAVORVALUES_HTTP_2_0, + SPDY: TMP_HTTPFLAVORVALUES_SPDY, + QUIC: TMP_HTTPFLAVORVALUES_QUIC, +}; +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for MessagingDestinationKindValues enum definition + * + * The kind of message destination. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE = 'queue'; +const TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC = 'topic'; +/** + * The kind of message destination. + * + * @deprecated Use MESSAGING_DESTINATION_KIND_VALUE_QUEUE. + */ +exports.MESSAGINGDESTINATIONKINDVALUES_QUEUE = TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE; +/** + * The kind of message destination. + * + * @deprecated Use MESSAGING_DESTINATION_KIND_VALUE_TOPIC. + */ +exports.MESSAGINGDESTINATIONKINDVALUES_TOPIC = TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC; +/** + * The constant map of values for MessagingDestinationKindValues. + * @deprecated Use the MESSAGINGDESTINATIONKINDVALUES_XXXXX constants rather than the MessagingDestinationKindValues.XXXXX for bundle minification. + */ +exports.MessagingDestinationKindValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE, + TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for MessagingOperationValues enum definition + * + * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_MESSAGINGOPERATIONVALUES_RECEIVE = 'receive'; +const TMP_MESSAGINGOPERATIONVALUES_PROCESS = 'process'; +/** + * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case. + * + * @deprecated Use MESSAGING_OPERATION_VALUE_RECEIVE. + */ +exports.MESSAGINGOPERATIONVALUES_RECEIVE = TMP_MESSAGINGOPERATIONVALUES_RECEIVE; +/** + * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case. + * + * @deprecated Use MESSAGING_OPERATION_VALUE_PROCESS. + */ +exports.MESSAGINGOPERATIONVALUES_PROCESS = TMP_MESSAGINGOPERATIONVALUES_PROCESS; +/** + * The constant map of values for MessagingOperationValues. + * @deprecated Use the MESSAGINGOPERATIONVALUES_XXXXX constants rather than the MessagingOperationValues.XXXXX for bundle minification. + */ +exports.MessagingOperationValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_MESSAGINGOPERATIONVALUES_RECEIVE, + TMP_MESSAGINGOPERATIONVALUES_PROCESS, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for RpcGrpcStatusCodeValues enum definition + * + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_RPCGRPCSTATUSCODEVALUES_OK = 0; +const TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED = 1; +const TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN = 2; +const TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = 3; +const TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = 4; +const TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND = 5; +const TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = 6; +const TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = 7; +const TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = 8; +const TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = 9; +const TMP_RPCGRPCSTATUSCODEVALUES_ABORTED = 10; +const TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = 11; +const TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = 12; +const TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL = 13; +const TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = 14; +const TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS = 15; +const TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = 16; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_OK. + */ +exports.RPCGRPCSTATUSCODEVALUES_OK = TMP_RPCGRPCSTATUSCODEVALUES_OK; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_CANCELLED. + */ +exports.RPCGRPCSTATUSCODEVALUES_CANCELLED = TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_UNKNOWN. + */ +exports.RPCGRPCSTATUSCODEVALUES_UNKNOWN = TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_INVALID_ARGUMENT. + */ +exports.RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_DEADLINE_EXCEEDED. + */ +exports.RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_NOT_FOUND. + */ +exports.RPCGRPCSTATUSCODEVALUES_NOT_FOUND = TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_ALREADY_EXISTS. + */ +exports.RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_PERMISSION_DENIED. + */ +exports.RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_RESOURCE_EXHAUSTED. + */ +exports.RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_FAILED_PRECONDITION. + */ +exports.RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_ABORTED. + */ +exports.RPCGRPCSTATUSCODEVALUES_ABORTED = TMP_RPCGRPCSTATUSCODEVALUES_ABORTED; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_OUT_OF_RANGE. + */ +exports.RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_UNIMPLEMENTED. + */ +exports.RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_INTERNAL. + */ +exports.RPCGRPCSTATUSCODEVALUES_INTERNAL = TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_UNAVAILABLE. + */ +exports.RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_DATA_LOSS. + */ +exports.RPCGRPCSTATUSCODEVALUES_DATA_LOSS = TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_UNAUTHENTICATED. + */ +exports.RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED; +/** + * The constant map of values for RpcGrpcStatusCodeValues. + * @deprecated Use the RPCGRPCSTATUSCODEVALUES_XXXXX constants rather than the RpcGrpcStatusCodeValues.XXXXX for bundle minification. + */ +exports.RpcGrpcStatusCodeValues = { + OK: TMP_RPCGRPCSTATUSCODEVALUES_OK, + CANCELLED: TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED, + UNKNOWN: TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN, + INVALID_ARGUMENT: TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT, + DEADLINE_EXCEEDED: TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED, + NOT_FOUND: TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND, + ALREADY_EXISTS: TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS, + PERMISSION_DENIED: TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED, + RESOURCE_EXHAUSTED: TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED, + FAILED_PRECONDITION: TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION, + ABORTED: TMP_RPCGRPCSTATUSCODEVALUES_ABORTED, + OUT_OF_RANGE: TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE, + UNIMPLEMENTED: TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED, + INTERNAL: TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL, + UNAVAILABLE: TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE, + DATA_LOSS: TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS, + UNAUTHENTICATED: TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED, +}; +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for MessageTypeValues enum definition + * + * Whether this is a received or sent message. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_MESSAGETYPEVALUES_SENT = 'SENT'; +const TMP_MESSAGETYPEVALUES_RECEIVED = 'RECEIVED'; +/** + * Whether this is a received or sent message. + * + * @deprecated Use MESSAGE_TYPE_VALUE_SENT. + */ +exports.MESSAGETYPEVALUES_SENT = TMP_MESSAGETYPEVALUES_SENT; +/** + * Whether this is a received or sent message. + * + * @deprecated Use MESSAGE_TYPE_VALUE_RECEIVED. + */ +exports.MESSAGETYPEVALUES_RECEIVED = TMP_MESSAGETYPEVALUES_RECEIVED; +/** + * The constant map of values for MessageTypeValues. + * @deprecated Use the MESSAGETYPEVALUES_XXXXX constants rather than the MessageTypeValues.XXXXX for bundle minification. + */ +exports.MessageTypeValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_MESSAGETYPEVALUES_SENT, + TMP_MESSAGETYPEVALUES_RECEIVED, +]); +//# sourceMappingURL=SemanticAttributes.js.map + +/***/ }), + +/***/ 19887: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +/* eslint-disable no-restricted-syntax -- + * These re-exports are only of constants, only one-level deep at this point, + * and should not cause problems for tree-shakers. + */ +__exportStar(__nccwpck_require__(98999), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 53291: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(78683), exports); +__exportStar(__nccwpck_require__(19144), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 78683: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RedisInstrumentation = void 0; +const api_1 = __nccwpck_require__(65163); +const instrumentation_1 = __nccwpck_require__(65584); +const utils_1 = __nccwpck_require__(81757); +const redis_common_1 = __nccwpck_require__(3194); +/** @knipignore */ +const version_1 = __nccwpck_require__(39279); +const semantic_conventions_1 = __nccwpck_require__(67275); +const OTEL_OPEN_SPANS = Symbol('opentelemetry.instrumentation.redis.open_spans'); +const MULTI_COMMAND_OPTIONS = Symbol('opentelemetry.instrumentation.redis.multi_command_options'); +const DEFAULT_CONFIG = { + requireParentSpan: false, +}; +class RedisInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, Object.assign(Object.assign({}, DEFAULT_CONFIG), config)); + } + setConfig(config = {}) { + super.setConfig(Object.assign(Object.assign({}, DEFAULT_CONFIG), config)); + } + init() { + // @node-redis/client is a new package introduced and consumed by 'redis 4.0.x' + // on redis@4.1.0 it was changed to @redis/client. + // we will instrument both packages + return [ + this._getInstrumentationNodeModuleDefinition('@redis/client'), + this._getInstrumentationNodeModuleDefinition('@node-redis/client'), + ]; + } + _getInstrumentationNodeModuleDefinition(basePackageName) { + const commanderModuleFile = new instrumentation_1.InstrumentationNodeModuleFile(`${basePackageName}/dist/lib/commander.js`, ['^1.0.0'], (moduleExports, moduleVersion) => { + const transformCommandArguments = moduleExports.transformCommandArguments; + if (!transformCommandArguments) { + this._diag.error('internal instrumentation error, missing transformCommandArguments function'); + return moduleExports; + } + // function name and signature changed in redis 4.1.0 from 'extendWithCommands' to 'attachCommands' + // the matching internal package names starts with 1.0.x (for redis 4.0.x) + const functionToPatch = (moduleVersion === null || moduleVersion === void 0 ? void 0 : moduleVersion.startsWith('1.0.')) + ? 'extendWithCommands' + : 'attachCommands'; + // this is the function that extend a redis client with a list of commands. + // the function patches the commandExecutor to record a span + if ((0, instrumentation_1.isWrapped)(moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports[functionToPatch])) { + this._unwrap(moduleExports, functionToPatch); + } + this._wrap(moduleExports, functionToPatch, this._getPatchExtendWithCommands(transformCommandArguments)); + return moduleExports; + }, (moduleExports) => { + if ((0, instrumentation_1.isWrapped)(moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.extendWithCommands)) { + this._unwrap(moduleExports, 'extendWithCommands'); + } + if ((0, instrumentation_1.isWrapped)(moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.attachCommands)) { + this._unwrap(moduleExports, 'attachCommands'); + } + }); + const multiCommanderModule = new instrumentation_1.InstrumentationNodeModuleFile(`${basePackageName}/dist/lib/client/multi-command.js`, ['^1.0.0'], (moduleExports) => { + var _a; + const redisClientMultiCommandPrototype = (_a = moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.default) === null || _a === void 0 ? void 0 : _a.prototype; + if ((0, instrumentation_1.isWrapped)(redisClientMultiCommandPrototype === null || redisClientMultiCommandPrototype === void 0 ? void 0 : redisClientMultiCommandPrototype.exec)) { + this._unwrap(redisClientMultiCommandPrototype, 'exec'); + } + this._wrap(redisClientMultiCommandPrototype, 'exec', this._getPatchMultiCommandsExec()); + if ((0, instrumentation_1.isWrapped)(redisClientMultiCommandPrototype === null || redisClientMultiCommandPrototype === void 0 ? void 0 : redisClientMultiCommandPrototype.addCommand)) { + this._unwrap(redisClientMultiCommandPrototype, 'addCommand'); + } + this._wrap(redisClientMultiCommandPrototype, 'addCommand', this._getPatchMultiCommandsAddCommand()); + return moduleExports; + }, (moduleExports) => { + var _a; + const redisClientMultiCommandPrototype = (_a = moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.default) === null || _a === void 0 ? void 0 : _a.prototype; + if ((0, instrumentation_1.isWrapped)(redisClientMultiCommandPrototype === null || redisClientMultiCommandPrototype === void 0 ? void 0 : redisClientMultiCommandPrototype.exec)) { + this._unwrap(redisClientMultiCommandPrototype, 'exec'); + } + if ((0, instrumentation_1.isWrapped)(redisClientMultiCommandPrototype === null || redisClientMultiCommandPrototype === void 0 ? void 0 : redisClientMultiCommandPrototype.addCommand)) { + this._unwrap(redisClientMultiCommandPrototype, 'addCommand'); + } + }); + const clientIndexModule = new instrumentation_1.InstrumentationNodeModuleFile(`${basePackageName}/dist/lib/client/index.js`, ['^1.0.0'], (moduleExports) => { + var _a; + const redisClientPrototype = (_a = moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.default) === null || _a === void 0 ? void 0 : _a.prototype; + // In some @redis/client versions 'multi' is a method. In later + // versions, as of https://github.com/redis/node-redis/pull/2324, + // 'MULTI' is a method and 'multi' is a property defined in the + // constructor that points to 'MULTI', and therefore it will not + // be defined on the prototype. + if (redisClientPrototype === null || redisClientPrototype === void 0 ? void 0 : redisClientPrototype.multi) { + if ((0, instrumentation_1.isWrapped)(redisClientPrototype === null || redisClientPrototype === void 0 ? void 0 : redisClientPrototype.multi)) { + this._unwrap(redisClientPrototype, 'multi'); + } + this._wrap(redisClientPrototype, 'multi', this._getPatchRedisClientMulti()); + } + if (redisClientPrototype === null || redisClientPrototype === void 0 ? void 0 : redisClientPrototype.MULTI) { + if ((0, instrumentation_1.isWrapped)(redisClientPrototype === null || redisClientPrototype === void 0 ? void 0 : redisClientPrototype.MULTI)) { + this._unwrap(redisClientPrototype, 'MULTI'); + } + this._wrap(redisClientPrototype, 'MULTI', this._getPatchRedisClientMulti()); + } + if ((0, instrumentation_1.isWrapped)(redisClientPrototype === null || redisClientPrototype === void 0 ? void 0 : redisClientPrototype.sendCommand)) { + this._unwrap(redisClientPrototype, 'sendCommand'); + } + this._wrap(redisClientPrototype, 'sendCommand', this._getPatchRedisClientSendCommand()); + this._wrap(redisClientPrototype, 'connect', this._getPatchedClientConnect()); + return moduleExports; + }, (moduleExports) => { + var _a; + const redisClientPrototype = (_a = moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.default) === null || _a === void 0 ? void 0 : _a.prototype; + if ((0, instrumentation_1.isWrapped)(redisClientPrototype === null || redisClientPrototype === void 0 ? void 0 : redisClientPrototype.multi)) { + this._unwrap(redisClientPrototype, 'multi'); + } + if ((0, instrumentation_1.isWrapped)(redisClientPrototype === null || redisClientPrototype === void 0 ? void 0 : redisClientPrototype.MULTI)) { + this._unwrap(redisClientPrototype, 'MULTI'); + } + if ((0, instrumentation_1.isWrapped)(redisClientPrototype === null || redisClientPrototype === void 0 ? void 0 : redisClientPrototype.sendCommand)) { + this._unwrap(redisClientPrototype, 'sendCommand'); + } + }); + return new instrumentation_1.InstrumentationNodeModuleDefinition(basePackageName, ['^1.0.0'], (moduleExports) => { + return moduleExports; + }, () => { }, [commanderModuleFile, multiCommanderModule, clientIndexModule]); + } + // serves both for redis 4.0.x where function name is extendWithCommands + // and redis ^4.1.0 where function name is attachCommands + _getPatchExtendWithCommands(transformCommandArguments) { + const plugin = this; + return function extendWithCommandsPatchWrapper(original) { + return function extendWithCommandsPatch(config) { + var _a; + if (((_a = config === null || config === void 0 ? void 0 : config.BaseClass) === null || _a === void 0 ? void 0 : _a.name) !== 'RedisClient') { + return original.apply(this, arguments); + } + const origExecutor = config.executor; + config.executor = function (command, args) { + const redisCommandArguments = transformCommandArguments(command, args).args; + return plugin._traceClientCommand(origExecutor, this, arguments, redisCommandArguments); + }; + return original.apply(this, arguments); + }; + }; + } + _getPatchMultiCommandsExec() { + const plugin = this; + return function execPatchWrapper(original) { + return function execPatch() { + const execRes = original.apply(this, arguments); + if (typeof (execRes === null || execRes === void 0 ? void 0 : execRes.then) !== 'function') { + plugin._diag.error('got non promise result when patching RedisClientMultiCommand.exec'); + return execRes; + } + return execRes + .then((redisRes) => { + const openSpans = this[OTEL_OPEN_SPANS]; + plugin._endSpansWithRedisReplies(openSpans, redisRes); + return redisRes; + }) + .catch((err) => { + const openSpans = this[OTEL_OPEN_SPANS]; + if (!openSpans) { + plugin._diag.error('cannot find open spans to end for redis multi command'); + } + else { + const replies = err.constructor.name === 'MultiErrorReply' + ? err.replies + : new Array(openSpans.length).fill(err); + plugin._endSpansWithRedisReplies(openSpans, replies); + } + return Promise.reject(err); + }); + }; + }; + } + _getPatchMultiCommandsAddCommand() { + const plugin = this; + return function addCommandWrapper(original) { + return function addCommandPatch(args) { + return plugin._traceClientCommand(original, this, arguments, args); + }; + }; + } + _getPatchRedisClientMulti() { + return function multiPatchWrapper(original) { + return function multiPatch() { + const multiRes = original.apply(this, arguments); + multiRes[MULTI_COMMAND_OPTIONS] = this.options; + return multiRes; + }; + }; + } + _getPatchRedisClientSendCommand() { + const plugin = this; + return function sendCommandWrapper(original) { + return function sendCommandPatch(args) { + return plugin._traceClientCommand(original, this, arguments, args); + }; + }; + } + _getPatchedClientConnect() { + const plugin = this; + return function connectWrapper(original) { + return function patchedConnect() { + const options = this.options; + const attributes = (0, utils_1.getClientAttributes)(plugin._diag, options); + const span = plugin.tracer.startSpan(`${RedisInstrumentation.COMPONENT}-connect`, { + kind: api_1.SpanKind.CLIENT, + attributes, + }); + const res = api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { + return original.apply(this); + }); + return res + .then((result) => { + span.end(); + return result; + }) + .catch((error) => { + span.recordException(error); + span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: error.message, + }); + span.end(); + return Promise.reject(error); + }); + }; + }; + } + _traceClientCommand(origFunction, origThis, origArguments, redisCommandArguments) { + const hasNoParentSpan = api_1.trace.getSpan(api_1.context.active()) === undefined; + if (hasNoParentSpan && this.getConfig().requireParentSpan) { + return origFunction.apply(origThis, origArguments); + } + const clientOptions = origThis.options || origThis[MULTI_COMMAND_OPTIONS]; + const commandName = redisCommandArguments[0]; // types also allows it to be a Buffer, but in practice it only string + const commandArgs = redisCommandArguments.slice(1); + const dbStatementSerializer = this.getConfig().dbStatementSerializer || redis_common_1.defaultDbStatementSerializer; + const attributes = (0, utils_1.getClientAttributes)(this._diag, clientOptions); + try { + const dbStatement = dbStatementSerializer(commandName, commandArgs); + if (dbStatement != null) { + attributes[semantic_conventions_1.SEMATTRS_DB_STATEMENT] = dbStatement; + } + } + catch (e) { + this._diag.error('dbStatementSerializer throw an exception', e, { + commandName, + }); + } + const span = this.tracer.startSpan(`${RedisInstrumentation.COMPONENT}-${commandName}`, { + kind: api_1.SpanKind.CLIENT, + attributes, + }); + const res = api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { + return origFunction.apply(origThis, origArguments); + }); + if (typeof (res === null || res === void 0 ? void 0 : res.then) === 'function') { + res.then((redisRes) => { + this._endSpanWithResponse(span, commandName, commandArgs, redisRes, undefined); + }, (err) => { + this._endSpanWithResponse(span, commandName, commandArgs, null, err); + }); + } + else { + const redisClientMultiCommand = res; + redisClientMultiCommand[OTEL_OPEN_SPANS] = + redisClientMultiCommand[OTEL_OPEN_SPANS] || []; + redisClientMultiCommand[OTEL_OPEN_SPANS].push({ + span, + commandName, + commandArgs, + }); + } + return res; + } + _endSpansWithRedisReplies(openSpans, replies) { + if (!openSpans) { + return this._diag.error('cannot find open spans to end for redis multi command'); + } + if (replies.length !== openSpans.length) { + return this._diag.error('number of multi command spans does not match response from redis'); + } + for (let i = 0; i < openSpans.length; i++) { + const { span, commandName, commandArgs } = openSpans[i]; + const currCommandRes = replies[i]; + const [res, err] = currCommandRes instanceof Error + ? [null, currCommandRes] + : [currCommandRes, undefined]; + this._endSpanWithResponse(span, commandName, commandArgs, res, err); + } + } + _endSpanWithResponse(span, commandName, commandArgs, response, error) { + const { responseHook } = this.getConfig(); + if (!error && responseHook) { + try { + responseHook(span, commandName, commandArgs, response); + } + catch (err) { + this._diag.error('responseHook throw an exception', err); + } + } + if (error) { + span.recordException(error); + span.setStatus({ code: api_1.SpanStatusCode.ERROR, message: error === null || error === void 0 ? void 0 : error.message }); + } + span.end(); + } +} +exports.RedisInstrumentation = RedisInstrumentation; +RedisInstrumentation.COMPONENT = 'redis'; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 19144: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 81757: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getClientAttributes = void 0; +const semantic_conventions_1 = __nccwpck_require__(67275); +function getClientAttributes(diag, options) { + var _a, _b; + return { + [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_REDIS, + [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: (_a = options === null || options === void 0 ? void 0 : options.socket) === null || _a === void 0 ? void 0 : _a.host, + [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: (_b = options === null || options === void 0 ? void 0 : options.socket) === null || _b === void 0 ? void 0 : _b.port, + [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: removeCredentialsFromDBConnectionStringAttribute(diag, options === null || options === void 0 ? void 0 : options.url), + }; +} +exports.getClientAttributes = getClientAttributes; +/** + * removeCredentialsFromDBConnectionStringAttribute removes basic auth from url and user_pwd from query string + * + * Examples: + * redis://user:pass@localhost:6379/mydb => redis://localhost:6379/mydb + * redis://localhost:6379?db=mydb&user_pwd=pass => redis://localhost:6379?db=mydb + */ +function removeCredentialsFromDBConnectionStringAttribute(diag, url) { + if (typeof url !== 'string' || !url) { + return; + } + try { + const u = new URL(url); + u.searchParams.delete('user_pwd'); + u.username = ''; + u.password = ''; + return u.href; + } + catch (err) { + diag.error('failed to sanitize redis connection url', err); + } + return; +} +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 39279: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.46.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-redis-4'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 70450: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(75850), exports); +__exportStar(__nccwpck_require__(30861), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 75850: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TediousInstrumentation = void 0; +const api = __nccwpck_require__(65163); +const events_1 = __nccwpck_require__(82361); +const instrumentation_1 = __nccwpck_require__(65584); +const semantic_conventions_1 = __nccwpck_require__(67275); +const utils_1 = __nccwpck_require__(60185); +/** @knipignore */ +const version_1 = __nccwpck_require__(39322); +const CURRENT_DATABASE = Symbol('opentelemetry.instrumentation-tedious.current-database'); +const PATCHED_METHODS = [ + 'callProcedure', + 'execSql', + 'execSqlBatch', + 'execBulkLoad', + 'prepare', + 'execute', +]; +function setDatabase(databaseName) { + Object.defineProperty(this, CURRENT_DATABASE, { + value: databaseName, + writable: true, + }); +} +class TediousInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); + } + init() { + return [ + new instrumentation_1.InstrumentationNodeModuleDefinition(TediousInstrumentation.COMPONENT, ['>=1.11.0 <20'], (moduleExports) => { + const ConnectionPrototype = moduleExports.Connection.prototype; + for (const method of PATCHED_METHODS) { + if ((0, instrumentation_1.isWrapped)(ConnectionPrototype[method])) { + this._unwrap(ConnectionPrototype, method); + } + this._wrap(ConnectionPrototype, method, this._patchQuery(method)); + } + if ((0, instrumentation_1.isWrapped)(ConnectionPrototype.connect)) { + this._unwrap(ConnectionPrototype, 'connect'); + } + this._wrap(ConnectionPrototype, 'connect', this._patchConnect); + return moduleExports; + }, (moduleExports) => { + if (moduleExports === undefined) + return; + const ConnectionPrototype = moduleExports.Connection.prototype; + for (const method of PATCHED_METHODS) { + this._unwrap(ConnectionPrototype, method); + } + this._unwrap(ConnectionPrototype, 'connect'); + }), + ]; + } + _patchConnect(original) { + return function patchedConnect() { + var _a, _b; + setDatabase.call(this, (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.database); + // remove the listener first in case it's already added + this.removeListener('databaseChange', setDatabase); + this.on('databaseChange', setDatabase); + this.once('end', () => { + this.removeListener('databaseChange', setDatabase); + }); + return original.apply(this, arguments); + }; + } + _patchQuery(operation) { + return (originalMethod) => { + const thisPlugin = this; + function patchedMethod(request) { + var _a, _b, _c, _d, _e, _f, _g, _h; + if (!(request instanceof events_1.EventEmitter)) { + thisPlugin._diag.warn(`Unexpected invocation of patched ${operation} method. Span not recorded`); + return originalMethod.apply(this, arguments); + } + let procCount = 0; + let statementCount = 0; + const incrementStatementCount = () => statementCount++; + const incrementProcCount = () => procCount++; + const databaseName = this[CURRENT_DATABASE]; + const sql = (request => { + var _a, _b; + // Required for <11.0.9 + if (request.sqlTextOrProcedure === 'sp_prepare' && + ((_b = (_a = request.parametersByName) === null || _a === void 0 ? void 0 : _a.stmt) === null || _b === void 0 ? void 0 : _b.value)) { + return request.parametersByName.stmt.value; + } + return request.sqlTextOrProcedure; + })(request); + const span = thisPlugin.tracer.startSpan((0, utils_1.getSpanName)(operation, databaseName, sql, request.table), { + kind: api.SpanKind.CLIENT, + attributes: { + [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_MSSQL, + [semantic_conventions_1.SEMATTRS_DB_NAME]: databaseName, + [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.port, + [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: (_c = this.config) === null || _c === void 0 ? void 0 : _c.server, + // >=4 uses `authentication` object, older versions just userName and password pair + [semantic_conventions_1.SEMATTRS_DB_USER]: (_e = (_d = this.config) === null || _d === void 0 ? void 0 : _d.userName) !== null && _e !== void 0 ? _e : (_h = (_g = (_f = this.config) === null || _f === void 0 ? void 0 : _f.authentication) === null || _g === void 0 ? void 0 : _g.options) === null || _h === void 0 ? void 0 : _h.userName, + [semantic_conventions_1.SEMATTRS_DB_STATEMENT]: sql, + [semantic_conventions_1.SEMATTRS_DB_SQL_TABLE]: request.table, + }, + }); + const endSpan = (0, utils_1.once)((err) => { + request.removeListener('done', incrementStatementCount); + request.removeListener('doneInProc', incrementStatementCount); + request.removeListener('doneProc', incrementProcCount); + request.removeListener('error', endSpan); + this.removeListener('end', endSpan); + span.setAttribute('tedious.procedure_count', procCount); + span.setAttribute('tedious.statement_count', statementCount); + if (err) { + span.setStatus({ + code: api.SpanStatusCode.ERROR, + message: err.message, + }); + } + span.end(); + }); + request.on('done', incrementStatementCount); + request.on('doneInProc', incrementStatementCount); + request.on('doneProc', incrementProcCount); + request.once('error', endSpan); + this.on('end', endSpan); + if (typeof request.callback === 'function') { + thisPlugin._wrap(request, 'callback', thisPlugin._patchCallbackQuery(endSpan)); + } + else { + thisPlugin._diag.error('Expected request.callback to be a function'); + } + return api.context.with(api.trace.setSpan(api.context.active(), span), originalMethod, this, ...arguments); + } + Object.defineProperty(patchedMethod, 'length', { + value: originalMethod.length, + writable: false, + }); + return patchedMethod; + }; + } + _patchCallbackQuery(endSpan) { + return (originalCallback) => { + return function (err, rowCount, rows) { + endSpan(err); + return originalCallback.apply(this, arguments); + }; + }; + } +} +exports.TediousInstrumentation = TediousInstrumentation; +TediousInstrumentation.COMPONENT = 'tedious'; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 30861: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 60185: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.once = exports.getSpanName = void 0; +/** + * The span name SHOULD be set to a low cardinality value + * representing the statement executed on the database. + * + * @returns Operation executed on Tedious Connection. Does not map to SQL statement in any way. + */ +function getSpanName(operation, db, sql, bulkLoadTable) { + if (operation === 'execBulkLoad' && bulkLoadTable && db) { + return `${operation} ${bulkLoadTable} ${db}`; + } + if (operation === 'callProcedure') { + // `sql` refers to procedure name with `callProcedure` + if (db) { + return `${operation} ${sql} ${db}`; + } + return `${operation} ${sql}`; + } + // do not use `sql` in general case because of high-cardinality + if (db) { + return `${operation} ${db}`; + } + return `${operation}`; +} +exports.getSpanName = getSpanName; +const once = (fn) => { + let called = false; + return (...args) => { + if (called) + return; + called = true; + return fn(...args); + }; +}; +exports.once = once; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 39322: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.18.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-tedious'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 21353: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SemanticAttributes = void 0; +// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2 +exports.SemanticAttributes = { + /** + * State of the HTTP connection in the HTTP connection pool. + */ + HTTP_CONNECTION_STATE: 'http.connection.state', + /** + * Describes a class of error the operation ended with. + * + * Note: The `error.type` SHOULD be predictable and SHOULD have low cardinality. + Instrumentations SHOULD document the list of errors they report. + + The cardinality of `error.type` within one instrumentation library SHOULD be low. + Telemetry consumers that aggregate data from multiple instrumentation libraries and applications + should be prepared for `error.type` to have high cardinality at query time when no + additional filters are applied. + + If the operation has completed successfully, instrumentations SHOULD NOT set `error.type`. + + If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes), + it's RECOMMENDED to: + + * Use a domain-specific attribute + * Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not. + */ + ERROR_TYPE: 'error.type', + /** + * The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. + */ + HTTP_REQUEST_BODY_SIZE: 'http.request.body.size', + /** + * HTTP request method. + * + * Note: HTTP request method value SHOULD be "known" to the instrumentation. + By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) + and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). + + If the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`. + + If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override + the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named + OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods + (this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults). + + HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly. + Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. + Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. + */ + HTTP_REQUEST_METHOD: 'http.request.method', + /** + * Original HTTP method sent by the client in the request line. + */ + HTTP_REQUEST_METHOD_ORIGINAL: 'http.request.method_original', + /** + * The ordinal number of request resending attempt (for any reason, including redirects). + * + * 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). + */ + HTTP_REQUEST_RESEND_COUNT: 'http.request.resend_count', + /** + * The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. + */ + HTTP_RESPONSE_BODY_SIZE: 'http.response.body.size', + /** + * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). + */ + HTTP_RESPONSE_STATUS_CODE: 'http.response.status_code', + /** + * The matched route, that is, the path template in the format used by the respective server framework. + * + * 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. + SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. + */ + HTTP_ROUTE: 'http.route', + /** + * Peer address of the network connection - IP address or Unix domain socket name. + */ + NETWORK_PEER_ADDRESS: 'network.peer.address', + /** + * Peer port number of the network connection. + */ + NETWORK_PEER_PORT: 'network.peer.port', + /** + * [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. + * + * Note: The value SHOULD be normalized to lowercase. + */ + NETWORK_PROTOCOL_NAME: 'network.protocol.name', + /** + * Version of the protocol specified in `network.protocol.name`. + * + * Note: `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. + */ + NETWORK_PROTOCOL_VERSION: 'network.protocol.version', + /** + * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. + * + * 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. + */ + SERVER_ADDRESS: 'server.address', + /** + * Server port number. + * + * 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. + */ + SERVER_PORT: 'server.port', + /** + * Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986). + * + * Note: For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. + `url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`. + `url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes. + */ + URL_FULL: 'url.full', + /** + * The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. + */ + URL_PATH: 'url.path', + /** + * The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component. + * + * Note: Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it. + */ + URL_QUERY: 'url.query', + /** + * The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. + */ + URL_SCHEME: 'url.scheme', + /** + * Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. + */ + USER_AGENT_ORIGINAL: 'user_agent.original', +}; +//# sourceMappingURL=SemanticAttributes.js.map + +/***/ }), + +/***/ 8076: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(3345), exports); +__exportStar(__nccwpck_require__(29450), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 29450: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 3345: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.UndiciInstrumentation = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const diagch = __nccwpck_require__(67643); +const url_1 = __nccwpck_require__(57310); +const instrumentation_1 = __nccwpck_require__(65584); +const api_1 = __nccwpck_require__(65163); +/** @knipignore */ +const version_1 = __nccwpck_require__(85978); +const SemanticAttributes_1 = __nccwpck_require__(21353); +const core_1 = __nccwpck_require__(89736); +// A combination of https://github.com/elastic/apm-agent-nodejs and +// https://github.com/gadget-inc/opentelemetry-instrumentations/blob/main/packages/opentelemetry-instrumentation-undici/src/index.ts +class UndiciInstrumentation extends instrumentation_1.InstrumentationBase { + constructor(config = {}) { + super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); + this._recordFromReq = new WeakMap(); + } + // No need to instrument files/modules + init() { + return undefined; + } + disable() { + super.disable(); + this._channelSubs.forEach(sub => sub.unsubscribe()); + this._channelSubs.length = 0; + } + enable() { + // "enabled" handling is currently a bit messy with InstrumentationBase. + // If constructed with `{enabled: false}`, this `.enable()` is still called, + // and `this.getConfig().enabled !== this.isEnabled()`, creating confusion. + // + // For now, this class will setup for instrumenting if `.enable()` is + // called, but use `this.getConfig().enabled` to determine if + // instrumentation should be generated. This covers the more likely common + // case of config being given a construction time, rather than later via + // `instance.enable()`, `.disable()`, or `.setConfig()` calls. + super.enable(); + // This method is called by the super-class constructor before ours is + // called. So we need to ensure the property is initalized. + this._channelSubs = this._channelSubs || []; + // Avoid to duplicate subscriptions + if (this._channelSubs.length > 0) { + return; + } + this.subscribeToChannel('undici:request:create', this.onRequestCreated.bind(this)); + this.subscribeToChannel('undici:client:sendHeaders', this.onRequestHeaders.bind(this)); + this.subscribeToChannel('undici:request:headers', this.onResponseHeaders.bind(this)); + this.subscribeToChannel('undici:request:trailers', this.onDone.bind(this)); + this.subscribeToChannel('undici:request:error', this.onError.bind(this)); + } + _updateMetricInstruments() { + this._httpClientDurationHistogram = this.meter.createHistogram('http.client.request.duration', { + description: 'Measures the duration of outbound HTTP requests.', + unit: 's', + valueType: api_1.ValueType.DOUBLE, + advice: { + explicitBucketBoundaries: [ + 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, + 7.5, 10, + ], + }, + }); + } + subscribeToChannel(diagnosticChannel, onMessage) { + var _a; + // `diagnostics_channel` had a ref counting bug until v18.19.0. + // https://github.com/nodejs/node/pull/47520 + const [major, minor] = process.version + .replace('v', '') + .split('.') + .map(n => Number(n)); + const useNewSubscribe = major > 18 || (major === 18 && minor >= 19); + let unsubscribe; + if (useNewSubscribe) { + (_a = diagch.subscribe) === null || _a === void 0 ? void 0 : _a.call(diagch, diagnosticChannel, onMessage); + unsubscribe = () => { var _a; return (_a = diagch.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(diagch, diagnosticChannel, onMessage); }; + } + else { + const channel = diagch.channel(diagnosticChannel); + channel.subscribe(onMessage); + unsubscribe = () => channel.unsubscribe(onMessage); + } + this._channelSubs.push({ + name: diagnosticChannel, + unsubscribe, + }); + } + // This is the 1st message we receive for each request (fired after request creation). Here we will + // create the span and populate some atttributes, then link the span to the request for further + // span processing + onRequestCreated({ request }) { + // Ignore if: + // - instrumentation is disabled + // - ignored by config + // - method is 'CONNECT' + const config = this.getConfig(); + const enabled = config.enabled !== false; + const shouldIgnoreReq = (0, instrumentation_1.safeExecuteInTheMiddle)(() => { + var _a; + return !enabled || + request.method === 'CONNECT' || + ((_a = config.ignoreRequestHook) === null || _a === void 0 ? void 0 : _a.call(config, request)); + }, e => e && this._diag.error('caught ignoreRequestHook error: ', e), true); + if (shouldIgnoreReq) { + return; + } + const startTime = (0, core_1.hrTime)(); + let requestUrl; + try { + requestUrl = new url_1.URL(request.path, request.origin); + } + catch (err) { + this._diag.warn('could not determine url.full:', err); + // Skip instrumenting this request. + return; + } + const urlScheme = requestUrl.protocol.replace(':', ''); + const requestMethod = this.getRequestMethod(request.method); + const attributes = { + [SemanticAttributes_1.SemanticAttributes.HTTP_REQUEST_METHOD]: requestMethod, + [SemanticAttributes_1.SemanticAttributes.HTTP_REQUEST_METHOD_ORIGINAL]: request.method, + [SemanticAttributes_1.SemanticAttributes.URL_FULL]: requestUrl.toString(), + [SemanticAttributes_1.SemanticAttributes.URL_PATH]: requestUrl.pathname, + [SemanticAttributes_1.SemanticAttributes.URL_QUERY]: requestUrl.search, + [SemanticAttributes_1.SemanticAttributes.URL_SCHEME]: urlScheme, + }; + const schemePorts = { https: '443', http: '80' }; + const serverAddress = requestUrl.hostname; + const serverPort = requestUrl.port || schemePorts[urlScheme]; + attributes[SemanticAttributes_1.SemanticAttributes.SERVER_ADDRESS] = serverAddress; + if (serverPort && !isNaN(Number(serverPort))) { + attributes[SemanticAttributes_1.SemanticAttributes.SERVER_PORT] = Number(serverPort); + } + // Get user agent from headers + let userAgent; + if (Array.isArray(request.headers)) { + const idx = request.headers.findIndex(h => h.toLowerCase() === 'user-agent'); + if (idx >= 0) { + userAgent = request.headers[idx + 1]; + } + } + else if (typeof request.headers === 'string') { + const headers = request.headers.split('\r\n'); + const uaHeader = headers.find(h => h.toLowerCase().startsWith('user-agent')); + userAgent = + uaHeader && uaHeader.substring(uaHeader.indexOf(':') + 1).trim(); + } + if (userAgent) { + attributes[SemanticAttributes_1.SemanticAttributes.USER_AGENT_ORIGINAL] = userAgent; + } + // Get attributes from the hook if present + const hookAttributes = (0, instrumentation_1.safeExecuteInTheMiddle)(() => { var _a; return (_a = config.startSpanHook) === null || _a === void 0 ? void 0 : _a.call(config, request); }, e => e && this._diag.error('caught startSpanHook error: ', e), true); + if (hookAttributes) { + Object.entries(hookAttributes).forEach(([key, val]) => { + attributes[key] = val; + }); + } + // Check if parent span is required via config and: + // - if a parent is required but not present, we use a `NoopSpan` to still + // propagate context without recording it. + // - create a span otherwise + const activeCtx = api_1.context.active(); + const currentSpan = api_1.trace.getSpan(activeCtx); + let span; + if (config.requireParentforSpans && + (!currentSpan || !api_1.trace.isSpanContextValid(currentSpan.spanContext()))) { + span = api_1.trace.wrapSpanContext(api_1.INVALID_SPAN_CONTEXT); + } + else { + span = this.tracer.startSpan(requestMethod === '_OTHER' ? 'HTTP' : requestMethod, { + kind: api_1.SpanKind.CLIENT, + attributes: attributes, + }, activeCtx); + } + // Execute the request hook if defined + (0, instrumentation_1.safeExecuteInTheMiddle)(() => { var _a; return (_a = config.requestHook) === null || _a === void 0 ? void 0 : _a.call(config, span, request); }, e => e && this._diag.error('caught requestHook error: ', e), true); + // Context propagation goes last so no hook can tamper + // the propagation headers + const requestContext = api_1.trace.setSpan(api_1.context.active(), span); + const addedHeaders = {}; + api_1.propagation.inject(requestContext, addedHeaders); + const headerEntries = Object.entries(addedHeaders); + for (let i = 0; i < headerEntries.length; i++) { + const [k, v] = headerEntries[i]; + if (typeof request.addHeader === 'function') { + request.addHeader(k, v); + } + else if (typeof request.headers === 'string') { + request.headers += `${k}: ${v}\r\n`; + } + else if (Array.isArray(request.headers)) { + // undici@6.11.0 accidentally, briefly removed `request.addHeader()`. + request.headers.push(k, v); + } + } + this._recordFromReq.set(request, { span, attributes, startTime }); + } + // This is the 2nd message we receive for each request. It is fired when connection with + // the remote is established and about to send the first byte. Here we do have info about the + // remote address and port so we can populate some `network.*` attributes into the span + onRequestHeaders({ request, socket }) { + var _a; + const record = this._recordFromReq.get(request); + if (!record) { + return; + } + const config = this.getConfig(); + const { span } = record; + const { remoteAddress, remotePort } = socket; + const spanAttributes = { + [SemanticAttributes_1.SemanticAttributes.NETWORK_PEER_ADDRESS]: remoteAddress, + [SemanticAttributes_1.SemanticAttributes.NETWORK_PEER_PORT]: remotePort, + }; + // After hooks have been processed (which may modify request headers) + // we can collect the headers based on the configuration + if ((_a = config.headersToSpanAttributes) === null || _a === void 0 ? void 0 : _a.requestHeaders) { + const headersToAttribs = new Set(config.headersToSpanAttributes.requestHeaders.map(n => n.toLowerCase())); + // headers could be in form + // ['name: value', ...] for v5 + // ['name', 'value', ...] for v6 + const rawHeaders = Array.isArray(request.headers) + ? request.headers + : request.headers.split('\r\n'); + rawHeaders.forEach((h, idx) => { + const sepIndex = h.indexOf(':'); + const hasSeparator = sepIndex !== -1; + const name = (hasSeparator ? h.substring(0, sepIndex) : h).toLowerCase(); + const value = hasSeparator + ? h.substring(sepIndex + 1) + : rawHeaders[idx + 1]; + if (headersToAttribs.has(name)) { + spanAttributes[`http.request.header.${name}`] = value.trim(); + } + }); + } + span.setAttributes(spanAttributes); + } + // This is the 3rd message we get for each request and it's fired when the server + // headers are received, body may not be accessible yet. + // From the response headers we can set the status and content length + onResponseHeaders({ request, response, }) { + var _a, _b; + const record = this._recordFromReq.get(request); + if (!record) { + return; + } + const { span, attributes } = record; + const spanAttributes = { + [SemanticAttributes_1.SemanticAttributes.HTTP_RESPONSE_STATUS_CODE]: response.statusCode, + }; + const config = this.getConfig(); + // Execute the response hook if defined + (0, instrumentation_1.safeExecuteInTheMiddle)(() => { var _a; return (_a = config.responseHook) === null || _a === void 0 ? void 0 : _a.call(config, span, { request, response }); }, e => e && this._diag.error('caught responseHook error: ', e), true); + const headersToAttribs = new Set(); + if ((_a = config.headersToSpanAttributes) === null || _a === void 0 ? void 0 : _a.responseHeaders) { + (_b = config.headersToSpanAttributes) === null || _b === void 0 ? void 0 : _b.responseHeaders.forEach(name => headersToAttribs.add(name.toLowerCase())); + } + for (let idx = 0; idx < response.headers.length; idx = idx + 2) { + const name = response.headers[idx].toString().toLowerCase(); + const value = response.headers[idx + 1]; + if (headersToAttribs.has(name)) { + spanAttributes[`http.response.header.${name}`] = value.toString(); + } + if (name === 'content-length') { + const contentLength = Number(value.toString()); + if (!isNaN(contentLength)) { + spanAttributes['http.response.header.content-length'] = contentLength; + } + } + } + span.setAttributes(spanAttributes); + span.setStatus({ + code: response.statusCode >= 400 + ? api_1.SpanStatusCode.ERROR + : api_1.SpanStatusCode.UNSET, + }); + record.attributes = Object.assign(attributes, spanAttributes); + } + // This is the last event we receive if the request went without any errors + onDone({ request }) { + const record = this._recordFromReq.get(request); + if (!record) { + return; + } + const { span, attributes, startTime } = record; + // End the span + span.end(); + this._recordFromReq.delete(request); + // Record metrics + this.recordRequestDuration(attributes, startTime); + } + // This is the event we get when something is wrong in the request like + // - invalid options when calling `fetch` global API or any undici method for request + // - connectivity errors such as unreachable host + // - requests aborted through an `AbortController.signal` + // NOTE: server errors are considered valid responses and it's the lib consumer + // who should deal with that. + onError({ request, error }) { + const record = this._recordFromReq.get(request); + if (!record) { + return; + } + const { span, attributes, startTime } = record; + // NOTE: in `undici@6.3.0` when request aborted the error type changes from + // a custom error (`RequestAbortedError`) to a built-in `DOMException` carrying + // some differences: + // - `code` is from DOMEXception (ABORT_ERR: 20) + // - `message` changes + // - stacktrace is smaller and contains node internal frames + span.recordException(error); + span.setStatus({ + code: api_1.SpanStatusCode.ERROR, + message: error.message, + }); + span.end(); + this._recordFromReq.delete(request); + // Record metrics (with the error) + attributes[SemanticAttributes_1.SemanticAttributes.ERROR_TYPE] = error.message; + this.recordRequestDuration(attributes, startTime); + } + recordRequestDuration(attributes, startTime) { + // Time to record metrics + const metricsAttributes = {}; + // Get the attribs already in span attributes + const keysToCopy = [ + SemanticAttributes_1.SemanticAttributes.HTTP_RESPONSE_STATUS_CODE, + SemanticAttributes_1.SemanticAttributes.HTTP_REQUEST_METHOD, + SemanticAttributes_1.SemanticAttributes.SERVER_ADDRESS, + SemanticAttributes_1.SemanticAttributes.SERVER_PORT, + SemanticAttributes_1.SemanticAttributes.URL_SCHEME, + SemanticAttributes_1.SemanticAttributes.ERROR_TYPE, + ]; + keysToCopy.forEach(key => { + if (key in attributes) { + metricsAttributes[key] = attributes[key]; + } + }); + // Take the duration and record it + const durationSeconds = (0, core_1.hrTimeToMilliseconds)((0, core_1.hrTimeDuration)(startTime, (0, core_1.hrTime)())) / 1000; + this._httpClientDurationHistogram.record(durationSeconds, metricsAttributes); + } + getRequestMethod(original) { + const knownMethods = { + CONNECT: true, + OPTIONS: true, + HEAD: true, + GET: true, + POST: true, + PUT: true, + PATCH: true, + DELETE: true, + TRACE: true, + }; + if (original.toUpperCase() in knownMethods) { + return original.toUpperCase(); + } + return '_OTHER'; + } +} +exports.UndiciInstrumentation = UndiciInstrumentation; +//# sourceMappingURL=undici.js.map + +/***/ }), + +/***/ 85978: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.PACKAGE_VERSION = '0.10.0'; +exports.PACKAGE_NAME = '@opentelemetry/instrumentation-undici'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 7507: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.registerInstrumentations = void 0; +const api_1 = __nccwpck_require__(65163); +const api_logs_1 = __nccwpck_require__(32832); +const autoLoaderUtils_1 = __nccwpck_require__(16307); +/** + * It will register instrumentations and plugins + * @param options + * @return returns function to unload instrumentation and plugins that were + * registered + */ +function registerInstrumentations(options) { + var _a, _b; + const tracerProvider = options.tracerProvider || api_1.trace.getTracerProvider(); + const meterProvider = options.meterProvider || api_1.metrics.getMeterProvider(); + const loggerProvider = options.loggerProvider || api_logs_1.logs.getLoggerProvider(); + const instrumentations = (_b = (_a = options.instrumentations) === null || _a === void 0 ? void 0 : _a.flat()) !== null && _b !== void 0 ? _b : []; + (0, autoLoaderUtils_1.enableInstrumentations)(instrumentations, tracerProvider, meterProvider, loggerProvider); + return () => { + (0, autoLoaderUtils_1.disableInstrumentations)(instrumentations); + }; +} +exports.registerInstrumentations = registerInstrumentations; +//# sourceMappingURL=autoLoader.js.map + +/***/ }), + +/***/ 16307: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.disableInstrumentations = exports.enableInstrumentations = void 0; +/** + * Enable instrumentations + * @param instrumentations + * @param tracerProvider + * @param meterProvider + */ +function enableInstrumentations(instrumentations, tracerProvider, meterProvider, loggerProvider) { + for (let i = 0, j = instrumentations.length; i < j; i++) { + const instrumentation = instrumentations[i]; + if (tracerProvider) { + instrumentation.setTracerProvider(tracerProvider); + } + if (meterProvider) { + instrumentation.setMeterProvider(meterProvider); + } + if (loggerProvider && instrumentation.setLoggerProvider) { + instrumentation.setLoggerProvider(loggerProvider); + } + // instrumentations have been already enabled during creation + // so enable only if user prevented that by setting enabled to false + // this is to prevent double enabling but when calling register all + // instrumentations should be now enabled + if (!instrumentation.getConfig().enabled) { + instrumentation.enable(); + } + } +} +exports.enableInstrumentations = enableInstrumentations; +/** + * Disable instrumentations + * @param instrumentations + */ +function disableInstrumentations(instrumentations) { + instrumentations.forEach(instrumentation => instrumentation.disable()); +} +exports.disableInstrumentations = disableInstrumentations; +//# sourceMappingURL=autoLoaderUtils.js.map + +/***/ }), + +/***/ 65584: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.safeExecuteInTheMiddleAsync = exports.safeExecuteInTheMiddle = exports.isWrapped = exports.InstrumentationNodeModuleFile = exports.InstrumentationNodeModuleDefinition = exports.InstrumentationBase = exports.registerInstrumentations = void 0; +var autoLoader_1 = __nccwpck_require__(7507); +Object.defineProperty(exports, "registerInstrumentations", ({ enumerable: true, get: function () { return autoLoader_1.registerInstrumentations; } })); +var index_1 = __nccwpck_require__(20997); +Object.defineProperty(exports, "InstrumentationBase", ({ enumerable: true, get: function () { return index_1.InstrumentationBase; } })); +var instrumentationNodeModuleDefinition_1 = __nccwpck_require__(1317); +Object.defineProperty(exports, "InstrumentationNodeModuleDefinition", ({ enumerable: true, get: function () { return instrumentationNodeModuleDefinition_1.InstrumentationNodeModuleDefinition; } })); +var instrumentationNodeModuleFile_1 = __nccwpck_require__(16633); +Object.defineProperty(exports, "InstrumentationNodeModuleFile", ({ enumerable: true, get: function () { return instrumentationNodeModuleFile_1.InstrumentationNodeModuleFile; } })); +var utils_1 = __nccwpck_require__(93806); +Object.defineProperty(exports, "isWrapped", ({ enumerable: true, get: function () { return utils_1.isWrapped; } })); +Object.defineProperty(exports, "safeExecuteInTheMiddle", ({ enumerable: true, get: function () { return utils_1.safeExecuteInTheMiddle; } })); +Object.defineProperty(exports, "safeExecuteInTheMiddleAsync", ({ enumerable: true, get: function () { return utils_1.safeExecuteInTheMiddleAsync; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 9216: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.InstrumentationAbstract = void 0; +const api_1 = __nccwpck_require__(65163); +const api_logs_1 = __nccwpck_require__(32832); +const shimmer = __nccwpck_require__(16672); +/** + * Base abstract internal class for instrumenting node and web plugins + */ +class InstrumentationAbstract { + constructor(instrumentationName, instrumentationVersion, config) { + this.instrumentationName = instrumentationName; + this.instrumentationVersion = instrumentationVersion; + this._config = {}; + /* Api to wrap instrumented method */ + this._wrap = shimmer.wrap; + /* Api to unwrap instrumented methods */ + this._unwrap = shimmer.unwrap; + /* Api to mass wrap instrumented method */ + this._massWrap = shimmer.massWrap; + /* Api to mass unwrap instrumented methods */ + this._massUnwrap = shimmer.massUnwrap; + this.setConfig(config); + this._diag = api_1.diag.createComponentLogger({ + namespace: instrumentationName, + }); + this._tracer = api_1.trace.getTracer(instrumentationName, instrumentationVersion); + this._meter = api_1.metrics.getMeter(instrumentationName, instrumentationVersion); + this._logger = api_logs_1.logs.getLogger(instrumentationName, instrumentationVersion); + this._updateMetricInstruments(); + } + /* Returns meter */ + get meter() { + return this._meter; + } + /** + * Sets MeterProvider to this plugin + * @param meterProvider + */ + setMeterProvider(meterProvider) { + this._meter = meterProvider.getMeter(this.instrumentationName, this.instrumentationVersion); + this._updateMetricInstruments(); + } + /* Returns logger */ + get logger() { + return this._logger; + } + /** + * Sets LoggerProvider to this plugin + * @param loggerProvider + */ + setLoggerProvider(loggerProvider) { + this._logger = loggerProvider.getLogger(this.instrumentationName, this.instrumentationVersion); + } + /** + * @experimental + * + * Get module definitions defined by {@link init}. + * This can be used for experimental compile-time instrumentation. + * + * @returns an array of {@link InstrumentationModuleDefinition} + */ + getModuleDefinitions() { + var _a; + const initResult = (_a = this.init()) !== null && _a !== void 0 ? _a : []; + if (!Array.isArray(initResult)) { + return [initResult]; + } + return initResult; + } + /** + * Sets the new metric instruments with the current Meter. + */ + _updateMetricInstruments() { + return; + } + /* Returns InstrumentationConfig */ + getConfig() { + return this._config; + } + /** + * Sets InstrumentationConfig to this plugin + * @param config + */ + setConfig(config) { + // copy config first level properties to ensure they are immutable. + // nested properties are not copied, thus are mutable from the outside. + this._config = Object.assign({ enabled: true }, config); + } + /** + * Sets TraceProvider to this plugin + * @param tracerProvider + */ + setTracerProvider(tracerProvider) { + this._tracer = tracerProvider.getTracer(this.instrumentationName, this.instrumentationVersion); + } + /* Returns tracer */ + get tracer() { + return this._tracer; + } + /** + * Execute span customization hook, if configured, and log any errors. + * Any semantics of the trigger and info are defined by the specific instrumentation. + * @param hookHandler The optional hook handler which the user has configured via instrumentation config + * @param triggerName The name of the trigger for executing the hook for logging purposes + * @param span The span to which the hook should be applied + * @param info The info object to be passed to the hook, with useful data the hook may use + */ + _runSpanCustomizationHook(hookHandler, triggerName, span, info) { + if (!hookHandler) { + return; + } + try { + hookHandler(span, info); + } + catch (e) { + this._diag.error(`Error running span customization hook due to exception in handler`, { triggerName }, e); + } + } +} +exports.InstrumentationAbstract = InstrumentationAbstract; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 1317: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.InstrumentationNodeModuleDefinition = void 0; +class InstrumentationNodeModuleDefinition { + constructor(name, supportedVersions, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + patch, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + unpatch, files) { + this.name = name; + this.supportedVersions = supportedVersions; + this.patch = patch; + this.unpatch = unpatch; + this.files = files || []; + } +} +exports.InstrumentationNodeModuleDefinition = InstrumentationNodeModuleDefinition; +//# sourceMappingURL=instrumentationNodeModuleDefinition.js.map + +/***/ }), + +/***/ 16633: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.InstrumentationNodeModuleFile = void 0; +const index_1 = __nccwpck_require__(20997); +class InstrumentationNodeModuleFile { + constructor(name, supportedVersions, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + patch, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + unpatch) { + this.supportedVersions = supportedVersions; + this.patch = patch; + this.unpatch = unpatch; + this.name = (0, index_1.normalize)(name); + } +} +exports.InstrumentationNodeModuleFile = InstrumentationNodeModuleFile; +//# sourceMappingURL=instrumentationNodeModuleFile.js.map + +/***/ }), + +/***/ 20997: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.normalize = exports.InstrumentationBase = void 0; +var node_1 = __nccwpck_require__(9674); +Object.defineProperty(exports, "InstrumentationBase", ({ enumerable: true, get: function () { return node_1.InstrumentationBase; } })); +Object.defineProperty(exports, "normalize", ({ enumerable: true, get: function () { return node_1.normalize; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 52986: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ModuleNameTrie = exports.ModuleNameSeparator = void 0; +exports.ModuleNameSeparator = '/'; +/** + * Node in a `ModuleNameTrie` + */ +class ModuleNameTrieNode { + constructor() { + this.hooks = []; + this.children = new Map(); + } +} +/** + * Trie containing nodes that represent a part of a module name (i.e. the parts separated by forward slash) + */ +class ModuleNameTrie { + constructor() { + this._trie = new ModuleNameTrieNode(); + this._counter = 0; + } + /** + * Insert a module hook into the trie + * + * @param {Hooked} hook Hook + */ + insert(hook) { + let trieNode = this._trie; + for (const moduleNamePart of hook.moduleName.split(exports.ModuleNameSeparator)) { + let nextNode = trieNode.children.get(moduleNamePart); + if (!nextNode) { + nextNode = new ModuleNameTrieNode(); + trieNode.children.set(moduleNamePart, nextNode); + } + trieNode = nextNode; + } + trieNode.hooks.push({ hook, insertedId: this._counter++ }); + } + /** + * Search for matching hooks in the trie + * + * @param {string} moduleName Module name + * @param {boolean} maintainInsertionOrder Whether to return the results in insertion order + * @param {boolean} fullOnly Whether to return only full matches + * @returns {Hooked[]} Matching hooks + */ + search(moduleName, { maintainInsertionOrder, fullOnly } = {}) { + let trieNode = this._trie; + const results = []; + let foundFull = true; + for (const moduleNamePart of moduleName.split(exports.ModuleNameSeparator)) { + const nextNode = trieNode.children.get(moduleNamePart); + if (!nextNode) { + foundFull = false; + break; + } + if (!fullOnly) { + results.push(...nextNode.hooks); + } + trieNode = nextNode; + } + if (fullOnly && foundFull) { + results.push(...trieNode.hooks); + } + if (results.length === 0) { + return []; + } + if (results.length === 1) { + return [results[0].hook]; + } + if (maintainInsertionOrder) { + results.sort((a, b) => a.insertedId - b.insertedId); + } + return results.map(({ hook }) => hook); + } +} +exports.ModuleNameTrie = ModuleNameTrie; +//# sourceMappingURL=ModuleNameTrie.js.map + +/***/ }), + +/***/ 77404: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RequireInTheMiddleSingleton = void 0; +const require_in_the_middle_1 = __nccwpck_require__(62009); +const path = __nccwpck_require__(71017); +const ModuleNameTrie_1 = __nccwpck_require__(52986); +/** + * Whether Mocha is running in this process + * Inspired by https://github.com/AndreasPizsa/detect-mocha + * + * @type {boolean} + */ +const isMocha = [ + 'afterEach', + 'after', + 'beforeEach', + 'before', + 'describe', + 'it', +].every(fn => { + // @ts-expect-error TS7053: Element implicitly has an 'any' type + return typeof global[fn] === 'function'; +}); +/** + * Singleton class for `require-in-the-middle` + * Allows instrumentation plugins to patch modules with only a single `require` patch + * WARNING: Because this class will create its own `require-in-the-middle` (RITM) instance, + * we should minimize the number of new instances of this class. + * Multiple instances of `@opentelemetry/instrumentation` (e.g. multiple versions) in a single process + * will result in multiple instances of RITM, which will have an impact + * on the performance of instrumentation hooks being applied. + */ +class RequireInTheMiddleSingleton { + constructor() { + this._moduleNameTrie = new ModuleNameTrie_1.ModuleNameTrie(); + this._initialize(); + } + _initialize() { + new require_in_the_middle_1.Hook( + // Intercept all `require` calls; we will filter the matching ones below + null, { internals: true }, (exports, name, basedir) => { + // For internal files on Windows, `name` will use backslash as the path separator + const normalizedModuleName = normalizePathSeparators(name); + const matches = this._moduleNameTrie.search(normalizedModuleName, { + maintainInsertionOrder: true, + // For core modules (e.g. `fs`), do not match on sub-paths (e.g. `fs/promises'). + // This matches the behavior of `require-in-the-middle`. + // `basedir` is always `undefined` for core modules. + fullOnly: basedir === undefined, + }); + for (const { onRequire } of matches) { + exports = onRequire(exports, name, basedir); + } + return exports; + }); + } + /** + * Register a hook with `require-in-the-middle` + * + * @param {string} moduleName Module name + * @param {OnRequireFn} onRequire Hook function + * @returns {Hooked} Registered hook + */ + register(moduleName, onRequire) { + const hooked = { moduleName, onRequire }; + this._moduleNameTrie.insert(hooked); + return hooked; + } + /** + * Get the `RequireInTheMiddleSingleton` singleton + * + * @returns {RequireInTheMiddleSingleton} Singleton of `RequireInTheMiddleSingleton` + */ + static getInstance() { + var _a; + // Mocha runs all test suites in the same process + // This prevents test suites from sharing a singleton + if (isMocha) + return new RequireInTheMiddleSingleton(); + return (this._instance = + (_a = this._instance) !== null && _a !== void 0 ? _a : new RequireInTheMiddleSingleton()); + } +} +exports.RequireInTheMiddleSingleton = RequireInTheMiddleSingleton; +/** + * Normalize the path separators to forward slash in a module name or path + * + * @param {string} moduleNameOrPath Module name or path + * @returns {string} Normalized module name or path + */ +function normalizePathSeparators(moduleNameOrPath) { + return path.sep !== ModuleNameTrie_1.ModuleNameSeparator + ? moduleNameOrPath.split(path.sep).join(ModuleNameTrie_1.ModuleNameSeparator) + : moduleNameOrPath; +} +//# sourceMappingURL=RequireInTheMiddleSingleton.js.map + +/***/ }), + +/***/ 9674: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.normalize = exports.InstrumentationBase = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var instrumentation_1 = __nccwpck_require__(93608); +Object.defineProperty(exports, "InstrumentationBase", ({ enumerable: true, get: function () { return instrumentation_1.InstrumentationBase; } })); +var normalize_1 = __nccwpck_require__(8974); +Object.defineProperty(exports, "normalize", ({ enumerable: true, get: function () { return normalize_1.normalize; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 93608: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.InstrumentationBase = void 0; +const path = __nccwpck_require__(71017); +const util_1 = __nccwpck_require__(73837); +const semver_1 = __nccwpck_require__(63547); +const shimmer_1 = __nccwpck_require__(16672); +const instrumentation_1 = __nccwpck_require__(9216); +const RequireInTheMiddleSingleton_1 = __nccwpck_require__(77404); +const import_in_the_middle_1 = __nccwpck_require__(36151); +const api_1 = __nccwpck_require__(65163); +const require_in_the_middle_1 = __nccwpck_require__(62009); +const fs_1 = __nccwpck_require__(57147); +const utils_1 = __nccwpck_require__(93806); +/** + * Base abstract class for instrumenting node plugins + */ +class InstrumentationBase extends instrumentation_1.InstrumentationAbstract { + constructor(instrumentationName, instrumentationVersion, config) { + super(instrumentationName, instrumentationVersion, config); + this._hooks = []; + this._requireInTheMiddleSingleton = RequireInTheMiddleSingleton_1.RequireInTheMiddleSingleton.getInstance(); + this._enabled = false; + this._wrap = (moduleExports, name, wrapper) => { + if ((0, utils_1.isWrapped)(moduleExports[name])) { + this._unwrap(moduleExports, name); + } + if (!util_1.types.isProxy(moduleExports)) { + return (0, shimmer_1.wrap)(moduleExports, name, wrapper); + } + else { + const wrapped = (0, shimmer_1.wrap)(Object.assign({}, moduleExports), name, wrapper); + Object.defineProperty(moduleExports, name, { + value: wrapped, + }); + return wrapped; + } + }; + this._unwrap = (moduleExports, name) => { + if (!util_1.types.isProxy(moduleExports)) { + return (0, shimmer_1.unwrap)(moduleExports, name); + } + else { + return Object.defineProperty(moduleExports, name, { + value: moduleExports[name], + }); + } + }; + this._massWrap = (moduleExportsArray, names, wrapper) => { + if (!moduleExportsArray) { + api_1.diag.error('must provide one or more modules to patch'); + return; + } + else if (!Array.isArray(moduleExportsArray)) { + moduleExportsArray = [moduleExportsArray]; + } + if (!(names && Array.isArray(names))) { + api_1.diag.error('must provide one or more functions to wrap on modules'); + return; + } + moduleExportsArray.forEach(moduleExports => { + names.forEach(name => { + this._wrap(moduleExports, name, wrapper); + }); + }); + }; + this._massUnwrap = (moduleExportsArray, names) => { + if (!moduleExportsArray) { + api_1.diag.error('must provide one or more modules to patch'); + return; + } + else if (!Array.isArray(moduleExportsArray)) { + moduleExportsArray = [moduleExportsArray]; + } + if (!(names && Array.isArray(names))) { + api_1.diag.error('must provide one or more functions to wrap on modules'); + return; + } + moduleExportsArray.forEach(moduleExports => { + names.forEach(name => { + this._unwrap(moduleExports, name); + }); + }); + }; + let modules = this.init(); + if (modules && !Array.isArray(modules)) { + modules = [modules]; + } + this._modules = modules || []; + if (this._config.enabled) { + this.enable(); + } + } + _warnOnPreloadedModules() { + this._modules.forEach((module) => { + const { name } = module; + try { + const resolvedModule = require.resolve(name); + if (require.cache[resolvedModule]) { + // Module is already cached, which means the instrumentation hook might not work + this._diag.warn(`Module ${name} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${name}`); + } + } + catch (_a) { + // Module isn't available, we can simply skip + } + }); + } + _extractPackageVersion(baseDir) { + try { + const json = (0, fs_1.readFileSync)(path.join(baseDir, 'package.json'), { + encoding: 'utf8', + }); + const version = JSON.parse(json).version; + return typeof version === 'string' ? version : undefined; + } + catch (error) { + api_1.diag.warn('Failed extracting version', baseDir); + } + return undefined; + } + _onRequire(module, exports, name, baseDir) { + var _a; + if (!baseDir) { + if (typeof module.patch === 'function') { + module.moduleExports = exports; + if (this._enabled) { + this._diag.debug('Applying instrumentation patch for nodejs core module on require hook', { + module: module.name, + }); + return module.patch(exports); + } + } + return exports; + } + const version = this._extractPackageVersion(baseDir); + module.moduleVersion = version; + if (module.name === name) { + // main module + if (isSupported(module.supportedVersions, version, module.includePrerelease)) { + if (typeof module.patch === 'function') { + module.moduleExports = exports; + if (this._enabled) { + this._diag.debug('Applying instrumentation patch for module on require hook', { + module: module.name, + version: module.moduleVersion, + baseDir, + }); + return module.patch(exports, module.moduleVersion); + } + } + } + return exports; + } + // internal file + const files = (_a = module.files) !== null && _a !== void 0 ? _a : []; + const normalizedName = path.normalize(name); + const supportedFileInstrumentations = files + .filter(f => f.name === normalizedName) + .filter(f => isSupported(f.supportedVersions, version, module.includePrerelease)); + return supportedFileInstrumentations.reduce((patchedExports, file) => { + file.moduleExports = patchedExports; + if (this._enabled) { + this._diag.debug('Applying instrumentation patch for nodejs module file on require hook', { + module: module.name, + version: module.moduleVersion, + fileName: file.name, + baseDir, + }); + // patch signature is not typed, so we cast it assuming it's correct + return file.patch(patchedExports, module.moduleVersion); + } + return patchedExports; + }, exports); + } + enable() { + if (this._enabled) { + return; + } + this._enabled = true; + // already hooked, just call patch again + if (this._hooks.length > 0) { + for (const module of this._modules) { + if (typeof module.patch === 'function' && module.moduleExports) { + this._diag.debug('Applying instrumentation patch for nodejs module on instrumentation enabled', { + module: module.name, + version: module.moduleVersion, + }); + module.patch(module.moduleExports, module.moduleVersion); + } + for (const file of module.files) { + if (file.moduleExports) { + this._diag.debug('Applying instrumentation patch for nodejs module file on instrumentation enabled', { + module: module.name, + version: module.moduleVersion, + fileName: file.name, + }); + file.patch(file.moduleExports, module.moduleVersion); + } + } + } + return; + } + this._warnOnPreloadedModules(); + for (const module of this._modules) { + const hookFn = (exports, name, baseDir) => { + if (!baseDir && path.isAbsolute(name)) { + const parsedPath = path.parse(name); + name = parsedPath.name; + baseDir = parsedPath.dir; + } + return this._onRequire(module, exports, name, baseDir); + }; + const onRequire = (exports, name, baseDir) => { + return this._onRequire(module, exports, name, baseDir); + }; + // `RequireInTheMiddleSingleton` does not support absolute paths. + // For an absolute paths, we must create a separate instance of the + // require-in-the-middle `Hook`. + const hook = path.isAbsolute(module.name) + ? new require_in_the_middle_1.Hook([module.name], { internals: true }, onRequire) + : this._requireInTheMiddleSingleton.register(module.name, onRequire); + this._hooks.push(hook); + const esmHook = new import_in_the_middle_1.Hook([module.name], { internals: false }, hookFn); + this._hooks.push(esmHook); + } + } + disable() { + if (!this._enabled) { + return; + } + this._enabled = false; + for (const module of this._modules) { + if (typeof module.unpatch === 'function' && module.moduleExports) { + this._diag.debug('Removing instrumentation patch for nodejs module on instrumentation disabled', { + module: module.name, + version: module.moduleVersion, + }); + module.unpatch(module.moduleExports, module.moduleVersion); + } + for (const file of module.files) { + if (file.moduleExports) { + this._diag.debug('Removing instrumentation patch for nodejs module file on instrumentation disabled', { + module: module.name, + version: module.moduleVersion, + fileName: file.name, + }); + file.unpatch(file.moduleExports, module.moduleVersion); + } + } + } + } + isEnabled() { + return this._enabled; + } +} +exports.InstrumentationBase = InstrumentationBase; +function isSupported(supportedVersions, version, includePrerelease) { + if (typeof version === 'undefined') { + // If we don't have the version, accept the wildcard case only + return supportedVersions.includes('*'); + } + return supportedVersions.some(supportedVersion => { + return (0, semver_1.satisfies)(version, supportedVersion, { includePrerelease }); + }); +} +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 8974: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.normalize = void 0; +var path_1 = __nccwpck_require__(71017); +Object.defineProperty(exports, "normalize", ({ enumerable: true, get: function () { return path_1.normalize; } })); +//# sourceMappingURL=normalize.js.map + +/***/ }), + +/***/ 93806: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isWrapped = exports.safeExecuteInTheMiddleAsync = exports.safeExecuteInTheMiddle = void 0; +/** + * function to execute patched function and being able to catch errors + * @param execute - function to be executed + * @param onFinish - callback to run when execute finishes + */ +function safeExecuteInTheMiddle(execute, onFinish, preventThrowingError) { + let error; + let result; + try { + result = execute(); + } + catch (e) { + error = e; + } + finally { + onFinish(error, result); + if (error && !preventThrowingError) { + // eslint-disable-next-line no-unsafe-finally + throw error; + } + // eslint-disable-next-line no-unsafe-finally + return result; + } +} +exports.safeExecuteInTheMiddle = safeExecuteInTheMiddle; +/** + * Async function to execute patched function and being able to catch errors + * @param execute - function to be executed + * @param onFinish - callback to run when execute finishes + */ +async function safeExecuteInTheMiddleAsync(execute, onFinish, preventThrowingError) { + let error; + let result; + try { + result = await execute(); + } + catch (e) { + error = e; + } + finally { + onFinish(error, result); + if (error && !preventThrowingError) { + // eslint-disable-next-line no-unsafe-finally + throw error; + } + // eslint-disable-next-line no-unsafe-finally + return result; + } +} +exports.safeExecuteInTheMiddleAsync = safeExecuteInTheMiddleAsync; +/** + * Checks if certain function has been already wrapped + * @param func + */ +function isWrapped(func) { + return (typeof func === 'function' && + typeof func.__original === 'function' && + typeof func.__unwrap === 'function' && + func.__wrapped === true); +} +exports.isWrapped = isWrapped; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 62433: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const ANY = Symbol('SemVer ANY') +// hoisted class for cyclic dependency +class Comparator { + static get ANY () { + return ANY + } + + constructor (comp, options) { + options = parseOptions(options) + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } + + comp = comp.trim().split(/\s+/).join(' ') + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) + + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } + + debug('comp', this) + } + + parse (comp) { + const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + const m = comp.match(r) + + if (!m) { + throw new TypeError(`Invalid comparator: ${comp}`) + } + + this.operator = m[1] !== undefined ? m[1] : '' + if (this.operator === '=') { + this.operator = '' + } + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } + } + + toString () { + return this.value + } + + test (version) { + debug('Comparator.test', version, this.options.loose) + + if (this.semver === ANY || version === ANY) { + return true + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + return cmp(version, this.operator, this.semver, this.options) + } + + intersects (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (this.operator === '') { + if (this.value === '') { + return true + } + return new Range(comp.value, options).test(this.value) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + return new Range(this.value, options).test(comp.semver) + } + + options = parseOptions(options) + + // Special cases where nothing can possibly be lower + if (options.includePrerelease && + (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) { + return false + } + if (!options.includePrerelease && + (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) { + return false + } + + // Same direction increasing (> or >=) + if (this.operator.startsWith('>') && comp.operator.startsWith('>')) { + return true + } + // Same direction decreasing (< or <=) + if (this.operator.startsWith('<') && comp.operator.startsWith('<')) { + return true + } + // same SemVer and both sides are inclusive (<= or >=) + if ( + (this.semver.version === comp.semver.version) && + this.operator.includes('=') && comp.operator.includes('=')) { + return true + } + // opposite directions less than + if (cmp(this.semver, '<', comp.semver, options) && + this.operator.startsWith('>') && comp.operator.startsWith('<')) { + return true + } + // opposite directions greater than + if (cmp(this.semver, '>', comp.semver, options) && + this.operator.startsWith('<') && comp.operator.startsWith('>')) { + return true + } + return false + } +} + +module.exports = Comparator + +const parseOptions = __nccwpck_require__(1893) +const { safeRe: re, t } = __nccwpck_require__(1681) +const cmp = __nccwpck_require__(41219) +const debug = __nccwpck_require__(27480) +const SemVer = __nccwpck_require__(16458) +const Range = __nccwpck_require__(62614) + + +/***/ }), + +/***/ 62614: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SPACE_CHARACTERS = /\s+/g + +// hoisted class for cyclic dependency +class Range { + constructor (range, options) { + options = parseOptions(options) + + if (range instanceof Range) { + if ( + range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease + ) { + return range + } else { + return new Range(range.raw, options) + } + } + + if (range instanceof Comparator) { + // just put it in the set and return + this.raw = range.value + this.set = [[range]] + this.formatted = undefined + return this + } + + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease + + // First reduce all whitespace as much as possible so we do not have to rely + // on potentially slow regexes like \s*. This is then stored and used for + // future error messages as well. + this.raw = range.trim().replace(SPACE_CHARACTERS, ' ') + + // First, split on || + this.set = this.raw + .split('||') + // map the range to a 2d array of comparators + .map(r => this.parseRange(r.trim())) + // throw out any comparator lists that are empty + // this generally means that it was not a valid range, which is allowed + // in loose mode, but will still throw if the WHOLE range is invalid. + .filter(c => c.length) + + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${this.raw}`) + } + + // if we have any that are not the null set, throw out null sets. + if (this.set.length > 1) { + // keep the first one, in case they're all null sets + const first = this.set[0] + this.set = this.set.filter(c => !isNullSet(c[0])) + if (this.set.length === 0) { + this.set = [first] + } else if (this.set.length > 1) { + // if we have any that are *, then the range is just * + for (const c of this.set) { + if (c.length === 1 && isAny(c[0])) { + this.set = [c] + break + } + } + } + } + + this.formatted = undefined + } + + get range () { + if (this.formatted === undefined) { + this.formatted = '' + for (let i = 0; i < this.set.length; i++) { + if (i > 0) { + this.formatted += '||' + } + const comps = this.set[i] + for (let k = 0; k < comps.length; k++) { + if (k > 0) { + this.formatted += ' ' + } + this.formatted += comps[k].toString().trim() + } + } + } + return this.formatted + } + + format () { + return this.range + } + + toString () { + return this.range + } + + parseRange (range) { + // memoize range parsing for performance. + // this is a very hot path, and fully deterministic. + const memoOpts = + (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | + (this.options.loose && FLAG_LOOSE) + const memoKey = memoOpts + ':' + range + const cached = cache.get(memoKey) + if (cached) { + return cached + } + + const loose = this.options.loose + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) + debug('hyphen replace', range) + + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range) + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[t.TILDETRIM], tildeTrimReplace) + debug('tilde trim', range) + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[t.CARETTRIM], caretTrimReplace) + debug('caret trim', range) + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + let rangeList = range + .split(' ') + .map(comp => parseComparator(comp, this.options)) + .join(' ') + .split(/\s+/) + // >=0.0.0 is equivalent to * + .map(comp => replaceGTE0(comp, this.options)) + + if (loose) { + // in loose mode, throw out any that are not valid comparators + rangeList = rangeList.filter(comp => { + debug('loose invalid filter', comp, this.options) + return !!comp.match(re[t.COMPARATORLOOSE]) + }) + } + debug('range list', rangeList) + + // if any comparators are the null set, then replace with JUST null set + // if more than one comparator, remove any * comparators + // also, don't include the same comparator more than once + const rangeMap = new Map() + const comparators = rangeList.map(comp => new Comparator(comp, this.options)) + for (const comp of comparators) { + if (isNullSet(comp)) { + return [comp] + } + rangeMap.set(comp.value, comp) + } + if (rangeMap.size > 1 && rangeMap.has('')) { + rangeMap.delete('') + } + + const result = [...rangeMap.values()] + cache.set(memoKey, result) + return result + } + + intersects (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + + return this.set.some((thisComparators) => { + return ( + isSatisfiable(thisComparators, options) && + range.set.some((rangeComparators) => { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) + } + + // if ANY of the sets match ALL of its comparators, then pass + test (version) { + if (!version) { + return false + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false + } +} + +module.exports = Range + +const LRU = __nccwpck_require__(35617) +const cache = new LRU() + +const parseOptions = __nccwpck_require__(1893) +const Comparator = __nccwpck_require__(62433) +const debug = __nccwpck_require__(27480) +const SemVer = __nccwpck_require__(16458) +const { + safeRe: re, + t, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace, +} = __nccwpck_require__(1681) +const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = __nccwpck_require__(95804) + +const isNullSet = c => c.value === '<0.0.0-0' +const isAny = c => c.value === '' + +// take a set of comparators and determine whether there +// exists a version which can satisfy it +const isSatisfiable = (comparators, options) => { + let result = true + const remainingComparators = comparators.slice() + let testComparator = remainingComparators.pop() + + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options) + }) + + testComparator = remainingComparators.pop() + } + + return result +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +const parseComparator = (comp, options) => { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp +} + +const isX = id => !id || id.toLowerCase() === 'x' || id === '*' + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 +// ~0.0.1 --> >=0.0.1 <0.1.0-0 +const replaceTildes = (comp, options) => { + return comp + .trim() + .split(/\s+/) + .map((c) => replaceTilde(c, options)) + .join(' ') +} + +const replaceTilde = (comp, options) => { + const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] + return comp.replace(r, (_, M, m, p, pr) => { + debug('tilde', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0` + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0-0 + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` + } else if (pr) { + debug('replaceTilde pr', pr) + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } else { + // ~1.2.3 == >=1.2.3 <1.3.0-0 + ret = `>=${M}.${m}.${p + } <${M}.${+m + 1}.0-0` + } + + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 +// ^1.2.3 --> >=1.2.3 <2.0.0-0 +// ^1.2.0 --> >=1.2.0 <2.0.0-0 +// ^0.0.1 --> >=0.0.1 <0.0.2-0 +// ^0.1.0 --> >=0.1.0 <0.2.0-0 +const replaceCarets = (comp, options) => { + return comp + .trim() + .split(/\s+/) + .map((c) => replaceCaret(c, options)) + .join(' ') +} + +const replaceCaret = (comp, options) => { + debug('caret', comp, options) + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] + const z = options.includePrerelease ? '-0' : '' + return comp.replace(r, (_, M, m, p, pr) => { + debug('caret', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` + } else if (isX(p)) { + if (M === '0') { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` + } else { + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${+M + 1}.0.0-0` + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p + }${z} <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p + }${z} <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p + } <${+M + 1}.0.0-0` + } + } + + debug('caret return', ret) + return ret + }) +} + +const replaceXRanges = (comp, options) => { + debug('replaceXRanges', comp, options) + return comp + .split(/\s+/) + .map((c) => replaceXRange(c, options)) + .join(' ') +} + +const replaceXRange = (comp, options) => { + comp = comp.trim() + const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] + return comp.replace(r, (ret, gtlt, M, m, p, pr) => { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + const xM = isX(M) + const xm = xM || isX(m) + const xp = xm || isX(p) + const anyX = xp + + if (gtlt === '=' && anyX) { + gtlt = '' + } + + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } + + if (gtlt === '<') { + pr = '-0' + } + + ret = `${gtlt + M}.${m}.${p}${pr}` + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` + } else if (xp) { + ret = `>=${M}.${m}.0${pr + } <${M}.${+m + 1}.0-0` + } + + debug('xRange return', ret) + + return ret + }) +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +const replaceStars = (comp, options) => { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp + .trim() + .replace(re[t.STAR], '') +} + +const replaceGTE0 = (comp, options) => { + debug('replaceGTE0', comp, options) + return comp + .trim() + .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') +} + +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 +// TODO build? +const hyphenReplace = incPr => ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr) => { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? '-0' : ''}` + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` + } else if (fpr) { + from = `>=${from}` + } else { + from = `>=${from}${incPr ? '-0' : ''}` + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0` + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0` + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}` + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0` + } else { + to = `<=${to}` + } + + return `${from} ${to}`.trim() +} + +const testSet = (set, version, options) => { + for (let i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } + + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (let i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === Comparator.ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + const allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false + } + + return true +} + + +/***/ }), + +/***/ 16458: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const debug = __nccwpck_require__(27480) +const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(95804) +const { safeRe: re, t } = __nccwpck_require__(1681) + +const parseOptions = __nccwpck_require__(1893) +const { compareIdentifiers } = __nccwpck_require__(37852) +class SemVer { + constructor (version, options) { + options = parseOptions(options) + + if (version instanceof SemVer) { + if (version.loose === !!options.loose && + version.includePrerelease === !!options.includePrerelease) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + // this isn't actually relevant for versions, but keep it so that we + // don't run into trouble passing this.options around. + this.includePrerelease = !!options.includePrerelease + + const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) + + if (!m) { + throw new TypeError(`Invalid Version: ${version}`) + } + + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() + } + + format () { + this.version = `${this.major}.${this.minor}.${this.patch}` + if (this.prerelease.length) { + this.version += `-${this.prerelease.join('.')}` + } + return this.version + } + + toString () { + return this.version + } + + compare (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + if (typeof other === 'string' && other === this.version) { + return 0 + } + other = new SemVer(other, this.options) + } + + if (other.version === this.version) { + return 0 + } + + return this.compareMain(other) || this.comparePre(other) + } + + compareMain (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return ( + compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) + ) + } + + comparePre (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + let i = 0 + do { + const a = this.prerelease[i] + const b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + compareBuild (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + let i = 0 + do { + const a = this.build[i] + const b = other.build[i] + debug('build compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc (release, identifier, identifierBase) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier, identifierBase) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier, identifierBase) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier, identifierBase) + this.inc('pre', identifier, identifierBase) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier, identifierBase) + } + this.inc('pre', identifier, identifierBase) + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if ( + this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0 + ) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case 'pre': { + const base = Number(identifierBase) ? 1 : 0 + + if (!identifier && identifierBase === false) { + throw new Error('invalid increment argument: identifier is empty') + } + + if (this.prerelease.length === 0) { + this.prerelease = [base] + } else { + let i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + if (identifier === this.prerelease.join('.') && identifierBase === false) { + throw new Error('invalid increment argument: identifier already exists') + } + this.prerelease.push(base) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + let prerelease = [identifier, base] + if (identifierBase === false) { + prerelease = [identifier] + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease + } + } else { + this.prerelease = prerelease + } + } + break + } + default: + throw new Error(`invalid increment argument: ${release}`) + } + this.raw = this.format() + if (this.build.length) { + this.raw += `+${this.build.join('.')}` + } + return this + } +} + +module.exports = SemVer + + +/***/ }), + +/***/ 68420: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parse = __nccwpck_require__(53155) +const clean = (version, options) => { + const s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} +module.exports = clean + + +/***/ }), + +/***/ 41219: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const eq = __nccwpck_require__(92759) +const neq = __nccwpck_require__(76489) +const gt = __nccwpck_require__(20617) +const gte = __nccwpck_require__(31581) +const lt = __nccwpck_require__(11959) +const lte = __nccwpck_require__(46264) + +const cmp = (a, op, b, loose) => { + switch (op) { + case '===': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a === b + + case '!==': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError(`Invalid operator: ${op}`) + } +} +module.exports = cmp + + +/***/ }), + +/***/ 32766: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(16458) +const parse = __nccwpck_require__(53155) +const { safeRe: re, t } = __nccwpck_require__(1681) + +const coerce = (version, options) => { + if (version instanceof SemVer) { + return version + } + + if (typeof version === 'number') { + version = String(version) + } + + if (typeof version !== 'string') { + return null + } + + options = options || {} + + let match = null + if (!options.rtl) { + match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]) + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL] + let next + while ((next = coerceRtlRegex.exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next + } + coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length + } + // leave it in a clean state + coerceRtlRegex.lastIndex = -1 + } + + if (match === null) { + return null + } + + const major = match[2] + const minor = match[3] || '0' + const patch = match[4] || '0' + const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '' + const build = options.includePrerelease && match[6] ? `+${match[6]}` : '' + + return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options) +} +module.exports = coerce + + +/***/ }), + +/***/ 43327: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(16458) +const compareBuild = (a, b, loose) => { + const versionA = new SemVer(a, loose) + const versionB = new SemVer(b, loose) + return versionA.compare(versionB) || versionA.compareBuild(versionB) +} +module.exports = compareBuild + + +/***/ }), + +/***/ 83723: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(54168) +const compareLoose = (a, b) => compare(a, b, true) +module.exports = compareLoose + + +/***/ }), + +/***/ 54168: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(16458) +const compare = (a, b, loose) => + new SemVer(a, loose).compare(new SemVer(b, loose)) + +module.exports = compare + + +/***/ }), + +/***/ 79623: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parse = __nccwpck_require__(53155) + +const diff = (version1, version2) => { + const v1 = parse(version1, null, true) + const v2 = parse(version2, null, true) + const comparison = v1.compare(v2) + + if (comparison === 0) { + return null + } + + const v1Higher = comparison > 0 + const highVersion = v1Higher ? v1 : v2 + const lowVersion = v1Higher ? v2 : v1 + const highHasPre = !!highVersion.prerelease.length + const lowHasPre = !!lowVersion.prerelease.length + + if (lowHasPre && !highHasPre) { + // Going from prerelease -> no prerelease requires some special casing + + // If the low version has only a major, then it will always be a major + // Some examples: + // 1.0.0-1 -> 1.0.0 + // 1.0.0-1 -> 1.1.1 + // 1.0.0-1 -> 2.0.0 + if (!lowVersion.patch && !lowVersion.minor) { + return 'major' + } + + // Otherwise it can be determined by checking the high version + + if (highVersion.patch) { + // anything higher than a patch bump would result in the wrong version + return 'patch' + } + + if (highVersion.minor) { + // anything higher than a minor bump would result in the wrong version + return 'minor' + } + + // bumping major/minor/patch all have same result + return 'major' + } + + // add the `pre` prefix if we are going to a prerelease version + const prefix = highHasPre ? 'pre' : '' + + if (v1.major !== v2.major) { + return prefix + 'major' + } + + if (v1.minor !== v2.minor) { + return prefix + 'minor' + } + + if (v1.patch !== v2.patch) { + return prefix + 'patch' + } + + // high and low are preleases + return 'prerelease' +} + +module.exports = diff + + +/***/ }), + +/***/ 92759: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(54168) +const eq = (a, b, loose) => compare(a, b, loose) === 0 +module.exports = eq + + +/***/ }), + +/***/ 20617: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(54168) +const gt = (a, b, loose) => compare(a, b, loose) > 0 +module.exports = gt + + +/***/ }), + +/***/ 31581: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(54168) +const gte = (a, b, loose) => compare(a, b, loose) >= 0 +module.exports = gte + + +/***/ }), + +/***/ 98571: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(16458) + +const inc = (version, release, options, identifier, identifierBase) => { + if (typeof (options) === 'string') { + identifierBase = identifier + identifier = options + options = undefined + } + + try { + return new SemVer( + version instanceof SemVer ? version.version : version, + options + ).inc(release, identifier, identifierBase).version + } catch (er) { + return null + } +} +module.exports = inc + + +/***/ }), + +/***/ 11959: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(54168) +const lt = (a, b, loose) => compare(a, b, loose) < 0 +module.exports = lt + + +/***/ }), + +/***/ 46264: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(54168) +const lte = (a, b, loose) => compare(a, b, loose) <= 0 +module.exports = lte + + +/***/ }), + +/***/ 19066: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(16458) +const major = (a, loose) => new SemVer(a, loose).major +module.exports = major + + +/***/ }), + +/***/ 47524: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(16458) +const minor = (a, loose) => new SemVer(a, loose).minor +module.exports = minor + + +/***/ }), + +/***/ 76489: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(54168) +const neq = (a, b, loose) => compare(a, b, loose) !== 0 +module.exports = neq + + +/***/ }), + +/***/ 53155: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(16458) +const parse = (version, options, throwErrors = false) => { + if (version instanceof SemVer) { + return version + } + try { + return new SemVer(version, options) + } catch (er) { + if (!throwErrors) { + return null + } + throw er + } +} + +module.exports = parse + + +/***/ }), + +/***/ 95436: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(16458) +const patch = (a, loose) => new SemVer(a, loose).patch +module.exports = patch + + +/***/ }), + +/***/ 76207: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parse = __nccwpck_require__(53155) +const prerelease = (version, options) => { + const parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} +module.exports = prerelease + + +/***/ }), + +/***/ 53133: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(54168) +const rcompare = (a, b, loose) => compare(b, a, loose) +module.exports = rcompare + + +/***/ }), + +/***/ 10035: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compareBuild = __nccwpck_require__(43327) +const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) +module.exports = rsort + + +/***/ }), + +/***/ 17913: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(62614) +const satisfies = (version, range, options) => { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} +module.exports = satisfies + + +/***/ }), + +/***/ 32857: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compareBuild = __nccwpck_require__(43327) +const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) +module.exports = sort + + +/***/ }), + +/***/ 85517: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parse = __nccwpck_require__(53155) +const valid = (version, options) => { + const v = parse(version, options) + return v ? v.version : null +} +module.exports = valid + + +/***/ }), + +/***/ 63547: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// just pre-load all the stuff that index.js lazily exports +const internalRe = __nccwpck_require__(1681) +const constants = __nccwpck_require__(95804) +const SemVer = __nccwpck_require__(16458) +const identifiers = __nccwpck_require__(37852) +const parse = __nccwpck_require__(53155) +const valid = __nccwpck_require__(85517) +const clean = __nccwpck_require__(68420) +const inc = __nccwpck_require__(98571) +const diff = __nccwpck_require__(79623) +const major = __nccwpck_require__(19066) +const minor = __nccwpck_require__(47524) +const patch = __nccwpck_require__(95436) +const prerelease = __nccwpck_require__(76207) +const compare = __nccwpck_require__(54168) +const rcompare = __nccwpck_require__(53133) +const compareLoose = __nccwpck_require__(83723) +const compareBuild = __nccwpck_require__(43327) +const sort = __nccwpck_require__(32857) +const rsort = __nccwpck_require__(10035) +const gt = __nccwpck_require__(20617) +const lt = __nccwpck_require__(11959) +const eq = __nccwpck_require__(92759) +const neq = __nccwpck_require__(76489) +const gte = __nccwpck_require__(31581) +const lte = __nccwpck_require__(46264) +const cmp = __nccwpck_require__(41219) +const coerce = __nccwpck_require__(32766) +const Comparator = __nccwpck_require__(62433) +const Range = __nccwpck_require__(62614) +const satisfies = __nccwpck_require__(17913) +const toComparators = __nccwpck_require__(12204) +const maxSatisfying = __nccwpck_require__(92103) +const minSatisfying = __nccwpck_require__(99584) +const minVersion = __nccwpck_require__(66053) +const validRange = __nccwpck_require__(91117) +const outside = __nccwpck_require__(87855) +const gtr = __nccwpck_require__(4215) +const ltr = __nccwpck_require__(84497) +const intersects = __nccwpck_require__(90680) +const simplifyRange = __nccwpck_require__(25556) +const subset = __nccwpck_require__(15301) +module.exports = { + parse, + valid, + clean, + inc, + diff, + major, + minor, + patch, + prerelease, + compare, + rcompare, + compareLoose, + compareBuild, + sort, + rsort, + gt, + lt, + eq, + neq, + gte, + lte, + cmp, + coerce, + Comparator, + Range, + satisfies, + toComparators, + maxSatisfying, + minSatisfying, + minVersion, + validRange, + outside, + gtr, + ltr, + intersects, + simplifyRange, + subset, + SemVer, + re: internalRe.re, + src: internalRe.src, + tokens: internalRe.t, + SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, + RELEASE_TYPES: constants.RELEASE_TYPES, + compareIdentifiers: identifiers.compareIdentifiers, + rcompareIdentifiers: identifiers.rcompareIdentifiers, +} + + +/***/ }), + +/***/ 95804: +/***/ ((module) => { + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +const SEMVER_SPEC_VERSION = '2.0.0' + +const MAX_LENGTH = 256 +const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || +/* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +const MAX_SAFE_COMPONENT_LENGTH = 16 + +// Max safe length for a build identifier. The max length minus 6 characters for +// the shortest version with a build 0.0.0+BUILD. +const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 + +const RELEASE_TYPES = [ + 'major', + 'premajor', + 'minor', + 'preminor', + 'patch', + 'prepatch', + 'prerelease', +] + +module.exports = { + MAX_LENGTH, + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_SAFE_INTEGER, + RELEASE_TYPES, + SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 0b001, + FLAG_LOOSE: 0b010, +} + + +/***/ }), + +/***/ 27480: +/***/ ((module) => { + +const debug = ( + typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG) +) ? (...args) => console.error('SEMVER', ...args) + : () => {} + +module.exports = debug + + +/***/ }), + +/***/ 37852: +/***/ ((module) => { + +const numeric = /^[0-9]+$/ +const compareIdentifiers = (a, b) => { + const anum = numeric.test(a) + const bnum = numeric.test(b) + + if (anum && bnum) { + a = +a + b = +b + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +} + +const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) + +module.exports = { + compareIdentifiers, + rcompareIdentifiers, +} + + +/***/ }), + +/***/ 35617: +/***/ ((module) => { + +class LRUCache { + constructor () { + this.max = 1000 + this.map = new Map() + } + + get (key) { + const value = this.map.get(key) + if (value === undefined) { + return undefined + } else { + // Remove the key from the map and add it to the end + this.map.delete(key) + this.map.set(key, value) + return value + } + } + + delete (key) { + return this.map.delete(key) + } + + set (key, value) { + const deleted = this.delete(key) + + if (!deleted && value !== undefined) { + // If cache is full, delete the least recently used item + if (this.map.size >= this.max) { + const firstKey = this.map.keys().next().value + this.delete(firstKey) + } + + this.map.set(key, value) + } + + return this + } +} + +module.exports = LRUCache + + +/***/ }), + +/***/ 1893: +/***/ ((module) => { + +// parse out just the options we care about +const looseOption = Object.freeze({ loose: true }) +const emptyOpts = Object.freeze({ }) +const parseOptions = options => { + if (!options) { + return emptyOpts + } + + if (typeof options !== 'object') { + return looseOption + } + + return options +} +module.exports = parseOptions + + +/***/ }), + +/***/ 1681: +/***/ ((module, exports, __nccwpck_require__) => { + +const { + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_LENGTH, +} = __nccwpck_require__(95804) +const debug = __nccwpck_require__(27480) +exports = module.exports = {} + +// The actual regexps go on exports.re +const re = exports.re = [] +const safeRe = exports.safeRe = [] +const src = exports.src = [] +const t = exports.t = {} +let R = 0 + +const LETTERDASHNUMBER = '[a-zA-Z0-9-]' + +// Replace some greedy regex tokens to prevent regex dos issues. These regex are +// used internally via the safeRe object since all inputs in this library get +// normalized first to trim and collapse all extra whitespace. The original +// regexes are exported for userland consumption and lower level usage. A +// future breaking change could export the safer regex only with a note that +// all input should have extra whitespace removed. +const safeRegexReplacements = [ + ['\\s', 1], + ['\\d', MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], +] + +const makeSafeRegex = (value) => { + for (const [token, max] of safeRegexReplacements) { + value = value + .split(`${token}*`).join(`${token}{0,${max}}`) + .split(`${token}+`).join(`${token}{1,${max}}`) + } + return value +} + +const createToken = (name, value, isGlobal) => { + const safe = makeSafeRegex(value) + const index = R++ + debug(name, index, value) + t[name] = index + src[index] = value + re[index] = new RegExp(value, isGlobal ? 'g' : undefined) + safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined) +} + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') +createToken('NUMERICIDENTIFIERLOOSE', '\\d+') + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`) + +// ## Main Version +// Three dot-separated numeric identifiers. + +createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})`) + +createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})`) + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] +}|${src[t.NONNUMERICIDENTIFIER]})`) + +createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] +}|${src[t.NONNUMERICIDENTIFIER]})`) + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] +}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) + +createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] +}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`) + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] +}(?:\\.${src[t.BUILDIDENTIFIER]})*))`) + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +createToken('FULLPLAIN', `v?${src[t.MAINVERSION] +}${src[t.PRERELEASE]}?${ + src[t.BUILD]}?`) + +createToken('FULL', `^${src[t.FULLPLAIN]}$`) + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] +}${src[t.PRERELEASELOOSE]}?${ + src[t.BUILD]}?`) + +createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) + +createToken('GTLT', '((?:<|>)?=?)') + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) +createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) + +createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:${src[t.PRERELEASE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:${src[t.PRERELEASELOOSE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) +createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +createToken('COERCEPLAIN', `${'(^|[^\\d])' + + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`) +createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`) +createToken('COERCEFULL', src[t.COERCEPLAIN] + + `(?:${src[t.PRERELEASE]})?` + + `(?:${src[t.BUILD]})?` + + `(?:$|[^\\d])`) +createToken('COERCERTL', src[t.COERCE], true) +createToken('COERCERTLFULL', src[t.COERCEFULL], true) + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +createToken('LONETILDE', '(?:~>?)') + +createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) +exports.tildeTrimReplace = '$1~' + +createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) +createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +createToken('LONECARET', '(?:\\^)') + +createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) +exports.caretTrimReplace = '$1^' + +createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) +createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) +createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] +}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) +exports.comparatorTrimReplace = '$1$2$3' + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAIN]})` + + `\\s*$`) + +createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAINLOOSE]})` + + `\\s*$`) + +// Star ranges basically just allow anything at all. +createToken('STAR', '(<|>)?=?\\s*\\*') +// >=0.0.0 is like a star +createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$') +createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$') + + +/***/ }), + +/***/ 4215: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// Determine if version is greater than all the versions possible in the range. +const outside = __nccwpck_require__(87855) +const gtr = (version, range, options) => outside(version, range, '>', options) +module.exports = gtr + + +/***/ }), + +/***/ 90680: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(62614) +const intersects = (r1, r2, options) => { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2, options) +} +module.exports = intersects + + +/***/ }), + +/***/ 84497: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const outside = __nccwpck_require__(87855) +// Determine if version is less than all the versions possible in the range +const ltr = (version, range, options) => outside(version, range, '<', options) +module.exports = ltr + + +/***/ }), + +/***/ 92103: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(16458) +const Range = __nccwpck_require__(62614) + +const maxSatisfying = (versions, range, options) => { + let max = null + let maxSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max +} +module.exports = maxSatisfying + + +/***/ }), + +/***/ 99584: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(16458) +const Range = __nccwpck_require__(62614) +const minSatisfying = (versions, range, options) => { + let min = null + let minSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min +} +module.exports = minSatisfying + + +/***/ }), + +/***/ 66053: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(16458) +const Range = __nccwpck_require__(62614) +const gt = __nccwpck_require__(20617) + +const minVersion = (range, loose) => { + range = new Range(range, loose) + + let minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } + + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } + + minver = null + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let setMin = null + comparators.forEach((comparator) => { + // Clone to avoid manipulating the comparator's semver object. + const compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!setMin || gt(compver, setMin)) { + setMin = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error(`Unexpected operation: ${comparator.operator}`) + } + }) + if (setMin && (!minver || gt(minver, setMin))) { + minver = setMin + } + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} +module.exports = minVersion + + +/***/ }), + +/***/ 87855: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(16458) +const Comparator = __nccwpck_require__(62433) +const { ANY } = Comparator +const Range = __nccwpck_require__(62614) +const satisfies = __nccwpck_require__(17913) +const gt = __nccwpck_require__(20617) +const lt = __nccwpck_require__(11959) +const lte = __nccwpck_require__(46264) +const gte = __nccwpck_require__(31581) + +const outside = (version, range, hilo, options) => { + version = new SemVer(version, options) + range = new Range(range, options) + + let gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisfies the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let high = null + let low = null + + comparators.forEach((comparator) => { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +module.exports = outside + + +/***/ }), + +/***/ 25556: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// given a set of versions and a range, create a "simplified" range +// that includes the same versions that the original range does +// If the original range is shorter than the simplified one, return that. +const satisfies = __nccwpck_require__(17913) +const compare = __nccwpck_require__(54168) +module.exports = (versions, range, options) => { + const set = [] + let first = null + let prev = null + const v = versions.sort((a, b) => compare(a, b, options)) + for (const version of v) { + const included = satisfies(version, range, options) + if (included) { + prev = version + if (!first) { + first = version + } + } else { + if (prev) { + set.push([first, prev]) + } + prev = null + first = null + } + } + if (first) { + set.push([first, null]) + } + + const ranges = [] + for (const [min, max] of set) { + if (min === max) { + ranges.push(min) + } else if (!max && min === v[0]) { + ranges.push('*') + } else if (!max) { + ranges.push(`>=${min}`) + } else if (min === v[0]) { + ranges.push(`<=${max}`) + } else { + ranges.push(`${min} - ${max}`) + } + } + const simplified = ranges.join(' || ') + const original = typeof range.raw === 'string' ? range.raw : String(range) + return simplified.length < original.length ? simplified : range +} + + +/***/ }), + +/***/ 15301: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(62614) +const Comparator = __nccwpck_require__(62433) +const { ANY } = Comparator +const satisfies = __nccwpck_require__(17913) +const compare = __nccwpck_require__(54168) + +// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: +// - Every simple range `r1, r2, ...` is a null set, OR +// - Every simple range `r1, r2, ...` which is not a null set is a subset of +// some `R1, R2, ...` +// +// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: +// - If c is only the ANY comparator +// - If C is only the ANY comparator, return true +// - Else if in prerelease mode, return false +// - else replace c with `[>=0.0.0]` +// - If C is only the ANY comparator +// - if in prerelease mode, return true +// - else replace C with `[>=0.0.0]` +// - Let EQ be the set of = comparators in c +// - If EQ is more than one, return true (null set) +// - Let GT be the highest > or >= comparator in c +// - Let LT be the lowest < or <= comparator in c +// - If GT and LT, and GT.semver > LT.semver, return true (null set) +// - If any C is a = range, and GT or LT are set, return false +// - If EQ +// - If GT, and EQ does not satisfy GT, return true (null set) +// - If LT, and EQ does not satisfy LT, return true (null set) +// - If EQ satisfies every C, return true +// - Else return false +// - If GT +// - If GT.semver is lower than any > or >= comp in C, return false +// - If GT is >=, and GT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the GT.semver tuple, return false +// - If LT +// - If LT.semver is greater than any < or <= comp in C, return false +// - If LT is <=, and LT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the LT.semver tuple, return false +// - Else return true + +const subset = (sub, dom, options = {}) => { + if (sub === dom) { + return true + } + + sub = new Range(sub, options) + dom = new Range(dom, options) + let sawNonNull = false + + OUTER: for (const simpleSub of sub.set) { + for (const simpleDom of dom.set) { + const isSub = simpleSubset(simpleSub, simpleDom, options) + sawNonNull = sawNonNull || isSub !== null + if (isSub) { + continue OUTER + } + } + // the null set is a subset of everything, but null simple ranges in + // a complex range should be ignored. so if we saw a non-null range, + // then we know this isn't a subset, but if EVERY simple range was null, + // then it is a subset. + if (sawNonNull) { + return false + } + } + return true +} + +const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')] +const minimumVersion = [new Comparator('>=0.0.0')] + +const simpleSubset = (sub, dom, options) => { + if (sub === dom) { + return true + } + + if (sub.length === 1 && sub[0].semver === ANY) { + if (dom.length === 1 && dom[0].semver === ANY) { + return true + } else if (options.includePrerelease) { + sub = minimumVersionWithPreRelease + } else { + sub = minimumVersion + } + } + + if (dom.length === 1 && dom[0].semver === ANY) { + if (options.includePrerelease) { + return true + } else { + dom = minimumVersion + } + } + + const eqSet = new Set() + let gt, lt + for (const c of sub) { + if (c.operator === '>' || c.operator === '>=') { + gt = higherGT(gt, c, options) + } else if (c.operator === '<' || c.operator === '<=') { + lt = lowerLT(lt, c, options) + } else { + eqSet.add(c.semver) + } + } + + if (eqSet.size > 1) { + return null + } + + let gtltComp + if (gt && lt) { + gtltComp = compare(gt.semver, lt.semver, options) + if (gtltComp > 0) { + return null + } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { + return null + } + } + + // will iterate one or zero times + for (const eq of eqSet) { + if (gt && !satisfies(eq, String(gt), options)) { + return null + } + + if (lt && !satisfies(eq, String(lt), options)) { + return null + } + + for (const c of dom) { + if (!satisfies(eq, String(c), options)) { + return false + } + } + + return true + } + + let higher, lower + let hasDomLT, hasDomGT + // if the subset has a prerelease, we need a comparator in the superset + // with the same tuple and a prerelease, or it's not a subset + let needDomLTPre = lt && + !options.includePrerelease && + lt.semver.prerelease.length ? lt.semver : false + let needDomGTPre = gt && + !options.includePrerelease && + gt.semver.prerelease.length ? gt.semver : false + // exception: <1.2.3-0 is the same as <1.2.3 + if (needDomLTPre && needDomLTPre.prerelease.length === 1 && + lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { + needDomLTPre = false + } + + for (const c of dom) { + hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' + hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' + if (gt) { + if (needDomGTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomGTPre.major && + c.semver.minor === needDomGTPre.minor && + c.semver.patch === needDomGTPre.patch) { + needDomGTPre = false + } + } + if (c.operator === '>' || c.operator === '>=') { + higher = higherGT(gt, c, options) + if (higher === c && higher !== gt) { + return false + } + } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) { + return false + } + } + if (lt) { + if (needDomLTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomLTPre.major && + c.semver.minor === needDomLTPre.minor && + c.semver.patch === needDomLTPre.patch) { + needDomLTPre = false + } + } + if (c.operator === '<' || c.operator === '<=') { + lower = lowerLT(lt, c, options) + if (lower === c && lower !== lt) { + return false + } + } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) { + return false + } + } + if (!c.operator && (lt || gt) && gtltComp !== 0) { + return false + } + } + + // if there was a < or >, and nothing in the dom, then must be false + // UNLESS it was limited by another range in the other direction. + // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 + if (gt && hasDomLT && !lt && gtltComp !== 0) { + return false + } + + if (lt && hasDomGT && !gt && gtltComp !== 0) { + return false + } + + // we needed a prerelease range in a specific tuple, but didn't get one + // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, + // because it includes prereleases in the 1.2.3 tuple + if (needDomGTPre || needDomLTPre) { + return false + } + + return true +} + +// >=1.2.3 is lower than >1.2.3 +const higherGT = (a, b, options) => { + if (!a) { + return b + } + const comp = compare(a.semver, b.semver, options) + return comp > 0 ? a + : comp < 0 ? b + : b.operator === '>' && a.operator === '>=' ? b + : a +} + +// <=1.2.3 is higher than <1.2.3 +const lowerLT = (a, b, options) => { + if (!a) { + return b + } + const comp = compare(a.semver, b.semver, options) + return comp < 0 ? a + : comp > 0 ? b + : b.operator === '<' && a.operator === '<=' ? b + : a +} + +module.exports = subset + + +/***/ }), + +/***/ 12204: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(62614) + +// Mostly just for testing and legacy API reasons +const toComparators = (range, options) => + new Range(range, options).set + .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) + +module.exports = toComparators + + +/***/ }), + +/***/ 91117: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(62614) +const validRange = (range, options) => { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} +module.exports = validRange + + +/***/ }), + +/***/ 3194: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.defaultDbStatementSerializer = void 0; +/** + * List of regexes and the number of arguments that should be serialized for matching commands. + * For example, HSET should serialize which key and field it's operating on, but not its value. + * Setting the subset to -1 will serialize all arguments. + * Commands without a match will have their first argument serialized. + * + * Refer to https://redis.io/commands/ for the full list. + */ +const serializationSubsets = [ + { + regex: /^ECHO/i, + args: 0, + }, + { + regex: /^(LPUSH|MSET|PFA|PUBLISH|RPUSH|SADD|SET|SPUBLISH|XADD|ZADD)/i, + args: 1, + }, + { + regex: /^(HSET|HMSET|LSET|LINSERT)/i, + args: 2, + }, + { + regex: /^(ACL|BIT|B[LRZ]|CLIENT|CLUSTER|CONFIG|COMMAND|DECR|DEL|EVAL|EX|FUNCTION|GEO|GET|HINCR|HMGET|HSCAN|INCR|L[TRLM]|MEMORY|P[EFISTU]|RPOP|S[CDIMORSU]|XACK|X[CDGILPRT]|Z[CDILMPRS])/i, + args: -1, + }, +]; +/** + * Given the redis command name and arguments, return a combination of the + * command name + the allowed arguments according to `serializationSubsets`. + * @param cmdName The redis command name + * @param cmdArgs The redis command arguments + * @returns a combination of the command name + args according to `serializationSubsets`. + */ +const defaultDbStatementSerializer = (cmdName, cmdArgs) => { + var _a, _b; + if (Array.isArray(cmdArgs) && cmdArgs.length) { + const nArgsToSerialize = (_b = (_a = serializationSubsets.find(({ regex }) => { + return regex.test(cmdName); + })) === null || _a === void 0 ? void 0 : _a.args) !== null && _b !== void 0 ? _b : 0; + const argsToSerialize = nArgsToSerialize >= 0 ? cmdArgs.slice(0, nArgsToSerialize) : cmdArgs; + if (cmdArgs.length > argsToSerialize.length) { + argsToSerialize.push(`[${cmdArgs.length - nArgsToSerialize} other arguments]`); + } + return `${cmdName} ${argsToSerialize.join(' ')}`; + } + return cmdName; +}; +exports.defaultDbStatementSerializer = defaultDbStatementSerializer; +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 72723: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Resource = void 0; +const api_1 = __nccwpck_require__(65163); +const semantic_conventions_1 = __nccwpck_require__(67275); +const core_1 = __nccwpck_require__(98156); +const platform_1 = __nccwpck_require__(7784); +/** + * A Resource describes the entity for which a signals (metrics or trace) are + * collected. + */ +class Resource { + constructor( + /** + * A dictionary of attributes with string keys and values that provide + * information about the entity as numbers, strings or booleans + * TODO: Consider to add check/validation on attributes. + */ + attributes, asyncAttributesPromise) { + var _a; + this._attributes = attributes; + this.asyncAttributesPending = asyncAttributesPromise != null; + this._syncAttributes = (_a = this._attributes) !== null && _a !== void 0 ? _a : {}; + this._asyncAttributesPromise = asyncAttributesPromise === null || asyncAttributesPromise === void 0 ? void 0 : asyncAttributesPromise.then(asyncAttributes => { + this._attributes = Object.assign({}, this._attributes, asyncAttributes); + this.asyncAttributesPending = false; + return asyncAttributes; + }, err => { + api_1.diag.debug("a resource's async attributes promise rejected: %s", err); + this.asyncAttributesPending = false; + return {}; + }); + } + /** + * Returns an empty Resource + */ + static empty() { + return Resource.EMPTY; + } + /** + * Returns a Resource that identifies the SDK in use. + */ + static default() { + return new Resource({ + [semantic_conventions_1.SEMRESATTRS_SERVICE_NAME]: (0, platform_1.defaultServiceName)(), + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]: core_1.SDK_INFO[semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE], + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME]: core_1.SDK_INFO[semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME], + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_VERSION]: core_1.SDK_INFO[semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_VERSION], + }); + } + get attributes() { + var _a; + if (this.asyncAttributesPending) { + api_1.diag.error('Accessing resource attributes before async attributes settled'); + } + return (_a = this._attributes) !== null && _a !== void 0 ? _a : {}; + } + /** + * Returns a promise that will never be rejected. Resolves when all async attributes have finished being added to + * this Resource's attributes. This is useful in exporters to block until resource detection + * has finished. + */ + async waitForAsyncAttributes() { + if (this.asyncAttributesPending) { + await this._asyncAttributesPromise; + } + } + /** + * Returns a new, merged {@link Resource} by merging the current Resource + * with the other Resource. In case of a collision, other Resource takes + * precedence. + * + * @param other the Resource that will be merged with this. + * @returns the newly merged Resource. + */ + merge(other) { + var _a; + if (!other) + return this; + // SpanAttributes from other resource overwrite attributes from this resource. + const mergedSyncAttributes = Object.assign(Object.assign({}, this._syncAttributes), ((_a = other._syncAttributes) !== null && _a !== void 0 ? _a : other.attributes)); + if (!this._asyncAttributesPromise && + !other._asyncAttributesPromise) { + return new Resource(mergedSyncAttributes); + } + const mergedAttributesPromise = Promise.all([ + this._asyncAttributesPromise, + other._asyncAttributesPromise, + ]).then(([thisAsyncAttributes, otherAsyncAttributes]) => { + var _a; + return Object.assign(Object.assign(Object.assign(Object.assign({}, this._syncAttributes), thisAsyncAttributes), ((_a = other._syncAttributes) !== null && _a !== void 0 ? _a : other.attributes)), otherAsyncAttributes); + }); + return new Resource(mergedSyncAttributes, mergedAttributesPromise); + } +} +exports.Resource = Resource; +Resource.EMPTY = new Resource({}); +//# sourceMappingURL=Resource.js.map + +/***/ }), + +/***/ 990: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.detectResourcesSync = exports.detectResources = void 0; +const Resource_1 = __nccwpck_require__(72723); +const api_1 = __nccwpck_require__(65163); +const utils_1 = __nccwpck_require__(44298); +/** + * Runs all resource detectors and returns the results merged into a single Resource. Promise + * does not resolve until all the underlying detectors have resolved, unlike + * detectResourcesSync. + * + * @deprecated use detectResourcesSync() instead. + * @param config Configuration for resource detection + */ +const detectResources = async (config = {}) => { + const resources = await Promise.all((config.detectors || []).map(async (d) => { + try { + const resource = await d.detect(config); + api_1.diag.debug(`${d.constructor.name} found resource.`, resource); + return resource; + } + catch (e) { + api_1.diag.debug(`${d.constructor.name} failed: ${e.message}`); + return Resource_1.Resource.empty(); + } + })); + // Future check if verbose logging is enabled issue #1903 + logResources(resources); + return resources.reduce((acc, resource) => acc.merge(resource), Resource_1.Resource.empty()); +}; +exports.detectResources = detectResources; +/** + * Runs all resource detectors synchronously, merging their results. In case of attribute collision later resources will take precedence. + * + * @param config Configuration for resource detection + */ +const detectResourcesSync = (config = {}) => { + var _a; + const resources = ((_a = config.detectors) !== null && _a !== void 0 ? _a : []).map((d) => { + try { + const resourceOrPromise = d.detect(config); + let resource; + if ((0, utils_1.isPromiseLike)(resourceOrPromise)) { + const createPromise = async () => { + var _a; + const resolvedResource = await resourceOrPromise; + await ((_a = resolvedResource.waitForAsyncAttributes) === null || _a === void 0 ? void 0 : _a.call(resolvedResource)); + return resolvedResource.attributes; + }; + resource = new Resource_1.Resource({}, createPromise()); + } + else { + resource = resourceOrPromise; + } + if (resource.waitForAsyncAttributes) { + void resource + .waitForAsyncAttributes() + .then(() => api_1.diag.debug(`${d.constructor.name} found resource.`, resource)); + } + else { + api_1.diag.debug(`${d.constructor.name} found resource.`, resource); + } + return resource; + } + catch (e) { + api_1.diag.error(`${d.constructor.name} failed: ${e.message}`); + return Resource_1.Resource.empty(); + } + }); + const mergedResources = resources.reduce((acc, resource) => acc.merge(resource), Resource_1.Resource.empty()); + if (mergedResources.waitForAsyncAttributes) { + void mergedResources.waitForAsyncAttributes().then(() => { + // Future check if verbose logging is enabled issue #1903 + logResources(resources); + }); + } + return mergedResources; +}; +exports.detectResourcesSync = detectResourcesSync; +/** + * Writes debug information about the detected resources to the logger defined in the resource detection config, if one is provided. + * + * @param resources The array of {@link Resource} that should be logged. Empty entries will be ignored. + */ +const logResources = (resources) => { + resources.forEach(resource => { + // Print only populated resources + if (Object.keys(resource.attributes).length > 0) { + const resourceDebugString = JSON.stringify(resource.attributes, null, 4); + api_1.diag.verbose(resourceDebugString); + } + }); +}; +//# sourceMappingURL=detect-resources.js.map + +/***/ }), + +/***/ 15969: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.browserDetector = void 0; +const BrowserDetectorSync_1 = __nccwpck_require__(33010); +/** + * BrowserDetector will be used to detect the resources related to browser. + */ +class BrowserDetector { + detect(config) { + return Promise.resolve(BrowserDetectorSync_1.browserDetectorSync.detect(config)); + } +} +exports.browserDetector = new BrowserDetector(); +//# sourceMappingURL=BrowserDetector.js.map + +/***/ }), + +/***/ 33010: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.browserDetectorSync = void 0; +const semantic_conventions_1 = __nccwpck_require__(67275); +const api_1 = __nccwpck_require__(65163); +const Resource_1 = __nccwpck_require__(72723); +/** + * BrowserDetectorSync will be used to detect the resources related to browser. + */ +class BrowserDetectorSync { + detect(config) { + var _a, _b, _c; + const isBrowser = typeof navigator !== 'undefined' && + ((_b = (_a = global.process) === null || _a === void 0 ? void 0 : _a.versions) === null || _b === void 0 ? void 0 : _b.node) === undefined && // Node.js v21 adds `navigator` + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore don't have Bun types + ((_c = global.Bun) === null || _c === void 0 ? void 0 : _c.version) === undefined; // Bun (bun.sh) defines `navigator` + if (!isBrowser) { + return Resource_1.Resource.empty(); + } + const browserResource = { + [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'browser', + [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION]: 'Web Browser', + [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_VERSION]: navigator.userAgent, + }; + return this._getResourceAttributes(browserResource, config); + } + /** + * Validates process resource attribute map from process variables + * + * @param browserResource The un-sanitized resource attributes from process as key/value pairs. + * @param config: Config + * @returns The sanitized resource attributes. + */ + _getResourceAttributes(browserResource, _config) { + if (browserResource[semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_VERSION] === '') { + api_1.diag.debug('BrowserDetector failed: Unable to find required browser resources. '); + return Resource_1.Resource.empty(); + } + else { + return new Resource_1.Resource(Object.assign({}, browserResource)); + } + } +} +exports.browserDetectorSync = new BrowserDetectorSync(); +//# sourceMappingURL=BrowserDetectorSync.js.map + +/***/ }), + +/***/ 22474: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.envDetector = void 0; +const EnvDetectorSync_1 = __nccwpck_require__(84565); +/** + * EnvDetector can be used to detect the presence of and create a Resource + * from the OTEL_RESOURCE_ATTRIBUTES environment variable. + */ +class EnvDetector { + /** + * Returns a {@link Resource} populated with attributes from the + * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async + * function to conform to the Detector interface. + * + * @param config The resource detection config + */ + detect(config) { + return Promise.resolve(EnvDetectorSync_1.envDetectorSync.detect(config)); + } +} +exports.envDetector = new EnvDetector(); +//# sourceMappingURL=EnvDetector.js.map + +/***/ }), + +/***/ 84565: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.envDetectorSync = void 0; +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(98156); +const semantic_conventions_1 = __nccwpck_require__(67275); +const Resource_1 = __nccwpck_require__(72723); +/** + * EnvDetectorSync can be used to detect the presence of and create a Resource + * from the OTEL_RESOURCE_ATTRIBUTES environment variable. + */ +class EnvDetectorSync { + constructor() { + // Type, attribute keys, and attribute values should not exceed 256 characters. + this._MAX_LENGTH = 255; + // OTEL_RESOURCE_ATTRIBUTES is a comma-separated list of attributes. + this._COMMA_SEPARATOR = ','; + // OTEL_RESOURCE_ATTRIBUTES contains key value pair separated by '='. + this._LABEL_KEY_VALUE_SPLITTER = '='; + this._ERROR_MESSAGE_INVALID_CHARS = 'should be a ASCII string with a length greater than 0 and not exceed ' + + this._MAX_LENGTH + + ' characters.'; + this._ERROR_MESSAGE_INVALID_VALUE = 'should be a ASCII string with a length not exceed ' + + this._MAX_LENGTH + + ' characters.'; + } + /** + * Returns a {@link Resource} populated with attributes from the + * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async + * function to conform to the Detector interface. + * + * @param config The resource detection config + */ + detect(_config) { + const attributes = {}; + const env = (0, core_1.getEnv)(); + const rawAttributes = env.OTEL_RESOURCE_ATTRIBUTES; + const serviceName = env.OTEL_SERVICE_NAME; + if (rawAttributes) { + try { + const parsedAttributes = this._parseResourceAttributes(rawAttributes); + Object.assign(attributes, parsedAttributes); + } + catch (e) { + api_1.diag.debug(`EnvDetector failed: ${e.message}`); + } + } + if (serviceName) { + attributes[semantic_conventions_1.SEMRESATTRS_SERVICE_NAME] = serviceName; + } + return new Resource_1.Resource(attributes); + } + /** + * Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment + * variable. + * + * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes describing + * the source in more detail, e.g. “key1=val1,key2=val2”. Domain names and + * paths are accepted as attribute keys. Values may be quoted or unquoted in + * general. If a value contains whitespace, =, or " characters, it must + * always be quoted. + * + * @param rawEnvAttributes The resource attributes as a comma-separated list + * of key/value pairs. + * @returns The sanitized resource attributes. + */ + _parseResourceAttributes(rawEnvAttributes) { + if (!rawEnvAttributes) + return {}; + const attributes = {}; + const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR, -1); + for (const rawAttribute of rawAttributes) { + const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER, -1); + if (keyValuePair.length !== 2) { + continue; + } + let [key, value] = keyValuePair; + // Leading and trailing whitespaces are trimmed. + key = key.trim(); + value = value.trim().split(/^"|"$/).join(''); + if (!this._isValidAndNotEmpty(key)) { + throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`); + } + if (!this._isValid(value)) { + throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`); + } + attributes[key] = decodeURIComponent(value); + } + return attributes; + } + /** + * Determines whether the given String is a valid printable ASCII string with + * a length not exceed _MAX_LENGTH characters. + * + * @param str The String to be validated. + * @returns Whether the String is valid. + */ + _isValid(name) { + return name.length <= this._MAX_LENGTH && this._isBaggageOctetString(name); + } + // https://www.w3.org/TR/baggage/#definition + _isBaggageOctetString(str) { + for (let i = 0; i < str.length; i++) { + const ch = str.charCodeAt(i); + if (ch < 0x21 || ch === 0x2c || ch === 0x3b || ch === 0x5c || ch > 0x7e) { + return false; + } + } + return true; + } + /** + * Determines whether the given String is a valid printable ASCII string with + * a length greater than 0 and not exceed _MAX_LENGTH characters. + * + * @param str The String to be validated. + * @returns Whether the String is valid and not empty. + */ + _isValidAndNotEmpty(str) { + return str.length > 0 && this._isValid(str); + } +} +exports.envDetectorSync = new EnvDetectorSync(); +//# sourceMappingURL=EnvDetectorSync.js.map + +/***/ }), + +/***/ 24918: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.envDetectorSync = exports.browserDetectorSync = exports.envDetector = exports.browserDetector = exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = void 0; +var platform_1 = __nccwpck_require__(3098); +Object.defineProperty(exports, "hostDetector", ({ enumerable: true, get: function () { return platform_1.hostDetector; } })); +Object.defineProperty(exports, "hostDetectorSync", ({ enumerable: true, get: function () { return platform_1.hostDetectorSync; } })); +Object.defineProperty(exports, "osDetector", ({ enumerable: true, get: function () { return platform_1.osDetector; } })); +Object.defineProperty(exports, "osDetectorSync", ({ enumerable: true, get: function () { return platform_1.osDetectorSync; } })); +Object.defineProperty(exports, "processDetector", ({ enumerable: true, get: function () { return platform_1.processDetector; } })); +Object.defineProperty(exports, "processDetectorSync", ({ enumerable: true, get: function () { return platform_1.processDetectorSync; } })); +Object.defineProperty(exports, "serviceInstanceIdDetectorSync", ({ enumerable: true, get: function () { return platform_1.serviceInstanceIdDetectorSync; } })); +var BrowserDetector_1 = __nccwpck_require__(15969); +Object.defineProperty(exports, "browserDetector", ({ enumerable: true, get: function () { return BrowserDetector_1.browserDetector; } })); +var EnvDetector_1 = __nccwpck_require__(22474); +Object.defineProperty(exports, "envDetector", ({ enumerable: true, get: function () { return EnvDetector_1.envDetector; } })); +var BrowserDetectorSync_1 = __nccwpck_require__(33010); +Object.defineProperty(exports, "browserDetectorSync", ({ enumerable: true, get: function () { return BrowserDetectorSync_1.browserDetectorSync; } })); +var EnvDetectorSync_1 = __nccwpck_require__(84565); +Object.defineProperty(exports, "envDetectorSync", ({ enumerable: true, get: function () { return EnvDetectorSync_1.envDetectorSync; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 3098: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var node_1 = __nccwpck_require__(29920); +Object.defineProperty(exports, "hostDetector", ({ enumerable: true, get: function () { return node_1.hostDetector; } })); +Object.defineProperty(exports, "hostDetectorSync", ({ enumerable: true, get: function () { return node_1.hostDetectorSync; } })); +Object.defineProperty(exports, "osDetector", ({ enumerable: true, get: function () { return node_1.osDetector; } })); +Object.defineProperty(exports, "osDetectorSync", ({ enumerable: true, get: function () { return node_1.osDetectorSync; } })); +Object.defineProperty(exports, "processDetector", ({ enumerable: true, get: function () { return node_1.processDetector; } })); +Object.defineProperty(exports, "processDetectorSync", ({ enumerable: true, get: function () { return node_1.processDetectorSync; } })); +Object.defineProperty(exports, "serviceInstanceIdDetectorSync", ({ enumerable: true, get: function () { return node_1.serviceInstanceIdDetectorSync; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 59251: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.hostDetector = void 0; +const HostDetectorSync_1 = __nccwpck_require__(13172); +/** + * HostDetector detects the resources related to the host current process is + * running on. Currently only non-cloud-based attributes are included. + */ +class HostDetector { + detect(_config) { + return Promise.resolve(HostDetectorSync_1.hostDetectorSync.detect(_config)); + } +} +exports.hostDetector = new HostDetector(); +//# sourceMappingURL=HostDetector.js.map + +/***/ }), + +/***/ 13172: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.hostDetectorSync = void 0; +const semantic_conventions_1 = __nccwpck_require__(67275); +const Resource_1 = __nccwpck_require__(72723); +const os_1 = __nccwpck_require__(22037); +const utils_1 = __nccwpck_require__(88227); +const getMachineId_1 = __nccwpck_require__(11804); +/** + * HostDetectorSync detects the resources related to the host current process is + * running on. Currently only non-cloud-based attributes are included. + */ +class HostDetectorSync { + detect(_config) { + const attributes = { + [semantic_conventions_1.SEMRESATTRS_HOST_NAME]: (0, os_1.hostname)(), + [semantic_conventions_1.SEMRESATTRS_HOST_ARCH]: (0, utils_1.normalizeArch)((0, os_1.arch)()), + }; + return new Resource_1.Resource(attributes, this._getAsyncAttributes()); + } + _getAsyncAttributes() { + return (0, getMachineId_1.getMachineId)().then(machineId => { + const attributes = {}; + if (machineId) { + attributes[semantic_conventions_1.SEMRESATTRS_HOST_ID] = machineId; + } + return attributes; + }); + } +} +exports.hostDetectorSync = new HostDetectorSync(); +//# sourceMappingURL=HostDetectorSync.js.map + +/***/ }), + +/***/ 58102: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.osDetector = void 0; +const OSDetectorSync_1 = __nccwpck_require__(53136); +/** + * OSDetector detects the resources related to the operating system (OS) on + * which the process represented by this resource is running. + */ +class OSDetector { + detect(_config) { + return Promise.resolve(OSDetectorSync_1.osDetectorSync.detect(_config)); + } +} +exports.osDetector = new OSDetector(); +//# sourceMappingURL=OSDetector.js.map + +/***/ }), + +/***/ 53136: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.osDetectorSync = void 0; +const semantic_conventions_1 = __nccwpck_require__(67275); +const Resource_1 = __nccwpck_require__(72723); +const os_1 = __nccwpck_require__(22037); +const utils_1 = __nccwpck_require__(88227); +/** + * OSDetectorSync detects the resources related to the operating system (OS) on + * which the process represented by this resource is running. + */ +class OSDetectorSync { + detect(_config) { + const attributes = { + [semantic_conventions_1.SEMRESATTRS_OS_TYPE]: (0, utils_1.normalizeType)((0, os_1.platform)()), + [semantic_conventions_1.SEMRESATTRS_OS_VERSION]: (0, os_1.release)(), + }; + return new Resource_1.Resource(attributes); + } +} +exports.osDetectorSync = new OSDetectorSync(); +//# sourceMappingURL=OSDetectorSync.js.map + +/***/ }), + +/***/ 62471: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.processDetector = void 0; +const ProcessDetectorSync_1 = __nccwpck_require__(68786); +/** + * ProcessDetector will be used to detect the resources related current process running + * and being instrumented from the NodeJS Process module. + */ +class ProcessDetector { + detect(config) { + return Promise.resolve(ProcessDetectorSync_1.processDetectorSync.detect(config)); + } +} +exports.processDetector = new ProcessDetector(); +//# sourceMappingURL=ProcessDetector.js.map + +/***/ }), + +/***/ 68786: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.processDetectorSync = void 0; +const api_1 = __nccwpck_require__(65163); +const semantic_conventions_1 = __nccwpck_require__(67275); +const Resource_1 = __nccwpck_require__(72723); +const os = __nccwpck_require__(22037); +/** + * ProcessDetectorSync will be used to detect the resources related current process running + * and being instrumented from the NodeJS Process module. + */ +class ProcessDetectorSync { + detect(_config) { + const attributes = { + [semantic_conventions_1.SEMRESATTRS_PROCESS_PID]: process.pid, + [semantic_conventions_1.SEMRESATTRS_PROCESS_EXECUTABLE_NAME]: process.title, + [semantic_conventions_1.SEMRESATTRS_PROCESS_EXECUTABLE_PATH]: process.execPath, + [semantic_conventions_1.SEMRESATTRS_PROCESS_COMMAND_ARGS]: [ + process.argv[0], + ...process.execArgv, + ...process.argv.slice(1), + ], + [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_VERSION]: process.versions.node, + [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'nodejs', + [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION]: 'Node.js', + }; + if (process.argv.length > 1) { + attributes[semantic_conventions_1.SEMRESATTRS_PROCESS_COMMAND] = process.argv[1]; + } + try { + const userInfo = os.userInfo(); + attributes[semantic_conventions_1.SEMRESATTRS_PROCESS_OWNER] = userInfo.username; + } + catch (e) { + api_1.diag.debug(`error obtaining process owner: ${e}`); + } + return new Resource_1.Resource(attributes); + } +} +exports.processDetectorSync = new ProcessDetectorSync(); +//# sourceMappingURL=ProcessDetectorSync.js.map + +/***/ }), + +/***/ 47750: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.serviceInstanceIdDetectorSync = void 0; +const semantic_conventions_1 = __nccwpck_require__(67275); +const Resource_1 = __nccwpck_require__(72723); +const crypto_1 = __nccwpck_require__(6113); +/** + * ServiceInstanceIdDetectorSync detects the resources related to the service instance ID. + */ +class ServiceInstanceIdDetectorSync { + detect(_config) { + const attributes = { + [semantic_conventions_1.SEMRESATTRS_SERVICE_INSTANCE_ID]: (0, crypto_1.randomUUID)(), + }; + return new Resource_1.Resource(attributes); + } +} +/** + * @experimental + */ +exports.serviceInstanceIdDetectorSync = new ServiceInstanceIdDetectorSync(); +//# sourceMappingURL=ServiceInstanceIdDetectorSync.js.map + +/***/ }), + +/***/ 29920: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = void 0; +var HostDetector_1 = __nccwpck_require__(59251); +Object.defineProperty(exports, "hostDetector", ({ enumerable: true, get: function () { return HostDetector_1.hostDetector; } })); +var HostDetectorSync_1 = __nccwpck_require__(13172); +Object.defineProperty(exports, "hostDetectorSync", ({ enumerable: true, get: function () { return HostDetectorSync_1.hostDetectorSync; } })); +var OSDetector_1 = __nccwpck_require__(58102); +Object.defineProperty(exports, "osDetector", ({ enumerable: true, get: function () { return OSDetector_1.osDetector; } })); +var OSDetectorSync_1 = __nccwpck_require__(53136); +Object.defineProperty(exports, "osDetectorSync", ({ enumerable: true, get: function () { return OSDetectorSync_1.osDetectorSync; } })); +var ProcessDetector_1 = __nccwpck_require__(62471); +Object.defineProperty(exports, "processDetector", ({ enumerable: true, get: function () { return ProcessDetector_1.processDetector; } })); +var ProcessDetectorSync_1 = __nccwpck_require__(68786); +Object.defineProperty(exports, "processDetectorSync", ({ enumerable: true, get: function () { return ProcessDetectorSync_1.processDetectorSync; } })); +var ServiceInstanceIdDetectorSync_1 = __nccwpck_require__(47750); +Object.defineProperty(exports, "serviceInstanceIdDetectorSync", ({ enumerable: true, get: function () { return ServiceInstanceIdDetectorSync_1.serviceInstanceIdDetectorSync; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 70055: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.execAsync = void 0; +const child_process = __nccwpck_require__(32081); +const util = __nccwpck_require__(73837); +exports.execAsync = util.promisify(child_process.exec); +//# sourceMappingURL=execAsync.js.map + +/***/ }), + +/***/ 82605: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +__webpack_unused_export__ = ({ value: true }); +exports.$ = void 0; +const fs_1 = __nccwpck_require__(57147); +const execAsync_1 = __nccwpck_require__(70055); +const api_1 = __nccwpck_require__(65163); +async function getMachineId() { + try { + const result = await fs_1.promises.readFile('/etc/hostid', { encoding: 'utf8' }); + return result.trim(); + } + catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + try { + const result = await (0, execAsync_1.execAsync)('kenv -q smbios.system.uuid'); + return result.stdout.trim(); + } + catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + return ''; +} +exports.$ = getMachineId; +//# sourceMappingURL=getMachineId-bsd.js.map + +/***/ }), + +/***/ 32685: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +__webpack_unused_export__ = ({ value: true }); +exports.$ = void 0; +const execAsync_1 = __nccwpck_require__(70055); +const api_1 = __nccwpck_require__(65163); +async function getMachineId() { + try { + const result = await (0, execAsync_1.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"'); + const idLine = result.stdout + .split('\n') + .find(line => line.includes('IOPlatformUUID')); + if (!idLine) { + return ''; + } + const parts = idLine.split('" = "'); + if (parts.length === 2) { + return parts[1].slice(0, -1); + } + } + catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + return ''; +} +exports.$ = getMachineId; +//# sourceMappingURL=getMachineId-darwin.js.map + +/***/ }), + +/***/ 8319: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + +__webpack_unused_export__ = ({ value: true }); +exports.$ = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const fs_1 = __nccwpck_require__(57147); +const api_1 = __nccwpck_require__(65163); +async function getMachineId() { + const paths = ['/etc/machine-id', '/var/lib/dbus/machine-id']; + for (const path of paths) { + try { + const result = await fs_1.promises.readFile(path, { encoding: 'utf8' }); + return result.trim(); + } + catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + } + return ''; +} +exports.$ = getMachineId; +//# sourceMappingURL=getMachineId-linux.js.map + +/***/ }), + +/***/ 56083: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +__webpack_unused_export__ = ({ value: true }); +exports.$ = void 0; +const api_1 = __nccwpck_require__(65163); +async function getMachineId() { + api_1.diag.debug('could not read machine-id: unsupported platform'); + return ''; +} +exports.$ = getMachineId; +//# sourceMappingURL=getMachineId-unsupported.js.map + +/***/ }), + +/***/ 29937: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +__webpack_unused_export__ = ({ value: true }); +exports.$ = void 0; +const process = __nccwpck_require__(77282); +const execAsync_1 = __nccwpck_require__(70055); +const api_1 = __nccwpck_require__(65163); +async function getMachineId() { + const args = 'QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid'; + let command = '%windir%\\System32\\REG.exe'; + if (process.arch === 'ia32' && 'PROCESSOR_ARCHITEW6432' in process.env) { + command = '%windir%\\sysnative\\cmd.exe /c ' + command; + } + try { + const result = await (0, execAsync_1.execAsync)(`${command} ${args}`); + const parts = result.stdout.split('REG_SZ'); + if (parts.length === 2) { + return parts[1].trim(); + } + } + catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + return ''; +} +exports.$ = getMachineId; +//# sourceMappingURL=getMachineId-win.js.map + +/***/ }), + +/***/ 11804: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getMachineId = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const process = __nccwpck_require__(77282); +let getMachineId; +exports.getMachineId = getMachineId; +switch (process.platform) { + case 'darwin': + (exports.getMachineId = getMachineId = (__nccwpck_require__(32685)/* .getMachineId */ .$)); + break; + case 'linux': + (exports.getMachineId = getMachineId = (__nccwpck_require__(8319)/* .getMachineId */ .$)); + break; + case 'freebsd': + (exports.getMachineId = getMachineId = (__nccwpck_require__(82605)/* .getMachineId */ .$)); + break; + case 'win32': + (exports.getMachineId = getMachineId = (__nccwpck_require__(29937)/* .getMachineId */ .$)); + break; + default: + (exports.getMachineId = getMachineId = (__nccwpck_require__(56083)/* .getMachineId */ .$)); +} +//# sourceMappingURL=getMachineId.js.map + +/***/ }), + +/***/ 88227: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.normalizeType = exports.normalizeArch = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const normalizeArch = (nodeArchString) => { + // Maps from https://nodejs.org/api/os.html#osarch to arch values in spec: + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/host.md + switch (nodeArchString) { + case 'arm': + return 'arm32'; + case 'ppc': + return 'ppc32'; + case 'x64': + return 'amd64'; + default: + return nodeArchString; + } +}; +exports.normalizeArch = normalizeArch; +const normalizeType = (nodePlatform) => { + // Maps from https://nodejs.org/api/os.html#osplatform to arch values in spec: + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/os.md + switch (nodePlatform) { + case 'sunos': + return 'solaris'; + case 'win32': + return 'windows'; + default: + return nodePlatform; + } +}; +exports.normalizeType = normalizeType; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 3871: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.detectResources = exports.detectResourcesSync = exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = exports.envDetectorSync = exports.envDetector = exports.browserDetectorSync = exports.browserDetector = exports.defaultServiceName = exports.Resource = void 0; +var Resource_1 = __nccwpck_require__(72723); +Object.defineProperty(exports, "Resource", ({ enumerable: true, get: function () { return Resource_1.Resource; } })); +var platform_1 = __nccwpck_require__(7784); +Object.defineProperty(exports, "defaultServiceName", ({ enumerable: true, get: function () { return platform_1.defaultServiceName; } })); +var detectors_1 = __nccwpck_require__(24918); +Object.defineProperty(exports, "browserDetector", ({ enumerable: true, get: function () { return detectors_1.browserDetector; } })); +Object.defineProperty(exports, "browserDetectorSync", ({ enumerable: true, get: function () { return detectors_1.browserDetectorSync; } })); +Object.defineProperty(exports, "envDetector", ({ enumerable: true, get: function () { return detectors_1.envDetector; } })); +Object.defineProperty(exports, "envDetectorSync", ({ enumerable: true, get: function () { return detectors_1.envDetectorSync; } })); +Object.defineProperty(exports, "hostDetector", ({ enumerable: true, get: function () { return detectors_1.hostDetector; } })); +Object.defineProperty(exports, "hostDetectorSync", ({ enumerable: true, get: function () { return detectors_1.hostDetectorSync; } })); +Object.defineProperty(exports, "osDetector", ({ enumerable: true, get: function () { return detectors_1.osDetector; } })); +Object.defineProperty(exports, "osDetectorSync", ({ enumerable: true, get: function () { return detectors_1.osDetectorSync; } })); +Object.defineProperty(exports, "processDetector", ({ enumerable: true, get: function () { return detectors_1.processDetector; } })); +Object.defineProperty(exports, "processDetectorSync", ({ enumerable: true, get: function () { return detectors_1.processDetectorSync; } })); +Object.defineProperty(exports, "serviceInstanceIdDetectorSync", ({ enumerable: true, get: function () { return detectors_1.serviceInstanceIdDetectorSync; } })); +var detect_resources_1 = __nccwpck_require__(990); +Object.defineProperty(exports, "detectResourcesSync", ({ enumerable: true, get: function () { return detect_resources_1.detectResourcesSync; } })); +Object.defineProperty(exports, "detectResources", ({ enumerable: true, get: function () { return detect_resources_1.detectResources; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 7784: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.defaultServiceName = void 0; +var node_1 = __nccwpck_require__(90342); +Object.defineProperty(exports, "defaultServiceName", ({ enumerable: true, get: function () { return node_1.defaultServiceName; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 85671: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.defaultServiceName = void 0; +function defaultServiceName() { + return `unknown_service:${process.argv0}`; +} +exports.defaultServiceName = defaultServiceName; +//# sourceMappingURL=default-service-name.js.map + +/***/ }), + +/***/ 90342: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.defaultServiceName = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var default_service_name_1 = __nccwpck_require__(85671); +Object.defineProperty(exports, "defaultServiceName", ({ enumerable: true, get: function () { return default_service_name_1.defaultServiceName; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 44298: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isPromiseLike = void 0; +const isPromiseLike = (val) => { + return (val !== null && typeof val === 'object' && typeof val.then === 'function'); +}; +exports.isPromiseLike = isPromiseLike; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 79285: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ExportResultCode = void 0; +var ExportResultCode; +(function (ExportResultCode) { + ExportResultCode[ExportResultCode["SUCCESS"] = 0] = "SUCCESS"; + ExportResultCode[ExportResultCode["FAILED"] = 1] = "FAILED"; +})(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {})); +//# sourceMappingURL=ExportResult.js.map + +/***/ }), + +/***/ 15121: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = void 0; +exports.BAGGAGE_KEY_PAIR_SEPARATOR = '='; +exports.BAGGAGE_PROPERTIES_SEPARATOR = ';'; +exports.BAGGAGE_ITEMS_SEPARATOR = ','; +// Name of the http header used to propagate the baggage +exports.BAGGAGE_HEADER = 'baggage'; +// Maximum number of name-value pairs allowed by w3c spec +exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; +// Maximum number of bytes per a single name-value pair allowed by w3c spec +exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; +// Maximum total length of all name-value pairs allowed by w3c spec +exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; +//# sourceMappingURL=constants.js.map + +/***/ }), + +/***/ 46439: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.W3CBaggagePropagator = void 0; +const api_1 = __nccwpck_require__(65163); +const suppress_tracing_1 = __nccwpck_require__(54777); +const constants_1 = __nccwpck_require__(15121); +const utils_1 = __nccwpck_require__(31576); +/** + * Propagates {@link Baggage} through Context format propagation. + * + * Based on the Baggage specification: + * https://w3c.github.io/baggage/ + */ +class W3CBaggagePropagator { + inject(context, carrier, setter) { + const baggage = api_1.propagation.getBaggage(context); + if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context)) + return; + const keyPairs = (0, utils_1.getKeyPairs)(baggage) + .filter((pair) => { + return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; + }) + .slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); + const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); + if (headerValue.length > 0) { + setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); + } + } + extract(context, carrier, getter) { + const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); + const baggageString = Array.isArray(headerValue) + ? headerValue.join(constants_1.BAGGAGE_ITEMS_SEPARATOR) + : headerValue; + if (!baggageString) + return context; + const baggage = {}; + if (baggageString.length === 0) { + return context; + } + const pairs = baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR); + pairs.forEach(entry => { + const keyPair = (0, utils_1.parsePairKeyValue)(entry); + if (keyPair) { + const baggageEntry = { value: keyPair.value }; + if (keyPair.metadata) { + baggageEntry.metadata = keyPair.metadata; + } + baggage[keyPair.key] = baggageEntry; + } + }); + if (Object.entries(baggage).length === 0) { + return context; + } + return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage)); + } + fields() { + return [constants_1.BAGGAGE_HEADER]; + } +} +exports.W3CBaggagePropagator = W3CBaggagePropagator; +//# sourceMappingURL=W3CBaggagePropagator.js.map + +/***/ }), + +/***/ 31576: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const api_1 = __nccwpck_require__(65163); +const constants_1 = __nccwpck_require__(15121); +function serializeKeyPairs(keyPairs) { + return keyPairs.reduce((hValue, current) => { + const value = `${hValue}${hValue !== '' ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ''}${current}`; + return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value; + }, ''); +} +exports.serializeKeyPairs = serializeKeyPairs; +function getKeyPairs(baggage) { + return baggage.getAllEntries().map(([key, value]) => { + let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`; + // include opaque metadata if provided + // NOTE: we intentionally don't URI-encode the metadata - that responsibility falls on the metadata implementation + if (value.metadata !== undefined) { + entry += constants_1.BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString(); + } + return entry; + }); +} +exports.getKeyPairs = getKeyPairs; +function parsePairKeyValue(entry) { + const valueProps = entry.split(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); + if (valueProps.length <= 0) + return; + const keyPairPart = valueProps.shift(); + if (!keyPairPart) + return; + const separatorIndex = keyPairPart.indexOf(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); + if (separatorIndex <= 0) + return; + const key = decodeURIComponent(keyPairPart.substring(0, separatorIndex).trim()); + const value = decodeURIComponent(keyPairPart.substring(separatorIndex + 1).trim()); + let metadata; + if (valueProps.length > 0) { + metadata = (0, api_1.baggageEntryMetadataFromString)(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR)); + } + return { key, value, metadata }; +} +exports.parsePairKeyValue = parsePairKeyValue; +/** + * Parse a string serialized in the baggage HTTP Format (without metadata): + * https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT.md + */ +function parseKeyPairsIntoRecord(value) { + if (typeof value !== 'string' || value.length === 0) + return {}; + return value + .split(constants_1.BAGGAGE_ITEMS_SEPARATOR) + .map(entry => { + return parsePairKeyValue(entry); + }) + .filter(keyPair => keyPair !== undefined && keyPair.value.length > 0) + .reduce((headers, keyPair) => { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + headers[keyPair.key] = keyPair.value; + return headers; + }, {}); +} +exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 46620: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AnchoredClock = void 0; +/** + * A utility for returning wall times anchored to a given point in time. Wall time measurements will + * not be taken from the system, but instead are computed by adding a monotonic clock time + * to the anchor point. + * + * This is needed because the system time can change and result in unexpected situations like + * spans ending before they are started. Creating an anchored clock for each local root span + * ensures that span timings and durations are accurate while preventing span times from drifting + * too far from the system clock. + * + * Only creating an anchored clock once per local trace ensures span times are correct relative + * to each other. For example, a child span will never have a start time before its parent even + * if the system clock is corrected during the local trace. + * + * Heavily inspired by the OTel Java anchored clock + * https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/AnchoredClock.java + */ +class AnchoredClock { + /** + * Create a new AnchoredClock anchored to the current time returned by systemClock. + * + * @param systemClock should be a clock that returns the number of milliseconds since January 1 1970 such as Date + * @param monotonicClock should be a clock that counts milliseconds monotonically such as window.performance or perf_hooks.performance + */ + constructor(systemClock, monotonicClock) { + this._monotonicClock = monotonicClock; + this._epochMillis = systemClock.now(); + this._performanceMillis = monotonicClock.now(); + } + /** + * Returns the current time by adding the number of milliseconds since the + * AnchoredClock was created to the creation epoch time + */ + now() { + const delta = this._monotonicClock.now() - this._performanceMillis; + return this._epochMillis + delta; + } +} +exports.AnchoredClock = AnchoredClock; +//# sourceMappingURL=anchored-clock.js.map + +/***/ }), + +/***/ 14764: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = void 0; +const api_1 = __nccwpck_require__(65163); +function sanitizeAttributes(attributes) { + const out = {}; + if (typeof attributes !== 'object' || attributes == null) { + return out; + } + for (const [key, val] of Object.entries(attributes)) { + if (!isAttributeKey(key)) { + api_1.diag.warn(`Invalid attribute key: ${key}`); + continue; + } + if (!isAttributeValue(val)) { + api_1.diag.warn(`Invalid attribute value set for key: ${key}`); + continue; + } + if (Array.isArray(val)) { + out[key] = val.slice(); + } + else { + out[key] = val; + } + } + return out; +} +exports.sanitizeAttributes = sanitizeAttributes; +function isAttributeKey(key) { + return typeof key === 'string' && key.length > 0; +} +exports.isAttributeKey = isAttributeKey; +function isAttributeValue(val) { + if (val == null) { + return true; + } + if (Array.isArray(val)) { + return isHomogeneousAttributeValueArray(val); + } + return isValidPrimitiveAttributeValue(val); +} +exports.isAttributeValue = isAttributeValue; +function isHomogeneousAttributeValueArray(arr) { + let type; + for (const element of arr) { + // null/undefined elements are allowed + if (element == null) + continue; + if (!type) { + if (isValidPrimitiveAttributeValue(element)) { + type = typeof element; + continue; + } + // encountered an invalid primitive + return false; + } + if (typeof element === type) { + continue; + } + return false; + } + return true; +} +function isValidPrimitiveAttributeValue(val) { + switch (typeof val) { + case 'number': + case 'boolean': + case 'string': + return true; + } + return false; +} +//# sourceMappingURL=attributes.js.map + +/***/ }), + +/***/ 85207: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.globalErrorHandler = exports.setGlobalErrorHandler = void 0; +const logging_error_handler_1 = __nccwpck_require__(27173); +/** The global error handler delegate */ +let delegateHandler = (0, logging_error_handler_1.loggingErrorHandler)(); +/** + * Set the global error handler + * @param {ErrorHandler} handler + */ +function setGlobalErrorHandler(handler) { + delegateHandler = handler; +} +exports.setGlobalErrorHandler = setGlobalErrorHandler; +/** + * Return the global error handler + * @param {Exception} ex + */ +function globalErrorHandler(ex) { + try { + delegateHandler(ex); + } + catch (_a) { } // eslint-disable-line no-empty +} +exports.globalErrorHandler = globalErrorHandler; +//# sourceMappingURL=global-error-handler.js.map + +/***/ }), + +/***/ 78799: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.hexToBinary = void 0; +function intValue(charCode) { + // 0-9 + if (charCode >= 48 && charCode <= 57) { + return charCode - 48; + } + // a-f + if (charCode >= 97 && charCode <= 102) { + return charCode - 87; + } + // A-F + return charCode - 55; +} +function hexToBinary(hexStr) { + const buf = new Uint8Array(hexStr.length / 2); + let offset = 0; + for (let i = 0; i < hexStr.length; i += 2) { + const hi = intValue(hexStr.charCodeAt(i)); + const lo = intValue(hexStr.charCodeAt(i + 1)); + buf[offset++] = (hi << 4) | lo; + } + return buf; +} +exports.hexToBinary = hexToBinary; +//# sourceMappingURL=hex-to-binary.js.map + +/***/ }), + +/***/ 27173: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.loggingErrorHandler = void 0; +const api_1 = __nccwpck_require__(65163); +/** + * Returns a function that logs an error using the provided logger, or a + * console logger if one was not provided. + */ +function loggingErrorHandler() { + return (ex) => { + api_1.diag.error(stringifyException(ex)); + }; +} +exports.loggingErrorHandler = loggingErrorHandler; +/** + * Converts an exception into a string representation + * @param {Exception} ex + */ +function stringifyException(ex) { + if (typeof ex === 'string') { + return ex; + } + else { + return JSON.stringify(flattenException(ex)); + } +} +/** + * Flattens an exception into key-value pairs by traversing the prototype chain + * and coercing values to strings. Duplicate properties will not be overwritten; + * the first insert wins. + */ +function flattenException(ex) { + const result = {}; + let current = ex; + while (current !== null) { + Object.getOwnPropertyNames(current).forEach(propertyName => { + if (result[propertyName]) + return; + const value = current[propertyName]; + if (value) { + result[propertyName] = String(value); + } + }); + current = Object.getPrototypeOf(current); + } + return result; +} +//# sourceMappingURL=logging-error-handler.js.map + +/***/ }), + +/***/ 45604: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.addHrTimes = exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = exports.getTimeOrigin = exports.millisToHrTime = void 0; +const platform_1 = __nccwpck_require__(3887); +const NANOSECOND_DIGITS = 9; +const NANOSECOND_DIGITS_IN_MILLIS = 6; +const MILLISECONDS_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS); +const SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); +/** + * Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]). + * @param epochMillis + */ +function millisToHrTime(epochMillis) { + const epochSeconds = epochMillis / 1000; + // Decimals only. + const seconds = Math.trunc(epochSeconds); + // Round sub-nanosecond accuracy to nanosecond. + const nanos = Math.round((epochMillis % 1000) * MILLISECONDS_TO_NANOSECONDS); + return [seconds, nanos]; +} +exports.millisToHrTime = millisToHrTime; +function getTimeOrigin() { + let timeOrigin = platform_1.otperformance.timeOrigin; + if (typeof timeOrigin !== 'number') { + const perf = platform_1.otperformance; + timeOrigin = perf.timing && perf.timing.fetchStart; + } + return timeOrigin; +} +exports.getTimeOrigin = getTimeOrigin; +/** + * Returns an hrtime calculated via performance component. + * @param performanceNow + */ +function hrTime(performanceNow) { + const timeOrigin = millisToHrTime(getTimeOrigin()); + const now = millisToHrTime(typeof performanceNow === 'number' ? performanceNow : platform_1.otperformance.now()); + return addHrTimes(timeOrigin, now); +} +exports.hrTime = hrTime; +/** + * + * Converts a TimeInput to an HrTime, defaults to _hrtime(). + * @param time + */ +function timeInputToHrTime(time) { + // process.hrtime + if (isTimeInputHrTime(time)) { + return time; + } + else if (typeof time === 'number') { + // Must be a performance.now() if it's smaller than process start time. + if (time < getTimeOrigin()) { + return hrTime(time); + } + else { + // epoch milliseconds or performance.timeOrigin + return millisToHrTime(time); + } + } + else if (time instanceof Date) { + return millisToHrTime(time.getTime()); + } + else { + throw TypeError('Invalid input type'); + } +} +exports.timeInputToHrTime = timeInputToHrTime; +/** + * Returns a duration of two hrTime. + * @param startTime + * @param endTime + */ +function hrTimeDuration(startTime, endTime) { + let seconds = endTime[0] - startTime[0]; + let nanos = endTime[1] - startTime[1]; + // overflow + if (nanos < 0) { + seconds -= 1; + // negate + nanos += SECOND_TO_NANOSECONDS; + } + return [seconds, nanos]; +} +exports.hrTimeDuration = hrTimeDuration; +/** + * Convert hrTime to timestamp, for example "2019-05-14T17:00:00.000123456Z" + * @param time + */ +function hrTimeToTimeStamp(time) { + const precision = NANOSECOND_DIGITS; + const tmp = `${'0'.repeat(precision)}${time[1]}Z`; + const nanoString = tmp.substring(tmp.length - precision - 1); + const date = new Date(time[0] * 1000).toISOString(); + return date.replace('000Z', nanoString); +} +exports.hrTimeToTimeStamp = hrTimeToTimeStamp; +/** + * Convert hrTime to nanoseconds. + * @param time + */ +function hrTimeToNanoseconds(time) { + return time[0] * SECOND_TO_NANOSECONDS + time[1]; +} +exports.hrTimeToNanoseconds = hrTimeToNanoseconds; +/** + * Convert hrTime to milliseconds. + * @param time + */ +function hrTimeToMilliseconds(time) { + return time[0] * 1e3 + time[1] / 1e6; +} +exports.hrTimeToMilliseconds = hrTimeToMilliseconds; +/** + * Convert hrTime to microseconds. + * @param time + */ +function hrTimeToMicroseconds(time) { + return time[0] * 1e6 + time[1] / 1e3; +} +exports.hrTimeToMicroseconds = hrTimeToMicroseconds; +/** + * check if time is HrTime + * @param value + */ +function isTimeInputHrTime(value) { + return (Array.isArray(value) && + value.length === 2 && + typeof value[0] === 'number' && + typeof value[1] === 'number'); +} +exports.isTimeInputHrTime = isTimeInputHrTime; +/** + * check if input value is a correct types.TimeInput + * @param value + */ +function isTimeInput(value) { + return (isTimeInputHrTime(value) || + typeof value === 'number' || + value instanceof Date); +} +exports.isTimeInput = isTimeInput; +/** + * Given 2 HrTime formatted times, return their sum as an HrTime. + */ +function addHrTimes(time1, time2) { + const out = [time1[0] + time2[0], time1[1] + time2[1]]; + // Nanoseconds + if (out[1] >= SECOND_TO_NANOSECONDS) { + out[1] -= SECOND_TO_NANOSECONDS; + out[0] += 1; + } + return out; +} +exports.addHrTimes = addHrTimes; +//# sourceMappingURL=time.js.map + +/***/ }), + +/***/ 98156: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.unrefTimer = exports.otperformance = exports.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = exports.baggageUtils = exports.ExportResultCode = exports.hexToBinary = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.isAttributeKey = exports.AnchoredClock = exports.W3CBaggagePropagator = void 0; +exports.internal = exports.VERSION = exports.BindOnceFuture = exports.isWrapped = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.TracesSamplerValues = exports.merge = exports.parseEnvironment = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ENVIRONMENT = void 0; +var W3CBaggagePropagator_1 = __nccwpck_require__(46439); +Object.defineProperty(exports, "W3CBaggagePropagator", ({ enumerable: true, get: function () { return W3CBaggagePropagator_1.W3CBaggagePropagator; } })); +var anchored_clock_1 = __nccwpck_require__(46620); +Object.defineProperty(exports, "AnchoredClock", ({ enumerable: true, get: function () { return anchored_clock_1.AnchoredClock; } })); +var attributes_1 = __nccwpck_require__(14764); +Object.defineProperty(exports, "isAttributeKey", ({ enumerable: true, get: function () { return attributes_1.isAttributeKey; } })); +Object.defineProperty(exports, "isAttributeValue", ({ enumerable: true, get: function () { return attributes_1.isAttributeValue; } })); +Object.defineProperty(exports, "sanitizeAttributes", ({ enumerable: true, get: function () { return attributes_1.sanitizeAttributes; } })); +var global_error_handler_1 = __nccwpck_require__(85207); +Object.defineProperty(exports, "globalErrorHandler", ({ enumerable: true, get: function () { return global_error_handler_1.globalErrorHandler; } })); +Object.defineProperty(exports, "setGlobalErrorHandler", ({ enumerable: true, get: function () { return global_error_handler_1.setGlobalErrorHandler; } })); +var logging_error_handler_1 = __nccwpck_require__(27173); +Object.defineProperty(exports, "loggingErrorHandler", ({ enumerable: true, get: function () { return logging_error_handler_1.loggingErrorHandler; } })); +var time_1 = __nccwpck_require__(45604); +Object.defineProperty(exports, "addHrTimes", ({ enumerable: true, get: function () { return time_1.addHrTimes; } })); +Object.defineProperty(exports, "getTimeOrigin", ({ enumerable: true, get: function () { return time_1.getTimeOrigin; } })); +Object.defineProperty(exports, "hrTime", ({ enumerable: true, get: function () { return time_1.hrTime; } })); +Object.defineProperty(exports, "hrTimeDuration", ({ enumerable: true, get: function () { return time_1.hrTimeDuration; } })); +Object.defineProperty(exports, "hrTimeToMicroseconds", ({ enumerable: true, get: function () { return time_1.hrTimeToMicroseconds; } })); +Object.defineProperty(exports, "hrTimeToMilliseconds", ({ enumerable: true, get: function () { return time_1.hrTimeToMilliseconds; } })); +Object.defineProperty(exports, "hrTimeToNanoseconds", ({ enumerable: true, get: function () { return time_1.hrTimeToNanoseconds; } })); +Object.defineProperty(exports, "hrTimeToTimeStamp", ({ enumerable: true, get: function () { return time_1.hrTimeToTimeStamp; } })); +Object.defineProperty(exports, "isTimeInput", ({ enumerable: true, get: function () { return time_1.isTimeInput; } })); +Object.defineProperty(exports, "isTimeInputHrTime", ({ enumerable: true, get: function () { return time_1.isTimeInputHrTime; } })); +Object.defineProperty(exports, "millisToHrTime", ({ enumerable: true, get: function () { return time_1.millisToHrTime; } })); +Object.defineProperty(exports, "timeInputToHrTime", ({ enumerable: true, get: function () { return time_1.timeInputToHrTime; } })); +var hex_to_binary_1 = __nccwpck_require__(78799); +Object.defineProperty(exports, "hexToBinary", ({ enumerable: true, get: function () { return hex_to_binary_1.hexToBinary; } })); +var ExportResult_1 = __nccwpck_require__(79285); +Object.defineProperty(exports, "ExportResultCode", ({ enumerable: true, get: function () { return ExportResult_1.ExportResultCode; } })); +const utils_1 = __nccwpck_require__(31576); +exports.baggageUtils = { + getKeyPairs: utils_1.getKeyPairs, + serializeKeyPairs: utils_1.serializeKeyPairs, + parseKeyPairsIntoRecord: utils_1.parseKeyPairsIntoRecord, + parsePairKeyValue: utils_1.parsePairKeyValue, +}; +var platform_1 = __nccwpck_require__(3887); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return platform_1.RandomIdGenerator; } })); +Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return platform_1.SDK_INFO; } })); +Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return platform_1._globalThis; } })); +Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return platform_1.getEnv; } })); +Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return platform_1.getEnvWithoutDefaults; } })); +Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return platform_1.hexToBase64; } })); +Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return platform_1.otperformance; } })); +Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return platform_1.unrefTimer; } })); +var composite_1 = __nccwpck_require__(24627); +Object.defineProperty(exports, "CompositePropagator", ({ enumerable: true, get: function () { return composite_1.CompositePropagator; } })); +var W3CTraceContextPropagator_1 = __nccwpck_require__(93280); +Object.defineProperty(exports, "TRACE_PARENT_HEADER", ({ enumerable: true, get: function () { return W3CTraceContextPropagator_1.TRACE_PARENT_HEADER; } })); +Object.defineProperty(exports, "TRACE_STATE_HEADER", ({ enumerable: true, get: function () { return W3CTraceContextPropagator_1.TRACE_STATE_HEADER; } })); +Object.defineProperty(exports, "W3CTraceContextPropagator", ({ enumerable: true, get: function () { return W3CTraceContextPropagator_1.W3CTraceContextPropagator; } })); +Object.defineProperty(exports, "parseTraceParent", ({ enumerable: true, get: function () { return W3CTraceContextPropagator_1.parseTraceParent; } })); +var rpc_metadata_1 = __nccwpck_require__(91787); +Object.defineProperty(exports, "RPCType", ({ enumerable: true, get: function () { return rpc_metadata_1.RPCType; } })); +Object.defineProperty(exports, "deleteRPCMetadata", ({ enumerable: true, get: function () { return rpc_metadata_1.deleteRPCMetadata; } })); +Object.defineProperty(exports, "getRPCMetadata", ({ enumerable: true, get: function () { return rpc_metadata_1.getRPCMetadata; } })); +Object.defineProperty(exports, "setRPCMetadata", ({ enumerable: true, get: function () { return rpc_metadata_1.setRPCMetadata; } })); +var AlwaysOffSampler_1 = __nccwpck_require__(8204); +Object.defineProperty(exports, "AlwaysOffSampler", ({ enumerable: true, get: function () { return AlwaysOffSampler_1.AlwaysOffSampler; } })); +var AlwaysOnSampler_1 = __nccwpck_require__(81598); +Object.defineProperty(exports, "AlwaysOnSampler", ({ enumerable: true, get: function () { return AlwaysOnSampler_1.AlwaysOnSampler; } })); +var ParentBasedSampler_1 = __nccwpck_require__(7291); +Object.defineProperty(exports, "ParentBasedSampler", ({ enumerable: true, get: function () { return ParentBasedSampler_1.ParentBasedSampler; } })); +var TraceIdRatioBasedSampler_1 = __nccwpck_require__(17973); +Object.defineProperty(exports, "TraceIdRatioBasedSampler", ({ enumerable: true, get: function () { return TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler; } })); +var suppress_tracing_1 = __nccwpck_require__(54777); +Object.defineProperty(exports, "isTracingSuppressed", ({ enumerable: true, get: function () { return suppress_tracing_1.isTracingSuppressed; } })); +Object.defineProperty(exports, "suppressTracing", ({ enumerable: true, get: function () { return suppress_tracing_1.suppressTracing; } })); +Object.defineProperty(exports, "unsuppressTracing", ({ enumerable: true, get: function () { return suppress_tracing_1.unsuppressTracing; } })); +var TraceState_1 = __nccwpck_require__(87297); +Object.defineProperty(exports, "TraceState", ({ enumerable: true, get: function () { return TraceState_1.TraceState; } })); +var environment_1 = __nccwpck_require__(50157); +Object.defineProperty(exports, "DEFAULT_ATTRIBUTE_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ATTRIBUTE_COUNT_LIMIT; } })); +Object.defineProperty(exports, "DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; } })); +Object.defineProperty(exports, "DEFAULT_ENVIRONMENT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ENVIRONMENT; } })); +Object.defineProperty(exports, "DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT; } })); +Object.defineProperty(exports, "DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT; } })); +Object.defineProperty(exports, "parseEnvironment", ({ enumerable: true, get: function () { return environment_1.parseEnvironment; } })); +var merge_1 = __nccwpck_require__(60317); +Object.defineProperty(exports, "merge", ({ enumerable: true, get: function () { return merge_1.merge; } })); +var sampling_1 = __nccwpck_require__(18963); +Object.defineProperty(exports, "TracesSamplerValues", ({ enumerable: true, get: function () { return sampling_1.TracesSamplerValues; } })); +var timeout_1 = __nccwpck_require__(39223); +Object.defineProperty(exports, "TimeoutError", ({ enumerable: true, get: function () { return timeout_1.TimeoutError; } })); +Object.defineProperty(exports, "callWithTimeout", ({ enumerable: true, get: function () { return timeout_1.callWithTimeout; } })); +var url_1 = __nccwpck_require__(17839); +Object.defineProperty(exports, "isUrlIgnored", ({ enumerable: true, get: function () { return url_1.isUrlIgnored; } })); +Object.defineProperty(exports, "urlMatches", ({ enumerable: true, get: function () { return url_1.urlMatches; } })); +var wrap_1 = __nccwpck_require__(46644); +Object.defineProperty(exports, "isWrapped", ({ enumerable: true, get: function () { return wrap_1.isWrapped; } })); +var callback_1 = __nccwpck_require__(57297); +Object.defineProperty(exports, "BindOnceFuture", ({ enumerable: true, get: function () { return callback_1.BindOnceFuture; } })); +var version_1 = __nccwpck_require__(12421); +Object.defineProperty(exports, "VERSION", ({ enumerable: true, get: function () { return version_1.VERSION; } })); +const exporter_1 = __nccwpck_require__(5786); +exports.internal = { + _export: exporter_1._export, +}; +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 5786: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._export = void 0; +const api_1 = __nccwpck_require__(65163); +const suppress_tracing_1 = __nccwpck_require__(54777); +/** + * @internal + * Shared functionality used by Exporters while exporting data, including suppression of Traces. + */ +function _export(exporter, arg) { + return new Promise(resolve => { + // prevent downstream exporter calls from generating spans + api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { + exporter.export(arg, (result) => { + resolve(result); + }); + }); + }); +} +exports._export = _export; +//# sourceMappingURL=exporter.js.map + +/***/ }), + +/***/ 54107: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.validateValue = exports.validateKey = void 0; +const VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]'; +const VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; +const VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; +const VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); +const VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; +const INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; +/** + * Key is opaque string up to 256 characters printable. It MUST begin with a + * lowercase letter, and can only contain lowercase letters a-z, digits 0-9, + * underscores _, dashes -, asterisks *, and forward slashes /. + * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the + * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key. + * see https://www.w3.org/TR/trace-context/#key + */ +function validateKey(key) { + return VALID_KEY_REGEX.test(key); +} +exports.validateKey = validateKey; +/** + * Value is opaque string up to 256 characters printable ASCII RFC0020 + * characters (i.e., the range 0x20 to 0x7E) except comma , and =. + */ +function validateValue(value) { + return (VALID_VALUE_BASE_REGEX.test(value) && + !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value)); +} +exports.validateValue = validateValue; +//# sourceMappingURL=validators.js.map + +/***/ }), + +/***/ 3887: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.unrefTimer = exports.otperformance = exports.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var node_1 = __nccwpck_require__(83021); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return node_1.RandomIdGenerator; } })); +Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return node_1.SDK_INFO; } })); +Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return node_1._globalThis; } })); +Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return node_1.getEnv; } })); +Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return node_1.getEnvWithoutDefaults; } })); +Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return node_1.hexToBase64; } })); +Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return node_1.otperformance; } })); +Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return node_1.unrefTimer; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 10720: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RandomIdGenerator = void 0; +const SPAN_ID_BYTES = 8; +const TRACE_ID_BYTES = 16; +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + */ +class RandomIdGenerator { + constructor() { + /** + * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex + * characters corresponding to 128 bits. + */ + this.generateTraceId = getIdGenerator(TRACE_ID_BYTES); + /** + * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex + * characters corresponding to 64 bits. + */ + this.generateSpanId = getIdGenerator(SPAN_ID_BYTES); + } +} +exports.RandomIdGenerator = RandomIdGenerator; +const SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES); +function getIdGenerator(bytes) { + return function generateId() { + for (let i = 0; i < bytes / 4; i++) { + // unsigned right shift drops decimal part of the number + // it is required because if a number between 2**32 and 2**32 - 1 is generated, an out of range error is thrown by writeUInt32BE + SHARED_BUFFER.writeUInt32BE((Math.random() * 2 ** 32) >>> 0, i * 4); + } + // If buffer is all 0, set the last byte to 1 to guarantee a valid w3c id is generated + for (let i = 0; i < bytes; i++) { + if (SHARED_BUFFER[i] > 0) { + break; + } + else if (i === bytes - 1) { + SHARED_BUFFER[bytes - 1] = 1; + } + } + return SHARED_BUFFER.toString('hex', 0, bytes); + }; +} +//# sourceMappingURL=RandomIdGenerator.js.map + +/***/ }), + +/***/ 1518: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getEnvWithoutDefaults = exports.getEnv = void 0; +const environment_1 = __nccwpck_require__(50157); +/** + * Gets the environment variables + */ +function getEnv() { + const processEnv = (0, environment_1.parseEnvironment)(process.env); + return Object.assign({}, environment_1.DEFAULT_ENVIRONMENT, processEnv); +} +exports.getEnv = getEnv; +function getEnvWithoutDefaults() { + return (0, environment_1.parseEnvironment)(process.env); +} +exports.getEnvWithoutDefaults = getEnvWithoutDefaults; +//# sourceMappingURL=environment.js.map + +/***/ }), + +/***/ 71595: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._globalThis = void 0; +/** only globals that common to node and browsers are allowed */ +// eslint-disable-next-line node/no-unsupported-features/es-builtins +exports._globalThis = typeof globalThis === 'object' ? globalThis : global; +//# sourceMappingURL=globalThis.js.map + +/***/ }), + +/***/ 64978: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.hexToBase64 = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const hex_to_binary_1 = __nccwpck_require__(78799); +function hexToBase64(hexStr) { + return Buffer.from((0, hex_to_binary_1.hexToBinary)(hexStr)).toString('base64'); +} +exports.hexToBase64 = hexToBase64; +//# sourceMappingURL=hex-to-base64.js.map + +/***/ }), + +/***/ 83021: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.unrefTimer = exports.SDK_INFO = exports.otperformance = exports.RandomIdGenerator = exports.hexToBase64 = exports._globalThis = exports.getEnv = exports.getEnvWithoutDefaults = void 0; +var environment_1 = __nccwpck_require__(1518); +Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return environment_1.getEnvWithoutDefaults; } })); +Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return environment_1.getEnv; } })); +var globalThis_1 = __nccwpck_require__(71595); +Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return globalThis_1._globalThis; } })); +var hex_to_base64_1 = __nccwpck_require__(64978); +Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return hex_to_base64_1.hexToBase64; } })); +var RandomIdGenerator_1 = __nccwpck_require__(10720); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return RandomIdGenerator_1.RandomIdGenerator; } })); +var performance_1 = __nccwpck_require__(38502); +Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return performance_1.otperformance; } })); +var sdk_info_1 = __nccwpck_require__(16826); +Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return sdk_info_1.SDK_INFO; } })); +var timer_util_1 = __nccwpck_require__(17049); +Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return timer_util_1.unrefTimer; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 38502: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.otperformance = void 0; +const perf_hooks_1 = __nccwpck_require__(4074); +exports.otperformance = perf_hooks_1.performance; +//# sourceMappingURL=performance.js.map + +/***/ }), + +/***/ 16826: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SDK_INFO = void 0; +const version_1 = __nccwpck_require__(12421); +const semantic_conventions_1 = __nccwpck_require__(67275); +/** Constants describing the SDK in use */ +exports.SDK_INFO = { + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME]: 'opentelemetry', + [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'node', + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRYSDKLANGUAGEVALUES_NODEJS, + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_VERSION]: version_1.VERSION, +}; +//# sourceMappingURL=sdk-info.js.map + +/***/ }), + +/***/ 17049: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.unrefTimer = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +function unrefTimer(timer) { + timer.unref(); +} +exports.unrefTimer = unrefTimer; +//# sourceMappingURL=timer-util.js.map + +/***/ }), + +/***/ 24627: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.CompositePropagator = void 0; +const api_1 = __nccwpck_require__(65163); +/** Combines multiple propagators into a single propagator. */ +class CompositePropagator { + /** + * Construct a composite propagator from a list of propagators. + * + * @param [config] Configuration object for composite propagator + */ + constructor(config = {}) { + var _a; + this._propagators = (_a = config.propagators) !== null && _a !== void 0 ? _a : []; + this._fields = Array.from(new Set(this._propagators + // older propagators may not have fields function, null check to be sure + .map(p => (typeof p.fields === 'function' ? p.fields() : [])) + .reduce((x, y) => x.concat(y), []))); + } + /** + * Run each of the configured propagators with the given context and carrier. + * Propagators are run in the order they are configured, so if multiple + * propagators write the same carrier key, the propagator later in the list + * will "win". + * + * @param context Context to inject + * @param carrier Carrier into which context will be injected + */ + inject(context, carrier, setter) { + for (const propagator of this._propagators) { + try { + propagator.inject(context, carrier, setter); + } + catch (err) { + api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); + } + } + } + /** + * Run each of the configured propagators with the given context and carrier. + * Propagators are run in the order they are configured, so if multiple + * propagators write the same context key, the propagator later in the list + * will "win". + * + * @param context Context to add values to + * @param carrier Carrier from which to extract context + */ + extract(context, carrier, getter) { + return this._propagators.reduce((ctx, propagator) => { + try { + return propagator.extract(ctx, carrier, getter); + } + catch (err) { + api_1.diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`); + } + return ctx; + }, context); + } + fields() { + // return a new array so our fields cannot be modified + return this._fields.slice(); + } +} +exports.CompositePropagator = CompositePropagator; +//# sourceMappingURL=composite.js.map + +/***/ }), + +/***/ 87297: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TraceState = void 0; +const validators_1 = __nccwpck_require__(54107); +const MAX_TRACE_STATE_ITEMS = 32; +const MAX_TRACE_STATE_LEN = 512; +const LIST_MEMBERS_SEPARATOR = ','; +const LIST_MEMBER_KEY_VALUE_SPLITTER = '='; +/** + * TraceState must be a class and not a simple object type because of the spec + * requirement (https://www.w3.org/TR/trace-context/#tracestate-field). + * + * Here is the list of allowed mutations: + * - New key-value pair should be added into the beginning of the list + * - The value of any key can be updated. Modified keys MUST be moved to the + * beginning of the list. + */ +class TraceState { + constructor(rawTraceState) { + this._internalState = new Map(); + if (rawTraceState) + this._parse(rawTraceState); + } + set(key, value) { + // TODO: Benchmark the different approaches(map vs list) and + // use the faster one. + const traceState = this._clone(); + if (traceState._internalState.has(key)) { + traceState._internalState.delete(key); + } + traceState._internalState.set(key, value); + return traceState; + } + unset(key) { + const traceState = this._clone(); + traceState._internalState.delete(key); + return traceState; + } + get(key) { + return this._internalState.get(key); + } + serialize() { + return this._keys() + .reduce((agg, key) => { + agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key)); + return agg; + }, []) + .join(LIST_MEMBERS_SEPARATOR); + } + _parse(rawTraceState) { + if (rawTraceState.length > MAX_TRACE_STATE_LEN) + return; + this._internalState = rawTraceState + .split(LIST_MEMBERS_SEPARATOR) + .reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning + .reduce((agg, part) => { + const listMember = part.trim(); // Optional Whitespace (OWS) handling + const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); + if (i !== -1) { + const key = listMember.slice(0, i); + const value = listMember.slice(i + 1, part.length); + if ((0, validators_1.validateKey)(key) && (0, validators_1.validateValue)(value)) { + agg.set(key, value); + } + else { + // TODO: Consider to add warning log + } + } + return agg; + }, new Map()); + // Because of the reverse() requirement, trunc must be done after map is created + if (this._internalState.size > MAX_TRACE_STATE_ITEMS) { + this._internalState = new Map(Array.from(this._internalState.entries()) + .reverse() // Use reverse same as original tracestate parse chain + .slice(0, MAX_TRACE_STATE_ITEMS)); + } + } + _keys() { + return Array.from(this._internalState.keys()).reverse(); + } + _clone() { + const traceState = new TraceState(); + traceState._internalState = new Map(this._internalState); + return traceState; + } +} +exports.TraceState = TraceState; +//# sourceMappingURL=TraceState.js.map + +/***/ }), + +/***/ 93280: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0; +const api_1 = __nccwpck_require__(65163); +const suppress_tracing_1 = __nccwpck_require__(54777); +const TraceState_1 = __nccwpck_require__(87297); +exports.TRACE_PARENT_HEADER = 'traceparent'; +exports.TRACE_STATE_HEADER = 'tracestate'; +const VERSION = '00'; +const VERSION_PART = '(?!ff)[\\da-f]{2}'; +const TRACE_ID_PART = '(?![0]{32})[\\da-f]{32}'; +const PARENT_ID_PART = '(?![0]{16})[\\da-f]{16}'; +const FLAGS_PART = '[\\da-f]{2}'; +const TRACE_PARENT_REGEX = new RegExp(`^\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\s?$`); +/** + * Parses information from the [traceparent] span tag and converts it into {@link SpanContext} + * @param traceParent - A meta property that comes from server. + * It should be dynamically generated server side to have the server's request trace Id, + * a parent span Id that was set on the server's request span, + * and the trace flags to indicate the server's sampling decision + * (01 = sampled, 00 = not sampled). + * for example: '{version}-{traceId}-{spanId}-{sampleDecision}' + * For more information see {@link https://www.w3.org/TR/trace-context/} + */ +function parseTraceParent(traceParent) { + const match = TRACE_PARENT_REGEX.exec(traceParent); + if (!match) + return null; + // According to the specification the implementation should be compatible + // with future versions. If there are more parts, we only reject it if it's using version 00 + // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent + if (match[1] === '00' && match[5]) + return null; + return { + traceId: match[2], + spanId: match[3], + traceFlags: parseInt(match[4], 16), + }; +} +exports.parseTraceParent = parseTraceParent; +/** + * Propagates {@link SpanContext} through Trace Context format propagation. + * + * Based on the Trace Context specification: + * https://www.w3.org/TR/trace-context/ + */ +class W3CTraceContextPropagator { + inject(context, carrier, setter) { + const spanContext = api_1.trace.getSpanContext(context); + if (!spanContext || + (0, suppress_tracing_1.isTracingSuppressed)(context) || + !(0, api_1.isSpanContextValid)(spanContext)) + return; + const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; + setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); + if (spanContext.traceState) { + setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); + } + } + extract(context, carrier, getter) { + const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); + if (!traceParentHeader) + return context; + const traceParent = Array.isArray(traceParentHeader) + ? traceParentHeader[0] + : traceParentHeader; + if (typeof traceParent !== 'string') + return context; + const spanContext = parseTraceParent(traceParent); + if (!spanContext) + return context; + spanContext.isRemote = true; + const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); + if (traceStateHeader) { + // If more than one `tracestate` header is found, we merge them into a + // single header. + const state = Array.isArray(traceStateHeader) + ? traceStateHeader.join(',') + : traceStateHeader; + spanContext.traceState = new TraceState_1.TraceState(typeof state === 'string' ? state : undefined); + } + return api_1.trace.setSpanContext(context, spanContext); + } + fields() { + return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; + } +} +exports.W3CTraceContextPropagator = W3CTraceContextPropagator; +//# sourceMappingURL=W3CTraceContextPropagator.js.map + +/***/ }), + +/***/ 91787: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0; +const api_1 = __nccwpck_require__(65163); +const RPC_METADATA_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key RPC_METADATA'); +var RPCType; +(function (RPCType) { + RPCType["HTTP"] = "http"; +})(RPCType = exports.RPCType || (exports.RPCType = {})); +function setRPCMetadata(context, meta) { + return context.setValue(RPC_METADATA_KEY, meta); +} +exports.setRPCMetadata = setRPCMetadata; +function deleteRPCMetadata(context) { + return context.deleteValue(RPC_METADATA_KEY); +} +exports.deleteRPCMetadata = deleteRPCMetadata; +function getRPCMetadata(context) { + return context.getValue(RPC_METADATA_KEY); +} +exports.getRPCMetadata = getRPCMetadata; +//# sourceMappingURL=rpc-metadata.js.map + +/***/ }), + +/***/ 8204: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AlwaysOffSampler = void 0; +const api_1 = __nccwpck_require__(65163); +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + * Sampler that samples no traces. + */ +class AlwaysOffSampler { + shouldSample() { + return { + decision: api_1.SamplingDecision.NOT_RECORD, + }; + } + toString() { + return 'AlwaysOffSampler'; + } +} +exports.AlwaysOffSampler = AlwaysOffSampler; +//# sourceMappingURL=AlwaysOffSampler.js.map + +/***/ }), + +/***/ 81598: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AlwaysOnSampler = void 0; +const api_1 = __nccwpck_require__(65163); +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + * Sampler that samples all traces. + */ +class AlwaysOnSampler { + shouldSample() { + return { + decision: api_1.SamplingDecision.RECORD_AND_SAMPLED, + }; + } + toString() { + return 'AlwaysOnSampler'; + } +} +exports.AlwaysOnSampler = AlwaysOnSampler; +//# sourceMappingURL=AlwaysOnSampler.js.map + +/***/ }), + +/***/ 7291: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ParentBasedSampler = void 0; +const api_1 = __nccwpck_require__(65163); +const global_error_handler_1 = __nccwpck_require__(85207); +const AlwaysOffSampler_1 = __nccwpck_require__(8204); +const AlwaysOnSampler_1 = __nccwpck_require__(81598); +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + * A composite sampler that either respects the parent span's sampling decision + * or delegates to `delegateSampler` for root spans. + */ +class ParentBasedSampler { + constructor(config) { + var _a, _b, _c, _d; + this._root = config.root; + if (!this._root) { + (0, global_error_handler_1.globalErrorHandler)(new Error('ParentBasedSampler must have a root sampler configured')); + this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); + } + this._remoteParentSampled = + (_a = config.remoteParentSampled) !== null && _a !== void 0 ? _a : new AlwaysOnSampler_1.AlwaysOnSampler(); + this._remoteParentNotSampled = + (_b = config.remoteParentNotSampled) !== null && _b !== void 0 ? _b : new AlwaysOffSampler_1.AlwaysOffSampler(); + this._localParentSampled = + (_c = config.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler_1.AlwaysOnSampler(); + this._localParentNotSampled = + (_d = config.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler_1.AlwaysOffSampler(); + } + shouldSample(context, traceId, spanName, spanKind, attributes, links) { + const parentContext = api_1.trace.getSpanContext(context); + if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) { + return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.isRemote) { + if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { + return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { + return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + toString() { + return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; + } +} +exports.ParentBasedSampler = ParentBasedSampler; +//# sourceMappingURL=ParentBasedSampler.js.map + +/***/ }), + +/***/ 17973: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TraceIdRatioBasedSampler = void 0; +const api_1 = __nccwpck_require__(65163); +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + * Sampler that samples a given fraction of traces based of trace id deterministically. + */ +class TraceIdRatioBasedSampler { + constructor(_ratio = 0) { + this._ratio = _ratio; + this._ratio = this._normalize(_ratio); + this._upperBound = Math.floor(this._ratio * 0xffffffff); + } + shouldSample(context, traceId) { + return { + decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound + ? api_1.SamplingDecision.RECORD_AND_SAMPLED + : api_1.SamplingDecision.NOT_RECORD, + }; + } + toString() { + return `TraceIdRatioBased{${this._ratio}}`; + } + _normalize(ratio) { + if (typeof ratio !== 'number' || isNaN(ratio)) + return 0; + return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio; + } + _accumulate(traceId) { + let accumulation = 0; + for (let i = 0; i < traceId.length / 8; i++) { + const pos = i * 8; + const part = parseInt(traceId.slice(pos, pos + 8), 16); + accumulation = (accumulation ^ part) >>> 0; + } + return accumulation; + } +} +exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; +//# sourceMappingURL=TraceIdRatioBasedSampler.js.map + +/***/ }), + +/***/ 54777: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0; +const api_1 = __nccwpck_require__(65163); +const SUPPRESS_TRACING_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key SUPPRESS_TRACING'); +function suppressTracing(context) { + return context.setValue(SUPPRESS_TRACING_KEY, true); +} +exports.suppressTracing = suppressTracing; +function unsuppressTracing(context) { + return context.deleteValue(SUPPRESS_TRACING_KEY); +} +exports.unsuppressTracing = unsuppressTracing; +function isTracingSuppressed(context) { + return context.getValue(SUPPRESS_TRACING_KEY) === true; +} +exports.isTracingSuppressed = isTracingSuppressed; +//# sourceMappingURL=suppress-tracing.js.map + +/***/ }), + +/***/ 57297: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BindOnceFuture = void 0; +const promise_1 = __nccwpck_require__(7857); +/** + * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked. + */ +class BindOnceFuture { + constructor(_callback, _that) { + this._callback = _callback; + this._that = _that; + this._isCalled = false; + this._deferred = new promise_1.Deferred(); + } + get isCalled() { + return this._isCalled; + } + get promise() { + return this._deferred.promise; + } + call(...args) { + if (!this._isCalled) { + this._isCalled = true; + try { + Promise.resolve(this._callback.call(this._that, ...args)).then(val => this._deferred.resolve(val), err => this._deferred.reject(err)); + } + catch (err) { + this._deferred.reject(err); + } + } + return this._deferred.promise; + } +} +exports.BindOnceFuture = BindOnceFuture; +//# sourceMappingURL=callback.js.map + +/***/ }), + +/***/ 50157: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseEnvironment = exports.DEFAULT_ENVIRONMENT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = void 0; +const api_1 = __nccwpck_require__(65163); +const sampling_1 = __nccwpck_require__(18963); +const DEFAULT_LIST_SEPARATOR = ','; +/** + * Environment interface to define all names + */ +const ENVIRONMENT_BOOLEAN_KEYS = ['OTEL_SDK_DISABLED']; +function isEnvVarABoolean(key) { + return (ENVIRONMENT_BOOLEAN_KEYS.indexOf(key) > -1); +} +const ENVIRONMENT_NUMBERS_KEYS = [ + 'OTEL_BSP_EXPORT_TIMEOUT', + 'OTEL_BSP_MAX_EXPORT_BATCH_SIZE', + 'OTEL_BSP_MAX_QUEUE_SIZE', + 'OTEL_BSP_SCHEDULE_DELAY', + 'OTEL_BLRP_EXPORT_TIMEOUT', + 'OTEL_BLRP_MAX_EXPORT_BATCH_SIZE', + 'OTEL_BLRP_MAX_QUEUE_SIZE', + 'OTEL_BLRP_SCHEDULE_DELAY', + 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT', + 'OTEL_ATTRIBUTE_COUNT_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT', + 'OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT', + 'OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT', + 'OTEL_SPAN_EVENT_COUNT_LIMIT', + 'OTEL_SPAN_LINK_COUNT_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT', + 'OTEL_EXPORTER_OTLP_TIMEOUT', + 'OTEL_EXPORTER_OTLP_TRACES_TIMEOUT', + 'OTEL_EXPORTER_OTLP_METRICS_TIMEOUT', + 'OTEL_EXPORTER_OTLP_LOGS_TIMEOUT', + 'OTEL_EXPORTER_JAEGER_AGENT_PORT', +]; +function isEnvVarANumber(key) { + return (ENVIRONMENT_NUMBERS_KEYS.indexOf(key) > -1); +} +const ENVIRONMENT_LISTS_KEYS = [ + 'OTEL_NO_PATCH_MODULES', + 'OTEL_PROPAGATORS', + 'OTEL_SEMCONV_STABILITY_OPT_IN', +]; +function isEnvVarAList(key) { + return ENVIRONMENT_LISTS_KEYS.indexOf(key) > -1; +} +exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity; +exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128; +exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = 128; +exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = 128; +/** + * Default environment variables + */ +exports.DEFAULT_ENVIRONMENT = { + OTEL_SDK_DISABLED: false, + CONTAINER_NAME: '', + ECS_CONTAINER_METADATA_URI_V4: '', + ECS_CONTAINER_METADATA_URI: '', + HOSTNAME: '', + KUBERNETES_SERVICE_HOST: '', + NAMESPACE: '', + OTEL_BSP_EXPORT_TIMEOUT: 30000, + OTEL_BSP_MAX_EXPORT_BATCH_SIZE: 512, + OTEL_BSP_MAX_QUEUE_SIZE: 2048, + OTEL_BSP_SCHEDULE_DELAY: 5000, + OTEL_BLRP_EXPORT_TIMEOUT: 30000, + OTEL_BLRP_MAX_EXPORT_BATCH_SIZE: 512, + OTEL_BLRP_MAX_QUEUE_SIZE: 2048, + OTEL_BLRP_SCHEDULE_DELAY: 5000, + OTEL_EXPORTER_JAEGER_AGENT_HOST: '', + OTEL_EXPORTER_JAEGER_AGENT_PORT: 6832, + OTEL_EXPORTER_JAEGER_ENDPOINT: '', + OTEL_EXPORTER_JAEGER_PASSWORD: '', + OTEL_EXPORTER_JAEGER_USER: '', + OTEL_EXPORTER_OTLP_ENDPOINT: '', + OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: '', + OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '', + OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: '', + OTEL_EXPORTER_OTLP_HEADERS: '', + OTEL_EXPORTER_OTLP_TRACES_HEADERS: '', + OTEL_EXPORTER_OTLP_METRICS_HEADERS: '', + OTEL_EXPORTER_OTLP_LOGS_HEADERS: '', + OTEL_EXPORTER_OTLP_TIMEOUT: 10000, + OTEL_EXPORTER_OTLP_TRACES_TIMEOUT: 10000, + OTEL_EXPORTER_OTLP_METRICS_TIMEOUT: 10000, + OTEL_EXPORTER_OTLP_LOGS_TIMEOUT: 10000, + OTEL_EXPORTER_ZIPKIN_ENDPOINT: 'http://localhost:9411/api/v2/spans', + OTEL_LOG_LEVEL: api_1.DiagLogLevel.INFO, + OTEL_NO_PATCH_MODULES: [], + OTEL_PROPAGATORS: ['tracecontext', 'baggage'], + OTEL_RESOURCE_ATTRIBUTES: '', + OTEL_SERVICE_NAME: '', + OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, + OTEL_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, + OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, + OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, + OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, + OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, + OTEL_SPAN_EVENT_COUNT_LIMIT: 128, + OTEL_SPAN_LINK_COUNT_LIMIT: 128, + OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT: exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, + OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT: exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT, + OTEL_TRACES_EXPORTER: '', + OTEL_TRACES_SAMPLER: sampling_1.TracesSamplerValues.ParentBasedAlwaysOn, + OTEL_TRACES_SAMPLER_ARG: '', + OTEL_LOGS_EXPORTER: '', + OTEL_EXPORTER_OTLP_INSECURE: '', + OTEL_EXPORTER_OTLP_TRACES_INSECURE: '', + OTEL_EXPORTER_OTLP_METRICS_INSECURE: '', + OTEL_EXPORTER_OTLP_LOGS_INSECURE: '', + OTEL_EXPORTER_OTLP_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_COMPRESSION: '', + OTEL_EXPORTER_OTLP_TRACES_COMPRESSION: '', + OTEL_EXPORTER_OTLP_METRICS_COMPRESSION: '', + OTEL_EXPORTER_OTLP_LOGS_COMPRESSION: '', + OTEL_EXPORTER_OTLP_CLIENT_KEY: '', + OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY: '', + OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY: '', + OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY: '', + OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_PROTOCOL: 'http/protobuf', + OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: 'http/protobuf', + OTEL_EXPORTER_OTLP_METRICS_PROTOCOL: 'http/protobuf', + OTEL_EXPORTER_OTLP_LOGS_PROTOCOL: 'http/protobuf', + OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE: 'cumulative', + OTEL_SEMCONV_STABILITY_OPT_IN: [], +}; +/** + * @param key + * @param environment + * @param values + */ +function parseBoolean(key, environment, values) { + if (typeof values[key] === 'undefined') { + return; + } + const value = String(values[key]); + // support case-insensitive "true" + environment[key] = value.toLowerCase() === 'true'; +} +/** + * Parses a variable as number with number validation + * @param name + * @param environment + * @param values + * @param min + * @param max + */ +function parseNumber(name, environment, values, min = -Infinity, max = Infinity) { + if (typeof values[name] !== 'undefined') { + const value = Number(values[name]); + if (!isNaN(value)) { + if (value < min) { + environment[name] = min; + } + else if (value > max) { + environment[name] = max; + } + else { + environment[name] = value; + } + } + } +} +/** + * Parses list-like strings from input into output. + * @param name + * @param environment + * @param values + * @param separator + */ +function parseStringList(name, output, input, separator = DEFAULT_LIST_SEPARATOR) { + const givenValue = input[name]; + if (typeof givenValue === 'string') { + output[name] = givenValue.split(separator).map(v => v.trim()); + } +} +// The support string -> DiagLogLevel mappings +const logLevelMap = { + ALL: api_1.DiagLogLevel.ALL, + VERBOSE: api_1.DiagLogLevel.VERBOSE, + DEBUG: api_1.DiagLogLevel.DEBUG, + INFO: api_1.DiagLogLevel.INFO, + WARN: api_1.DiagLogLevel.WARN, + ERROR: api_1.DiagLogLevel.ERROR, + NONE: api_1.DiagLogLevel.NONE, +}; +/** + * Environmentally sets log level if valid log level string is provided + * @param key + * @param environment + * @param values + */ +function setLogLevelFromEnv(key, environment, values) { + const value = values[key]; + if (typeof value === 'string') { + const theLevel = logLevelMap[value.toUpperCase()]; + if (theLevel != null) { + environment[key] = theLevel; + } + } +} +/** + * Parses environment values + * @param values + */ +function parseEnvironment(values) { + const environment = {}; + for (const env in exports.DEFAULT_ENVIRONMENT) { + const key = env; + switch (key) { + case 'OTEL_LOG_LEVEL': + setLogLevelFromEnv(key, environment, values); + break; + default: + if (isEnvVarABoolean(key)) { + parseBoolean(key, environment, values); + } + else if (isEnvVarANumber(key)) { + parseNumber(key, environment, values); + } + else if (isEnvVarAList(key)) { + parseStringList(key, environment, values); + } + else { + const value = values[key]; + if (typeof value !== 'undefined' && value !== null) { + environment[key] = String(value); + } + } + } + } + return environment; +} +exports.parseEnvironment = parseEnvironment; +//# sourceMappingURL=environment.js.map + +/***/ }), + +/***/ 55366: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isPlainObject = void 0; +/* eslint-disable @typescript-eslint/no-explicit-any */ +/** + * based on lodash in order to support esm builds without esModuleInterop. + * lodash is using MIT License. + **/ +const objectTag = '[object Object]'; +const nullTag = '[object Null]'; +const undefinedTag = '[object Undefined]'; +const funcProto = Function.prototype; +const funcToString = funcProto.toString; +const objectCtorString = funcToString.call(Object); +const getPrototype = overArg(Object.getPrototypeOf, Object); +const objectProto = Object.prototype; +const hasOwnProperty = objectProto.hasOwnProperty; +const symToStringTag = Symbol ? Symbol.toStringTag : undefined; +const nativeObjectToString = objectProto.toString; +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function (arg) { + return func(transform(arg)); + }; +} +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) !== objectTag) { + return false; + } + const proto = getPrototype(value); + if (proto === null) { + return true; + } + const Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return (typeof Ctor == 'function' && + Ctor instanceof Ctor && + funcToString.call(Ctor) === objectCtorString); +} +exports.isPlainObject = isPlainObject; +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return symToStringTag && symToStringTag in Object(value) + ? getRawTag(value) + : objectToString(value); +} +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; + let unmasked = false; + try { + value[symToStringTag] = undefined; + unmasked = true; + } + catch (e) { + // silence + } + const result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } + else { + delete value[symToStringTag]; + } + } + return result; +} +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} +//# sourceMappingURL=lodash.merge.js.map + +/***/ }), + +/***/ 60317: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.merge = void 0; +/* eslint-disable @typescript-eslint/no-explicit-any */ +const lodash_merge_1 = __nccwpck_require__(55366); +const MAX_LEVEL = 20; +/** + * Merges objects together + * @param args - objects / values to be merged + */ +function merge(...args) { + let result = args.shift(); + const objects = new WeakMap(); + while (args.length > 0) { + result = mergeTwoObjects(result, args.shift(), 0, objects); + } + return result; +} +exports.merge = merge; +function takeValue(value) { + if (isArray(value)) { + return value.slice(); + } + return value; +} +/** + * Merges two objects + * @param one - first object + * @param two - second object + * @param level - current deep level + * @param objects - objects holder that has been already referenced - to prevent + * cyclic dependency + */ +function mergeTwoObjects(one, two, level = 0, objects) { + let result; + if (level > MAX_LEVEL) { + return undefined; + } + level++; + if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) { + result = takeValue(two); + } + else if (isArray(one)) { + result = one.slice(); + if (isArray(two)) { + for (let i = 0, j = two.length; i < j; i++) { + result.push(takeValue(two[i])); + } + } + else if (isObject(two)) { + const keys = Object.keys(two); + for (let i = 0, j = keys.length; i < j; i++) { + const key = keys[i]; + result[key] = takeValue(two[key]); + } + } + } + else if (isObject(one)) { + if (isObject(two)) { + if (!shouldMerge(one, two)) { + return two; + } + result = Object.assign({}, one); + const keys = Object.keys(two); + for (let i = 0, j = keys.length; i < j; i++) { + const key = keys[i]; + const twoValue = two[key]; + if (isPrimitive(twoValue)) { + if (typeof twoValue === 'undefined') { + delete result[key]; + } + else { + // result[key] = takeValue(twoValue); + result[key] = twoValue; + } + } + else { + const obj1 = result[key]; + const obj2 = twoValue; + if (wasObjectReferenced(one, key, objects) || + wasObjectReferenced(two, key, objects)) { + delete result[key]; + } + else { + if (isObject(obj1) && isObject(obj2)) { + const arr1 = objects.get(obj1) || []; + const arr2 = objects.get(obj2) || []; + arr1.push({ obj: one, key }); + arr2.push({ obj: two, key }); + objects.set(obj1, arr1); + objects.set(obj2, arr2); + } + result[key] = mergeTwoObjects(result[key], twoValue, level, objects); + } + } + } + } + else { + result = two; + } + } + return result; +} +/** + * Function to check if object has been already reference + * @param obj + * @param key + * @param objects + */ +function wasObjectReferenced(obj, key, objects) { + const arr = objects.get(obj[key]) || []; + for (let i = 0, j = arr.length; i < j; i++) { + const info = arr[i]; + if (info.key === key && info.obj === obj) { + return true; + } + } + return false; +} +function isArray(value) { + return Array.isArray(value); +} +function isFunction(value) { + return typeof value === 'function'; +} +function isObject(value) { + return (!isPrimitive(value) && + !isArray(value) && + !isFunction(value) && + typeof value === 'object'); +} +function isPrimitive(value) { + return (typeof value === 'string' || + typeof value === 'number' || + typeof value === 'boolean' || + typeof value === 'undefined' || + value instanceof Date || + value instanceof RegExp || + value === null); +} +function shouldMerge(one, two) { + if (!(0, lodash_merge_1.isPlainObject)(one) || !(0, lodash_merge_1.isPlainObject)(two)) { + return false; + } + return true; +} +//# sourceMappingURL=merge.js.map + +/***/ }), + +/***/ 7857: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Deferred = void 0; +class Deferred { + constructor() { + this._promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + }); + } + get promise() { + return this._promise; + } + resolve(val) { + this._resolve(val); + } + reject(err) { + this._reject(err); + } +} +exports.Deferred = Deferred; +//# sourceMappingURL=promise.js.map + +/***/ }), + +/***/ 18963: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TracesSamplerValues = void 0; +var TracesSamplerValues; +(function (TracesSamplerValues) { + TracesSamplerValues["AlwaysOff"] = "always_off"; + TracesSamplerValues["AlwaysOn"] = "always_on"; + TracesSamplerValues["ParentBasedAlwaysOff"] = "parentbased_always_off"; + TracesSamplerValues["ParentBasedAlwaysOn"] = "parentbased_always_on"; + TracesSamplerValues["ParentBasedTraceIdRatio"] = "parentbased_traceidratio"; + TracesSamplerValues["TraceIdRatio"] = "traceidratio"; +})(TracesSamplerValues = exports.TracesSamplerValues || (exports.TracesSamplerValues = {})); +//# sourceMappingURL=sampling.js.map + +/***/ }), + +/***/ 39223: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.callWithTimeout = exports.TimeoutError = void 0; +/** + * Error that is thrown on timeouts. + */ +class TimeoutError extends Error { + constructor(message) { + super(message); + // manually adjust prototype to retain `instanceof` functionality when targeting ES5, see: + // https://github.com/Microsoft/TypeScript-wiki/blob/main/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work + Object.setPrototypeOf(this, TimeoutError.prototype); + } +} +exports.TimeoutError = TimeoutError; +/** + * Adds a timeout to a promise and rejects if the specified timeout has elapsed. Also rejects if the specified promise + * rejects, and resolves if the specified promise resolves. + * + *

NOTE: this operation will continue even after it throws a {@link TimeoutError}. + * + * @param promise promise to use with timeout. + * @param timeout the timeout in milliseconds until the returned promise is rejected. + */ +function callWithTimeout(promise, timeout) { + let timeoutHandle; + const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { + timeoutHandle = setTimeout(function timeoutHandler() { + reject(new TimeoutError('Operation timed out.')); + }, timeout); + }); + return Promise.race([promise, timeoutPromise]).then(result => { + clearTimeout(timeoutHandle); + return result; + }, reason => { + clearTimeout(timeoutHandle); + throw reason; + }); +} +exports.callWithTimeout = callWithTimeout; +//# sourceMappingURL=timeout.js.map + +/***/ }), + +/***/ 17839: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isUrlIgnored = exports.urlMatches = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +function urlMatches(url, urlToMatch) { + if (typeof urlToMatch === 'string') { + return url === urlToMatch; + } + else { + return !!url.match(urlToMatch); + } +} +exports.urlMatches = urlMatches; +/** + * Check if {@param url} should be ignored when comparing against {@param ignoredUrls} + * @param url + * @param ignoredUrls + */ +function isUrlIgnored(url, ignoredUrls) { + if (!ignoredUrls) { + return false; + } + for (const ignoreUrl of ignoredUrls) { + if (urlMatches(url, ignoreUrl)) { + return true; + } + } + return false; +} +exports.isUrlIgnored = isUrlIgnored; +//# sourceMappingURL=url.js.map + +/***/ }), + +/***/ 46644: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isWrapped = void 0; +/** + * Checks if certain function has been already wrapped + * @param func + */ +function isWrapped(func) { + return (typeof func === 'function' && + typeof func.__original === 'function' && + typeof func.__unwrap === 'function' && + func.__wrapped === true); +} +exports.isWrapped = isWrapped; +//# sourceMappingURL=wrap.js.map + +/***/ }), + +/***/ 12421: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.VERSION = '1.30.1'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 78920: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BasicTracerProvider = exports.ForceFlushState = void 0; +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(56460); +const resources_1 = __nccwpck_require__(3871); +const Tracer_1 = __nccwpck_require__(63806); +const config_1 = __nccwpck_require__(91); +const MultiSpanProcessor_1 = __nccwpck_require__(12352); +const NoopSpanProcessor_1 = __nccwpck_require__(69252); +const platform_1 = __nccwpck_require__(10262); +const utility_1 = __nccwpck_require__(54324); +var ForceFlushState; +(function (ForceFlushState) { + ForceFlushState[ForceFlushState["resolved"] = 0] = "resolved"; + ForceFlushState[ForceFlushState["timeout"] = 1] = "timeout"; + ForceFlushState[ForceFlushState["error"] = 2] = "error"; + ForceFlushState[ForceFlushState["unresolved"] = 3] = "unresolved"; +})(ForceFlushState = exports.ForceFlushState || (exports.ForceFlushState = {})); +/** + * This class represents a basic tracer provider which platform libraries can extend + */ +class BasicTracerProvider { + constructor(config = {}) { + var _a, _b; + this._registeredSpanProcessors = []; + this._tracers = new Map(); + const mergedConfig = (0, core_1.merge)({}, (0, config_1.loadDefaultConfig)(), (0, utility_1.reconfigureLimits)(config)); + this.resource = (_a = mergedConfig.resource) !== null && _a !== void 0 ? _a : resources_1.Resource.empty(); + if (mergedConfig.mergeResourceWithDefaults) { + this.resource = resources_1.Resource.default().merge(this.resource); + } + this._config = Object.assign({}, mergedConfig, { + resource: this.resource, + }); + if ((_b = config.spanProcessors) === null || _b === void 0 ? void 0 : _b.length) { + this._registeredSpanProcessors = [...config.spanProcessors]; + this.activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(this._registeredSpanProcessors); + } + else { + const defaultExporter = this._buildExporterFromEnv(); + if (defaultExporter !== undefined) { + const batchProcessor = new platform_1.BatchSpanProcessor(defaultExporter); + this.activeSpanProcessor = batchProcessor; + } + else { + this.activeSpanProcessor = new NoopSpanProcessor_1.NoopSpanProcessor(); + } + } + } + getTracer(name, version, options) { + const key = `${name}@${version || ''}:${(options === null || options === void 0 ? void 0 : options.schemaUrl) || ''}`; + if (!this._tracers.has(key)) { + this._tracers.set(key, new Tracer_1.Tracer({ name, version, schemaUrl: options === null || options === void 0 ? void 0 : options.schemaUrl }, this._config, this)); + } + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return this._tracers.get(key); + } + /** + * @deprecated please use {@link TracerConfig} spanProcessors property + * Adds a new {@link SpanProcessor} to this tracer. + * @param spanProcessor the new SpanProcessor to be added. + */ + addSpanProcessor(spanProcessor) { + if (this._registeredSpanProcessors.length === 0) { + // since we might have enabled by default a batchProcessor, we disable it + // before adding the new one + this.activeSpanProcessor + .shutdown() + .catch(err => api_1.diag.error('Error while trying to shutdown current span processor', err)); + } + this._registeredSpanProcessors.push(spanProcessor); + this.activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(this._registeredSpanProcessors); + } + getActiveSpanProcessor() { + return this.activeSpanProcessor; + } + /** + * Register this TracerProvider for use with the OpenTelemetry API. + * Undefined values may be replaced with defaults, and + * null values will be skipped. + * + * @param config Configuration object for SDK registration + */ + register(config = {}) { + api_1.trace.setGlobalTracerProvider(this); + if (config.propagator === undefined) { + config.propagator = this._buildPropagatorFromEnv(); + } + if (config.contextManager) { + api_1.context.setGlobalContextManager(config.contextManager); + } + if (config.propagator) { + api_1.propagation.setGlobalPropagator(config.propagator); + } + } + forceFlush() { + const timeout = this._config.forceFlushTimeoutMillis; + const promises = this._registeredSpanProcessors.map((spanProcessor) => { + return new Promise(resolve => { + let state; + const timeoutInterval = setTimeout(() => { + resolve(new Error(`Span processor did not completed within timeout period of ${timeout} ms`)); + state = ForceFlushState.timeout; + }, timeout); + spanProcessor + .forceFlush() + .then(() => { + clearTimeout(timeoutInterval); + if (state !== ForceFlushState.timeout) { + state = ForceFlushState.resolved; + resolve(state); + } + }) + .catch(error => { + clearTimeout(timeoutInterval); + state = ForceFlushState.error; + resolve(error); + }); + }); + }); + return new Promise((resolve, reject) => { + Promise.all(promises) + .then(results => { + const errors = results.filter(result => result !== ForceFlushState.resolved); + if (errors.length > 0) { + reject(errors); + } + else { + resolve(); + } + }) + .catch(error => reject([error])); + }); + } + shutdown() { + return this.activeSpanProcessor.shutdown(); + } + /** + * TS cannot yet infer the type of this.constructor: + * https://github.com/Microsoft/TypeScript/issues/3841#issuecomment-337560146 + * There is no need to override either of the getters in your child class. + * The type of the registered component maps should be the same across all + * classes in the inheritance tree. + */ + _getPropagator(name) { + var _a; + return (_a = this.constructor._registeredPropagators.get(name)) === null || _a === void 0 ? void 0 : _a(); + } + _getSpanExporter(name) { + var _a; + return (_a = this.constructor._registeredExporters.get(name)) === null || _a === void 0 ? void 0 : _a(); + } + _buildPropagatorFromEnv() { + // per spec, propagators from env must be deduplicated + const uniquePropagatorNames = Array.from(new Set((0, core_1.getEnv)().OTEL_PROPAGATORS)); + const propagators = uniquePropagatorNames.map(name => { + const propagator = this._getPropagator(name); + if (!propagator) { + api_1.diag.warn(`Propagator "${name}" requested through environment variable is unavailable.`); + } + return propagator; + }); + const validPropagators = propagators.reduce((list, item) => { + if (item) { + list.push(item); + } + return list; + }, []); + if (validPropagators.length === 0) { + return; + } + else if (uniquePropagatorNames.length === 1) { + return validPropagators[0]; + } + else { + return new core_1.CompositePropagator({ + propagators: validPropagators, + }); + } + } + _buildExporterFromEnv() { + const exporterName = (0, core_1.getEnv)().OTEL_TRACES_EXPORTER; + if (exporterName === 'none' || exporterName === '') + return; + const exporter = this._getSpanExporter(exporterName); + if (!exporter) { + api_1.diag.error(`Exporter "${exporterName}" requested through environment variable is unavailable.`); + } + return exporter; + } +} +exports.BasicTracerProvider = BasicTracerProvider; +BasicTracerProvider._registeredPropagators = new Map([ + ['tracecontext', () => new core_1.W3CTraceContextPropagator()], + ['baggage', () => new core_1.W3CBaggagePropagator()], +]); +BasicTracerProvider._registeredExporters = new Map(); +//# sourceMappingURL=BasicTracerProvider.js.map + +/***/ }), + +/***/ 12352: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MultiSpanProcessor = void 0; +const core_1 = __nccwpck_require__(56460); +/** + * Implementation of the {@link SpanProcessor} that simply forwards all + * received events to a list of {@link SpanProcessor}s. + */ +class MultiSpanProcessor { + constructor(_spanProcessors) { + this._spanProcessors = _spanProcessors; + } + forceFlush() { + const promises = []; + for (const spanProcessor of this._spanProcessors) { + promises.push(spanProcessor.forceFlush()); + } + return new Promise(resolve => { + Promise.all(promises) + .then(() => { + resolve(); + }) + .catch(error => { + (0, core_1.globalErrorHandler)(error || new Error('MultiSpanProcessor: forceFlush failed')); + resolve(); + }); + }); + } + onStart(span, context) { + for (const spanProcessor of this._spanProcessors) { + spanProcessor.onStart(span, context); + } + } + onEnd(span) { + for (const spanProcessor of this._spanProcessors) { + spanProcessor.onEnd(span); + } + } + shutdown() { + const promises = []; + for (const spanProcessor of this._spanProcessors) { + promises.push(spanProcessor.shutdown()); + } + return new Promise((resolve, reject) => { + Promise.all(promises).then(() => { + resolve(); + }, reject); + }); + } +} +exports.MultiSpanProcessor = MultiSpanProcessor; +//# sourceMappingURL=MultiSpanProcessor.js.map + +/***/ }), + +/***/ 17446: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SamplingDecision = void 0; +/** + * A sampling decision that determines how a {@link Span} will be recorded + * and collected. + */ +var SamplingDecision; +(function (SamplingDecision) { + /** + * `Span.isRecording() === false`, span will not be recorded and all events + * and attributes will be dropped. + */ + SamplingDecision[SamplingDecision["NOT_RECORD"] = 0] = "NOT_RECORD"; + /** + * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags} + * MUST NOT be set. + */ + SamplingDecision[SamplingDecision["RECORD"] = 1] = "RECORD"; + /** + * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags} + * MUST be set. + */ + SamplingDecision[SamplingDecision["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; +})(SamplingDecision = exports.SamplingDecision || (exports.SamplingDecision = {})); +//# sourceMappingURL=Sampler.js.map + +/***/ }), + +/***/ 61301: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Span = void 0; +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(56460); +const semantic_conventions_1 = __nccwpck_require__(67275); +const enums_1 = __nccwpck_require__(35092); +/** + * This class represents a span. + */ +class Span { + /** + * Constructs a new Span instance. + * + * @deprecated calling Span constructor directly is not supported. Please use tracer.startSpan. + * */ + constructor(parentTracer, context, spanName, spanContext, kind, parentSpanId, links = [], startTime, _deprecatedClock, // keeping this argument even though it is unused to ensure backwards compatibility + attributes) { + this.attributes = {}; + this.links = []; + this.events = []; + this._droppedAttributesCount = 0; + this._droppedEventsCount = 0; + this._droppedLinksCount = 0; + this.status = { + code: api_1.SpanStatusCode.UNSET, + }; + this.endTime = [0, 0]; + this._ended = false; + this._duration = [-1, -1]; + this.name = spanName; + this._spanContext = spanContext; + this.parentSpanId = parentSpanId; + this.kind = kind; + this.links = links; + const now = Date.now(); + this._performanceStartTime = core_1.otperformance.now(); + this._performanceOffset = + now - (this._performanceStartTime + (0, core_1.getTimeOrigin)()); + this._startTimeProvided = startTime != null; + this.startTime = this._getTime(startTime !== null && startTime !== void 0 ? startTime : now); + this.resource = parentTracer.resource; + this.instrumentationLibrary = parentTracer.instrumentationLibrary; + this._spanLimits = parentTracer.getSpanLimits(); + this._attributeValueLengthLimit = + this._spanLimits.attributeValueLengthLimit || 0; + if (attributes != null) { + this.setAttributes(attributes); + } + this._spanProcessor = parentTracer.getActiveSpanProcessor(); + this._spanProcessor.onStart(this, context); + } + spanContext() { + return this._spanContext; + } + setAttribute(key, value) { + if (value == null || this._isSpanEnded()) + return this; + if (key.length === 0) { + api_1.diag.warn(`Invalid attribute key: ${key}`); + return this; + } + if (!(0, core_1.isAttributeValue)(value)) { + api_1.diag.warn(`Invalid attribute value set for key: ${key}`); + return this; + } + if (Object.keys(this.attributes).length >= + this._spanLimits.attributeCountLimit && + !Object.prototype.hasOwnProperty.call(this.attributes, key)) { + this._droppedAttributesCount++; + return this; + } + this.attributes[key] = this._truncateToSize(value); + return this; + } + setAttributes(attributes) { + for (const [k, v] of Object.entries(attributes)) { + this.setAttribute(k, v); + } + return this; + } + /** + * + * @param name Span Name + * @param [attributesOrStartTime] Span attributes or start time + * if type is {@type TimeInput} and 3rd param is undefined + * @param [timeStamp] Specified time stamp for the event + */ + addEvent(name, attributesOrStartTime, timeStamp) { + if (this._isSpanEnded()) + return this; + if (this._spanLimits.eventCountLimit === 0) { + api_1.diag.warn('No events allowed.'); + this._droppedEventsCount++; + return this; + } + if (this.events.length >= this._spanLimits.eventCountLimit) { + if (this._droppedEventsCount === 0) { + api_1.diag.debug('Dropping extra events.'); + } + this.events.shift(); + this._droppedEventsCount++; + } + if ((0, core_1.isTimeInput)(attributesOrStartTime)) { + if (!(0, core_1.isTimeInput)(timeStamp)) { + timeStamp = attributesOrStartTime; + } + attributesOrStartTime = undefined; + } + const attributes = (0, core_1.sanitizeAttributes)(attributesOrStartTime); + this.events.push({ + name, + attributes, + time: this._getTime(timeStamp), + droppedAttributesCount: 0, + }); + return this; + } + addLink(link) { + this.links.push(link); + return this; + } + addLinks(links) { + this.links.push(...links); + return this; + } + setStatus(status) { + if (this._isSpanEnded()) + return this; + this.status = Object.assign({}, status); + // When using try-catch, the caught "error" is of type `any`. When then assigning `any` to `status.message`, + // TypeScript will not error. While this can happen during use of any API, it is more common on Span#setStatus() + // as it's likely used in a catch-block. Therefore, we validate if `status.message` is actually a string, null, or + // undefined to avoid an incorrect type causing issues downstream. + if (this.status.message != null && typeof status.message !== 'string') { + api_1.diag.warn(`Dropping invalid status.message of type '${typeof status.message}', expected 'string'`); + delete this.status.message; + } + return this; + } + updateName(name) { + if (this._isSpanEnded()) + return this; + this.name = name; + return this; + } + end(endTime) { + if (this._isSpanEnded()) { + api_1.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`); + return; + } + this._ended = true; + this.endTime = this._getTime(endTime); + this._duration = (0, core_1.hrTimeDuration)(this.startTime, this.endTime); + if (this._duration[0] < 0) { + api_1.diag.warn('Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.', this.startTime, this.endTime); + this.endTime = this.startTime.slice(); + this._duration = [0, 0]; + } + if (this._droppedEventsCount > 0) { + api_1.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`); + } + this._spanProcessor.onEnd(this); + } + _getTime(inp) { + if (typeof inp === 'number' && inp <= core_1.otperformance.now()) { + // must be a performance timestamp + // apply correction and convert to hrtime + return (0, core_1.hrTime)(inp + this._performanceOffset); + } + if (typeof inp === 'number') { + return (0, core_1.millisToHrTime)(inp); + } + if (inp instanceof Date) { + return (0, core_1.millisToHrTime)(inp.getTime()); + } + if ((0, core_1.isTimeInputHrTime)(inp)) { + return inp; + } + if (this._startTimeProvided) { + // if user provided a time for the start manually + // we can't use duration to calculate event/end times + return (0, core_1.millisToHrTime)(Date.now()); + } + const msDuration = core_1.otperformance.now() - this._performanceStartTime; + return (0, core_1.addHrTimes)(this.startTime, (0, core_1.millisToHrTime)(msDuration)); + } + isRecording() { + return this._ended === false; + } + recordException(exception, time) { + const attributes = {}; + if (typeof exception === 'string') { + attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_MESSAGE] = exception; + } + else if (exception) { + if (exception.code) { + attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_TYPE] = exception.code.toString(); + } + else if (exception.name) { + attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_TYPE] = exception.name; + } + if (exception.message) { + attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_MESSAGE] = exception.message; + } + if (exception.stack) { + attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_STACKTRACE] = exception.stack; + } + } + // these are minimum requirements from spec + if (attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_TYPE] || + attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_MESSAGE]) { + this.addEvent(enums_1.ExceptionEventName, attributes, time); + } + else { + api_1.diag.warn(`Failed to record an exception ${exception}`); + } + } + get duration() { + return this._duration; + } + get ended() { + return this._ended; + } + get droppedAttributesCount() { + return this._droppedAttributesCount; + } + get droppedEventsCount() { + return this._droppedEventsCount; + } + get droppedLinksCount() { + return this._droppedLinksCount; + } + _isSpanEnded() { + if (this._ended) { + api_1.diag.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`); + } + return this._ended; + } + // Utility function to truncate given value within size + // for value type of string, will truncate to given limit + // for type of non-string, will return same value + _truncateToLimitUtil(value, limit) { + if (value.length <= limit) { + return value; + } + return value.substring(0, limit); + } + /** + * If the given attribute value is of type string and has more characters than given {@code attributeValueLengthLimit} then + * return string with truncated to {@code attributeValueLengthLimit} characters + * + * If the given attribute value is array of strings then + * return new array of strings with each element truncated to {@code attributeValueLengthLimit} characters + * + * Otherwise return same Attribute {@code value} + * + * @param value Attribute value + * @returns truncated attribute value if required, otherwise same value + */ + _truncateToSize(value) { + const limit = this._attributeValueLengthLimit; + // Check limit + if (limit <= 0) { + // Negative values are invalid, so do not truncate + api_1.diag.warn(`Attribute value limit must be positive, got ${limit}`); + return value; + } + // String + if (typeof value === 'string') { + return this._truncateToLimitUtil(value, limit); + } + // Array of strings + if (Array.isArray(value)) { + return value.map(val => typeof val === 'string' ? this._truncateToLimitUtil(val, limit) : val); + } + // Other types, no need to apply value length limit + return value; + } +} +exports.Span = Span; +//# sourceMappingURL=Span.js.map + +/***/ }), + +/***/ 63806: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Tracer = void 0; +const api = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(56460); +const Span_1 = __nccwpck_require__(61301); +const utility_1 = __nccwpck_require__(54324); +const platform_1 = __nccwpck_require__(10262); +/** + * This class represents a basic tracer. + */ +class Tracer { + /** + * Constructs a new Tracer instance. + */ + constructor(instrumentationLibrary, config, _tracerProvider) { + this._tracerProvider = _tracerProvider; + const localConfig = (0, utility_1.mergeConfig)(config); + this._sampler = localConfig.sampler; + this._generalLimits = localConfig.generalLimits; + this._spanLimits = localConfig.spanLimits; + this._idGenerator = config.idGenerator || new platform_1.RandomIdGenerator(); + this.resource = _tracerProvider.resource; + this.instrumentationLibrary = instrumentationLibrary; + } + /** + * Starts a new Span or returns the default NoopSpan based on the sampling + * decision. + */ + startSpan(name, options = {}, context = api.context.active()) { + var _a, _b, _c; + // remove span from context in case a root span is requested via options + if (options.root) { + context = api.trace.deleteSpan(context); + } + const parentSpan = api.trace.getSpan(context); + if ((0, core_1.isTracingSuppressed)(context)) { + api.diag.debug('Instrumentation suppressed, returning Noop Span'); + const nonRecordingSpan = api.trace.wrapSpanContext(api.INVALID_SPAN_CONTEXT); + return nonRecordingSpan; + } + const parentSpanContext = parentSpan === null || parentSpan === void 0 ? void 0 : parentSpan.spanContext(); + const spanId = this._idGenerator.generateSpanId(); + let traceId; + let traceState; + let parentSpanId; + if (!parentSpanContext || + !api.trace.isSpanContextValid(parentSpanContext)) { + // New root span. + traceId = this._idGenerator.generateTraceId(); + } + else { + // New child span. + traceId = parentSpanContext.traceId; + traceState = parentSpanContext.traceState; + parentSpanId = parentSpanContext.spanId; + } + const spanKind = (_a = options.kind) !== null && _a !== void 0 ? _a : api.SpanKind.INTERNAL; + const links = ((_b = options.links) !== null && _b !== void 0 ? _b : []).map(link => { + return { + context: link.context, + attributes: (0, core_1.sanitizeAttributes)(link.attributes), + }; + }); + const attributes = (0, core_1.sanitizeAttributes)(options.attributes); + // make sampling decision + const samplingResult = this._sampler.shouldSample(context, traceId, name, spanKind, attributes, links); + traceState = (_c = samplingResult.traceState) !== null && _c !== void 0 ? _c : traceState; + const traceFlags = samplingResult.decision === api.SamplingDecision.RECORD_AND_SAMPLED + ? api.TraceFlags.SAMPLED + : api.TraceFlags.NONE; + const spanContext = { traceId, spanId, traceFlags, traceState }; + if (samplingResult.decision === api.SamplingDecision.NOT_RECORD) { + api.diag.debug('Recording is off, propagating context in a non-recording span'); + const nonRecordingSpan = api.trace.wrapSpanContext(spanContext); + return nonRecordingSpan; + } + // Set initial span attributes. The attributes object may have been mutated + // by the sampler, so we sanitize the merged attributes before setting them. + const initAttributes = (0, core_1.sanitizeAttributes)(Object.assign(attributes, samplingResult.attributes)); + const span = new Span_1.Span(this, context, name, spanContext, spanKind, parentSpanId, links, options.startTime, undefined, initAttributes); + return span; + } + startActiveSpan(name, arg2, arg3, arg4) { + let opts; + let ctx; + let fn; + if (arguments.length < 2) { + return; + } + else if (arguments.length === 2) { + fn = arg2; + } + else if (arguments.length === 3) { + opts = arg2; + fn = arg3; + } + else { + opts = arg2; + ctx = arg3; + fn = arg4; + } + const parentContext = ctx !== null && ctx !== void 0 ? ctx : api.context.active(); + const span = this.startSpan(name, opts, parentContext); + const contextWithSpanSet = api.trace.setSpan(parentContext, span); + return api.context.with(contextWithSpanSet, fn, undefined, span); + } + /** Returns the active {@link GeneralLimits}. */ + getGeneralLimits() { + return this._generalLimits; + } + /** Returns the active {@link SpanLimits}. */ + getSpanLimits() { + return this._spanLimits; + } + getActiveSpanProcessor() { + return this._tracerProvider.getActiveSpanProcessor(); + } +} +exports.Tracer = Tracer; +//# sourceMappingURL=Tracer.js.map + +/***/ }), + +/***/ 91: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.buildSamplerFromEnv = exports.loadDefaultConfig = void 0; +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(56460); +const AlwaysOffSampler_1 = __nccwpck_require__(68118); +const AlwaysOnSampler_1 = __nccwpck_require__(13032); +const ParentBasedSampler_1 = __nccwpck_require__(58070); +const TraceIdRatioBasedSampler_1 = __nccwpck_require__(16712); +const FALLBACK_OTEL_TRACES_SAMPLER = core_1.TracesSamplerValues.AlwaysOn; +const DEFAULT_RATIO = 1; +/** + * Load default configuration. For fields with primitive values, any user-provided + * value will override the corresponding default value. For fields with + * non-primitive values (like `spanLimits`), the user-provided value will be + * used to extend the default value. + */ +// object needs to be wrapped in this function and called when needed otherwise +// envs are parsed before tests are ran - causes tests using these envs to fail +function loadDefaultConfig() { + const env = (0, core_1.getEnv)(); + return { + sampler: buildSamplerFromEnv(env), + forceFlushTimeoutMillis: 30000, + generalLimits: { + attributeValueLengthLimit: env.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT, + attributeCountLimit: env.OTEL_ATTRIBUTE_COUNT_LIMIT, + }, + spanLimits: { + attributeValueLengthLimit: env.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, + attributeCountLimit: env.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, + linkCountLimit: env.OTEL_SPAN_LINK_COUNT_LIMIT, + eventCountLimit: env.OTEL_SPAN_EVENT_COUNT_LIMIT, + attributePerEventCountLimit: env.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, + attributePerLinkCountLimit: env.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT, + }, + mergeResourceWithDefaults: true, + }; +} +exports.loadDefaultConfig = loadDefaultConfig; +/** + * Based on environment, builds a sampler, complies with specification. + * @param environment optional, by default uses getEnv(), but allows passing a value to reuse parsed environment + */ +function buildSamplerFromEnv(environment = (0, core_1.getEnv)()) { + switch (environment.OTEL_TRACES_SAMPLER) { + case core_1.TracesSamplerValues.AlwaysOn: + return new AlwaysOnSampler_1.AlwaysOnSampler(); + case core_1.TracesSamplerValues.AlwaysOff: + return new AlwaysOffSampler_1.AlwaysOffSampler(); + case core_1.TracesSamplerValues.ParentBasedAlwaysOn: + return new ParentBasedSampler_1.ParentBasedSampler({ + root: new AlwaysOnSampler_1.AlwaysOnSampler(), + }); + case core_1.TracesSamplerValues.ParentBasedAlwaysOff: + return new ParentBasedSampler_1.ParentBasedSampler({ + root: new AlwaysOffSampler_1.AlwaysOffSampler(), + }); + case core_1.TracesSamplerValues.TraceIdRatio: + return new TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(environment)); + case core_1.TracesSamplerValues.ParentBasedTraceIdRatio: + return new ParentBasedSampler_1.ParentBasedSampler({ + root: new TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(environment)), + }); + default: + api_1.diag.error(`OTEL_TRACES_SAMPLER value "${environment.OTEL_TRACES_SAMPLER} invalid, defaulting to ${FALLBACK_OTEL_TRACES_SAMPLER}".`); + return new AlwaysOnSampler_1.AlwaysOnSampler(); + } +} +exports.buildSamplerFromEnv = buildSamplerFromEnv; +function getSamplerProbabilityFromEnv(environment) { + if (environment.OTEL_TRACES_SAMPLER_ARG === undefined || + environment.OTEL_TRACES_SAMPLER_ARG === '') { + api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${DEFAULT_RATIO}.`); + return DEFAULT_RATIO; + } + const probability = Number(environment.OTEL_TRACES_SAMPLER_ARG); + if (isNaN(probability)) { + api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${environment.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${DEFAULT_RATIO}.`); + return DEFAULT_RATIO; + } + if (probability < 0 || probability > 1) { + api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${environment.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${DEFAULT_RATIO}.`); + return DEFAULT_RATIO; + } + return probability; +} +//# sourceMappingURL=config.js.map + +/***/ }), + +/***/ 35092: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ExceptionEventName = void 0; +// Event name definitions +exports.ExceptionEventName = 'exception'; +//# sourceMappingURL=enums.js.map + +/***/ }), + +/***/ 69727: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BatchSpanProcessorBase = void 0; +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(56460); +/** + * Implementation of the {@link SpanProcessor} that batches spans exported by + * the SDK then pushes them to the exporter pipeline. + */ +class BatchSpanProcessorBase { + constructor(_exporter, config) { + this._exporter = _exporter; + this._isExporting = false; + this._finishedSpans = []; + this._droppedSpansCount = 0; + const env = (0, core_1.getEnv)(); + this._maxExportBatchSize = + typeof (config === null || config === void 0 ? void 0 : config.maxExportBatchSize) === 'number' + ? config.maxExportBatchSize + : env.OTEL_BSP_MAX_EXPORT_BATCH_SIZE; + this._maxQueueSize = + typeof (config === null || config === void 0 ? void 0 : config.maxQueueSize) === 'number' + ? config.maxQueueSize + : env.OTEL_BSP_MAX_QUEUE_SIZE; + this._scheduledDelayMillis = + typeof (config === null || config === void 0 ? void 0 : config.scheduledDelayMillis) === 'number' + ? config.scheduledDelayMillis + : env.OTEL_BSP_SCHEDULE_DELAY; + this._exportTimeoutMillis = + typeof (config === null || config === void 0 ? void 0 : config.exportTimeoutMillis) === 'number' + ? config.exportTimeoutMillis + : env.OTEL_BSP_EXPORT_TIMEOUT; + this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); + if (this._maxExportBatchSize > this._maxQueueSize) { + api_1.diag.warn('BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize'); + this._maxExportBatchSize = this._maxQueueSize; + } + } + forceFlush() { + if (this._shutdownOnce.isCalled) { + return this._shutdownOnce.promise; + } + return this._flushAll(); + } + // does nothing. + onStart(_span, _parentContext) { } + onEnd(span) { + if (this._shutdownOnce.isCalled) { + return; + } + if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) { + return; + } + this._addToBuffer(span); + } + shutdown() { + return this._shutdownOnce.call(); + } + _shutdown() { + return Promise.resolve() + .then(() => { + return this.onShutdown(); + }) + .then(() => { + return this._flushAll(); + }) + .then(() => { + return this._exporter.shutdown(); + }); + } + /** Add a span in the buffer. */ + _addToBuffer(span) { + if (this._finishedSpans.length >= this._maxQueueSize) { + // limit reached, drop span + if (this._droppedSpansCount === 0) { + api_1.diag.debug('maxQueueSize reached, dropping spans'); + } + this._droppedSpansCount++; + return; + } + if (this._droppedSpansCount > 0) { + // some spans were dropped, log once with count of spans dropped + api_1.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`); + this._droppedSpansCount = 0; + } + this._finishedSpans.push(span); + this._maybeStartTimer(); + } + /** + * Send all spans to the exporter respecting the batch size limit + * This function is used only on forceFlush or shutdown, + * for all other cases _flush should be used + * */ + _flushAll() { + return new Promise((resolve, reject) => { + const promises = []; + // calculate number of batches + const count = Math.ceil(this._finishedSpans.length / this._maxExportBatchSize); + for (let i = 0, j = count; i < j; i++) { + promises.push(this._flushOneBatch()); + } + Promise.all(promises) + .then(() => { + resolve(); + }) + .catch(reject); + }); + } + _flushOneBatch() { + this._clearTimer(); + if (this._finishedSpans.length === 0) { + return Promise.resolve(); + } + return new Promise((resolve, reject) => { + const timer = setTimeout(() => { + // don't wait anymore for export, this way the next batch can start + reject(new Error('Timeout')); + }, this._exportTimeoutMillis); + // prevent downstream exporter calls from generating spans + api_1.context.with((0, core_1.suppressTracing)(api_1.context.active()), () => { + // Reset the finished spans buffer here because the next invocations of the _flush method + // could pass the same finished spans to the exporter if the buffer is cleared + // outside the execution of this callback. + let spans; + if (this._finishedSpans.length <= this._maxExportBatchSize) { + spans = this._finishedSpans; + this._finishedSpans = []; + } + else { + spans = this._finishedSpans.splice(0, this._maxExportBatchSize); + } + const doExport = () => this._exporter.export(spans, result => { + var _a; + clearTimeout(timer); + if (result.code === core_1.ExportResultCode.SUCCESS) { + resolve(); + } + else { + reject((_a = result.error) !== null && _a !== void 0 ? _a : new Error('BatchSpanProcessor: span export failed')); + } + }); + let pendingResources = null; + for (let i = 0, len = spans.length; i < len; i++) { + const span = spans[i]; + if (span.resource.asyncAttributesPending && + span.resource.waitForAsyncAttributes) { + pendingResources !== null && pendingResources !== void 0 ? pendingResources : (pendingResources = []); + pendingResources.push(span.resource.waitForAsyncAttributes()); + } + } + // Avoid scheduling a promise to make the behavior more predictable and easier to test + if (pendingResources === null) { + doExport(); + } + else { + Promise.all(pendingResources).then(doExport, err => { + (0, core_1.globalErrorHandler)(err); + reject(err); + }); + } + }); + }); + } + _maybeStartTimer() { + if (this._isExporting) + return; + const flush = () => { + this._isExporting = true; + this._flushOneBatch() + .finally(() => { + this._isExporting = false; + if (this._finishedSpans.length > 0) { + this._clearTimer(); + this._maybeStartTimer(); + } + }) + .catch(e => { + this._isExporting = false; + (0, core_1.globalErrorHandler)(e); + }); + }; + // we only wait if the queue doesn't have enough elements yet + if (this._finishedSpans.length >= this._maxExportBatchSize) { + return flush(); + } + if (this._timer !== undefined) + return; + this._timer = setTimeout(() => flush(), this._scheduledDelayMillis); + (0, core_1.unrefTimer)(this._timer); + } + _clearTimer() { + if (this._timer !== undefined) { + clearTimeout(this._timer); + this._timer = undefined; + } + } +} +exports.BatchSpanProcessorBase = BatchSpanProcessorBase; +//# sourceMappingURL=BatchSpanProcessorBase.js.map + +/***/ }), + +/***/ 36784: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ConsoleSpanExporter = void 0; +const core_1 = __nccwpck_require__(56460); +/** + * This is implementation of {@link SpanExporter} that prints spans to the + * console. This class can be used for diagnostic purposes. + * + * NOTE: This {@link SpanExporter} is intended for diagnostics use only, output rendered to the console may change at any time. + */ +/* eslint-disable no-console */ +class ConsoleSpanExporter { + /** + * Export spans. + * @param spans + * @param resultCallback + */ + export(spans, resultCallback) { + return this._sendSpans(spans, resultCallback); + } + /** + * Shutdown the exporter. + */ + shutdown() { + this._sendSpans([]); + return this.forceFlush(); + } + /** + * Exports any pending spans in exporter + */ + forceFlush() { + return Promise.resolve(); + } + /** + * converts span info into more readable format + * @param span + */ + _exportInfo(span) { + var _a; + return { + resource: { + attributes: span.resource.attributes, + }, + instrumentationScope: span.instrumentationLibrary, + traceId: span.spanContext().traceId, + parentId: span.parentSpanId, + traceState: (_a = span.spanContext().traceState) === null || _a === void 0 ? void 0 : _a.serialize(), + name: span.name, + id: span.spanContext().spanId, + kind: span.kind, + timestamp: (0, core_1.hrTimeToMicroseconds)(span.startTime), + duration: (0, core_1.hrTimeToMicroseconds)(span.duration), + attributes: span.attributes, + status: span.status, + events: span.events, + links: span.links, + }; + } + /** + * Showing spans in console + * @param spans + * @param done + */ + _sendSpans(spans, done) { + for (const span of spans) { + console.dir(this._exportInfo(span), { depth: 3 }); + } + if (done) { + return done({ code: core_1.ExportResultCode.SUCCESS }); + } + } +} +exports.ConsoleSpanExporter = ConsoleSpanExporter; +//# sourceMappingURL=ConsoleSpanExporter.js.map + +/***/ }), + +/***/ 24093: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.InMemorySpanExporter = void 0; +const core_1 = __nccwpck_require__(56460); +/** + * This class can be used for testing purposes. It stores the exported spans + * in a list in memory that can be retrieved using the `getFinishedSpans()` + * method. + */ +class InMemorySpanExporter { + constructor() { + this._finishedSpans = []; + /** + * Indicates if the exporter has been "shutdown." + * When false, exported spans will not be stored in-memory. + */ + this._stopped = false; + } + export(spans, resultCallback) { + if (this._stopped) + return resultCallback({ + code: core_1.ExportResultCode.FAILED, + error: new Error('Exporter has been stopped'), + }); + this._finishedSpans.push(...spans); + setTimeout(() => resultCallback({ code: core_1.ExportResultCode.SUCCESS }), 0); + } + shutdown() { + this._stopped = true; + this._finishedSpans = []; + return this.forceFlush(); + } + /** + * Exports any pending spans in the exporter + */ + forceFlush() { + return Promise.resolve(); + } + reset() { + this._finishedSpans = []; + } + getFinishedSpans() { + return this._finishedSpans; + } +} +exports.InMemorySpanExporter = InMemorySpanExporter; +//# sourceMappingURL=InMemorySpanExporter.js.map + +/***/ }), + +/***/ 69252: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NoopSpanProcessor = void 0; +/** No-op implementation of SpanProcessor */ +class NoopSpanProcessor { + onStart(_span, _context) { } + onEnd(_span) { } + shutdown() { + return Promise.resolve(); + } + forceFlush() { + return Promise.resolve(); + } +} +exports.NoopSpanProcessor = NoopSpanProcessor; +//# sourceMappingURL=NoopSpanProcessor.js.map + +/***/ }), + +/***/ 89802: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SimpleSpanProcessor = void 0; +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(56460); +/** + * An implementation of the {@link SpanProcessor} that converts the {@link Span} + * to {@link ReadableSpan} and passes it to the configured exporter. + * + * Only spans that are sampled are converted. + * + * 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. + */ +class SimpleSpanProcessor { + constructor(_exporter) { + this._exporter = _exporter; + this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); + this._unresolvedExports = new Set(); + } + async forceFlush() { + // await unresolved resources before resolving + await Promise.all(Array.from(this._unresolvedExports)); + if (this._exporter.forceFlush) { + await this._exporter.forceFlush(); + } + } + onStart(_span, _parentContext) { } + onEnd(span) { + var _a, _b; + if (this._shutdownOnce.isCalled) { + return; + } + if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) { + return; + } + const doExport = () => core_1.internal + ._export(this._exporter, [span]) + .then((result) => { + var _a; + if (result.code !== core_1.ExportResultCode.SUCCESS) { + (0, core_1.globalErrorHandler)((_a = result.error) !== null && _a !== void 0 ? _a : new Error(`SimpleSpanProcessor: span export failed (status ${result})`)); + } + }) + .catch(error => { + (0, core_1.globalErrorHandler)(error); + }); + // Avoid scheduling a promise to make the behavior more predictable and easier to test + if (span.resource.asyncAttributesPending) { + const exportPromise = (_b = (_a = span.resource).waitForAsyncAttributes) === null || _b === void 0 ? void 0 : _b.call(_a).then(() => { + if (exportPromise != null) { + this._unresolvedExports.delete(exportPromise); + } + return doExport(); + }, err => (0, core_1.globalErrorHandler)(err)); + // store the unresolved exports + if (exportPromise != null) { + this._unresolvedExports.add(exportPromise); + } + } + else { + void doExport(); + } + } + shutdown() { + return this._shutdownOnce.call(); + } + _shutdown() { + return this._exporter.shutdown(); + } +} +exports.SimpleSpanProcessor = SimpleSpanProcessor; +//# sourceMappingURL=SimpleSpanProcessor.js.map + +/***/ }), + +/***/ 29253: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Span = exports.SamplingDecision = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.NoopSpanProcessor = exports.SimpleSpanProcessor = exports.InMemorySpanExporter = exports.ConsoleSpanExporter = exports.RandomIdGenerator = exports.BatchSpanProcessor = exports.ForceFlushState = exports.BasicTracerProvider = exports.Tracer = void 0; +var Tracer_1 = __nccwpck_require__(63806); +Object.defineProperty(exports, "Tracer", ({ enumerable: true, get: function () { return Tracer_1.Tracer; } })); +var BasicTracerProvider_1 = __nccwpck_require__(78920); +Object.defineProperty(exports, "BasicTracerProvider", ({ enumerable: true, get: function () { return BasicTracerProvider_1.BasicTracerProvider; } })); +Object.defineProperty(exports, "ForceFlushState", ({ enumerable: true, get: function () { return BasicTracerProvider_1.ForceFlushState; } })); +var platform_1 = __nccwpck_require__(10262); +Object.defineProperty(exports, "BatchSpanProcessor", ({ enumerable: true, get: function () { return platform_1.BatchSpanProcessor; } })); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return platform_1.RandomIdGenerator; } })); +var ConsoleSpanExporter_1 = __nccwpck_require__(36784); +Object.defineProperty(exports, "ConsoleSpanExporter", ({ enumerable: true, get: function () { return ConsoleSpanExporter_1.ConsoleSpanExporter; } })); +var InMemorySpanExporter_1 = __nccwpck_require__(24093); +Object.defineProperty(exports, "InMemorySpanExporter", ({ enumerable: true, get: function () { return InMemorySpanExporter_1.InMemorySpanExporter; } })); +var SimpleSpanProcessor_1 = __nccwpck_require__(89802); +Object.defineProperty(exports, "SimpleSpanProcessor", ({ enumerable: true, get: function () { return SimpleSpanProcessor_1.SimpleSpanProcessor; } })); +var NoopSpanProcessor_1 = __nccwpck_require__(69252); +Object.defineProperty(exports, "NoopSpanProcessor", ({ enumerable: true, get: function () { return NoopSpanProcessor_1.NoopSpanProcessor; } })); +var AlwaysOffSampler_1 = __nccwpck_require__(68118); +Object.defineProperty(exports, "AlwaysOffSampler", ({ enumerable: true, get: function () { return AlwaysOffSampler_1.AlwaysOffSampler; } })); +var AlwaysOnSampler_1 = __nccwpck_require__(13032); +Object.defineProperty(exports, "AlwaysOnSampler", ({ enumerable: true, get: function () { return AlwaysOnSampler_1.AlwaysOnSampler; } })); +var ParentBasedSampler_1 = __nccwpck_require__(58070); +Object.defineProperty(exports, "ParentBasedSampler", ({ enumerable: true, get: function () { return ParentBasedSampler_1.ParentBasedSampler; } })); +var TraceIdRatioBasedSampler_1 = __nccwpck_require__(16712); +Object.defineProperty(exports, "TraceIdRatioBasedSampler", ({ enumerable: true, get: function () { return TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler; } })); +var Sampler_1 = __nccwpck_require__(17446); +Object.defineProperty(exports, "SamplingDecision", ({ enumerable: true, get: function () { return Sampler_1.SamplingDecision; } })); +var Span_1 = __nccwpck_require__(61301); +Object.defineProperty(exports, "Span", ({ enumerable: true, get: function () { return Span_1.Span; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 10262: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RandomIdGenerator = exports.BatchSpanProcessor = void 0; +var node_1 = __nccwpck_require__(36573); +Object.defineProperty(exports, "BatchSpanProcessor", ({ enumerable: true, get: function () { return node_1.BatchSpanProcessor; } })); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return node_1.RandomIdGenerator; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 97670: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RandomIdGenerator = void 0; +const SPAN_ID_BYTES = 8; +const TRACE_ID_BYTES = 16; +class RandomIdGenerator { + constructor() { + /** + * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex + * characters corresponding to 128 bits. + */ + this.generateTraceId = getIdGenerator(TRACE_ID_BYTES); + /** + * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex + * characters corresponding to 64 bits. + */ + this.generateSpanId = getIdGenerator(SPAN_ID_BYTES); + } +} +exports.RandomIdGenerator = RandomIdGenerator; +const SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES); +function getIdGenerator(bytes) { + return function generateId() { + for (let i = 0; i < bytes / 4; i++) { + // unsigned right shift drops decimal part of the number + // it is required because if a number between 2**32 and 2**32 - 1 is generated, an out of range error is thrown by writeUInt32BE + SHARED_BUFFER.writeUInt32BE((Math.random() * 2 ** 32) >>> 0, i * 4); + } + // If buffer is all 0, set the last byte to 1 to guarantee a valid w3c id is generated + for (let i = 0; i < bytes; i++) { + if (SHARED_BUFFER[i] > 0) { + break; + } + else if (i === bytes - 1) { + SHARED_BUFFER[bytes - 1] = 1; + } + } + return SHARED_BUFFER.toString('hex', 0, bytes); + }; +} +//# sourceMappingURL=RandomIdGenerator.js.map + +/***/ }), + +/***/ 97913: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BatchSpanProcessor = void 0; +const BatchSpanProcessorBase_1 = __nccwpck_require__(69727); +class BatchSpanProcessor extends BatchSpanProcessorBase_1.BatchSpanProcessorBase { + onShutdown() { } +} +exports.BatchSpanProcessor = BatchSpanProcessor; +//# sourceMappingURL=BatchSpanProcessor.js.map + +/***/ }), + +/***/ 36573: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RandomIdGenerator = exports.BatchSpanProcessor = void 0; +var BatchSpanProcessor_1 = __nccwpck_require__(97913); +Object.defineProperty(exports, "BatchSpanProcessor", ({ enumerable: true, get: function () { return BatchSpanProcessor_1.BatchSpanProcessor; } })); +var RandomIdGenerator_1 = __nccwpck_require__(97670); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return RandomIdGenerator_1.RandomIdGenerator; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 68118: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AlwaysOffSampler = void 0; +const Sampler_1 = __nccwpck_require__(17446); +/** Sampler that samples no traces. */ +class AlwaysOffSampler { + shouldSample() { + return { + decision: Sampler_1.SamplingDecision.NOT_RECORD, + }; + } + toString() { + return 'AlwaysOffSampler'; + } +} +exports.AlwaysOffSampler = AlwaysOffSampler; +//# sourceMappingURL=AlwaysOffSampler.js.map + +/***/ }), + +/***/ 13032: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AlwaysOnSampler = void 0; +const Sampler_1 = __nccwpck_require__(17446); +/** Sampler that samples all traces. */ +class AlwaysOnSampler { + shouldSample() { + return { + decision: Sampler_1.SamplingDecision.RECORD_AND_SAMPLED, + }; + } + toString() { + return 'AlwaysOnSampler'; + } +} +exports.AlwaysOnSampler = AlwaysOnSampler; +//# sourceMappingURL=AlwaysOnSampler.js.map + +/***/ }), + +/***/ 58070: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ParentBasedSampler = void 0; +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(56460); +const AlwaysOffSampler_1 = __nccwpck_require__(68118); +const AlwaysOnSampler_1 = __nccwpck_require__(13032); +/** + * A composite sampler that either respects the parent span's sampling decision + * or delegates to `delegateSampler` for root spans. + */ +class ParentBasedSampler { + constructor(config) { + var _a, _b, _c, _d; + this._root = config.root; + if (!this._root) { + (0, core_1.globalErrorHandler)(new Error('ParentBasedSampler must have a root sampler configured')); + this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); + } + this._remoteParentSampled = + (_a = config.remoteParentSampled) !== null && _a !== void 0 ? _a : new AlwaysOnSampler_1.AlwaysOnSampler(); + this._remoteParentNotSampled = + (_b = config.remoteParentNotSampled) !== null && _b !== void 0 ? _b : new AlwaysOffSampler_1.AlwaysOffSampler(); + this._localParentSampled = + (_c = config.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler_1.AlwaysOnSampler(); + this._localParentNotSampled = + (_d = config.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler_1.AlwaysOffSampler(); + } + shouldSample(context, traceId, spanName, spanKind, attributes, links) { + const parentContext = api_1.trace.getSpanContext(context); + if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) { + return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.isRemote) { + if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { + return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { + return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + toString() { + return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; + } +} +exports.ParentBasedSampler = ParentBasedSampler; +//# sourceMappingURL=ParentBasedSampler.js.map + +/***/ }), + +/***/ 16712: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TraceIdRatioBasedSampler = void 0; +const api_1 = __nccwpck_require__(65163); +const Sampler_1 = __nccwpck_require__(17446); +/** Sampler that samples a given fraction of traces based of trace id deterministically. */ +class TraceIdRatioBasedSampler { + constructor(_ratio = 0) { + this._ratio = _ratio; + this._ratio = this._normalize(_ratio); + this._upperBound = Math.floor(this._ratio * 0xffffffff); + } + shouldSample(context, traceId) { + return { + decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound + ? Sampler_1.SamplingDecision.RECORD_AND_SAMPLED + : Sampler_1.SamplingDecision.NOT_RECORD, + }; + } + toString() { + return `TraceIdRatioBased{${this._ratio}}`; + } + _normalize(ratio) { + if (typeof ratio !== 'number' || isNaN(ratio)) + return 0; + return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio; + } + _accumulate(traceId) { + let accumulation = 0; + for (let i = 0; i < traceId.length / 8; i++) { + const pos = i * 8; + const part = parseInt(traceId.slice(pos, pos + 8), 16); + accumulation = (accumulation ^ part) >>> 0; + } + return accumulation; + } +} +exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; +//# sourceMappingURL=TraceIdRatioBasedSampler.js.map + +/***/ }), + +/***/ 54324: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.reconfigureLimits = exports.mergeConfig = void 0; +const config_1 = __nccwpck_require__(91); +const core_1 = __nccwpck_require__(56460); +/** + * Function to merge Default configuration (as specified in './config') with + * user provided configurations. + */ +function mergeConfig(userConfig) { + const perInstanceDefaults = { + sampler: (0, config_1.buildSamplerFromEnv)(), + }; + const DEFAULT_CONFIG = (0, config_1.loadDefaultConfig)(); + const target = Object.assign({}, DEFAULT_CONFIG, perInstanceDefaults, userConfig); + target.generalLimits = Object.assign({}, DEFAULT_CONFIG.generalLimits, userConfig.generalLimits || {}); + target.spanLimits = Object.assign({}, DEFAULT_CONFIG.spanLimits, userConfig.spanLimits || {}); + return target; +} +exports.mergeConfig = mergeConfig; +/** + * When general limits are provided and model specific limits are not, + * configures the model specific limits by using the values from the general ones. + * @param userConfig User provided tracer configuration + */ +function reconfigureLimits(userConfig) { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; + const spanLimits = Object.assign({}, userConfig.spanLimits); + const parsedEnvConfig = (0, core_1.getEnvWithoutDefaults)(); + /** + * Reassign span attribute count limit to use first non null value defined by user or use default value + */ + spanLimits.attributeCountLimit = + (_f = (_e = (_d = (_b = (_a = userConfig.spanLimits) === null || _a === void 0 ? void 0 : _a.attributeCountLimit) !== null && _b !== void 0 ? _b : (_c = userConfig.generalLimits) === null || _c === void 0 ? void 0 : _c.attributeCountLimit) !== null && _d !== void 0 ? _d : parsedEnvConfig.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT) !== null && _e !== void 0 ? _e : parsedEnvConfig.OTEL_ATTRIBUTE_COUNT_LIMIT) !== null && _f !== void 0 ? _f : core_1.DEFAULT_ATTRIBUTE_COUNT_LIMIT; + /** + * Reassign span attribute value length limit to use first non null value defined by user or use default value + */ + spanLimits.attributeValueLengthLimit = + (_m = (_l = (_k = (_h = (_g = userConfig.spanLimits) === null || _g === void 0 ? void 0 : _g.attributeValueLengthLimit) !== null && _h !== void 0 ? _h : (_j = userConfig.generalLimits) === null || _j === void 0 ? void 0 : _j.attributeValueLengthLimit) !== null && _k !== void 0 ? _k : parsedEnvConfig.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT) !== null && _l !== void 0 ? _l : parsedEnvConfig.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT) !== null && _m !== void 0 ? _m : core_1.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; + return Object.assign({}, userConfig, { spanLimits }); +} +exports.reconfigureLimits = reconfigureLimits; +//# sourceMappingURL=utility.js.map + +/***/ }), + +/***/ 59872: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ExportResultCode = void 0; +var ExportResultCode; +(function (ExportResultCode) { + ExportResultCode[ExportResultCode["SUCCESS"] = 0] = "SUCCESS"; + ExportResultCode[ExportResultCode["FAILED"] = 1] = "FAILED"; +})(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {})); +//# sourceMappingURL=ExportResult.js.map + +/***/ }), + +/***/ 2477: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = void 0; +exports.BAGGAGE_KEY_PAIR_SEPARATOR = '='; +exports.BAGGAGE_PROPERTIES_SEPARATOR = ';'; +exports.BAGGAGE_ITEMS_SEPARATOR = ','; +// Name of the http header used to propagate the baggage +exports.BAGGAGE_HEADER = 'baggage'; +// Maximum number of name-value pairs allowed by w3c spec +exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; +// Maximum number of bytes per a single name-value pair allowed by w3c spec +exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; +// Maximum total length of all name-value pairs allowed by w3c spec +exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; +//# sourceMappingURL=constants.js.map + +/***/ }), + +/***/ 76683: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.W3CBaggagePropagator = void 0; +const api_1 = __nccwpck_require__(65163); +const suppress_tracing_1 = __nccwpck_require__(1761); +const constants_1 = __nccwpck_require__(2477); +const utils_1 = __nccwpck_require__(37830); +/** + * Propagates {@link Baggage} through Context format propagation. + * + * Based on the Baggage specification: + * https://w3c.github.io/baggage/ + */ +class W3CBaggagePropagator { + inject(context, carrier, setter) { + const baggage = api_1.propagation.getBaggage(context); + if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context)) + return; + const keyPairs = (0, utils_1.getKeyPairs)(baggage) + .filter((pair) => { + return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; + }) + .slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); + const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); + if (headerValue.length > 0) { + setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); + } + } + extract(context, carrier, getter) { + const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); + const baggageString = Array.isArray(headerValue) + ? headerValue.join(constants_1.BAGGAGE_ITEMS_SEPARATOR) + : headerValue; + if (!baggageString) + return context; + const baggage = {}; + if (baggageString.length === 0) { + return context; + } + const pairs = baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR); + pairs.forEach(entry => { + const keyPair = (0, utils_1.parsePairKeyValue)(entry); + if (keyPair) { + const baggageEntry = { value: keyPair.value }; + if (keyPair.metadata) { + baggageEntry.metadata = keyPair.metadata; + } + baggage[keyPair.key] = baggageEntry; + } + }); + if (Object.entries(baggage).length === 0) { + return context; + } + return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage)); + } + fields() { + return [constants_1.BAGGAGE_HEADER]; + } +} +exports.W3CBaggagePropagator = W3CBaggagePropagator; +//# sourceMappingURL=W3CBaggagePropagator.js.map + +/***/ }), + +/***/ 37830: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const api_1 = __nccwpck_require__(65163); +const constants_1 = __nccwpck_require__(2477); +function serializeKeyPairs(keyPairs) { + return keyPairs.reduce((hValue, current) => { + const value = `${hValue}${hValue !== '' ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ''}${current}`; + return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value; + }, ''); +} +exports.serializeKeyPairs = serializeKeyPairs; +function getKeyPairs(baggage) { + return baggage.getAllEntries().map(([key, value]) => { + let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`; + // include opaque metadata if provided + // NOTE: we intentionally don't URI-encode the metadata - that responsibility falls on the metadata implementation + if (value.metadata !== undefined) { + entry += constants_1.BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString(); + } + return entry; + }); +} +exports.getKeyPairs = getKeyPairs; +function parsePairKeyValue(entry) { + const valueProps = entry.split(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); + if (valueProps.length <= 0) + return; + const keyPairPart = valueProps.shift(); + if (!keyPairPart) + return; + const separatorIndex = keyPairPart.indexOf(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); + if (separatorIndex <= 0) + return; + const key = decodeURIComponent(keyPairPart.substring(0, separatorIndex).trim()); + const value = decodeURIComponent(keyPairPart.substring(separatorIndex + 1).trim()); + let metadata; + if (valueProps.length > 0) { + metadata = (0, api_1.baggageEntryMetadataFromString)(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR)); + } + return { key, value, metadata }; +} +exports.parsePairKeyValue = parsePairKeyValue; +/** + * Parse a string serialized in the baggage HTTP Format (without metadata): + * https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT.md + */ +function parseKeyPairsIntoRecord(value) { + if (typeof value !== 'string' || value.length === 0) + return {}; + return value + .split(constants_1.BAGGAGE_ITEMS_SEPARATOR) + .map(entry => { + return parsePairKeyValue(entry); + }) + .filter(keyPair => keyPair !== undefined && keyPair.value.length > 0) + .reduce((headers, keyPair) => { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + headers[keyPair.key] = keyPair.value; + return headers; + }, {}); +} +exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 61558: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AnchoredClock = void 0; +/** + * A utility for returning wall times anchored to a given point in time. Wall time measurements will + * not be taken from the system, but instead are computed by adding a monotonic clock time + * to the anchor point. + * + * This is needed because the system time can change and result in unexpected situations like + * spans ending before they are started. Creating an anchored clock for each local root span + * ensures that span timings and durations are accurate while preventing span times from drifting + * too far from the system clock. + * + * Only creating an anchored clock once per local trace ensures span times are correct relative + * to each other. For example, a child span will never have a start time before its parent even + * if the system clock is corrected during the local trace. + * + * Heavily inspired by the OTel Java anchored clock + * https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/AnchoredClock.java + */ +class AnchoredClock { + /** + * Create a new AnchoredClock anchored to the current time returned by systemClock. + * + * @param systemClock should be a clock that returns the number of milliseconds since January 1 1970 such as Date + * @param monotonicClock should be a clock that counts milliseconds monotonically such as window.performance or perf_hooks.performance + */ + constructor(systemClock, monotonicClock) { + this._monotonicClock = monotonicClock; + this._epochMillis = systemClock.now(); + this._performanceMillis = monotonicClock.now(); + } + /** + * Returns the current time by adding the number of milliseconds since the + * AnchoredClock was created to the creation epoch time + */ + now() { + const delta = this._monotonicClock.now() - this._performanceMillis; + return this._epochMillis + delta; + } +} +exports.AnchoredClock = AnchoredClock; +//# sourceMappingURL=anchored-clock.js.map + +/***/ }), + +/***/ 49925: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = void 0; +const api_1 = __nccwpck_require__(65163); +function sanitizeAttributes(attributes) { + const out = {}; + if (typeof attributes !== 'object' || attributes == null) { + return out; + } + for (const [key, val] of Object.entries(attributes)) { + if (!isAttributeKey(key)) { + api_1.diag.warn(`Invalid attribute key: ${key}`); + continue; + } + if (!isAttributeValue(val)) { + api_1.diag.warn(`Invalid attribute value set for key: ${key}`); + continue; + } + if (Array.isArray(val)) { + out[key] = val.slice(); + } + else { + out[key] = val; + } + } + return out; +} +exports.sanitizeAttributes = sanitizeAttributes; +function isAttributeKey(key) { + return typeof key === 'string' && key.length > 0; +} +exports.isAttributeKey = isAttributeKey; +function isAttributeValue(val) { + if (val == null) { + return true; + } + if (Array.isArray(val)) { + return isHomogeneousAttributeValueArray(val); + } + return isValidPrimitiveAttributeValue(val); +} +exports.isAttributeValue = isAttributeValue; +function isHomogeneousAttributeValueArray(arr) { + let type; + for (const element of arr) { + // null/undefined elements are allowed + if (element == null) + continue; + if (!type) { + if (isValidPrimitiveAttributeValue(element)) { + type = typeof element; + continue; + } + // encountered an invalid primitive + return false; + } + if (typeof element === type) { + continue; + } + return false; + } + return true; +} +function isValidPrimitiveAttributeValue(val) { + switch (typeof val) { + case 'number': + case 'boolean': + case 'string': + return true; + } + return false; +} +//# sourceMappingURL=attributes.js.map + +/***/ }), + +/***/ 54328: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.globalErrorHandler = exports.setGlobalErrorHandler = void 0; +const logging_error_handler_1 = __nccwpck_require__(76149); +/** The global error handler delegate */ +let delegateHandler = (0, logging_error_handler_1.loggingErrorHandler)(); +/** + * Set the global error handler + * @param {ErrorHandler} handler + */ +function setGlobalErrorHandler(handler) { + delegateHandler = handler; +} +exports.setGlobalErrorHandler = setGlobalErrorHandler; +/** + * Return the global error handler + * @param {Exception} ex + */ +function globalErrorHandler(ex) { + try { + delegateHandler(ex); + } + catch (_a) { } // eslint-disable-line no-empty +} +exports.globalErrorHandler = globalErrorHandler; +//# sourceMappingURL=global-error-handler.js.map + +/***/ }), + +/***/ 23954: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.hexToBinary = void 0; +function intValue(charCode) { + // 0-9 + if (charCode >= 48 && charCode <= 57) { + return charCode - 48; + } + // a-f + if (charCode >= 97 && charCode <= 102) { + return charCode - 87; + } + // A-F + return charCode - 55; +} +function hexToBinary(hexStr) { + const buf = new Uint8Array(hexStr.length / 2); + let offset = 0; + for (let i = 0; i < hexStr.length; i += 2) { + const hi = intValue(hexStr.charCodeAt(i)); + const lo = intValue(hexStr.charCodeAt(i + 1)); + buf[offset++] = (hi << 4) | lo; + } + return buf; +} +exports.hexToBinary = hexToBinary; +//# sourceMappingURL=hex-to-binary.js.map + +/***/ }), + +/***/ 76149: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.loggingErrorHandler = void 0; +const api_1 = __nccwpck_require__(65163); +/** + * Returns a function that logs an error using the provided logger, or a + * console logger if one was not provided. + */ +function loggingErrorHandler() { + return (ex) => { + api_1.diag.error(stringifyException(ex)); + }; +} +exports.loggingErrorHandler = loggingErrorHandler; +/** + * Converts an exception into a string representation + * @param {Exception} ex + */ +function stringifyException(ex) { + if (typeof ex === 'string') { + return ex; + } + else { + return JSON.stringify(flattenException(ex)); + } +} +/** + * Flattens an exception into key-value pairs by traversing the prototype chain + * and coercing values to strings. Duplicate properties will not be overwritten; + * the first insert wins. + */ +function flattenException(ex) { + const result = {}; + let current = ex; + while (current !== null) { + Object.getOwnPropertyNames(current).forEach(propertyName => { + if (result[propertyName]) + return; + const value = current[propertyName]; + if (value) { + result[propertyName] = String(value); + } + }); + current = Object.getPrototypeOf(current); + } + return result; +} +//# sourceMappingURL=logging-error-handler.js.map + +/***/ }), + +/***/ 94806: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.addHrTimes = exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = exports.getTimeOrigin = exports.millisToHrTime = void 0; +const platform_1 = __nccwpck_require__(45649); +const NANOSECOND_DIGITS = 9; +const NANOSECOND_DIGITS_IN_MILLIS = 6; +const MILLISECONDS_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS); +const SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); +/** + * Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]). + * @param epochMillis + */ +function millisToHrTime(epochMillis) { + const epochSeconds = epochMillis / 1000; + // Decimals only. + const seconds = Math.trunc(epochSeconds); + // Round sub-nanosecond accuracy to nanosecond. + const nanos = Math.round((epochMillis % 1000) * MILLISECONDS_TO_NANOSECONDS); + return [seconds, nanos]; +} +exports.millisToHrTime = millisToHrTime; +function getTimeOrigin() { + let timeOrigin = platform_1.otperformance.timeOrigin; + if (typeof timeOrigin !== 'number') { + const perf = platform_1.otperformance; + timeOrigin = perf.timing && perf.timing.fetchStart; + } + return timeOrigin; +} +exports.getTimeOrigin = getTimeOrigin; +/** + * Returns an hrtime calculated via performance component. + * @param performanceNow + */ +function hrTime(performanceNow) { + const timeOrigin = millisToHrTime(getTimeOrigin()); + const now = millisToHrTime(typeof performanceNow === 'number' ? performanceNow : platform_1.otperformance.now()); + return addHrTimes(timeOrigin, now); +} +exports.hrTime = hrTime; +/** + * + * Converts a TimeInput to an HrTime, defaults to _hrtime(). + * @param time + */ +function timeInputToHrTime(time) { + // process.hrtime + if (isTimeInputHrTime(time)) { + return time; + } + else if (typeof time === 'number') { + // Must be a performance.now() if it's smaller than process start time. + if (time < getTimeOrigin()) { + return hrTime(time); + } + else { + // epoch milliseconds or performance.timeOrigin + return millisToHrTime(time); + } + } + else if (time instanceof Date) { + return millisToHrTime(time.getTime()); + } + else { + throw TypeError('Invalid input type'); + } +} +exports.timeInputToHrTime = timeInputToHrTime; +/** + * Returns a duration of two hrTime. + * @param startTime + * @param endTime + */ +function hrTimeDuration(startTime, endTime) { + let seconds = endTime[0] - startTime[0]; + let nanos = endTime[1] - startTime[1]; + // overflow + if (nanos < 0) { + seconds -= 1; + // negate + nanos += SECOND_TO_NANOSECONDS; + } + return [seconds, nanos]; +} +exports.hrTimeDuration = hrTimeDuration; +/** + * Convert hrTime to timestamp, for example "2019-05-14T17:00:00.000123456Z" + * @param time + */ +function hrTimeToTimeStamp(time) { + const precision = NANOSECOND_DIGITS; + const tmp = `${'0'.repeat(precision)}${time[1]}Z`; + const nanoString = tmp.substring(tmp.length - precision - 1); + const date = new Date(time[0] * 1000).toISOString(); + return date.replace('000Z', nanoString); +} +exports.hrTimeToTimeStamp = hrTimeToTimeStamp; +/** + * Convert hrTime to nanoseconds. + * @param time + */ +function hrTimeToNanoseconds(time) { + return time[0] * SECOND_TO_NANOSECONDS + time[1]; +} +exports.hrTimeToNanoseconds = hrTimeToNanoseconds; +/** + * Convert hrTime to milliseconds. + * @param time + */ +function hrTimeToMilliseconds(time) { + return time[0] * 1e3 + time[1] / 1e6; +} +exports.hrTimeToMilliseconds = hrTimeToMilliseconds; +/** + * Convert hrTime to microseconds. + * @param time + */ +function hrTimeToMicroseconds(time) { + return time[0] * 1e6 + time[1] / 1e3; +} +exports.hrTimeToMicroseconds = hrTimeToMicroseconds; +/** + * check if time is HrTime + * @param value + */ +function isTimeInputHrTime(value) { + return (Array.isArray(value) && + value.length === 2 && + typeof value[0] === 'number' && + typeof value[1] === 'number'); +} +exports.isTimeInputHrTime = isTimeInputHrTime; +/** + * check if input value is a correct types.TimeInput + * @param value + */ +function isTimeInput(value) { + return (isTimeInputHrTime(value) || + typeof value === 'number' || + value instanceof Date); +} +exports.isTimeInput = isTimeInput; +/** + * Given 2 HrTime formatted times, return their sum as an HrTime. + */ +function addHrTimes(time1, time2) { + const out = [time1[0] + time2[0], time1[1] + time2[1]]; + // Nanoseconds + if (out[1] >= SECOND_TO_NANOSECONDS) { + out[1] -= SECOND_TO_NANOSECONDS; + out[0] += 1; + } + return out; +} +exports.addHrTimes = addHrTimes; +//# sourceMappingURL=time.js.map + +/***/ }), + +/***/ 56460: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.unrefTimer = exports.otperformance = exports.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = exports.baggageUtils = exports.ExportResultCode = exports.hexToBinary = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.isAttributeKey = exports.AnchoredClock = exports.W3CBaggagePropagator = void 0; +exports.internal = exports.VERSION = exports.BindOnceFuture = exports.isWrapped = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.TracesSamplerValues = exports.merge = exports.parseEnvironment = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ENVIRONMENT = void 0; +var W3CBaggagePropagator_1 = __nccwpck_require__(76683); +Object.defineProperty(exports, "W3CBaggagePropagator", ({ enumerable: true, get: function () { return W3CBaggagePropagator_1.W3CBaggagePropagator; } })); +var anchored_clock_1 = __nccwpck_require__(61558); +Object.defineProperty(exports, "AnchoredClock", ({ enumerable: true, get: function () { return anchored_clock_1.AnchoredClock; } })); +var attributes_1 = __nccwpck_require__(49925); +Object.defineProperty(exports, "isAttributeKey", ({ enumerable: true, get: function () { return attributes_1.isAttributeKey; } })); +Object.defineProperty(exports, "isAttributeValue", ({ enumerable: true, get: function () { return attributes_1.isAttributeValue; } })); +Object.defineProperty(exports, "sanitizeAttributes", ({ enumerable: true, get: function () { return attributes_1.sanitizeAttributes; } })); +var global_error_handler_1 = __nccwpck_require__(54328); +Object.defineProperty(exports, "globalErrorHandler", ({ enumerable: true, get: function () { return global_error_handler_1.globalErrorHandler; } })); +Object.defineProperty(exports, "setGlobalErrorHandler", ({ enumerable: true, get: function () { return global_error_handler_1.setGlobalErrorHandler; } })); +var logging_error_handler_1 = __nccwpck_require__(76149); +Object.defineProperty(exports, "loggingErrorHandler", ({ enumerable: true, get: function () { return logging_error_handler_1.loggingErrorHandler; } })); +var time_1 = __nccwpck_require__(94806); +Object.defineProperty(exports, "addHrTimes", ({ enumerable: true, get: function () { return time_1.addHrTimes; } })); +Object.defineProperty(exports, "getTimeOrigin", ({ enumerable: true, get: function () { return time_1.getTimeOrigin; } })); +Object.defineProperty(exports, "hrTime", ({ enumerable: true, get: function () { return time_1.hrTime; } })); +Object.defineProperty(exports, "hrTimeDuration", ({ enumerable: true, get: function () { return time_1.hrTimeDuration; } })); +Object.defineProperty(exports, "hrTimeToMicroseconds", ({ enumerable: true, get: function () { return time_1.hrTimeToMicroseconds; } })); +Object.defineProperty(exports, "hrTimeToMilliseconds", ({ enumerable: true, get: function () { return time_1.hrTimeToMilliseconds; } })); +Object.defineProperty(exports, "hrTimeToNanoseconds", ({ enumerable: true, get: function () { return time_1.hrTimeToNanoseconds; } })); +Object.defineProperty(exports, "hrTimeToTimeStamp", ({ enumerable: true, get: function () { return time_1.hrTimeToTimeStamp; } })); +Object.defineProperty(exports, "isTimeInput", ({ enumerable: true, get: function () { return time_1.isTimeInput; } })); +Object.defineProperty(exports, "isTimeInputHrTime", ({ enumerable: true, get: function () { return time_1.isTimeInputHrTime; } })); +Object.defineProperty(exports, "millisToHrTime", ({ enumerable: true, get: function () { return time_1.millisToHrTime; } })); +Object.defineProperty(exports, "timeInputToHrTime", ({ enumerable: true, get: function () { return time_1.timeInputToHrTime; } })); +var hex_to_binary_1 = __nccwpck_require__(23954); +Object.defineProperty(exports, "hexToBinary", ({ enumerable: true, get: function () { return hex_to_binary_1.hexToBinary; } })); +var ExportResult_1 = __nccwpck_require__(59872); +Object.defineProperty(exports, "ExportResultCode", ({ enumerable: true, get: function () { return ExportResult_1.ExportResultCode; } })); +const utils_1 = __nccwpck_require__(37830); +exports.baggageUtils = { + getKeyPairs: utils_1.getKeyPairs, + serializeKeyPairs: utils_1.serializeKeyPairs, + parseKeyPairsIntoRecord: utils_1.parseKeyPairsIntoRecord, + parsePairKeyValue: utils_1.parsePairKeyValue, +}; +var platform_1 = __nccwpck_require__(45649); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return platform_1.RandomIdGenerator; } })); +Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return platform_1.SDK_INFO; } })); +Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return platform_1._globalThis; } })); +Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return platform_1.getEnv; } })); +Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return platform_1.getEnvWithoutDefaults; } })); +Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return platform_1.hexToBase64; } })); +Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return platform_1.otperformance; } })); +Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return platform_1.unrefTimer; } })); +var composite_1 = __nccwpck_require__(74712); +Object.defineProperty(exports, "CompositePropagator", ({ enumerable: true, get: function () { return composite_1.CompositePropagator; } })); +var W3CTraceContextPropagator_1 = __nccwpck_require__(39344); +Object.defineProperty(exports, "TRACE_PARENT_HEADER", ({ enumerable: true, get: function () { return W3CTraceContextPropagator_1.TRACE_PARENT_HEADER; } })); +Object.defineProperty(exports, "TRACE_STATE_HEADER", ({ enumerable: true, get: function () { return W3CTraceContextPropagator_1.TRACE_STATE_HEADER; } })); +Object.defineProperty(exports, "W3CTraceContextPropagator", ({ enumerable: true, get: function () { return W3CTraceContextPropagator_1.W3CTraceContextPropagator; } })); +Object.defineProperty(exports, "parseTraceParent", ({ enumerable: true, get: function () { return W3CTraceContextPropagator_1.parseTraceParent; } })); +var rpc_metadata_1 = __nccwpck_require__(84727); +Object.defineProperty(exports, "RPCType", ({ enumerable: true, get: function () { return rpc_metadata_1.RPCType; } })); +Object.defineProperty(exports, "deleteRPCMetadata", ({ enumerable: true, get: function () { return rpc_metadata_1.deleteRPCMetadata; } })); +Object.defineProperty(exports, "getRPCMetadata", ({ enumerable: true, get: function () { return rpc_metadata_1.getRPCMetadata; } })); +Object.defineProperty(exports, "setRPCMetadata", ({ enumerable: true, get: function () { return rpc_metadata_1.setRPCMetadata; } })); +var AlwaysOffSampler_1 = __nccwpck_require__(11742); +Object.defineProperty(exports, "AlwaysOffSampler", ({ enumerable: true, get: function () { return AlwaysOffSampler_1.AlwaysOffSampler; } })); +var AlwaysOnSampler_1 = __nccwpck_require__(30137); +Object.defineProperty(exports, "AlwaysOnSampler", ({ enumerable: true, get: function () { return AlwaysOnSampler_1.AlwaysOnSampler; } })); +var ParentBasedSampler_1 = __nccwpck_require__(67801); +Object.defineProperty(exports, "ParentBasedSampler", ({ enumerable: true, get: function () { return ParentBasedSampler_1.ParentBasedSampler; } })); +var TraceIdRatioBasedSampler_1 = __nccwpck_require__(12900); +Object.defineProperty(exports, "TraceIdRatioBasedSampler", ({ enumerable: true, get: function () { return TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler; } })); +var suppress_tracing_1 = __nccwpck_require__(1761); +Object.defineProperty(exports, "isTracingSuppressed", ({ enumerable: true, get: function () { return suppress_tracing_1.isTracingSuppressed; } })); +Object.defineProperty(exports, "suppressTracing", ({ enumerable: true, get: function () { return suppress_tracing_1.suppressTracing; } })); +Object.defineProperty(exports, "unsuppressTracing", ({ enumerable: true, get: function () { return suppress_tracing_1.unsuppressTracing; } })); +var TraceState_1 = __nccwpck_require__(13837); +Object.defineProperty(exports, "TraceState", ({ enumerable: true, get: function () { return TraceState_1.TraceState; } })); +var environment_1 = __nccwpck_require__(15017); +Object.defineProperty(exports, "DEFAULT_ATTRIBUTE_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ATTRIBUTE_COUNT_LIMIT; } })); +Object.defineProperty(exports, "DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; } })); +Object.defineProperty(exports, "DEFAULT_ENVIRONMENT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ENVIRONMENT; } })); +Object.defineProperty(exports, "DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT; } })); +Object.defineProperty(exports, "DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT; } })); +Object.defineProperty(exports, "parseEnvironment", ({ enumerable: true, get: function () { return environment_1.parseEnvironment; } })); +var merge_1 = __nccwpck_require__(85841); +Object.defineProperty(exports, "merge", ({ enumerable: true, get: function () { return merge_1.merge; } })); +var sampling_1 = __nccwpck_require__(30731); +Object.defineProperty(exports, "TracesSamplerValues", ({ enumerable: true, get: function () { return sampling_1.TracesSamplerValues; } })); +var timeout_1 = __nccwpck_require__(20480); +Object.defineProperty(exports, "TimeoutError", ({ enumerable: true, get: function () { return timeout_1.TimeoutError; } })); +Object.defineProperty(exports, "callWithTimeout", ({ enumerable: true, get: function () { return timeout_1.callWithTimeout; } })); +var url_1 = __nccwpck_require__(38966); +Object.defineProperty(exports, "isUrlIgnored", ({ enumerable: true, get: function () { return url_1.isUrlIgnored; } })); +Object.defineProperty(exports, "urlMatches", ({ enumerable: true, get: function () { return url_1.urlMatches; } })); +var wrap_1 = __nccwpck_require__(49625); +Object.defineProperty(exports, "isWrapped", ({ enumerable: true, get: function () { return wrap_1.isWrapped; } })); +var callback_1 = __nccwpck_require__(86119); +Object.defineProperty(exports, "BindOnceFuture", ({ enumerable: true, get: function () { return callback_1.BindOnceFuture; } })); +var version_1 = __nccwpck_require__(33802); +Object.defineProperty(exports, "VERSION", ({ enumerable: true, get: function () { return version_1.VERSION; } })); +const exporter_1 = __nccwpck_require__(19189); +exports.internal = { + _export: exporter_1._export, +}; +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 19189: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._export = void 0; +const api_1 = __nccwpck_require__(65163); +const suppress_tracing_1 = __nccwpck_require__(1761); +/** + * @internal + * Shared functionality used by Exporters while exporting data, including suppression of Traces. + */ +function _export(exporter, arg) { + return new Promise(resolve => { + // prevent downstream exporter calls from generating spans + api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { + exporter.export(arg, (result) => { + resolve(result); + }); + }); + }); +} +exports._export = _export; +//# sourceMappingURL=exporter.js.map + +/***/ }), + +/***/ 94763: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.validateValue = exports.validateKey = void 0; +const VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]'; +const VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; +const VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; +const VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); +const VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; +const INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; +/** + * Key is opaque string up to 256 characters printable. It MUST begin with a + * lowercase letter, and can only contain lowercase letters a-z, digits 0-9, + * underscores _, dashes -, asterisks *, and forward slashes /. + * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the + * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key. + * see https://www.w3.org/TR/trace-context/#key + */ +function validateKey(key) { + return VALID_KEY_REGEX.test(key); +} +exports.validateKey = validateKey; +/** + * Value is opaque string up to 256 characters printable ASCII RFC0020 + * characters (i.e., the range 0x20 to 0x7E) except comma , and =. + */ +function validateValue(value) { + return (VALID_VALUE_BASE_REGEX.test(value) && + !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value)); +} +exports.validateValue = validateValue; +//# sourceMappingURL=validators.js.map + +/***/ }), + +/***/ 45649: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.unrefTimer = exports.otperformance = exports.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var node_1 = __nccwpck_require__(63591); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return node_1.RandomIdGenerator; } })); +Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return node_1.SDK_INFO; } })); +Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return node_1._globalThis; } })); +Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return node_1.getEnv; } })); +Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return node_1.getEnvWithoutDefaults; } })); +Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return node_1.hexToBase64; } })); +Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return node_1.otperformance; } })); +Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return node_1.unrefTimer; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 25336: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RandomIdGenerator = void 0; +const SPAN_ID_BYTES = 8; +const TRACE_ID_BYTES = 16; +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + */ +class RandomIdGenerator { + constructor() { + /** + * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex + * characters corresponding to 128 bits. + */ + this.generateTraceId = getIdGenerator(TRACE_ID_BYTES); + /** + * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex + * characters corresponding to 64 bits. + */ + this.generateSpanId = getIdGenerator(SPAN_ID_BYTES); + } +} +exports.RandomIdGenerator = RandomIdGenerator; +const SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES); +function getIdGenerator(bytes) { + return function generateId() { + for (let i = 0; i < bytes / 4; i++) { + // unsigned right shift drops decimal part of the number + // it is required because if a number between 2**32 and 2**32 - 1 is generated, an out of range error is thrown by writeUInt32BE + SHARED_BUFFER.writeUInt32BE((Math.random() * 2 ** 32) >>> 0, i * 4); + } + // If buffer is all 0, set the last byte to 1 to guarantee a valid w3c id is generated + for (let i = 0; i < bytes; i++) { + if (SHARED_BUFFER[i] > 0) { + break; + } + else if (i === bytes - 1) { + SHARED_BUFFER[bytes - 1] = 1; + } + } + return SHARED_BUFFER.toString('hex', 0, bytes); + }; +} +//# sourceMappingURL=RandomIdGenerator.js.map + +/***/ }), + +/***/ 61542: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getEnvWithoutDefaults = exports.getEnv = void 0; +const environment_1 = __nccwpck_require__(15017); +/** + * Gets the environment variables + */ +function getEnv() { + const processEnv = (0, environment_1.parseEnvironment)(process.env); + return Object.assign({}, environment_1.DEFAULT_ENVIRONMENT, processEnv); +} +exports.getEnv = getEnv; +function getEnvWithoutDefaults() { + return (0, environment_1.parseEnvironment)(process.env); +} +exports.getEnvWithoutDefaults = getEnvWithoutDefaults; +//# sourceMappingURL=environment.js.map + +/***/ }), + +/***/ 40247: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._globalThis = void 0; +/** only globals that common to node and browsers are allowed */ +// eslint-disable-next-line node/no-unsupported-features/es-builtins +exports._globalThis = typeof globalThis === 'object' ? globalThis : global; +//# sourceMappingURL=globalThis.js.map + +/***/ }), + +/***/ 94028: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.hexToBase64 = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const hex_to_binary_1 = __nccwpck_require__(23954); +function hexToBase64(hexStr) { + return Buffer.from((0, hex_to_binary_1.hexToBinary)(hexStr)).toString('base64'); +} +exports.hexToBase64 = hexToBase64; +//# sourceMappingURL=hex-to-base64.js.map + +/***/ }), + +/***/ 63591: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.unrefTimer = exports.SDK_INFO = exports.otperformance = exports.RandomIdGenerator = exports.hexToBase64 = exports._globalThis = exports.getEnv = exports.getEnvWithoutDefaults = void 0; +var environment_1 = __nccwpck_require__(61542); +Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return environment_1.getEnvWithoutDefaults; } })); +Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return environment_1.getEnv; } })); +var globalThis_1 = __nccwpck_require__(40247); +Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return globalThis_1._globalThis; } })); +var hex_to_base64_1 = __nccwpck_require__(94028); +Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return hex_to_base64_1.hexToBase64; } })); +var RandomIdGenerator_1 = __nccwpck_require__(25336); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return RandomIdGenerator_1.RandomIdGenerator; } })); +var performance_1 = __nccwpck_require__(54813); +Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return performance_1.otperformance; } })); +var sdk_info_1 = __nccwpck_require__(97526); +Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return sdk_info_1.SDK_INFO; } })); +var timer_util_1 = __nccwpck_require__(84589); +Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return timer_util_1.unrefTimer; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 54813: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.otperformance = void 0; +const perf_hooks_1 = __nccwpck_require__(4074); +exports.otperformance = perf_hooks_1.performance; +//# sourceMappingURL=performance.js.map + +/***/ }), + +/***/ 97526: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SDK_INFO = void 0; +const version_1 = __nccwpck_require__(33802); +const semantic_conventions_1 = __nccwpck_require__(67275); +/** Constants describing the SDK in use */ +exports.SDK_INFO = { + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME]: 'opentelemetry', + [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'node', + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRYSDKLANGUAGEVALUES_NODEJS, + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_VERSION]: version_1.VERSION, +}; +//# sourceMappingURL=sdk-info.js.map + +/***/ }), + +/***/ 84589: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.unrefTimer = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +function unrefTimer(timer) { + timer.unref(); +} +exports.unrefTimer = unrefTimer; +//# sourceMappingURL=timer-util.js.map + +/***/ }), + +/***/ 74712: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.CompositePropagator = void 0; +const api_1 = __nccwpck_require__(65163); +/** Combines multiple propagators into a single propagator. */ +class CompositePropagator { + /** + * Construct a composite propagator from a list of propagators. + * + * @param [config] Configuration object for composite propagator + */ + constructor(config = {}) { + var _a; + this._propagators = (_a = config.propagators) !== null && _a !== void 0 ? _a : []; + this._fields = Array.from(new Set(this._propagators + // older propagators may not have fields function, null check to be sure + .map(p => (typeof p.fields === 'function' ? p.fields() : [])) + .reduce((x, y) => x.concat(y), []))); + } + /** + * Run each of the configured propagators with the given context and carrier. + * Propagators are run in the order they are configured, so if multiple + * propagators write the same carrier key, the propagator later in the list + * will "win". + * + * @param context Context to inject + * @param carrier Carrier into which context will be injected + */ + inject(context, carrier, setter) { + for (const propagator of this._propagators) { + try { + propagator.inject(context, carrier, setter); + } + catch (err) { + api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); + } + } + } + /** + * Run each of the configured propagators with the given context and carrier. + * Propagators are run in the order they are configured, so if multiple + * propagators write the same context key, the propagator later in the list + * will "win". + * + * @param context Context to add values to + * @param carrier Carrier from which to extract context + */ + extract(context, carrier, getter) { + return this._propagators.reduce((ctx, propagator) => { + try { + return propagator.extract(ctx, carrier, getter); + } + catch (err) { + api_1.diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`); + } + return ctx; + }, context); + } + fields() { + // return a new array so our fields cannot be modified + return this._fields.slice(); + } +} +exports.CompositePropagator = CompositePropagator; +//# sourceMappingURL=composite.js.map + +/***/ }), + +/***/ 13837: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TraceState = void 0; +const validators_1 = __nccwpck_require__(94763); +const MAX_TRACE_STATE_ITEMS = 32; +const MAX_TRACE_STATE_LEN = 512; +const LIST_MEMBERS_SEPARATOR = ','; +const LIST_MEMBER_KEY_VALUE_SPLITTER = '='; +/** + * TraceState must be a class and not a simple object type because of the spec + * requirement (https://www.w3.org/TR/trace-context/#tracestate-field). + * + * Here is the list of allowed mutations: + * - New key-value pair should be added into the beginning of the list + * - The value of any key can be updated. Modified keys MUST be moved to the + * beginning of the list. + */ +class TraceState { + constructor(rawTraceState) { + this._internalState = new Map(); + if (rawTraceState) + this._parse(rawTraceState); + } + set(key, value) { + // TODO: Benchmark the different approaches(map vs list) and + // use the faster one. + const traceState = this._clone(); + if (traceState._internalState.has(key)) { + traceState._internalState.delete(key); + } + traceState._internalState.set(key, value); + return traceState; + } + unset(key) { + const traceState = this._clone(); + traceState._internalState.delete(key); + return traceState; + } + get(key) { + return this._internalState.get(key); + } + serialize() { + return this._keys() + .reduce((agg, key) => { + agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key)); + return agg; + }, []) + .join(LIST_MEMBERS_SEPARATOR); + } + _parse(rawTraceState) { + if (rawTraceState.length > MAX_TRACE_STATE_LEN) + return; + this._internalState = rawTraceState + .split(LIST_MEMBERS_SEPARATOR) + .reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning + .reduce((agg, part) => { + const listMember = part.trim(); // Optional Whitespace (OWS) handling + const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); + if (i !== -1) { + const key = listMember.slice(0, i); + const value = listMember.slice(i + 1, part.length); + if ((0, validators_1.validateKey)(key) && (0, validators_1.validateValue)(value)) { + agg.set(key, value); + } + else { + // TODO: Consider to add warning log + } + } + return agg; + }, new Map()); + // Because of the reverse() requirement, trunc must be done after map is created + if (this._internalState.size > MAX_TRACE_STATE_ITEMS) { + this._internalState = new Map(Array.from(this._internalState.entries()) + .reverse() // Use reverse same as original tracestate parse chain + .slice(0, MAX_TRACE_STATE_ITEMS)); + } + } + _keys() { + return Array.from(this._internalState.keys()).reverse(); + } + _clone() { + const traceState = new TraceState(); + traceState._internalState = new Map(this._internalState); + return traceState; + } +} +exports.TraceState = TraceState; +//# sourceMappingURL=TraceState.js.map + +/***/ }), + +/***/ 39344: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0; +const api_1 = __nccwpck_require__(65163); +const suppress_tracing_1 = __nccwpck_require__(1761); +const TraceState_1 = __nccwpck_require__(13837); +exports.TRACE_PARENT_HEADER = 'traceparent'; +exports.TRACE_STATE_HEADER = 'tracestate'; +const VERSION = '00'; +const VERSION_PART = '(?!ff)[\\da-f]{2}'; +const TRACE_ID_PART = '(?![0]{32})[\\da-f]{32}'; +const PARENT_ID_PART = '(?![0]{16})[\\da-f]{16}'; +const FLAGS_PART = '[\\da-f]{2}'; +const TRACE_PARENT_REGEX = new RegExp(`^\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\s?$`); +/** + * Parses information from the [traceparent] span tag and converts it into {@link SpanContext} + * @param traceParent - A meta property that comes from server. + * It should be dynamically generated server side to have the server's request trace Id, + * a parent span Id that was set on the server's request span, + * and the trace flags to indicate the server's sampling decision + * (01 = sampled, 00 = not sampled). + * for example: '{version}-{traceId}-{spanId}-{sampleDecision}' + * For more information see {@link https://www.w3.org/TR/trace-context/} + */ +function parseTraceParent(traceParent) { + const match = TRACE_PARENT_REGEX.exec(traceParent); + if (!match) + return null; + // According to the specification the implementation should be compatible + // with future versions. If there are more parts, we only reject it if it's using version 00 + // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent + if (match[1] === '00' && match[5]) + return null; + return { + traceId: match[2], + spanId: match[3], + traceFlags: parseInt(match[4], 16), + }; +} +exports.parseTraceParent = parseTraceParent; +/** + * Propagates {@link SpanContext} through Trace Context format propagation. + * + * Based on the Trace Context specification: + * https://www.w3.org/TR/trace-context/ + */ +class W3CTraceContextPropagator { + inject(context, carrier, setter) { + const spanContext = api_1.trace.getSpanContext(context); + if (!spanContext || + (0, suppress_tracing_1.isTracingSuppressed)(context) || + !(0, api_1.isSpanContextValid)(spanContext)) + return; + const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; + setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); + if (spanContext.traceState) { + setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); + } + } + extract(context, carrier, getter) { + const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); + if (!traceParentHeader) + return context; + const traceParent = Array.isArray(traceParentHeader) + ? traceParentHeader[0] + : traceParentHeader; + if (typeof traceParent !== 'string') + return context; + const spanContext = parseTraceParent(traceParent); + if (!spanContext) + return context; + spanContext.isRemote = true; + const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); + if (traceStateHeader) { + // If more than one `tracestate` header is found, we merge them into a + // single header. + const state = Array.isArray(traceStateHeader) + ? traceStateHeader.join(',') + : traceStateHeader; + spanContext.traceState = new TraceState_1.TraceState(typeof state === 'string' ? state : undefined); + } + return api_1.trace.setSpanContext(context, spanContext); + } + fields() { + return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; + } +} +exports.W3CTraceContextPropagator = W3CTraceContextPropagator; +//# sourceMappingURL=W3CTraceContextPropagator.js.map + +/***/ }), + +/***/ 84727: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0; +const api_1 = __nccwpck_require__(65163); +const RPC_METADATA_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key RPC_METADATA'); +var RPCType; +(function (RPCType) { + RPCType["HTTP"] = "http"; +})(RPCType = exports.RPCType || (exports.RPCType = {})); +function setRPCMetadata(context, meta) { + return context.setValue(RPC_METADATA_KEY, meta); +} +exports.setRPCMetadata = setRPCMetadata; +function deleteRPCMetadata(context) { + return context.deleteValue(RPC_METADATA_KEY); +} +exports.deleteRPCMetadata = deleteRPCMetadata; +function getRPCMetadata(context) { + return context.getValue(RPC_METADATA_KEY); +} +exports.getRPCMetadata = getRPCMetadata; +//# sourceMappingURL=rpc-metadata.js.map + +/***/ }), + +/***/ 11742: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AlwaysOffSampler = void 0; +const api_1 = __nccwpck_require__(65163); +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + * Sampler that samples no traces. + */ +class AlwaysOffSampler { + shouldSample() { + return { + decision: api_1.SamplingDecision.NOT_RECORD, + }; + } + toString() { + return 'AlwaysOffSampler'; + } +} +exports.AlwaysOffSampler = AlwaysOffSampler; +//# sourceMappingURL=AlwaysOffSampler.js.map + +/***/ }), + +/***/ 30137: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AlwaysOnSampler = void 0; +const api_1 = __nccwpck_require__(65163); +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + * Sampler that samples all traces. + */ +class AlwaysOnSampler { + shouldSample() { + return { + decision: api_1.SamplingDecision.RECORD_AND_SAMPLED, + }; + } + toString() { + return 'AlwaysOnSampler'; + } +} +exports.AlwaysOnSampler = AlwaysOnSampler; +//# sourceMappingURL=AlwaysOnSampler.js.map + +/***/ }), + +/***/ 67801: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ParentBasedSampler = void 0; +const api_1 = __nccwpck_require__(65163); +const global_error_handler_1 = __nccwpck_require__(54328); +const AlwaysOffSampler_1 = __nccwpck_require__(11742); +const AlwaysOnSampler_1 = __nccwpck_require__(30137); +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + * A composite sampler that either respects the parent span's sampling decision + * or delegates to `delegateSampler` for root spans. + */ +class ParentBasedSampler { + constructor(config) { + var _a, _b, _c, _d; + this._root = config.root; + if (!this._root) { + (0, global_error_handler_1.globalErrorHandler)(new Error('ParentBasedSampler must have a root sampler configured')); + this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); + } + this._remoteParentSampled = + (_a = config.remoteParentSampled) !== null && _a !== void 0 ? _a : new AlwaysOnSampler_1.AlwaysOnSampler(); + this._remoteParentNotSampled = + (_b = config.remoteParentNotSampled) !== null && _b !== void 0 ? _b : new AlwaysOffSampler_1.AlwaysOffSampler(); + this._localParentSampled = + (_c = config.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler_1.AlwaysOnSampler(); + this._localParentNotSampled = + (_d = config.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler_1.AlwaysOffSampler(); + } + shouldSample(context, traceId, spanName, spanKind, attributes, links) { + const parentContext = api_1.trace.getSpanContext(context); + if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) { + return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.isRemote) { + if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { + return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { + return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + toString() { + return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; + } +} +exports.ParentBasedSampler = ParentBasedSampler; +//# sourceMappingURL=ParentBasedSampler.js.map + +/***/ }), + +/***/ 12900: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TraceIdRatioBasedSampler = void 0; +const api_1 = __nccwpck_require__(65163); +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + * Sampler that samples a given fraction of traces based of trace id deterministically. + */ +class TraceIdRatioBasedSampler { + constructor(_ratio = 0) { + this._ratio = _ratio; + this._ratio = this._normalize(_ratio); + this._upperBound = Math.floor(this._ratio * 0xffffffff); + } + shouldSample(context, traceId) { + return { + decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound + ? api_1.SamplingDecision.RECORD_AND_SAMPLED + : api_1.SamplingDecision.NOT_RECORD, + }; + } + toString() { + return `TraceIdRatioBased{${this._ratio}}`; + } + _normalize(ratio) { + if (typeof ratio !== 'number' || isNaN(ratio)) + return 0; + return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio; + } + _accumulate(traceId) { + let accumulation = 0; + for (let i = 0; i < traceId.length / 8; i++) { + const pos = i * 8; + const part = parseInt(traceId.slice(pos, pos + 8), 16); + accumulation = (accumulation ^ part) >>> 0; + } + return accumulation; + } +} +exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; +//# sourceMappingURL=TraceIdRatioBasedSampler.js.map + +/***/ }), + +/***/ 1761: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0; +const api_1 = __nccwpck_require__(65163); +const SUPPRESS_TRACING_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key SUPPRESS_TRACING'); +function suppressTracing(context) { + return context.setValue(SUPPRESS_TRACING_KEY, true); +} +exports.suppressTracing = suppressTracing; +function unsuppressTracing(context) { + return context.deleteValue(SUPPRESS_TRACING_KEY); +} +exports.unsuppressTracing = unsuppressTracing; +function isTracingSuppressed(context) { + return context.getValue(SUPPRESS_TRACING_KEY) === true; +} +exports.isTracingSuppressed = isTracingSuppressed; +//# sourceMappingURL=suppress-tracing.js.map + +/***/ }), + +/***/ 86119: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BindOnceFuture = void 0; +const promise_1 = __nccwpck_require__(1491); +/** + * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked. + */ +class BindOnceFuture { + constructor(_callback, _that) { + this._callback = _callback; + this._that = _that; + this._isCalled = false; + this._deferred = new promise_1.Deferred(); + } + get isCalled() { + return this._isCalled; + } + get promise() { + return this._deferred.promise; + } + call(...args) { + if (!this._isCalled) { + this._isCalled = true; + try { + Promise.resolve(this._callback.call(this._that, ...args)).then(val => this._deferred.resolve(val), err => this._deferred.reject(err)); + } + catch (err) { + this._deferred.reject(err); + } + } + return this._deferred.promise; + } +} +exports.BindOnceFuture = BindOnceFuture; +//# sourceMappingURL=callback.js.map + +/***/ }), + +/***/ 15017: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseEnvironment = exports.DEFAULT_ENVIRONMENT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = void 0; +const api_1 = __nccwpck_require__(65163); +const sampling_1 = __nccwpck_require__(30731); +const DEFAULT_LIST_SEPARATOR = ','; +/** + * Environment interface to define all names + */ +const ENVIRONMENT_BOOLEAN_KEYS = ['OTEL_SDK_DISABLED']; +function isEnvVarABoolean(key) { + return (ENVIRONMENT_BOOLEAN_KEYS.indexOf(key) > -1); +} +const ENVIRONMENT_NUMBERS_KEYS = [ + 'OTEL_BSP_EXPORT_TIMEOUT', + 'OTEL_BSP_MAX_EXPORT_BATCH_SIZE', + 'OTEL_BSP_MAX_QUEUE_SIZE', + 'OTEL_BSP_SCHEDULE_DELAY', + 'OTEL_BLRP_EXPORT_TIMEOUT', + 'OTEL_BLRP_MAX_EXPORT_BATCH_SIZE', + 'OTEL_BLRP_MAX_QUEUE_SIZE', + 'OTEL_BLRP_SCHEDULE_DELAY', + 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT', + 'OTEL_ATTRIBUTE_COUNT_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT', + 'OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT', + 'OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT', + 'OTEL_SPAN_EVENT_COUNT_LIMIT', + 'OTEL_SPAN_LINK_COUNT_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT', + 'OTEL_EXPORTER_OTLP_TIMEOUT', + 'OTEL_EXPORTER_OTLP_TRACES_TIMEOUT', + 'OTEL_EXPORTER_OTLP_METRICS_TIMEOUT', + 'OTEL_EXPORTER_OTLP_LOGS_TIMEOUT', + 'OTEL_EXPORTER_JAEGER_AGENT_PORT', +]; +function isEnvVarANumber(key) { + return (ENVIRONMENT_NUMBERS_KEYS.indexOf(key) > -1); +} +const ENVIRONMENT_LISTS_KEYS = [ + 'OTEL_NO_PATCH_MODULES', + 'OTEL_PROPAGATORS', + 'OTEL_SEMCONV_STABILITY_OPT_IN', +]; +function isEnvVarAList(key) { + return ENVIRONMENT_LISTS_KEYS.indexOf(key) > -1; +} +exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity; +exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128; +exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = 128; +exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = 128; +/** + * Default environment variables + */ +exports.DEFAULT_ENVIRONMENT = { + OTEL_SDK_DISABLED: false, + CONTAINER_NAME: '', + ECS_CONTAINER_METADATA_URI_V4: '', + ECS_CONTAINER_METADATA_URI: '', + HOSTNAME: '', + KUBERNETES_SERVICE_HOST: '', + NAMESPACE: '', + OTEL_BSP_EXPORT_TIMEOUT: 30000, + OTEL_BSP_MAX_EXPORT_BATCH_SIZE: 512, + OTEL_BSP_MAX_QUEUE_SIZE: 2048, + OTEL_BSP_SCHEDULE_DELAY: 5000, + OTEL_BLRP_EXPORT_TIMEOUT: 30000, + OTEL_BLRP_MAX_EXPORT_BATCH_SIZE: 512, + OTEL_BLRP_MAX_QUEUE_SIZE: 2048, + OTEL_BLRP_SCHEDULE_DELAY: 5000, + OTEL_EXPORTER_JAEGER_AGENT_HOST: '', + OTEL_EXPORTER_JAEGER_AGENT_PORT: 6832, + OTEL_EXPORTER_JAEGER_ENDPOINT: '', + OTEL_EXPORTER_JAEGER_PASSWORD: '', + OTEL_EXPORTER_JAEGER_USER: '', + OTEL_EXPORTER_OTLP_ENDPOINT: '', + OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: '', + OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '', + OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: '', + OTEL_EXPORTER_OTLP_HEADERS: '', + OTEL_EXPORTER_OTLP_TRACES_HEADERS: '', + OTEL_EXPORTER_OTLP_METRICS_HEADERS: '', + OTEL_EXPORTER_OTLP_LOGS_HEADERS: '', + OTEL_EXPORTER_OTLP_TIMEOUT: 10000, + OTEL_EXPORTER_OTLP_TRACES_TIMEOUT: 10000, + OTEL_EXPORTER_OTLP_METRICS_TIMEOUT: 10000, + OTEL_EXPORTER_OTLP_LOGS_TIMEOUT: 10000, + OTEL_EXPORTER_ZIPKIN_ENDPOINT: 'http://localhost:9411/api/v2/spans', + OTEL_LOG_LEVEL: api_1.DiagLogLevel.INFO, + OTEL_NO_PATCH_MODULES: [], + OTEL_PROPAGATORS: ['tracecontext', 'baggage'], + OTEL_RESOURCE_ATTRIBUTES: '', + OTEL_SERVICE_NAME: '', + OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, + OTEL_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, + OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, + OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, + OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, + OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, + OTEL_SPAN_EVENT_COUNT_LIMIT: 128, + OTEL_SPAN_LINK_COUNT_LIMIT: 128, + OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT: exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, + OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT: exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT, + OTEL_TRACES_EXPORTER: '', + OTEL_TRACES_SAMPLER: sampling_1.TracesSamplerValues.ParentBasedAlwaysOn, + OTEL_TRACES_SAMPLER_ARG: '', + OTEL_LOGS_EXPORTER: '', + OTEL_EXPORTER_OTLP_INSECURE: '', + OTEL_EXPORTER_OTLP_TRACES_INSECURE: '', + OTEL_EXPORTER_OTLP_METRICS_INSECURE: '', + OTEL_EXPORTER_OTLP_LOGS_INSECURE: '', + OTEL_EXPORTER_OTLP_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_COMPRESSION: '', + OTEL_EXPORTER_OTLP_TRACES_COMPRESSION: '', + OTEL_EXPORTER_OTLP_METRICS_COMPRESSION: '', + OTEL_EXPORTER_OTLP_LOGS_COMPRESSION: '', + OTEL_EXPORTER_OTLP_CLIENT_KEY: '', + OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY: '', + OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY: '', + OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY: '', + OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_PROTOCOL: 'http/protobuf', + OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: 'http/protobuf', + OTEL_EXPORTER_OTLP_METRICS_PROTOCOL: 'http/protobuf', + OTEL_EXPORTER_OTLP_LOGS_PROTOCOL: 'http/protobuf', + OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE: 'cumulative', + OTEL_SEMCONV_STABILITY_OPT_IN: [], +}; +/** + * @param key + * @param environment + * @param values + */ +function parseBoolean(key, environment, values) { + if (typeof values[key] === 'undefined') { + return; + } + const value = String(values[key]); + // support case-insensitive "true" + environment[key] = value.toLowerCase() === 'true'; +} +/** + * Parses a variable as number with number validation + * @param name + * @param environment + * @param values + * @param min + * @param max + */ +function parseNumber(name, environment, values, min = -Infinity, max = Infinity) { + if (typeof values[name] !== 'undefined') { + const value = Number(values[name]); + if (!isNaN(value)) { + if (value < min) { + environment[name] = min; + } + else if (value > max) { + environment[name] = max; + } + else { + environment[name] = value; + } + } + } +} +/** + * Parses list-like strings from input into output. + * @param name + * @param environment + * @param values + * @param separator + */ +function parseStringList(name, output, input, separator = DEFAULT_LIST_SEPARATOR) { + const givenValue = input[name]; + if (typeof givenValue === 'string') { + output[name] = givenValue.split(separator).map(v => v.trim()); + } +} +// The support string -> DiagLogLevel mappings +const logLevelMap = { + ALL: api_1.DiagLogLevel.ALL, + VERBOSE: api_1.DiagLogLevel.VERBOSE, + DEBUG: api_1.DiagLogLevel.DEBUG, + INFO: api_1.DiagLogLevel.INFO, + WARN: api_1.DiagLogLevel.WARN, + ERROR: api_1.DiagLogLevel.ERROR, + NONE: api_1.DiagLogLevel.NONE, +}; +/** + * Environmentally sets log level if valid log level string is provided + * @param key + * @param environment + * @param values + */ +function setLogLevelFromEnv(key, environment, values) { + const value = values[key]; + if (typeof value === 'string') { + const theLevel = logLevelMap[value.toUpperCase()]; + if (theLevel != null) { + environment[key] = theLevel; + } + } +} +/** + * Parses environment values + * @param values + */ +function parseEnvironment(values) { + const environment = {}; + for (const env in exports.DEFAULT_ENVIRONMENT) { + const key = env; + switch (key) { + case 'OTEL_LOG_LEVEL': + setLogLevelFromEnv(key, environment, values); + break; + default: + if (isEnvVarABoolean(key)) { + parseBoolean(key, environment, values); + } + else if (isEnvVarANumber(key)) { + parseNumber(key, environment, values); + } + else if (isEnvVarAList(key)) { + parseStringList(key, environment, values); + } + else { + const value = values[key]; + if (typeof value !== 'undefined' && value !== null) { + environment[key] = String(value); + } + } + } + } + return environment; +} +exports.parseEnvironment = parseEnvironment; +//# sourceMappingURL=environment.js.map + +/***/ }), + +/***/ 35449: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isPlainObject = void 0; +/* eslint-disable @typescript-eslint/no-explicit-any */ +/** + * based on lodash in order to support esm builds without esModuleInterop. + * lodash is using MIT License. + **/ +const objectTag = '[object Object]'; +const nullTag = '[object Null]'; +const undefinedTag = '[object Undefined]'; +const funcProto = Function.prototype; +const funcToString = funcProto.toString; +const objectCtorString = funcToString.call(Object); +const getPrototype = overArg(Object.getPrototypeOf, Object); +const objectProto = Object.prototype; +const hasOwnProperty = objectProto.hasOwnProperty; +const symToStringTag = Symbol ? Symbol.toStringTag : undefined; +const nativeObjectToString = objectProto.toString; +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function (arg) { + return func(transform(arg)); + }; +} +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) !== objectTag) { + return false; + } + const proto = getPrototype(value); + if (proto === null) { + return true; + } + const Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return (typeof Ctor == 'function' && + Ctor instanceof Ctor && + funcToString.call(Ctor) === objectCtorString); +} +exports.isPlainObject = isPlainObject; +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return symToStringTag && symToStringTag in Object(value) + ? getRawTag(value) + : objectToString(value); +} +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; + let unmasked = false; + try { + value[symToStringTag] = undefined; + unmasked = true; + } + catch (e) { + // silence + } + const result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } + else { + delete value[symToStringTag]; + } + } + return result; +} +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} +//# sourceMappingURL=lodash.merge.js.map + +/***/ }), + +/***/ 85841: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.merge = void 0; +/* eslint-disable @typescript-eslint/no-explicit-any */ +const lodash_merge_1 = __nccwpck_require__(35449); +const MAX_LEVEL = 20; +/** + * Merges objects together + * @param args - objects / values to be merged + */ +function merge(...args) { + let result = args.shift(); + const objects = new WeakMap(); + while (args.length > 0) { + result = mergeTwoObjects(result, args.shift(), 0, objects); + } + return result; +} +exports.merge = merge; +function takeValue(value) { + if (isArray(value)) { + return value.slice(); + } + return value; +} +/** + * Merges two objects + * @param one - first object + * @param two - second object + * @param level - current deep level + * @param objects - objects holder that has been already referenced - to prevent + * cyclic dependency + */ +function mergeTwoObjects(one, two, level = 0, objects) { + let result; + if (level > MAX_LEVEL) { + return undefined; + } + level++; + if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) { + result = takeValue(two); + } + else if (isArray(one)) { + result = one.slice(); + if (isArray(two)) { + for (let i = 0, j = two.length; i < j; i++) { + result.push(takeValue(two[i])); + } + } + else if (isObject(two)) { + const keys = Object.keys(two); + for (let i = 0, j = keys.length; i < j; i++) { + const key = keys[i]; + result[key] = takeValue(two[key]); + } + } + } + else if (isObject(one)) { + if (isObject(two)) { + if (!shouldMerge(one, two)) { + return two; + } + result = Object.assign({}, one); + const keys = Object.keys(two); + for (let i = 0, j = keys.length; i < j; i++) { + const key = keys[i]; + const twoValue = two[key]; + if (isPrimitive(twoValue)) { + if (typeof twoValue === 'undefined') { + delete result[key]; + } + else { + // result[key] = takeValue(twoValue); + result[key] = twoValue; + } + } + else { + const obj1 = result[key]; + const obj2 = twoValue; + if (wasObjectReferenced(one, key, objects) || + wasObjectReferenced(two, key, objects)) { + delete result[key]; + } + else { + if (isObject(obj1) && isObject(obj2)) { + const arr1 = objects.get(obj1) || []; + const arr2 = objects.get(obj2) || []; + arr1.push({ obj: one, key }); + arr2.push({ obj: two, key }); + objects.set(obj1, arr1); + objects.set(obj2, arr2); + } + result[key] = mergeTwoObjects(result[key], twoValue, level, objects); + } + } + } + } + else { + result = two; + } + } + return result; +} +/** + * Function to check if object has been already reference + * @param obj + * @param key + * @param objects + */ +function wasObjectReferenced(obj, key, objects) { + const arr = objects.get(obj[key]) || []; + for (let i = 0, j = arr.length; i < j; i++) { + const info = arr[i]; + if (info.key === key && info.obj === obj) { + return true; + } + } + return false; +} +function isArray(value) { + return Array.isArray(value); +} +function isFunction(value) { + return typeof value === 'function'; +} +function isObject(value) { + return (!isPrimitive(value) && + !isArray(value) && + !isFunction(value) && + typeof value === 'object'); +} +function isPrimitive(value) { + return (typeof value === 'string' || + typeof value === 'number' || + typeof value === 'boolean' || + typeof value === 'undefined' || + value instanceof Date || + value instanceof RegExp || + value === null); +} +function shouldMerge(one, two) { + if (!(0, lodash_merge_1.isPlainObject)(one) || !(0, lodash_merge_1.isPlainObject)(two)) { + return false; + } + return true; +} +//# sourceMappingURL=merge.js.map + +/***/ }), + +/***/ 1491: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Deferred = void 0; +class Deferred { + constructor() { + this._promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + }); + } + get promise() { + return this._promise; + } + resolve(val) { + this._resolve(val); + } + reject(err) { + this._reject(err); + } +} +exports.Deferred = Deferred; +//# sourceMappingURL=promise.js.map + +/***/ }), + +/***/ 30731: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TracesSamplerValues = void 0; +var TracesSamplerValues; +(function (TracesSamplerValues) { + TracesSamplerValues["AlwaysOff"] = "always_off"; + TracesSamplerValues["AlwaysOn"] = "always_on"; + TracesSamplerValues["ParentBasedAlwaysOff"] = "parentbased_always_off"; + TracesSamplerValues["ParentBasedAlwaysOn"] = "parentbased_always_on"; + TracesSamplerValues["ParentBasedTraceIdRatio"] = "parentbased_traceidratio"; + TracesSamplerValues["TraceIdRatio"] = "traceidratio"; +})(TracesSamplerValues = exports.TracesSamplerValues || (exports.TracesSamplerValues = {})); +//# sourceMappingURL=sampling.js.map + +/***/ }), + +/***/ 20480: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.callWithTimeout = exports.TimeoutError = void 0; +/** + * Error that is thrown on timeouts. + */ +class TimeoutError extends Error { + constructor(message) { + super(message); + // manually adjust prototype to retain `instanceof` functionality when targeting ES5, see: + // https://github.com/Microsoft/TypeScript-wiki/blob/main/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work + Object.setPrototypeOf(this, TimeoutError.prototype); + } +} +exports.TimeoutError = TimeoutError; +/** + * Adds a timeout to a promise and rejects if the specified timeout has elapsed. Also rejects if the specified promise + * rejects, and resolves if the specified promise resolves. + * + *

NOTE: this operation will continue even after it throws a {@link TimeoutError}. + * + * @param promise promise to use with timeout. + * @param timeout the timeout in milliseconds until the returned promise is rejected. + */ +function callWithTimeout(promise, timeout) { + let timeoutHandle; + const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { + timeoutHandle = setTimeout(function timeoutHandler() { + reject(new TimeoutError('Operation timed out.')); + }, timeout); + }); + return Promise.race([promise, timeoutPromise]).then(result => { + clearTimeout(timeoutHandle); + return result; + }, reason => { + clearTimeout(timeoutHandle); + throw reason; + }); +} +exports.callWithTimeout = callWithTimeout; +//# sourceMappingURL=timeout.js.map + +/***/ }), + +/***/ 38966: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isUrlIgnored = exports.urlMatches = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +function urlMatches(url, urlToMatch) { + if (typeof urlToMatch === 'string') { + return url === urlToMatch; + } + else { + return !!url.match(urlToMatch); + } +} +exports.urlMatches = urlMatches; +/** + * Check if {@param url} should be ignored when comparing against {@param ignoredUrls} + * @param url + * @param ignoredUrls + */ +function isUrlIgnored(url, ignoredUrls) { + if (!ignoredUrls) { + return false; + } + for (const ignoreUrl of ignoredUrls) { + if (urlMatches(url, ignoreUrl)) { + return true; + } + } + return false; +} +exports.isUrlIgnored = isUrlIgnored; +//# sourceMappingURL=url.js.map + +/***/ }), + +/***/ 49625: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isWrapped = void 0; +/** + * Checks if certain function has been already wrapped + * @param func + */ +function isWrapped(func) { + return (typeof func === 'function' && + typeof func.__original === 'function' && + typeof func.__unwrap === 'function' && + func.__wrapped === true); +} +exports.isWrapped = isWrapped; +//# sourceMappingURL=wrap.js.map + +/***/ }), + +/***/ 33802: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.VERSION = '1.30.1'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 67275: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +/* eslint-disable no-restricted-syntax -- + * These re-exports are only of constants, only two-levels deep, and + * should not cause problems for tree-shakers. + */ +// Deprecated. These are kept around for compatibility purposes +__exportStar(__nccwpck_require__(45836), exports); +__exportStar(__nccwpck_require__(2834), exports); +// Use these instead +__exportStar(__nccwpck_require__(69301), exports); +__exportStar(__nccwpck_require__(46152), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 749: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createConstMap = void 0; +/** + * Creates a const map from the given values + * @param values - An array of values to be used as keys and values in the map. + * @returns A populated version of the map with the values and keys derived from the values. + */ +/*#__NO_SIDE_EFFECTS__*/ +function createConstMap(values) { + // eslint-disable-next-line prefer-const, @typescript-eslint/no-explicit-any + let res = {}; + const len = values.length; + for (let lp = 0; lp < len; lp++) { + const val = values[lp]; + if (val) { + res[String(val).toUpperCase().replace(/[-.]/g, '_')] = val; + } + } + return res; +} +exports.createConstMap = createConstMap; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 85003: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SEMRESATTRS_K8S_STATEFULSET_NAME = exports.SEMRESATTRS_K8S_STATEFULSET_UID = exports.SEMRESATTRS_K8S_DEPLOYMENT_NAME = exports.SEMRESATTRS_K8S_DEPLOYMENT_UID = exports.SEMRESATTRS_K8S_REPLICASET_NAME = exports.SEMRESATTRS_K8S_REPLICASET_UID = exports.SEMRESATTRS_K8S_CONTAINER_NAME = exports.SEMRESATTRS_K8S_POD_NAME = exports.SEMRESATTRS_K8S_POD_UID = exports.SEMRESATTRS_K8S_NAMESPACE_NAME = exports.SEMRESATTRS_K8S_NODE_UID = exports.SEMRESATTRS_K8S_NODE_NAME = exports.SEMRESATTRS_K8S_CLUSTER_NAME = exports.SEMRESATTRS_HOST_IMAGE_VERSION = exports.SEMRESATTRS_HOST_IMAGE_ID = exports.SEMRESATTRS_HOST_IMAGE_NAME = exports.SEMRESATTRS_HOST_ARCH = exports.SEMRESATTRS_HOST_TYPE = exports.SEMRESATTRS_HOST_NAME = exports.SEMRESATTRS_HOST_ID = exports.SEMRESATTRS_FAAS_MAX_MEMORY = exports.SEMRESATTRS_FAAS_INSTANCE = exports.SEMRESATTRS_FAAS_VERSION = exports.SEMRESATTRS_FAAS_ID = exports.SEMRESATTRS_FAAS_NAME = exports.SEMRESATTRS_DEVICE_MODEL_NAME = exports.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER = exports.SEMRESATTRS_DEVICE_ID = exports.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT = exports.SEMRESATTRS_CONTAINER_IMAGE_TAG = exports.SEMRESATTRS_CONTAINER_IMAGE_NAME = exports.SEMRESATTRS_CONTAINER_RUNTIME = exports.SEMRESATTRS_CONTAINER_ID = exports.SEMRESATTRS_CONTAINER_NAME = exports.SEMRESATTRS_AWS_LOG_STREAM_ARNS = exports.SEMRESATTRS_AWS_LOG_STREAM_NAMES = exports.SEMRESATTRS_AWS_LOG_GROUP_ARNS = exports.SEMRESATTRS_AWS_LOG_GROUP_NAMES = exports.SEMRESATTRS_AWS_EKS_CLUSTER_ARN = exports.SEMRESATTRS_AWS_ECS_TASK_REVISION = exports.SEMRESATTRS_AWS_ECS_TASK_FAMILY = exports.SEMRESATTRS_AWS_ECS_TASK_ARN = exports.SEMRESATTRS_AWS_ECS_LAUNCHTYPE = exports.SEMRESATTRS_AWS_ECS_CLUSTER_ARN = exports.SEMRESATTRS_AWS_ECS_CONTAINER_ARN = exports.SEMRESATTRS_CLOUD_PLATFORM = exports.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE = exports.SEMRESATTRS_CLOUD_REGION = exports.SEMRESATTRS_CLOUD_ACCOUNT_ID = exports.SEMRESATTRS_CLOUD_PROVIDER = void 0; +exports.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = exports.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = exports.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = exports.CLOUDPLATFORMVALUES_AZURE_AKS = exports.CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = exports.CLOUDPLATFORMVALUES_AZURE_VM = exports.CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = exports.CLOUDPLATFORMVALUES_AWS_LAMBDA = exports.CLOUDPLATFORMVALUES_AWS_EKS = exports.CLOUDPLATFORMVALUES_AWS_ECS = exports.CLOUDPLATFORMVALUES_AWS_EC2 = exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = exports.CloudProviderValues = exports.CLOUDPROVIDERVALUES_GCP = exports.CLOUDPROVIDERVALUES_AZURE = exports.CLOUDPROVIDERVALUES_AWS = exports.CLOUDPROVIDERVALUES_ALIBABA_CLOUD = exports.SemanticResourceAttributes = exports.SEMRESATTRS_WEBENGINE_DESCRIPTION = exports.SEMRESATTRS_WEBENGINE_VERSION = exports.SEMRESATTRS_WEBENGINE_NAME = exports.SEMRESATTRS_TELEMETRY_AUTO_VERSION = exports.SEMRESATTRS_TELEMETRY_SDK_VERSION = exports.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE = exports.SEMRESATTRS_TELEMETRY_SDK_NAME = exports.SEMRESATTRS_SERVICE_VERSION = exports.SEMRESATTRS_SERVICE_INSTANCE_ID = exports.SEMRESATTRS_SERVICE_NAMESPACE = exports.SEMRESATTRS_SERVICE_NAME = exports.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION = exports.SEMRESATTRS_PROCESS_RUNTIME_VERSION = exports.SEMRESATTRS_PROCESS_RUNTIME_NAME = exports.SEMRESATTRS_PROCESS_OWNER = exports.SEMRESATTRS_PROCESS_COMMAND_ARGS = exports.SEMRESATTRS_PROCESS_COMMAND_LINE = exports.SEMRESATTRS_PROCESS_COMMAND = exports.SEMRESATTRS_PROCESS_EXECUTABLE_PATH = exports.SEMRESATTRS_PROCESS_EXECUTABLE_NAME = exports.SEMRESATTRS_PROCESS_PID = exports.SEMRESATTRS_OS_VERSION = exports.SEMRESATTRS_OS_NAME = exports.SEMRESATTRS_OS_DESCRIPTION = exports.SEMRESATTRS_OS_TYPE = exports.SEMRESATTRS_K8S_CRONJOB_NAME = exports.SEMRESATTRS_K8S_CRONJOB_UID = exports.SEMRESATTRS_K8S_JOB_NAME = exports.SEMRESATTRS_K8S_JOB_UID = exports.SEMRESATTRS_K8S_DAEMONSET_NAME = exports.SEMRESATTRS_K8S_DAEMONSET_UID = void 0; +exports.TelemetrySdkLanguageValues = exports.TELEMETRYSDKLANGUAGEVALUES_WEBJS = exports.TELEMETRYSDKLANGUAGEVALUES_RUBY = exports.TELEMETRYSDKLANGUAGEVALUES_PYTHON = exports.TELEMETRYSDKLANGUAGEVALUES_PHP = exports.TELEMETRYSDKLANGUAGEVALUES_NODEJS = exports.TELEMETRYSDKLANGUAGEVALUES_JAVA = exports.TELEMETRYSDKLANGUAGEVALUES_GO = exports.TELEMETRYSDKLANGUAGEVALUES_ERLANG = exports.TELEMETRYSDKLANGUAGEVALUES_DOTNET = exports.TELEMETRYSDKLANGUAGEVALUES_CPP = exports.OsTypeValues = exports.OSTYPEVALUES_Z_OS = exports.OSTYPEVALUES_SOLARIS = exports.OSTYPEVALUES_AIX = exports.OSTYPEVALUES_HPUX = exports.OSTYPEVALUES_DRAGONFLYBSD = exports.OSTYPEVALUES_OPENBSD = exports.OSTYPEVALUES_NETBSD = exports.OSTYPEVALUES_FREEBSD = exports.OSTYPEVALUES_DARWIN = exports.OSTYPEVALUES_LINUX = exports.OSTYPEVALUES_WINDOWS = exports.HostArchValues = exports.HOSTARCHVALUES_X86 = exports.HOSTARCHVALUES_PPC64 = exports.HOSTARCHVALUES_PPC32 = exports.HOSTARCHVALUES_IA64 = exports.HOSTARCHVALUES_ARM64 = exports.HOSTARCHVALUES_ARM32 = exports.HOSTARCHVALUES_AMD64 = exports.AwsEcsLaunchtypeValues = exports.AWSECSLAUNCHTYPEVALUES_FARGATE = exports.AWSECSLAUNCHTYPEVALUES_EC2 = exports.CloudPlatformValues = exports.CLOUDPLATFORMVALUES_GCP_APP_ENGINE = exports.CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = exports.CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = exports.CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = void 0; +const utils_1 = __nccwpck_require__(749); +//---------------------------------------------------------------------------------------------------------- +// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2 +//---------------------------------------------------------------------------------------------------------- +//---------------------------------------------------------------------------------------------------------- +// Constant values for SemanticResourceAttributes +//---------------------------------------------------------------------------------------------------------- +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_CLOUD_PROVIDER = 'cloud.provider'; +const TMP_CLOUD_ACCOUNT_ID = 'cloud.account.id'; +const TMP_CLOUD_REGION = 'cloud.region'; +const TMP_CLOUD_AVAILABILITY_ZONE = 'cloud.availability_zone'; +const TMP_CLOUD_PLATFORM = 'cloud.platform'; +const TMP_AWS_ECS_CONTAINER_ARN = 'aws.ecs.container.arn'; +const TMP_AWS_ECS_CLUSTER_ARN = 'aws.ecs.cluster.arn'; +const TMP_AWS_ECS_LAUNCHTYPE = 'aws.ecs.launchtype'; +const TMP_AWS_ECS_TASK_ARN = 'aws.ecs.task.arn'; +const TMP_AWS_ECS_TASK_FAMILY = 'aws.ecs.task.family'; +const TMP_AWS_ECS_TASK_REVISION = 'aws.ecs.task.revision'; +const TMP_AWS_EKS_CLUSTER_ARN = 'aws.eks.cluster.arn'; +const TMP_AWS_LOG_GROUP_NAMES = 'aws.log.group.names'; +const TMP_AWS_LOG_GROUP_ARNS = 'aws.log.group.arns'; +const TMP_AWS_LOG_STREAM_NAMES = 'aws.log.stream.names'; +const TMP_AWS_LOG_STREAM_ARNS = 'aws.log.stream.arns'; +const TMP_CONTAINER_NAME = 'container.name'; +const TMP_CONTAINER_ID = 'container.id'; +const TMP_CONTAINER_RUNTIME = 'container.runtime'; +const TMP_CONTAINER_IMAGE_NAME = 'container.image.name'; +const TMP_CONTAINER_IMAGE_TAG = 'container.image.tag'; +const TMP_DEPLOYMENT_ENVIRONMENT = 'deployment.environment'; +const TMP_DEVICE_ID = 'device.id'; +const TMP_DEVICE_MODEL_IDENTIFIER = 'device.model.identifier'; +const TMP_DEVICE_MODEL_NAME = 'device.model.name'; +const TMP_FAAS_NAME = 'faas.name'; +const TMP_FAAS_ID = 'faas.id'; +const TMP_FAAS_VERSION = 'faas.version'; +const TMP_FAAS_INSTANCE = 'faas.instance'; +const TMP_FAAS_MAX_MEMORY = 'faas.max_memory'; +const TMP_HOST_ID = 'host.id'; +const TMP_HOST_NAME = 'host.name'; +const TMP_HOST_TYPE = 'host.type'; +const TMP_HOST_ARCH = 'host.arch'; +const TMP_HOST_IMAGE_NAME = 'host.image.name'; +const TMP_HOST_IMAGE_ID = 'host.image.id'; +const TMP_HOST_IMAGE_VERSION = 'host.image.version'; +const TMP_K8S_CLUSTER_NAME = 'k8s.cluster.name'; +const TMP_K8S_NODE_NAME = 'k8s.node.name'; +const TMP_K8S_NODE_UID = 'k8s.node.uid'; +const TMP_K8S_NAMESPACE_NAME = 'k8s.namespace.name'; +const TMP_K8S_POD_UID = 'k8s.pod.uid'; +const TMP_K8S_POD_NAME = 'k8s.pod.name'; +const TMP_K8S_CONTAINER_NAME = 'k8s.container.name'; +const TMP_K8S_REPLICASET_UID = 'k8s.replicaset.uid'; +const TMP_K8S_REPLICASET_NAME = 'k8s.replicaset.name'; +const TMP_K8S_DEPLOYMENT_UID = 'k8s.deployment.uid'; +const TMP_K8S_DEPLOYMENT_NAME = 'k8s.deployment.name'; +const TMP_K8S_STATEFULSET_UID = 'k8s.statefulset.uid'; +const TMP_K8S_STATEFULSET_NAME = 'k8s.statefulset.name'; +const TMP_K8S_DAEMONSET_UID = 'k8s.daemonset.uid'; +const TMP_K8S_DAEMONSET_NAME = 'k8s.daemonset.name'; +const TMP_K8S_JOB_UID = 'k8s.job.uid'; +const TMP_K8S_JOB_NAME = 'k8s.job.name'; +const TMP_K8S_CRONJOB_UID = 'k8s.cronjob.uid'; +const TMP_K8S_CRONJOB_NAME = 'k8s.cronjob.name'; +const TMP_OS_TYPE = 'os.type'; +const TMP_OS_DESCRIPTION = 'os.description'; +const TMP_OS_NAME = 'os.name'; +const TMP_OS_VERSION = 'os.version'; +const TMP_PROCESS_PID = 'process.pid'; +const TMP_PROCESS_EXECUTABLE_NAME = 'process.executable.name'; +const TMP_PROCESS_EXECUTABLE_PATH = 'process.executable.path'; +const TMP_PROCESS_COMMAND = 'process.command'; +const TMP_PROCESS_COMMAND_LINE = 'process.command_line'; +const TMP_PROCESS_COMMAND_ARGS = 'process.command_args'; +const TMP_PROCESS_OWNER = 'process.owner'; +const TMP_PROCESS_RUNTIME_NAME = 'process.runtime.name'; +const TMP_PROCESS_RUNTIME_VERSION = 'process.runtime.version'; +const TMP_PROCESS_RUNTIME_DESCRIPTION = 'process.runtime.description'; +const TMP_SERVICE_NAME = 'service.name'; +const TMP_SERVICE_NAMESPACE = 'service.namespace'; +const TMP_SERVICE_INSTANCE_ID = 'service.instance.id'; +const TMP_SERVICE_VERSION = 'service.version'; +const TMP_TELEMETRY_SDK_NAME = 'telemetry.sdk.name'; +const TMP_TELEMETRY_SDK_LANGUAGE = 'telemetry.sdk.language'; +const TMP_TELEMETRY_SDK_VERSION = 'telemetry.sdk.version'; +const TMP_TELEMETRY_AUTO_VERSION = 'telemetry.auto.version'; +const TMP_WEBENGINE_NAME = 'webengine.name'; +const TMP_WEBENGINE_VERSION = 'webengine.version'; +const TMP_WEBENGINE_DESCRIPTION = 'webengine.description'; +/** + * Name of the cloud provider. + * + * @deprecated Use ATTR_CLOUD_PROVIDER in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_CLOUD_PROVIDER = TMP_CLOUD_PROVIDER; +/** + * The cloud account ID the resource is assigned to. + * + * @deprecated Use ATTR_CLOUD_ACCOUNT_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_CLOUD_ACCOUNT_ID = TMP_CLOUD_ACCOUNT_ID; +/** + * The geographical region the resource is running. Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), or [Google Cloud regions](https://cloud.google.com/about/locations). + * + * @deprecated Use ATTR_CLOUD_REGION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_CLOUD_REGION = TMP_CLOUD_REGION; +/** + * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. + * + * Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud. + * + * @deprecated Use ATTR_CLOUD_AVAILABILITY_ZONE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE = TMP_CLOUD_AVAILABILITY_ZONE; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use ATTR_CLOUD_PLATFORM in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_CLOUD_PLATFORM = TMP_CLOUD_PLATFORM; +/** + * The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). + * + * @deprecated Use ATTR_AWS_ECS_CONTAINER_ARN in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_AWS_ECS_CONTAINER_ARN = TMP_AWS_ECS_CONTAINER_ARN; +/** + * The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). + * + * @deprecated Use ATTR_AWS_ECS_CLUSTER_ARN in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_AWS_ECS_CLUSTER_ARN = TMP_AWS_ECS_CLUSTER_ARN; +/** + * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. + * + * @deprecated Use ATTR_AWS_ECS_LAUNCHTYPE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_AWS_ECS_LAUNCHTYPE = TMP_AWS_ECS_LAUNCHTYPE; +/** + * The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). + * + * @deprecated Use ATTR_AWS_ECS_TASK_ARN in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_AWS_ECS_TASK_ARN = TMP_AWS_ECS_TASK_ARN; +/** + * The task definition family this task definition is a member of. + * + * @deprecated Use ATTR_AWS_ECS_TASK_FAMILY in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_AWS_ECS_TASK_FAMILY = TMP_AWS_ECS_TASK_FAMILY; +/** + * The revision for this task definition. + * + * @deprecated Use ATTR_AWS_ECS_TASK_REVISION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_AWS_ECS_TASK_REVISION = TMP_AWS_ECS_TASK_REVISION; +/** + * The ARN of an EKS cluster. + * + * @deprecated Use ATTR_AWS_EKS_CLUSTER_ARN in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_AWS_EKS_CLUSTER_ARN = TMP_AWS_EKS_CLUSTER_ARN; +/** + * The name(s) of the AWS log group(s) an application is writing to. + * + * Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. + * + * @deprecated Use ATTR_AWS_LOG_GROUP_NAMES in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_AWS_LOG_GROUP_NAMES = TMP_AWS_LOG_GROUP_NAMES; +/** + * The Amazon Resource Name(s) (ARN) of the AWS log group(s). + * + * Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). + * + * @deprecated Use ATTR_AWS_LOG_GROUP_ARNS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_AWS_LOG_GROUP_ARNS = TMP_AWS_LOG_GROUP_ARNS; +/** + * The name(s) of the AWS log stream(s) an application is writing to. + * + * @deprecated Use ATTR_AWS_LOG_STREAM_NAMES in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_AWS_LOG_STREAM_NAMES = TMP_AWS_LOG_STREAM_NAMES; +/** + * The ARN(s) of the AWS log stream(s). + * + * Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. + * + * @deprecated Use ATTR_AWS_LOG_STREAM_ARNS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_AWS_LOG_STREAM_ARNS = TMP_AWS_LOG_STREAM_ARNS; +/** + * Container name. + * + * @deprecated Use ATTR_CONTAINER_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_CONTAINER_NAME = TMP_CONTAINER_NAME; +/** + * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. + * + * @deprecated Use ATTR_CONTAINER_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_CONTAINER_ID = TMP_CONTAINER_ID; +/** + * The container runtime managing this container. + * + * @deprecated Use ATTR_CONTAINER_RUNTIME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_CONTAINER_RUNTIME = TMP_CONTAINER_RUNTIME; +/** + * Name of the image the container was built on. + * + * @deprecated Use ATTR_CONTAINER_IMAGE_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_CONTAINER_IMAGE_NAME = TMP_CONTAINER_IMAGE_NAME; +/** + * Container image tag. + * + * @deprecated Use ATTR_CONTAINER_IMAGE_TAGS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_CONTAINER_IMAGE_TAG = TMP_CONTAINER_IMAGE_TAG; +/** + * Name of the [deployment environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka deployment tier). + * + * @deprecated Use ATTR_DEPLOYMENT_ENVIRONMENT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT = TMP_DEPLOYMENT_ENVIRONMENT; +/** + * A unique identifier representing the device. + * + * Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. + * + * @deprecated Use ATTR_DEVICE_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_DEVICE_ID = TMP_DEVICE_ID; +/** + * The model identifier for the device. + * + * Note: It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device. + * + * @deprecated Use ATTR_DEVICE_MODEL_IDENTIFIER in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER = TMP_DEVICE_MODEL_IDENTIFIER; +/** + * The marketing name for the device model. + * + * Note: It's recommended this value represents a human readable version of the device model rather than a machine readable alternative. + * + * @deprecated Use ATTR_DEVICE_MODEL_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_DEVICE_MODEL_NAME = TMP_DEVICE_MODEL_NAME; +/** + * The name of the single function that this runtime instance executes. + * + * Note: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the [`code.namespace`/`code.function`](../../trace/semantic_conventions/span-general.md#source-code-attributes) span attributes). + * + * @deprecated Use ATTR_FAAS_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_FAAS_NAME = TMP_FAAS_NAME; +/** +* The unique ID of the single function that this runtime instance executes. +* +* Note: Depending on the cloud provider, use: + +* **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). +Take care not to use the "invoked ARN" directly but replace any +[alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) with the resolved function version, as the same runtime instance may be invokable with multiple +different aliases. +* **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) +* **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id). + +On some providers, it may not be possible to determine the full ID at startup, +which is why this field cannot be made required. For example, on AWS the account ID +part of the ARN is not available without calling another AWS API +which may be deemed too slow for a short-running lambda function. +As an alternative, consider setting `faas.id` as a span attribute instead. +* +* @deprecated Use ATTR_CLOUD_RESOURCE_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). +*/ +exports.SEMRESATTRS_FAAS_ID = TMP_FAAS_ID; +/** +* The immutable version of the function being executed. +* +* Note: Depending on the cloud provider and platform, use: + +* **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) + (an integer represented as a decimal string). +* **Google Cloud Run:** The [revision](https://cloud.google.com/run/docs/managing/revisions) + (i.e., the function name plus the revision suffix). +* **Google Cloud Functions:** The value of the + [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). +* **Azure Functions:** Not applicable. Do not set this attribute. +* +* @deprecated Use ATTR_FAAS_VERSION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). +*/ +exports.SEMRESATTRS_FAAS_VERSION = TMP_FAAS_VERSION; +/** + * The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. + * + * Note: * **AWS Lambda:** Use the (full) log stream name. + * + * @deprecated Use ATTR_FAAS_INSTANCE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_FAAS_INSTANCE = TMP_FAAS_INSTANCE; +/** + * The amount of memory available to the serverless function in MiB. + * + * Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information. + * + * @deprecated Use ATTR_FAAS_MAX_MEMORY in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_FAAS_MAX_MEMORY = TMP_FAAS_MAX_MEMORY; +/** + * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. + * + * @deprecated Use ATTR_HOST_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_HOST_ID = TMP_HOST_ID; +/** + * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. + * + * @deprecated Use ATTR_HOST_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_HOST_NAME = TMP_HOST_NAME; +/** + * Type of host. For Cloud, this must be the machine type. + * + * @deprecated Use ATTR_HOST_TYPE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_HOST_TYPE = TMP_HOST_TYPE; +/** + * The CPU architecture the host system is running on. + * + * @deprecated Use ATTR_HOST_ARCH in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_HOST_ARCH = TMP_HOST_ARCH; +/** + * Name of the VM image or OS install the host was instantiated from. + * + * @deprecated Use ATTR_HOST_IMAGE_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_HOST_IMAGE_NAME = TMP_HOST_IMAGE_NAME; +/** + * VM image ID. For Cloud, this value is from the provider. + * + * @deprecated Use ATTR_HOST_IMAGE_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_HOST_IMAGE_ID = TMP_HOST_IMAGE_ID; +/** + * The version string of the VM image as defined in [Version Attributes](README.md#version-attributes). + * + * @deprecated Use ATTR_HOST_IMAGE_VERSION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_HOST_IMAGE_VERSION = TMP_HOST_IMAGE_VERSION; +/** + * The name of the cluster. + * + * @deprecated Use ATTR_K8S_CLUSTER_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_K8S_CLUSTER_NAME = TMP_K8S_CLUSTER_NAME; +/** + * The name of the Node. + * + * @deprecated Use ATTR_K8S_NODE_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_K8S_NODE_NAME = TMP_K8S_NODE_NAME; +/** + * The UID of the Node. + * + * @deprecated Use ATTR_K8S_NODE_UID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_K8S_NODE_UID = TMP_K8S_NODE_UID; +/** + * The name of the namespace that the pod is running in. + * + * @deprecated Use ATTR_K8S_NAMESPACE_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_K8S_NAMESPACE_NAME = TMP_K8S_NAMESPACE_NAME; +/** + * The UID of the Pod. + * + * @deprecated Use ATTR_K8S_POD_UID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_K8S_POD_UID = TMP_K8S_POD_UID; +/** + * The name of the Pod. + * + * @deprecated Use ATTR_K8S_POD_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_K8S_POD_NAME = TMP_K8S_POD_NAME; +/** + * The name of the Container in a Pod template. + * + * @deprecated Use ATTR_K8S_CONTAINER_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_K8S_CONTAINER_NAME = TMP_K8S_CONTAINER_NAME; +/** + * The UID of the ReplicaSet. + * + * @deprecated Use ATTR_K8S_REPLICASET_UID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_K8S_REPLICASET_UID = TMP_K8S_REPLICASET_UID; +/** + * The name of the ReplicaSet. + * + * @deprecated Use ATTR_K8S_REPLICASET_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_K8S_REPLICASET_NAME = TMP_K8S_REPLICASET_NAME; +/** + * The UID of the Deployment. + * + * @deprecated Use ATTR_K8S_DEPLOYMENT_UID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_K8S_DEPLOYMENT_UID = TMP_K8S_DEPLOYMENT_UID; +/** + * The name of the Deployment. + * + * @deprecated Use ATTR_K8S_DEPLOYMENT_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_K8S_DEPLOYMENT_NAME = TMP_K8S_DEPLOYMENT_NAME; +/** + * The UID of the StatefulSet. + * + * @deprecated Use ATTR_K8S_STATEFULSET_UID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_K8S_STATEFULSET_UID = TMP_K8S_STATEFULSET_UID; +/** + * The name of the StatefulSet. + * + * @deprecated Use ATTR_K8S_STATEFULSET_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_K8S_STATEFULSET_NAME = TMP_K8S_STATEFULSET_NAME; +/** + * The UID of the DaemonSet. + * + * @deprecated Use ATTR_K8S_DAEMONSET_UID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_K8S_DAEMONSET_UID = TMP_K8S_DAEMONSET_UID; +/** + * The name of the DaemonSet. + * + * @deprecated Use ATTR_K8S_DAEMONSET_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_K8S_DAEMONSET_NAME = TMP_K8S_DAEMONSET_NAME; +/** + * The UID of the Job. + * + * @deprecated Use ATTR_K8S_JOB_UID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_K8S_JOB_UID = TMP_K8S_JOB_UID; +/** + * The name of the Job. + * + * @deprecated Use ATTR_K8S_JOB_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_K8S_JOB_NAME = TMP_K8S_JOB_NAME; +/** + * The UID of the CronJob. + * + * @deprecated Use ATTR_K8S_CRONJOB_UID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_K8S_CRONJOB_UID = TMP_K8S_CRONJOB_UID; +/** + * The name of the CronJob. + * + * @deprecated Use ATTR_K8S_CRONJOB_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_K8S_CRONJOB_NAME = TMP_K8S_CRONJOB_NAME; +/** + * The operating system type. + * + * @deprecated Use ATTR_OS_TYPE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_OS_TYPE = TMP_OS_TYPE; +/** + * Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. + * + * @deprecated Use ATTR_OS_DESCRIPTION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_OS_DESCRIPTION = TMP_OS_DESCRIPTION; +/** + * Human readable operating system name. + * + * @deprecated Use ATTR_OS_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_OS_NAME = TMP_OS_NAME; +/** + * The version string of the operating system as defined in [Version Attributes](../../resource/semantic_conventions/README.md#version-attributes). + * + * @deprecated Use ATTR_OS_VERSION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_OS_VERSION = TMP_OS_VERSION; +/** + * Process identifier (PID). + * + * @deprecated Use ATTR_PROCESS_PID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_PROCESS_PID = TMP_PROCESS_PID; +/** + * The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. + * + * @deprecated Use ATTR_PROCESS_EXECUTABLE_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_PROCESS_EXECUTABLE_NAME = TMP_PROCESS_EXECUTABLE_NAME; +/** + * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. + * + * @deprecated Use ATTR_PROCESS_EXECUTABLE_PATH in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_PROCESS_EXECUTABLE_PATH = TMP_PROCESS_EXECUTABLE_PATH; +/** + * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. + * + * @deprecated Use ATTR_PROCESS_COMMAND in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_PROCESS_COMMAND = TMP_PROCESS_COMMAND; +/** + * The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. + * + * @deprecated Use ATTR_PROCESS_COMMAND_LINE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_PROCESS_COMMAND_LINE = TMP_PROCESS_COMMAND_LINE; +/** + * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. + * + * @deprecated Use ATTR_PROCESS_COMMAND_ARGS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_PROCESS_COMMAND_ARGS = TMP_PROCESS_COMMAND_ARGS; +/** + * The username of the user that owns the process. + * + * @deprecated Use ATTR_PROCESS_OWNER in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_PROCESS_OWNER = TMP_PROCESS_OWNER; +/** + * The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. + * + * @deprecated Use ATTR_PROCESS_RUNTIME_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_PROCESS_RUNTIME_NAME = TMP_PROCESS_RUNTIME_NAME; +/** + * The version of the runtime of this process, as returned by the runtime without modification. + * + * @deprecated Use ATTR_PROCESS_RUNTIME_VERSION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_PROCESS_RUNTIME_VERSION = TMP_PROCESS_RUNTIME_VERSION; +/** + * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. + * + * @deprecated Use ATTR_PROCESS_RUNTIME_DESCRIPTION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION = TMP_PROCESS_RUNTIME_DESCRIPTION; +/** + * Logical name of the service. + * + * 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#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. + * + * @deprecated Use ATTR_SERVICE_NAME. + */ +exports.SEMRESATTRS_SERVICE_NAME = TMP_SERVICE_NAME; +/** + * A namespace for `service.name`. + * + * 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. + * + * @deprecated Use ATTR_SERVICE_NAMESPACE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_SERVICE_NAMESPACE = TMP_SERVICE_NAMESPACE; +/** + * The string ID of the service instance. + * + * Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations). + * + * @deprecated Use ATTR_SERVICE_INSTANCE_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_SERVICE_INSTANCE_ID = TMP_SERVICE_INSTANCE_ID; +/** + * The version string of the service API or implementation. + * + * @deprecated Use ATTR_SERVICE_VERSION. + */ +exports.SEMRESATTRS_SERVICE_VERSION = TMP_SERVICE_VERSION; +/** + * The name of the telemetry SDK as defined above. + * + * @deprecated Use ATTR_TELEMETRY_SDK_NAME. + */ +exports.SEMRESATTRS_TELEMETRY_SDK_NAME = TMP_TELEMETRY_SDK_NAME; +/** + * The language of the telemetry SDK. + * + * @deprecated Use ATTR_TELEMETRY_SDK_LANGUAGE. + */ +exports.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE = TMP_TELEMETRY_SDK_LANGUAGE; +/** + * The version string of the telemetry SDK. + * + * @deprecated Use ATTR_TELEMETRY_SDK_VERSION. + */ +exports.SEMRESATTRS_TELEMETRY_SDK_VERSION = TMP_TELEMETRY_SDK_VERSION; +/** + * The version string of the auto instrumentation agent, if used. + * + * @deprecated Use ATTR_TELEMETRY_DISTRO_VERSION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_TELEMETRY_AUTO_VERSION = TMP_TELEMETRY_AUTO_VERSION; +/** + * The name of the web engine. + * + * @deprecated Use ATTR_WEBENGINE_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_WEBENGINE_NAME = TMP_WEBENGINE_NAME; +/** + * The version of the web engine. + * + * @deprecated Use ATTR_WEBENGINE_VERSION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_WEBENGINE_VERSION = TMP_WEBENGINE_VERSION; +/** + * Additional description of the web engine (e.g. detailed version and edition information). + * + * @deprecated Use ATTR_WEBENGINE_DESCRIPTION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMRESATTRS_WEBENGINE_DESCRIPTION = TMP_WEBENGINE_DESCRIPTION; +/** + * Create exported Value Map for SemanticResourceAttributes values + * @deprecated Use the SEMRESATTRS_XXXXX constants rather than the SemanticResourceAttributes.XXXXX for bundle minification + */ +exports.SemanticResourceAttributes = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_CLOUD_PROVIDER, + TMP_CLOUD_ACCOUNT_ID, + TMP_CLOUD_REGION, + TMP_CLOUD_AVAILABILITY_ZONE, + TMP_CLOUD_PLATFORM, + TMP_AWS_ECS_CONTAINER_ARN, + TMP_AWS_ECS_CLUSTER_ARN, + TMP_AWS_ECS_LAUNCHTYPE, + TMP_AWS_ECS_TASK_ARN, + TMP_AWS_ECS_TASK_FAMILY, + TMP_AWS_ECS_TASK_REVISION, + TMP_AWS_EKS_CLUSTER_ARN, + TMP_AWS_LOG_GROUP_NAMES, + TMP_AWS_LOG_GROUP_ARNS, + TMP_AWS_LOG_STREAM_NAMES, + TMP_AWS_LOG_STREAM_ARNS, + TMP_CONTAINER_NAME, + TMP_CONTAINER_ID, + TMP_CONTAINER_RUNTIME, + TMP_CONTAINER_IMAGE_NAME, + TMP_CONTAINER_IMAGE_TAG, + TMP_DEPLOYMENT_ENVIRONMENT, + TMP_DEVICE_ID, + TMP_DEVICE_MODEL_IDENTIFIER, + TMP_DEVICE_MODEL_NAME, + TMP_FAAS_NAME, + TMP_FAAS_ID, + TMP_FAAS_VERSION, + TMP_FAAS_INSTANCE, + TMP_FAAS_MAX_MEMORY, + TMP_HOST_ID, + TMP_HOST_NAME, + TMP_HOST_TYPE, + TMP_HOST_ARCH, + TMP_HOST_IMAGE_NAME, + TMP_HOST_IMAGE_ID, + TMP_HOST_IMAGE_VERSION, + TMP_K8S_CLUSTER_NAME, + TMP_K8S_NODE_NAME, + TMP_K8S_NODE_UID, + TMP_K8S_NAMESPACE_NAME, + TMP_K8S_POD_UID, + TMP_K8S_POD_NAME, + TMP_K8S_CONTAINER_NAME, + TMP_K8S_REPLICASET_UID, + TMP_K8S_REPLICASET_NAME, + TMP_K8S_DEPLOYMENT_UID, + TMP_K8S_DEPLOYMENT_NAME, + TMP_K8S_STATEFULSET_UID, + TMP_K8S_STATEFULSET_NAME, + TMP_K8S_DAEMONSET_UID, + TMP_K8S_DAEMONSET_NAME, + TMP_K8S_JOB_UID, + TMP_K8S_JOB_NAME, + TMP_K8S_CRONJOB_UID, + TMP_K8S_CRONJOB_NAME, + TMP_OS_TYPE, + TMP_OS_DESCRIPTION, + TMP_OS_NAME, + TMP_OS_VERSION, + TMP_PROCESS_PID, + TMP_PROCESS_EXECUTABLE_NAME, + TMP_PROCESS_EXECUTABLE_PATH, + TMP_PROCESS_COMMAND, + TMP_PROCESS_COMMAND_LINE, + TMP_PROCESS_COMMAND_ARGS, + TMP_PROCESS_OWNER, + TMP_PROCESS_RUNTIME_NAME, + TMP_PROCESS_RUNTIME_VERSION, + TMP_PROCESS_RUNTIME_DESCRIPTION, + TMP_SERVICE_NAME, + TMP_SERVICE_NAMESPACE, + TMP_SERVICE_INSTANCE_ID, + TMP_SERVICE_VERSION, + TMP_TELEMETRY_SDK_NAME, + TMP_TELEMETRY_SDK_LANGUAGE, + TMP_TELEMETRY_SDK_VERSION, + TMP_TELEMETRY_AUTO_VERSION, + TMP_WEBENGINE_NAME, + TMP_WEBENGINE_VERSION, + TMP_WEBENGINE_DESCRIPTION, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for CloudProviderValues enum definition + * + * Name of the cloud provider. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD = 'alibaba_cloud'; +const TMP_CLOUDPROVIDERVALUES_AWS = 'aws'; +const TMP_CLOUDPROVIDERVALUES_AZURE = 'azure'; +const TMP_CLOUDPROVIDERVALUES_GCP = 'gcp'; +/** + * Name of the cloud provider. + * + * @deprecated Use CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPROVIDERVALUES_ALIBABA_CLOUD = TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD; +/** + * Name of the cloud provider. + * + * @deprecated Use CLOUD_PROVIDER_VALUE_AWS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPROVIDERVALUES_AWS = TMP_CLOUDPROVIDERVALUES_AWS; +/** + * Name of the cloud provider. + * + * @deprecated Use CLOUD_PROVIDER_VALUE_AZURE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPROVIDERVALUES_AZURE = TMP_CLOUDPROVIDERVALUES_AZURE; +/** + * Name of the cloud provider. + * + * @deprecated Use CLOUD_PROVIDER_VALUE_GCP in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPROVIDERVALUES_GCP = TMP_CLOUDPROVIDERVALUES_GCP; +/** + * The constant map of values for CloudProviderValues. + * @deprecated Use the CLOUDPROVIDERVALUES_XXXXX constants rather than the CloudProviderValues.XXXXX for bundle minification. + */ +exports.CloudProviderValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD, + TMP_CLOUDPROVIDERVALUES_AWS, + TMP_CLOUDPROVIDERVALUES_AZURE, + TMP_CLOUDPROVIDERVALUES_GCP, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for CloudPlatformValues enum definition + * + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = 'alibaba_cloud_ecs'; +const TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = 'alibaba_cloud_fc'; +const TMP_CLOUDPLATFORMVALUES_AWS_EC2 = 'aws_ec2'; +const TMP_CLOUDPLATFORMVALUES_AWS_ECS = 'aws_ecs'; +const TMP_CLOUDPLATFORMVALUES_AWS_EKS = 'aws_eks'; +const TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA = 'aws_lambda'; +const TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = 'aws_elastic_beanstalk'; +const TMP_CLOUDPLATFORMVALUES_AZURE_VM = 'azure_vm'; +const TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = 'azure_container_instances'; +const TMP_CLOUDPLATFORMVALUES_AZURE_AKS = 'azure_aks'; +const TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = 'azure_functions'; +const TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = 'azure_app_service'; +const TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = 'gcp_compute_engine'; +const TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = 'gcp_cloud_run'; +const TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = 'gcp_kubernetes_engine'; +const TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = 'gcp_cloud_functions'; +const TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE = 'gcp_app_engine'; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_FC in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_AWS_EC2 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPLATFORMVALUES_AWS_EC2 = TMP_CLOUDPLATFORMVALUES_AWS_EC2; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_AWS_ECS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPLATFORMVALUES_AWS_ECS = TMP_CLOUDPLATFORMVALUES_AWS_ECS; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_AWS_EKS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPLATFORMVALUES_AWS_EKS = TMP_CLOUDPLATFORMVALUES_AWS_EKS; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_AWS_LAMBDA in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPLATFORMVALUES_AWS_LAMBDA = TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_AWS_ELASTIC_BEANSTALK in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_AZURE_VM in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPLATFORMVALUES_AZURE_VM = TMP_CLOUDPLATFORMVALUES_AZURE_VM; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_AZURE_CONTAINER_INSTANCES in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_AZURE_AKS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPLATFORMVALUES_AZURE_AKS = TMP_CLOUDPLATFORMVALUES_AZURE_AKS; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_AZURE_FUNCTIONS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_AZURE_APP_SERVICE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_GCP_COMPUTE_ENGINE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_GCP_CLOUD_RUN in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_GCP_KUBERNETES_ENGINE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_GCP_CLOUD_FUNCTIONS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS; +/** + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + * + * @deprecated Use CLOUD_PLATFORM_VALUE_GCP_APP_ENGINE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.CLOUDPLATFORMVALUES_GCP_APP_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE; +/** + * The constant map of values for CloudPlatformValues. + * @deprecated Use the CLOUDPLATFORMVALUES_XXXXX constants rather than the CloudPlatformValues.XXXXX for bundle minification. + */ +exports.CloudPlatformValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS, + TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC, + TMP_CLOUDPLATFORMVALUES_AWS_EC2, + TMP_CLOUDPLATFORMVALUES_AWS_ECS, + TMP_CLOUDPLATFORMVALUES_AWS_EKS, + TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA, + TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK, + TMP_CLOUDPLATFORMVALUES_AZURE_VM, + TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES, + TMP_CLOUDPLATFORMVALUES_AZURE_AKS, + TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS, + TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE, + TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE, + TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN, + TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE, + TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS, + TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for AwsEcsLaunchtypeValues enum definition + * + * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_AWSECSLAUNCHTYPEVALUES_EC2 = 'ec2'; +const TMP_AWSECSLAUNCHTYPEVALUES_FARGATE = 'fargate'; +/** + * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. + * + * @deprecated Use AWS_ECS_LAUNCHTYPE_VALUE_EC2 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.AWSECSLAUNCHTYPEVALUES_EC2 = TMP_AWSECSLAUNCHTYPEVALUES_EC2; +/** + * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. + * + * @deprecated Use AWS_ECS_LAUNCHTYPE_VALUE_FARGATE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.AWSECSLAUNCHTYPEVALUES_FARGATE = TMP_AWSECSLAUNCHTYPEVALUES_FARGATE; +/** + * The constant map of values for AwsEcsLaunchtypeValues. + * @deprecated Use the AWSECSLAUNCHTYPEVALUES_XXXXX constants rather than the AwsEcsLaunchtypeValues.XXXXX for bundle minification. + */ +exports.AwsEcsLaunchtypeValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_AWSECSLAUNCHTYPEVALUES_EC2, + TMP_AWSECSLAUNCHTYPEVALUES_FARGATE, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for HostArchValues enum definition + * + * The CPU architecture the host system is running on. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_HOSTARCHVALUES_AMD64 = 'amd64'; +const TMP_HOSTARCHVALUES_ARM32 = 'arm32'; +const TMP_HOSTARCHVALUES_ARM64 = 'arm64'; +const TMP_HOSTARCHVALUES_IA64 = 'ia64'; +const TMP_HOSTARCHVALUES_PPC32 = 'ppc32'; +const TMP_HOSTARCHVALUES_PPC64 = 'ppc64'; +const TMP_HOSTARCHVALUES_X86 = 'x86'; +/** + * The CPU architecture the host system is running on. + * + * @deprecated Use HOST_ARCH_VALUE_AMD64 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.HOSTARCHVALUES_AMD64 = TMP_HOSTARCHVALUES_AMD64; +/** + * The CPU architecture the host system is running on. + * + * @deprecated Use HOST_ARCH_VALUE_ARM32 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.HOSTARCHVALUES_ARM32 = TMP_HOSTARCHVALUES_ARM32; +/** + * The CPU architecture the host system is running on. + * + * @deprecated Use HOST_ARCH_VALUE_ARM64 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.HOSTARCHVALUES_ARM64 = TMP_HOSTARCHVALUES_ARM64; +/** + * The CPU architecture the host system is running on. + * + * @deprecated Use HOST_ARCH_VALUE_IA64 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.HOSTARCHVALUES_IA64 = TMP_HOSTARCHVALUES_IA64; +/** + * The CPU architecture the host system is running on. + * + * @deprecated Use HOST_ARCH_VALUE_PPC32 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.HOSTARCHVALUES_PPC32 = TMP_HOSTARCHVALUES_PPC32; +/** + * The CPU architecture the host system is running on. + * + * @deprecated Use HOST_ARCH_VALUE_PPC64 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.HOSTARCHVALUES_PPC64 = TMP_HOSTARCHVALUES_PPC64; +/** + * The CPU architecture the host system is running on. + * + * @deprecated Use HOST_ARCH_VALUE_X86 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.HOSTARCHVALUES_X86 = TMP_HOSTARCHVALUES_X86; +/** + * The constant map of values for HostArchValues. + * @deprecated Use the HOSTARCHVALUES_XXXXX constants rather than the HostArchValues.XXXXX for bundle minification. + */ +exports.HostArchValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_HOSTARCHVALUES_AMD64, + TMP_HOSTARCHVALUES_ARM32, + TMP_HOSTARCHVALUES_ARM64, + TMP_HOSTARCHVALUES_IA64, + TMP_HOSTARCHVALUES_PPC32, + TMP_HOSTARCHVALUES_PPC64, + TMP_HOSTARCHVALUES_X86, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for OsTypeValues enum definition + * + * The operating system type. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_OSTYPEVALUES_WINDOWS = 'windows'; +const TMP_OSTYPEVALUES_LINUX = 'linux'; +const TMP_OSTYPEVALUES_DARWIN = 'darwin'; +const TMP_OSTYPEVALUES_FREEBSD = 'freebsd'; +const TMP_OSTYPEVALUES_NETBSD = 'netbsd'; +const TMP_OSTYPEVALUES_OPENBSD = 'openbsd'; +const TMP_OSTYPEVALUES_DRAGONFLYBSD = 'dragonflybsd'; +const TMP_OSTYPEVALUES_HPUX = 'hpux'; +const TMP_OSTYPEVALUES_AIX = 'aix'; +const TMP_OSTYPEVALUES_SOLARIS = 'solaris'; +const TMP_OSTYPEVALUES_Z_OS = 'z_os'; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_WINDOWS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.OSTYPEVALUES_WINDOWS = TMP_OSTYPEVALUES_WINDOWS; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_LINUX in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.OSTYPEVALUES_LINUX = TMP_OSTYPEVALUES_LINUX; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_DARWIN in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.OSTYPEVALUES_DARWIN = TMP_OSTYPEVALUES_DARWIN; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_FREEBSD in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.OSTYPEVALUES_FREEBSD = TMP_OSTYPEVALUES_FREEBSD; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_NETBSD in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.OSTYPEVALUES_NETBSD = TMP_OSTYPEVALUES_NETBSD; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_OPENBSD in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.OSTYPEVALUES_OPENBSD = TMP_OSTYPEVALUES_OPENBSD; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_DRAGONFLYBSD in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.OSTYPEVALUES_DRAGONFLYBSD = TMP_OSTYPEVALUES_DRAGONFLYBSD; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_HPUX in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.OSTYPEVALUES_HPUX = TMP_OSTYPEVALUES_HPUX; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_AIX in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.OSTYPEVALUES_AIX = TMP_OSTYPEVALUES_AIX; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_SOLARIS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.OSTYPEVALUES_SOLARIS = TMP_OSTYPEVALUES_SOLARIS; +/** + * The operating system type. + * + * @deprecated Use OS_TYPE_VALUE_Z_OS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.OSTYPEVALUES_Z_OS = TMP_OSTYPEVALUES_Z_OS; +/** + * The constant map of values for OsTypeValues. + * @deprecated Use the OSTYPEVALUES_XXXXX constants rather than the OsTypeValues.XXXXX for bundle minification. + */ +exports.OsTypeValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_OSTYPEVALUES_WINDOWS, + TMP_OSTYPEVALUES_LINUX, + TMP_OSTYPEVALUES_DARWIN, + TMP_OSTYPEVALUES_FREEBSD, + TMP_OSTYPEVALUES_NETBSD, + TMP_OSTYPEVALUES_OPENBSD, + TMP_OSTYPEVALUES_DRAGONFLYBSD, + TMP_OSTYPEVALUES_HPUX, + TMP_OSTYPEVALUES_AIX, + TMP_OSTYPEVALUES_SOLARIS, + TMP_OSTYPEVALUES_Z_OS, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for TelemetrySdkLanguageValues enum definition + * + * The language of the telemetry SDK. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_TELEMETRYSDKLANGUAGEVALUES_CPP = 'cpp'; +const TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET = 'dotnet'; +const TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG = 'erlang'; +const TMP_TELEMETRYSDKLANGUAGEVALUES_GO = 'go'; +const TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA = 'java'; +const TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS = 'nodejs'; +const TMP_TELEMETRYSDKLANGUAGEVALUES_PHP = 'php'; +const TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON = 'python'; +const TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY = 'ruby'; +const TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS = 'webjs'; +/** + * The language of the telemetry SDK. + * + * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_CPP. + */ +exports.TELEMETRYSDKLANGUAGEVALUES_CPP = TMP_TELEMETRYSDKLANGUAGEVALUES_CPP; +/** + * The language of the telemetry SDK. + * + * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET. + */ +exports.TELEMETRYSDKLANGUAGEVALUES_DOTNET = TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET; +/** + * The language of the telemetry SDK. + * + * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG. + */ +exports.TELEMETRYSDKLANGUAGEVALUES_ERLANG = TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG; +/** + * The language of the telemetry SDK. + * + * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_GO. + */ +exports.TELEMETRYSDKLANGUAGEVALUES_GO = TMP_TELEMETRYSDKLANGUAGEVALUES_GO; +/** + * The language of the telemetry SDK. + * + * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_JAVA. + */ +exports.TELEMETRYSDKLANGUAGEVALUES_JAVA = TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA; +/** + * The language of the telemetry SDK. + * + * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS. + */ +exports.TELEMETRYSDKLANGUAGEVALUES_NODEJS = TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS; +/** + * The language of the telemetry SDK. + * + * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_PHP. + */ +exports.TELEMETRYSDKLANGUAGEVALUES_PHP = TMP_TELEMETRYSDKLANGUAGEVALUES_PHP; +/** + * The language of the telemetry SDK. + * + * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON. + */ +exports.TELEMETRYSDKLANGUAGEVALUES_PYTHON = TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON; +/** + * The language of the telemetry SDK. + * + * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_RUBY. + */ +exports.TELEMETRYSDKLANGUAGEVALUES_RUBY = TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY; +/** + * The language of the telemetry SDK. + * + * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS. + */ +exports.TELEMETRYSDKLANGUAGEVALUES_WEBJS = TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS; +/** + * The constant map of values for TelemetrySdkLanguageValues. + * @deprecated Use the TELEMETRYSDKLANGUAGEVALUES_XXXXX constants rather than the TelemetrySdkLanguageValues.XXXXX for bundle minification. + */ +exports.TelemetrySdkLanguageValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_TELEMETRYSDKLANGUAGEVALUES_CPP, + TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET, + TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG, + TMP_TELEMETRYSDKLANGUAGEVALUES_GO, + TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA, + TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS, + TMP_TELEMETRYSDKLANGUAGEVALUES_PHP, + TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON, + TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY, + TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS, +]); +//# sourceMappingURL=SemanticResourceAttributes.js.map + +/***/ }), + +/***/ 2834: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +/* eslint-disable no-restricted-syntax -- + * These re-exports are only of constants, only one-level deep at this point, + * and should not cause problems for tree-shakers. + */ +__exportStar(__nccwpck_require__(85003), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 69301: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.HTTP_REQUEST_METHOD_VALUE_POST = exports.HTTP_REQUEST_METHOD_VALUE_PATCH = exports.HTTP_REQUEST_METHOD_VALUE_OPTIONS = exports.HTTP_REQUEST_METHOD_VALUE_HEAD = exports.HTTP_REQUEST_METHOD_VALUE_GET = exports.HTTP_REQUEST_METHOD_VALUE_DELETE = exports.HTTP_REQUEST_METHOD_VALUE_CONNECT = exports.HTTP_REQUEST_METHOD_VALUE_OTHER = exports.ATTR_HTTP_REQUEST_METHOD = exports.ATTR_HTTP_REQUEST_HEADER = exports.ATTR_EXCEPTION_TYPE = exports.ATTR_EXCEPTION_STACKTRACE = exports.ATTR_EXCEPTION_MESSAGE = exports.ATTR_EXCEPTION_ESCAPED = exports.ERROR_TYPE_VALUE_OTHER = exports.ATTR_ERROR_TYPE = exports.ATTR_CLIENT_PORT = exports.ATTR_CLIENT_ADDRESS = exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = exports.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = exports.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = exports.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED = exports.ATTR_ASPNETCORE_RATE_LIMITING_POLICY = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = exports.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = exports.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = exports.ATTR_TELEMETRY_SDK_VERSION = exports.ATTR_TELEMETRY_SDK_NAME = exports.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = exports.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUST = exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = exports.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = exports.TELEMETRY_SDK_LANGUAGE_VALUE_PHP = exports.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = exports.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = exports.TELEMETRY_SDK_LANGUAGE_VALUE_GO = exports.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = exports.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = exports.TELEMETRY_SDK_LANGUAGE_VALUE_CPP = exports.ATTR_TELEMETRY_SDK_LANGUAGE = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = exports.ATTR_ASPNETCORE_RATE_LIMITING_RESULT = void 0; +exports.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = exports.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = exports.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = exports.ATTR_SIGNALR_CONNECTION_STATUS = exports.ATTR_SERVICE_VERSION = exports.ATTR_SERVICE_NAME = exports.ATTR_SERVER_PORT = exports.ATTR_SERVER_ADDRESS = exports.ATTR_OTEL_STATUS_DESCRIPTION = exports.OTEL_STATUS_CODE_VALUE_OK = exports.OTEL_STATUS_CODE_VALUE_ERROR = exports.ATTR_OTEL_STATUS_CODE = exports.ATTR_OTEL_SCOPE_VERSION = exports.ATTR_OTEL_SCOPE_NAME = exports.NETWORK_TYPE_VALUE_IPV6 = exports.NETWORK_TYPE_VALUE_IPV4 = exports.ATTR_NETWORK_TYPE = exports.NETWORK_TRANSPORT_VALUE_UNIX = exports.NETWORK_TRANSPORT_VALUE_UDP = exports.NETWORK_TRANSPORT_VALUE_TCP = exports.NETWORK_TRANSPORT_VALUE_QUIC = exports.NETWORK_TRANSPORT_VALUE_PIPE = exports.ATTR_NETWORK_TRANSPORT = exports.ATTR_NETWORK_PROTOCOL_VERSION = exports.ATTR_NETWORK_PROTOCOL_NAME = exports.ATTR_NETWORK_PEER_PORT = exports.ATTR_NETWORK_PEER_ADDRESS = exports.ATTR_NETWORK_LOCAL_PORT = exports.ATTR_NETWORK_LOCAL_ADDRESS = exports.JVM_THREAD_STATE_VALUE_WAITING = exports.JVM_THREAD_STATE_VALUE_TIMED_WAITING = exports.JVM_THREAD_STATE_VALUE_TERMINATED = exports.JVM_THREAD_STATE_VALUE_RUNNABLE = exports.JVM_THREAD_STATE_VALUE_NEW = exports.JVM_THREAD_STATE_VALUE_BLOCKED = exports.ATTR_JVM_THREAD_STATE = exports.ATTR_JVM_THREAD_DAEMON = exports.JVM_MEMORY_TYPE_VALUE_NON_HEAP = exports.JVM_MEMORY_TYPE_VALUE_HEAP = exports.ATTR_JVM_MEMORY_TYPE = exports.ATTR_JVM_MEMORY_POOL_NAME = exports.ATTR_JVM_GC_NAME = exports.ATTR_JVM_GC_ACTION = exports.ATTR_HTTP_ROUTE = exports.ATTR_HTTP_RESPONSE_STATUS_CODE = exports.ATTR_HTTP_RESPONSE_HEADER = exports.ATTR_HTTP_REQUEST_RESEND_COUNT = exports.ATTR_HTTP_REQUEST_METHOD_ORIGINAL = exports.HTTP_REQUEST_METHOD_VALUE_TRACE = exports.HTTP_REQUEST_METHOD_VALUE_PUT = void 0; +exports.ATTR_USER_AGENT_ORIGINAL = exports.ATTR_URL_SCHEME = exports.ATTR_URL_QUERY = exports.ATTR_URL_PATH = exports.ATTR_URL_FULL = exports.ATTR_URL_FRAGMENT = exports.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = exports.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = exports.SIGNALR_TRANSPORT_VALUE_LONG_POLLING = exports.ATTR_SIGNALR_TRANSPORT = void 0; +//---------------------------------------------------------------------------------------------------------- +// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/registry/stable/attributes.ts.j2 +//---------------------------------------------------------------------------------------------------------- +/** + * Rate-limiting result, shows whether the lease was acquired or contains a rejection reason + * + * @example acquired + * @example request_canceled + */ +exports.ATTR_ASPNETCORE_RATE_LIMITING_RESULT = 'aspnetcore.rate_limiting.result'; +/** + * Enum value "acquired" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}. + */ +exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = "acquired"; +/** + * Enum value "endpoint_limiter" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}. + */ +exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = "endpoint_limiter"; +/** + * Enum value "global_limiter" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}. + */ +exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = "global_limiter"; +/** + * Enum value "request_canceled" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}. + */ +exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = "request_canceled"; +/** + * The language of the telemetry SDK. + */ +exports.ATTR_TELEMETRY_SDK_LANGUAGE = 'telemetry.sdk.language'; +/** + * Enum value "cpp" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_CPP = "cpp"; +/** + * Enum value "dotnet" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = "dotnet"; +/** + * Enum value "erlang" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = "erlang"; +/** + * Enum value "go" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_GO = "go"; +/** + * Enum value "java" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = "java"; +/** + * Enum value "nodejs" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = "nodejs"; +/** + * Enum value "php" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_PHP = "php"; +/** + * Enum value "python" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = "python"; +/** + * Enum value "ruby" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = "ruby"; +/** + * Enum value "rust" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUST = "rust"; +/** + * Enum value "swift" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = "swift"; +/** + * Enum value "webjs" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = "webjs"; +/** + * The name of the telemetry SDK as defined above. + * + * @example opentelemetry + * + * @note The OpenTelemetry SDK **MUST** set the `telemetry.sdk.name` attribute to `opentelemetry`. + * If another SDK, like a fork or a vendor-provided implementation, is used, this SDK **MUST** set the + * `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point + * or another suitable identifier depending on the language. + * The identifier `opentelemetry` is reserved and **MUST NOT** be used in this case. + * All custom identifiers **SHOULD** be stable across different versions of an implementation. + */ +exports.ATTR_TELEMETRY_SDK_NAME = 'telemetry.sdk.name'; +/** + * The version string of the telemetry SDK. + * + * @example 1.2.3 + */ +exports.ATTR_TELEMETRY_SDK_VERSION = 'telemetry.sdk.version'; +/** + * Full type name of the [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. + * + * @example Contoso.MyHandler + */ +exports.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = 'aspnetcore.diagnostics.handler.type'; +/** + * ASP.NET Core exception middleware handling result + * + * @example handled + * @example unhandled + */ +exports.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = 'aspnetcore.diagnostics.exception.result'; +/** + * Enum value "aborted" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}. + */ +exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = "aborted"; +/** + * Enum value "handled" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}. + */ +exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = "handled"; +/** + * Enum value "skipped" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}. + */ +exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = "skipped"; +/** + * Enum value "unhandled" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}. + */ +exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = "unhandled"; +/** + * Rate limiting policy name. + * + * @example fixed + * @example sliding + * @example token + */ +exports.ATTR_ASPNETCORE_RATE_LIMITING_POLICY = 'aspnetcore.rate_limiting.policy'; +/** + * Flag indicating if request was handled by the application pipeline. + * + * @example true + */ +exports.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED = 'aspnetcore.request.is_unhandled'; +/** + * A value that indicates whether the matched route is a fallback route. + * + * @example true + */ +exports.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = 'aspnetcore.routing.is_fallback'; +/** + * Match result - success or failure + * + * @example success + * @example failure + */ +exports.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = 'aspnetcore.routing.match_status'; +/** + * Enum value "failure" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}. + */ +exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = "failure"; +/** + * Enum value "success" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}. + */ +exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = "success"; +/** + * Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. + * + * @example client.example.com + * @example 10.1.2.80 + * @example /tmp/my.sock + * + * @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. + */ +exports.ATTR_CLIENT_ADDRESS = 'client.address'; +/** + * Client port number. + * + * @example 65123 + * + * @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. + */ +exports.ATTR_CLIENT_PORT = 'client.port'; +/** + * Describes a class of error the operation ended with. + * + * @example timeout + * @example java.net.UnknownHostException + * @example server_certificate_invalid + * @example 500 + * + * @note The `error.type` **SHOULD** be predictable, and **SHOULD** have low cardinality. + * + * When `error.type` is set to a type (e.g., an exception type), its + * canonical class name identifying the type within the artifact **SHOULD** be used. + * + * Instrumentations **SHOULD** document the list of errors they report. + * + * The cardinality of `error.type` within one instrumentation library **SHOULD** be low. + * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications + * should be prepared for `error.type` to have high cardinality at query time when no + * additional filters are applied. + * + * If the operation has completed successfully, instrumentations **SHOULD NOT** set `error.type`. + * + * If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes), + * it's **RECOMMENDED** to: + * + * - Use a domain-specific attribute + * - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not. + */ +exports.ATTR_ERROR_TYPE = 'error.type'; +/** + * Enum value "_OTHER" for attribute {@link ATTR_ERROR_TYPE}. + */ +exports.ERROR_TYPE_VALUE_OTHER = "_OTHER"; +/** + * **SHOULD** be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. + * + * @note An exception is considered to have escaped (or left) the scope of a span, + * if that span is ended while the exception is still logically "in flight". + * This may be actually "in flight" in some languages (e.g. if the exception + * is passed to a Context manager's `__exit__` method in Python) but will + * usually be caught at the point of recording the exception in most languages. + * + * It is usually not possible to determine at the point where an exception is thrown + * whether it will escape the scope of a span. + * However, it is trivial to know that an exception + * will escape, if one checks for an active exception just before ending the span, + * as done in the [example for recording span exceptions](https://opentelemetry.io/docs/specs/semconv/exceptions/exceptions-spans/#recording-an-exception). + * + * It follows that an exception may still escape the scope of the span + * even if the `exception.escaped` attribute was not set or set to false, + * since the event might have been recorded at a time where it was not + * clear whether the exception will escape. + */ +exports.ATTR_EXCEPTION_ESCAPED = 'exception.escaped'; +/** + * The exception message. + * + * @example Division by zero + * @example Can't convert 'int' object to str implicitly + */ +exports.ATTR_EXCEPTION_MESSAGE = 'exception.message'; +/** + * 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. + * + * @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" + */ +exports.ATTR_EXCEPTION_STACKTRACE = 'exception.stacktrace'; +/** + * 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. + * + * @example java.net.ConnectException + * @example OSError + */ +exports.ATTR_EXCEPTION_TYPE = 'exception.type'; +/** + * HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. + * + * @example http.request.header.content-type=["application/json"] + * @example http.request.header.x-forwarded-for=["1.2.3.4", "1.2.3.5"] + * + * @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. + * The `User-Agent` header is already captured in the `user_agent.original` attribute. Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended. + * The attribute value **MUST** consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. + */ +const ATTR_HTTP_REQUEST_HEADER = (key) => `http.request.header.${key}`; +exports.ATTR_HTTP_REQUEST_HEADER = ATTR_HTTP_REQUEST_HEADER; +/** + * HTTP request method. + * + * @example GET + * @example POST + * @example HEAD + * + * @note HTTP request method value **SHOULD** be "known" to the instrumentation. + * By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) + * and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). + * + * If the HTTP request method is not known to instrumentation, it **MUST** set the `http.request.method` attribute to `_OTHER`. + * + * If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it **MUST** provide a way to override + * the list of known HTTP methods. If this override is done via environment variable, then the environment variable **MUST** be named + * OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods + * (this list **MUST** be a full override of the default known method, it is not a list of known methods in addition to the defaults). + * + * HTTP method names are case-sensitive and `http.request.method` attribute value **MUST** match a known HTTP method name exactly. + * Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, **SHOULD** populate a canonical equivalent. + * Tracing instrumentations that do so, **MUST** also set `http.request.method_original` to the original value. + */ +exports.ATTR_HTTP_REQUEST_METHOD = 'http.request.method'; +/** + * Enum value "_OTHER" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + */ +exports.HTTP_REQUEST_METHOD_VALUE_OTHER = "_OTHER"; +/** + * Enum value "CONNECT" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + */ +exports.HTTP_REQUEST_METHOD_VALUE_CONNECT = "CONNECT"; +/** + * Enum value "DELETE" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + */ +exports.HTTP_REQUEST_METHOD_VALUE_DELETE = "DELETE"; +/** + * Enum value "GET" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + */ +exports.HTTP_REQUEST_METHOD_VALUE_GET = "GET"; +/** + * Enum value "HEAD" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + */ +exports.HTTP_REQUEST_METHOD_VALUE_HEAD = "HEAD"; +/** + * Enum value "OPTIONS" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + */ +exports.HTTP_REQUEST_METHOD_VALUE_OPTIONS = "OPTIONS"; +/** + * Enum value "PATCH" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + */ +exports.HTTP_REQUEST_METHOD_VALUE_PATCH = "PATCH"; +/** + * Enum value "POST" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + */ +exports.HTTP_REQUEST_METHOD_VALUE_POST = "POST"; +/** + * Enum value "PUT" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + */ +exports.HTTP_REQUEST_METHOD_VALUE_PUT = "PUT"; +/** + * Enum value "TRACE" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + */ +exports.HTTP_REQUEST_METHOD_VALUE_TRACE = "TRACE"; +/** + * Original HTTP method sent by the client in the request line. + * + * @example GeT + * @example ACL + * @example foo + */ +exports.ATTR_HTTP_REQUEST_METHOD_ORIGINAL = 'http.request.method_original'; +/** + * The ordinal number of request resending attempt (for any reason, including redirects). + * + * @example 3 + * + * @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). + */ +exports.ATTR_HTTP_REQUEST_RESEND_COUNT = 'http.request.resend_count'; +/** + * HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. + * + * @example http.response.header.content-type=["application/json"] + * @example http.response.header.my-custom-header=["abc", "def"] + * + * @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. + * Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended. + * The attribute value **MUST** consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. + */ +const ATTR_HTTP_RESPONSE_HEADER = (key) => `http.response.header.${key}`; +exports.ATTR_HTTP_RESPONSE_HEADER = ATTR_HTTP_RESPONSE_HEADER; +/** + * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). + * + * @example 200 + */ +exports.ATTR_HTTP_RESPONSE_STATUS_CODE = 'http.response.status_code'; +/** + * The matched route, that is, the path template in the format used by the respective server framework. + * + * @example /users/:userID? + * @example {controller}/{action}/{id?} + * + * @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. + * **SHOULD** include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. + */ +exports.ATTR_HTTP_ROUTE = 'http.route'; +/** + * Name of the garbage collector action. + * + * @example end of minor GC + * @example end of major GC + * + * @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()). + */ +exports.ATTR_JVM_GC_ACTION = 'jvm.gc.action'; +/** + * Name of the garbage collector. + * + * @example G1 Young Generation + * @example G1 Old Generation + * + * @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()). + */ +exports.ATTR_JVM_GC_NAME = 'jvm.gc.name'; +/** + * Name of the memory pool. + * + * @example G1 Old Gen + * @example G1 Eden space + * @example G1 Survivor Space + * + * @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()). + */ +exports.ATTR_JVM_MEMORY_POOL_NAME = 'jvm.memory.pool.name'; +/** + * The type of memory. + * + * @example heap + * @example non_heap + */ +exports.ATTR_JVM_MEMORY_TYPE = 'jvm.memory.type'; +/** + * Enum value "heap" for attribute {@link ATTR_JVM_MEMORY_TYPE}. + */ +exports.JVM_MEMORY_TYPE_VALUE_HEAP = "heap"; +/** + * Enum value "non_heap" for attribute {@link ATTR_JVM_MEMORY_TYPE}. + */ +exports.JVM_MEMORY_TYPE_VALUE_NON_HEAP = "non_heap"; +/** + * Whether the thread is daemon or not. + */ +exports.ATTR_JVM_THREAD_DAEMON = 'jvm.thread.daemon'; +/** + * State of the thread. + * + * @example runnable + * @example blocked + */ +exports.ATTR_JVM_THREAD_STATE = 'jvm.thread.state'; +/** + * Enum value "blocked" for attribute {@link ATTR_JVM_THREAD_STATE}. + */ +exports.JVM_THREAD_STATE_VALUE_BLOCKED = "blocked"; +/** + * Enum value "new" for attribute {@link ATTR_JVM_THREAD_STATE}. + */ +exports.JVM_THREAD_STATE_VALUE_NEW = "new"; +/** + * Enum value "runnable" for attribute {@link ATTR_JVM_THREAD_STATE}. + */ +exports.JVM_THREAD_STATE_VALUE_RUNNABLE = "runnable"; +/** + * Enum value "terminated" for attribute {@link ATTR_JVM_THREAD_STATE}. + */ +exports.JVM_THREAD_STATE_VALUE_TERMINATED = "terminated"; +/** + * Enum value "timed_waiting" for attribute {@link ATTR_JVM_THREAD_STATE}. + */ +exports.JVM_THREAD_STATE_VALUE_TIMED_WAITING = "timed_waiting"; +/** + * Enum value "waiting" for attribute {@link ATTR_JVM_THREAD_STATE}. + */ +exports.JVM_THREAD_STATE_VALUE_WAITING = "waiting"; +/** + * Local address of the network connection - IP address or Unix domain socket name. + * + * @example 10.1.2.80 + * @example /tmp/my.sock + */ +exports.ATTR_NETWORK_LOCAL_ADDRESS = 'network.local.address'; +/** + * Local port number of the network connection. + * + * @example 65123 + */ +exports.ATTR_NETWORK_LOCAL_PORT = 'network.local.port'; +/** + * Peer address of the network connection - IP address or Unix domain socket name. + * + * @example 10.1.2.80 + * @example /tmp/my.sock + */ +exports.ATTR_NETWORK_PEER_ADDRESS = 'network.peer.address'; +/** + * Peer port number of the network connection. + * + * @example 65123 + */ +exports.ATTR_NETWORK_PEER_PORT = 'network.peer.port'; +/** + * [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. + * + * @example amqp + * @example http + * @example mqtt + * + * @note The value **SHOULD** be normalized to lowercase. + */ +exports.ATTR_NETWORK_PROTOCOL_NAME = 'network.protocol.name'; +/** + * The actual version of the protocol used for network communication. + * + * @example 1.1 + * @example 2 + * + * @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. + */ +exports.ATTR_NETWORK_PROTOCOL_VERSION = 'network.protocol.version'; +/** + * [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). + * + * @example tcp + * @example udp + * + * @note The value **SHOULD** be normalized to lowercase. + * + * Consider always setting the transport when setting a port number, since + * a port number is ambiguous without knowing the transport. For example + * different processes could be listening on TCP port 12345 and UDP port 12345. + */ +exports.ATTR_NETWORK_TRANSPORT = 'network.transport'; +/** + * Enum value "pipe" for attribute {@link ATTR_NETWORK_TRANSPORT}. + */ +exports.NETWORK_TRANSPORT_VALUE_PIPE = "pipe"; +/** + * Enum value "quic" for attribute {@link ATTR_NETWORK_TRANSPORT}. + */ +exports.NETWORK_TRANSPORT_VALUE_QUIC = "quic"; +/** + * Enum value "tcp" for attribute {@link ATTR_NETWORK_TRANSPORT}. + */ +exports.NETWORK_TRANSPORT_VALUE_TCP = "tcp"; +/** + * Enum value "udp" for attribute {@link ATTR_NETWORK_TRANSPORT}. + */ +exports.NETWORK_TRANSPORT_VALUE_UDP = "udp"; +/** + * Enum value "unix" for attribute {@link ATTR_NETWORK_TRANSPORT}. + */ +exports.NETWORK_TRANSPORT_VALUE_UNIX = "unix"; +/** + * [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. + * + * @example ipv4 + * @example ipv6 + * + * @note The value **SHOULD** be normalized to lowercase. + */ +exports.ATTR_NETWORK_TYPE = 'network.type'; +/** + * Enum value "ipv4" for attribute {@link ATTR_NETWORK_TYPE}. + */ +exports.NETWORK_TYPE_VALUE_IPV4 = "ipv4"; +/** + * Enum value "ipv6" for attribute {@link ATTR_NETWORK_TYPE}. + */ +exports.NETWORK_TYPE_VALUE_IPV6 = "ipv6"; +/** + * The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). + * + * @example io.opentelemetry.contrib.mongodb + */ +exports.ATTR_OTEL_SCOPE_NAME = 'otel.scope.name'; +/** + * The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). + * + * @example 1.0.0 + */ +exports.ATTR_OTEL_SCOPE_VERSION = 'otel.scope.version'; +/** + * Name of the code, either "OK" or "ERROR". **MUST NOT** be set if the status code is UNSET. + */ +exports.ATTR_OTEL_STATUS_CODE = 'otel.status_code'; +/** + * Enum value "ERROR" for attribute {@link ATTR_OTEL_STATUS_CODE}. + */ +exports.OTEL_STATUS_CODE_VALUE_ERROR = "ERROR"; +/** + * Enum value "OK" for attribute {@link ATTR_OTEL_STATUS_CODE}. + */ +exports.OTEL_STATUS_CODE_VALUE_OK = "OK"; +/** + * Description of the Status if it has a value, otherwise not set. + * + * @example resource not found + */ +exports.ATTR_OTEL_STATUS_DESCRIPTION = 'otel.status_description'; +/** + * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. + * + * @example example.com + * @example 10.1.2.80 + * @example /tmp/my.sock + * + * @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. + */ +exports.ATTR_SERVER_ADDRESS = 'server.address'; +/** + * Server port number. + * + * @example 80 + * @example 8080 + * @example 443 + * + * @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. + */ +exports.ATTR_SERVER_PORT = 'server.port'; +/** + * Logical name of the service. + * + * @example shoppingcart + * + * @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`. + */ +exports.ATTR_SERVICE_NAME = 'service.name'; +/** + * The version string of the service API or implementation. The format is not defined by these conventions. + * + * @example 2.0.0 + * @example a01dbef8a + */ +exports.ATTR_SERVICE_VERSION = 'service.version'; +/** + * SignalR HTTP connection closure status. + * + * @example app_shutdown + * @example timeout + */ +exports.ATTR_SIGNALR_CONNECTION_STATUS = 'signalr.connection.status'; +/** + * Enum value "app_shutdown" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}. + */ +exports.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = "app_shutdown"; +/** + * Enum value "normal_closure" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}. + */ +exports.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = "normal_closure"; +/** + * Enum value "timeout" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}. + */ +exports.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = "timeout"; +/** + * [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md) + * + * @example web_sockets + * @example long_polling + */ +exports.ATTR_SIGNALR_TRANSPORT = 'signalr.transport'; +/** + * Enum value "long_polling" for attribute {@link ATTR_SIGNALR_TRANSPORT}. + */ +exports.SIGNALR_TRANSPORT_VALUE_LONG_POLLING = "long_polling"; +/** + * Enum value "server_sent_events" for attribute {@link ATTR_SIGNALR_TRANSPORT}. + */ +exports.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = "server_sent_events"; +/** + * Enum value "web_sockets" for attribute {@link ATTR_SIGNALR_TRANSPORT}. + */ +exports.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = "web_sockets"; +/** + * The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component + * + * @example SemConv + */ +exports.ATTR_URL_FRAGMENT = 'url.fragment'; +/** + * Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) + * + * @example https://www.foo.bar/search?q=OpenTelemetry#SemConv + * @example //localhost + * + * @note For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it **SHOULD** be included nevertheless. + * `url.full` **MUST NOT** contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password **SHOULD** be redacted and attribute's value **SHOULD** be `https://REDACTED:REDACTED@www.example.com/`. + * `url.full` **SHOULD** capture the absolute URL when it is available (or can be reconstructed). Sensitive content provided in `url.full` **SHOULD** be scrubbed when instrumentations can identify it. + */ +exports.ATTR_URL_FULL = 'url.full'; +/** + * The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component + * + * @example /search + * + * @note Sensitive content provided in `url.path` **SHOULD** be scrubbed when instrumentations can identify it. + */ +exports.ATTR_URL_PATH = 'url.path'; +/** + * The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component + * + * @example q=OpenTelemetry + * + * @note Sensitive content provided in `url.query` **SHOULD** be scrubbed when instrumentations can identify it. + */ +exports.ATTR_URL_QUERY = 'url.query'; +/** + * The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. + * + * @example https + * @example ftp + * @example telnet + */ +exports.ATTR_URL_SCHEME = 'url.scheme'; +/** + * Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. + * + * @example CERN-LineMode/2.15 libwww/2.17b3 + * @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 + * @example YourApp/1.0.0 grpc-java-okhttp/1.27.2 + */ +exports.ATTR_USER_AGENT_ORIGINAL = 'user_agent.original'; +//# sourceMappingURL=stable_attributes.js.map + +/***/ }), + +/***/ 46152: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.METRIC_SIGNALR_SERVER_CONNECTION_DURATION = exports.METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS = exports.METRIC_KESTREL_UPGRADED_CONNECTIONS = exports.METRIC_KESTREL_TLS_HANDSHAKE_DURATION = exports.METRIC_KESTREL_REJECTED_CONNECTIONS = exports.METRIC_KESTREL_QUEUED_REQUESTS = exports.METRIC_KESTREL_QUEUED_CONNECTIONS = exports.METRIC_KESTREL_CONNECTION_DURATION = exports.METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES = exports.METRIC_KESTREL_ACTIVE_CONNECTIONS = exports.METRIC_JVM_THREAD_COUNT = exports.METRIC_JVM_MEMORY_USED_AFTER_LAST_GC = exports.METRIC_JVM_MEMORY_USED = exports.METRIC_JVM_MEMORY_LIMIT = exports.METRIC_JVM_MEMORY_COMMITTED = exports.METRIC_JVM_GC_DURATION = exports.METRIC_JVM_CPU_TIME = exports.METRIC_JVM_CPU_RECENT_UTILIZATION = exports.METRIC_JVM_CPU_COUNT = exports.METRIC_JVM_CLASS_UNLOADED = exports.METRIC_JVM_CLASS_LOADED = exports.METRIC_JVM_CLASS_COUNT = exports.METRIC_HTTP_SERVER_REQUEST_DURATION = exports.METRIC_HTTP_CLIENT_REQUEST_DURATION = exports.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS = exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS = exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION = exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE = exports.METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS = exports.METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES = exports.METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS = void 0; +//---------------------------------------------------------------------------------------------------------- +// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/register/stable/metrics.ts.j2 +//---------------------------------------------------------------------------------------------------------- +/** + * Number of exceptions caught by exception handling middleware. + * + * @note Meter name: `Microsoft.AspNetCore.Diagnostics`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS = 'aspnetcore.diagnostics.exceptions'; +/** + * Number of requests that are currently active on the server that hold a rate limiting lease. + * + * @note Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES = 'aspnetcore.rate_limiting.active_request_leases'; +/** + * Number of requests that are currently queued, waiting to acquire a rate limiting lease. + * + * @note Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS = 'aspnetcore.rate_limiting.queued_requests'; +/** + * The time the request spent in a queue waiting to acquire a rate limiting lease. + * + * @note Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE = 'aspnetcore.rate_limiting.request.time_in_queue'; +/** + * The duration of rate limiting lease held by requests on the server. + * + * @note Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION = 'aspnetcore.rate_limiting.request_lease.duration'; +/** + * Number of requests that tried to acquire a rate limiting lease. + * + * @note Requests could be: + * + * - Rejected by global or endpoint rate limiting policies + * - Canceled while waiting for the lease. + * + * Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS = 'aspnetcore.rate_limiting.requests'; +/** + * Number of requests that were attempted to be matched to an endpoint. + * + * @note Meter name: `Microsoft.AspNetCore.Routing`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS = 'aspnetcore.routing.match_attempts'; +/** + * Duration of HTTP client requests. + */ +exports.METRIC_HTTP_CLIENT_REQUEST_DURATION = 'http.client.request.duration'; +/** + * Duration of HTTP server requests. + */ +exports.METRIC_HTTP_SERVER_REQUEST_DURATION = 'http.server.request.duration'; +/** + * Number of classes currently loaded. + */ +exports.METRIC_JVM_CLASS_COUNT = 'jvm.class.count'; +/** + * Number of classes loaded since JVM start. + */ +exports.METRIC_JVM_CLASS_LOADED = 'jvm.class.loaded'; +/** + * Number of classes unloaded since JVM start. + */ +exports.METRIC_JVM_CLASS_UNLOADED = 'jvm.class.unloaded'; +/** + * Number of processors available to the Java virtual machine. + */ +exports.METRIC_JVM_CPU_COUNT = 'jvm.cpu.count'; +/** + * Recent CPU utilization for the process as reported by the JVM. + * + * @note The value range is [0.0,1.0]. This utilization is not defined as being for the specific interval since last measurement (unlike `system.cpu.utilization`). [Reference](https://docs.oracle.com/en/java/javase/17/docs/api/jdk.management/com/sun/management/OperatingSystemMXBean.html#getProcessCpuLoad()). + */ +exports.METRIC_JVM_CPU_RECENT_UTILIZATION = 'jvm.cpu.recent_utilization'; +/** + * CPU time used by the process as reported by the JVM. + */ +exports.METRIC_JVM_CPU_TIME = 'jvm.cpu.time'; +/** + * Duration of JVM garbage collection actions. + */ +exports.METRIC_JVM_GC_DURATION = 'jvm.gc.duration'; +/** + * Measure of memory committed. + */ +exports.METRIC_JVM_MEMORY_COMMITTED = 'jvm.memory.committed'; +/** + * Measure of max obtainable memory. + */ +exports.METRIC_JVM_MEMORY_LIMIT = 'jvm.memory.limit'; +/** + * Measure of memory used. + */ +exports.METRIC_JVM_MEMORY_USED = 'jvm.memory.used'; +/** + * Measure of memory used, as measured after the most recent garbage collection event on this pool. + */ +exports.METRIC_JVM_MEMORY_USED_AFTER_LAST_GC = 'jvm.memory.used_after_last_gc'; +/** + * Number of executing platform threads. + */ +exports.METRIC_JVM_THREAD_COUNT = 'jvm.thread.count'; +/** + * Number of connections that are currently active on the server. + * + * @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_KESTREL_ACTIVE_CONNECTIONS = 'kestrel.active_connections'; +/** + * Number of TLS handshakes that are currently in progress on the server. + * + * @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES = 'kestrel.active_tls_handshakes'; +/** + * The duration of connections on the server. + * + * @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_KESTREL_CONNECTION_DURATION = 'kestrel.connection.duration'; +/** + * Number of connections that are currently queued and are waiting to start. + * + * @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_KESTREL_QUEUED_CONNECTIONS = 'kestrel.queued_connections'; +/** + * Number of HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are currently queued and are waiting to start. + * + * @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_KESTREL_QUEUED_REQUESTS = 'kestrel.queued_requests'; +/** + * Number of connections rejected by the server. + * + * @note Connections are rejected when the currently active count exceeds the value configured with `MaxConcurrentConnections`. + * Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_KESTREL_REJECTED_CONNECTIONS = 'kestrel.rejected_connections'; +/** + * The duration of TLS handshakes on the server. + * + * @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_KESTREL_TLS_HANDSHAKE_DURATION = 'kestrel.tls_handshake.duration'; +/** + * Number of connections that are currently upgraded (WebSockets). . + * + * @note The counter only tracks HTTP/1.1 connections. + * + * Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_KESTREL_UPGRADED_CONNECTIONS = 'kestrel.upgraded_connections'; +/** + * Number of connections that are currently active on the server. + * + * @note Meter name: `Microsoft.AspNetCore.Http.Connections`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS = 'signalr.server.active_connections'; +/** + * The duration of connections on the server. + * + * @note Meter name: `Microsoft.AspNetCore.Http.Connections`; Added in: ASP.NET Core 8.0 + */ +exports.METRIC_SIGNALR_SERVER_CONNECTION_DURATION = 'signalr.server.connection.duration'; +//# sourceMappingURL=stable_metrics.js.map + +/***/ }), + +/***/ 89943: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SEMATTRS_NET_HOST_CARRIER_ICC = exports.SEMATTRS_NET_HOST_CARRIER_MNC = exports.SEMATTRS_NET_HOST_CARRIER_MCC = exports.SEMATTRS_NET_HOST_CARRIER_NAME = exports.SEMATTRS_NET_HOST_CONNECTION_SUBTYPE = exports.SEMATTRS_NET_HOST_CONNECTION_TYPE = exports.SEMATTRS_NET_HOST_NAME = exports.SEMATTRS_NET_HOST_PORT = exports.SEMATTRS_NET_HOST_IP = exports.SEMATTRS_NET_PEER_NAME = exports.SEMATTRS_NET_PEER_PORT = exports.SEMATTRS_NET_PEER_IP = exports.SEMATTRS_NET_TRANSPORT = exports.SEMATTRS_FAAS_INVOKED_REGION = exports.SEMATTRS_FAAS_INVOKED_PROVIDER = exports.SEMATTRS_FAAS_INVOKED_NAME = exports.SEMATTRS_FAAS_COLDSTART = exports.SEMATTRS_FAAS_CRON = exports.SEMATTRS_FAAS_TIME = exports.SEMATTRS_FAAS_DOCUMENT_NAME = exports.SEMATTRS_FAAS_DOCUMENT_TIME = exports.SEMATTRS_FAAS_DOCUMENT_OPERATION = exports.SEMATTRS_FAAS_DOCUMENT_COLLECTION = exports.SEMATTRS_FAAS_EXECUTION = exports.SEMATTRS_FAAS_TRIGGER = exports.SEMATTRS_EXCEPTION_ESCAPED = exports.SEMATTRS_EXCEPTION_STACKTRACE = exports.SEMATTRS_EXCEPTION_MESSAGE = exports.SEMATTRS_EXCEPTION_TYPE = exports.SEMATTRS_DB_SQL_TABLE = exports.SEMATTRS_DB_MONGODB_COLLECTION = exports.SEMATTRS_DB_REDIS_DATABASE_INDEX = exports.SEMATTRS_DB_HBASE_NAMESPACE = exports.SEMATTRS_DB_CASSANDRA_COORDINATOR_DC = exports.SEMATTRS_DB_CASSANDRA_COORDINATOR_ID = exports.SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = exports.SEMATTRS_DB_CASSANDRA_IDEMPOTENCE = exports.SEMATTRS_DB_CASSANDRA_TABLE = exports.SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL = exports.SEMATTRS_DB_CASSANDRA_PAGE_SIZE = exports.SEMATTRS_DB_CASSANDRA_KEYSPACE = exports.SEMATTRS_DB_MSSQL_INSTANCE_NAME = exports.SEMATTRS_DB_OPERATION = exports.SEMATTRS_DB_STATEMENT = exports.SEMATTRS_DB_NAME = exports.SEMATTRS_DB_JDBC_DRIVER_CLASSNAME = exports.SEMATTRS_DB_USER = exports.SEMATTRS_DB_CONNECTION_STRING = exports.SEMATTRS_DB_SYSTEM = exports.SEMATTRS_AWS_LAMBDA_INVOKED_ARN = void 0; +exports.SEMATTRS_MESSAGING_DESTINATION_KIND = exports.SEMATTRS_MESSAGING_DESTINATION = exports.SEMATTRS_MESSAGING_SYSTEM = exports.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = exports.SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = exports.SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT = exports.SEMATTRS_AWS_DYNAMODB_COUNT = exports.SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS = exports.SEMATTRS_AWS_DYNAMODB_SEGMENT = exports.SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD = exports.SEMATTRS_AWS_DYNAMODB_TABLE_COUNT = exports.SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = exports.SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = exports.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = exports.SEMATTRS_AWS_DYNAMODB_SELECT = exports.SEMATTRS_AWS_DYNAMODB_INDEX_NAME = exports.SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET = exports.SEMATTRS_AWS_DYNAMODB_LIMIT = exports.SEMATTRS_AWS_DYNAMODB_PROJECTION = exports.SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ = exports.SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = exports.SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = exports.SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = exports.SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY = exports.SEMATTRS_AWS_DYNAMODB_TABLE_NAMES = exports.SEMATTRS_HTTP_CLIENT_IP = exports.SEMATTRS_HTTP_ROUTE = exports.SEMATTRS_HTTP_SERVER_NAME = exports.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = exports.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH = exports.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = exports.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH = exports.SEMATTRS_HTTP_USER_AGENT = exports.SEMATTRS_HTTP_FLAVOR = exports.SEMATTRS_HTTP_STATUS_CODE = exports.SEMATTRS_HTTP_SCHEME = exports.SEMATTRS_HTTP_HOST = exports.SEMATTRS_HTTP_TARGET = exports.SEMATTRS_HTTP_URL = exports.SEMATTRS_HTTP_METHOD = exports.SEMATTRS_CODE_LINENO = exports.SEMATTRS_CODE_FILEPATH = exports.SEMATTRS_CODE_NAMESPACE = exports.SEMATTRS_CODE_FUNCTION = exports.SEMATTRS_THREAD_NAME = exports.SEMATTRS_THREAD_ID = exports.SEMATTRS_ENDUSER_SCOPE = exports.SEMATTRS_ENDUSER_ROLE = exports.SEMATTRS_ENDUSER_ID = exports.SEMATTRS_PEER_SERVICE = void 0; +exports.DBSYSTEMVALUES_FILEMAKER = exports.DBSYSTEMVALUES_DERBY = exports.DBSYSTEMVALUES_FIREBIRD = exports.DBSYSTEMVALUES_ADABAS = exports.DBSYSTEMVALUES_CACHE = exports.DBSYSTEMVALUES_EDB = exports.DBSYSTEMVALUES_FIRSTSQL = exports.DBSYSTEMVALUES_INGRES = exports.DBSYSTEMVALUES_HANADB = exports.DBSYSTEMVALUES_MAXDB = exports.DBSYSTEMVALUES_PROGRESS = exports.DBSYSTEMVALUES_HSQLDB = exports.DBSYSTEMVALUES_CLOUDSCAPE = exports.DBSYSTEMVALUES_HIVE = exports.DBSYSTEMVALUES_REDSHIFT = exports.DBSYSTEMVALUES_POSTGRESQL = exports.DBSYSTEMVALUES_DB2 = exports.DBSYSTEMVALUES_ORACLE = exports.DBSYSTEMVALUES_MYSQL = exports.DBSYSTEMVALUES_MSSQL = exports.DBSYSTEMVALUES_OTHER_SQL = exports.SemanticAttributes = exports.SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE = exports.SEMATTRS_MESSAGE_COMPRESSED_SIZE = exports.SEMATTRS_MESSAGE_ID = exports.SEMATTRS_MESSAGE_TYPE = exports.SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE = exports.SEMATTRS_RPC_JSONRPC_ERROR_CODE = exports.SEMATTRS_RPC_JSONRPC_REQUEST_ID = exports.SEMATTRS_RPC_JSONRPC_VERSION = exports.SEMATTRS_RPC_GRPC_STATUS_CODE = exports.SEMATTRS_RPC_METHOD = exports.SEMATTRS_RPC_SERVICE = exports.SEMATTRS_RPC_SYSTEM = exports.SEMATTRS_MESSAGING_KAFKA_TOMBSTONE = exports.SEMATTRS_MESSAGING_KAFKA_PARTITION = exports.SEMATTRS_MESSAGING_KAFKA_CLIENT_ID = exports.SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP = exports.SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY = exports.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY = exports.SEMATTRS_MESSAGING_CONSUMER_ID = exports.SEMATTRS_MESSAGING_OPERATION = exports.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = exports.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = exports.SEMATTRS_MESSAGING_CONVERSATION_ID = exports.SEMATTRS_MESSAGING_MESSAGE_ID = exports.SEMATTRS_MESSAGING_URL = exports.SEMATTRS_MESSAGING_PROTOCOL_VERSION = exports.SEMATTRS_MESSAGING_PROTOCOL = exports.SEMATTRS_MESSAGING_TEMP_DESTINATION = void 0; +exports.FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = exports.FaasDocumentOperationValues = exports.FAASDOCUMENTOPERATIONVALUES_DELETE = exports.FAASDOCUMENTOPERATIONVALUES_EDIT = exports.FAASDOCUMENTOPERATIONVALUES_INSERT = exports.FaasTriggerValues = exports.FAASTRIGGERVALUES_OTHER = exports.FAASTRIGGERVALUES_TIMER = exports.FAASTRIGGERVALUES_PUBSUB = exports.FAASTRIGGERVALUES_HTTP = exports.FAASTRIGGERVALUES_DATASOURCE = exports.DbCassandraConsistencyLevelValues = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = exports.DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ANY = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_THREE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_TWO = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ONE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ALL = exports.DbSystemValues = exports.DBSYSTEMVALUES_COCKROACHDB = exports.DBSYSTEMVALUES_MEMCACHED = exports.DBSYSTEMVALUES_ELASTICSEARCH = exports.DBSYSTEMVALUES_GEODE = exports.DBSYSTEMVALUES_NEO4J = exports.DBSYSTEMVALUES_DYNAMODB = exports.DBSYSTEMVALUES_COSMOSDB = exports.DBSYSTEMVALUES_COUCHDB = exports.DBSYSTEMVALUES_COUCHBASE = exports.DBSYSTEMVALUES_REDIS = exports.DBSYSTEMVALUES_MONGODB = exports.DBSYSTEMVALUES_HBASE = exports.DBSYSTEMVALUES_CASSANDRA = exports.DBSYSTEMVALUES_COLDFUSION = exports.DBSYSTEMVALUES_H2 = exports.DBSYSTEMVALUES_VERTICA = exports.DBSYSTEMVALUES_TERADATA = exports.DBSYSTEMVALUES_SYBASE = exports.DBSYSTEMVALUES_SQLITE = exports.DBSYSTEMVALUES_POINTBASE = exports.DBSYSTEMVALUES_PERVASIVE = exports.DBSYSTEMVALUES_NETEZZA = exports.DBSYSTEMVALUES_MARIADB = exports.DBSYSTEMVALUES_INTERBASE = exports.DBSYSTEMVALUES_INSTANTDB = exports.DBSYSTEMVALUES_INFORMIX = void 0; +exports.MESSAGINGOPERATIONVALUES_RECEIVE = exports.MessagingDestinationKindValues = exports.MESSAGINGDESTINATIONKINDVALUES_TOPIC = exports.MESSAGINGDESTINATIONKINDVALUES_QUEUE = exports.HttpFlavorValues = exports.HTTPFLAVORVALUES_QUIC = exports.HTTPFLAVORVALUES_SPDY = exports.HTTPFLAVORVALUES_HTTP_2_0 = exports.HTTPFLAVORVALUES_HTTP_1_1 = exports.HTTPFLAVORVALUES_HTTP_1_0 = exports.NetHostConnectionSubtypeValues = exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_NR = exports.NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = exports.NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_GSM = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = exports.NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = exports.NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = exports.NetHostConnectionTypeValues = exports.NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = exports.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = exports.NETHOSTCONNECTIONTYPEVALUES_CELL = exports.NETHOSTCONNECTIONTYPEVALUES_WIRED = exports.NETHOSTCONNECTIONTYPEVALUES_WIFI = exports.NetTransportValues = exports.NETTRANSPORTVALUES_OTHER = exports.NETTRANSPORTVALUES_INPROC = exports.NETTRANSPORTVALUES_PIPE = exports.NETTRANSPORTVALUES_UNIX = exports.NETTRANSPORTVALUES_IP = exports.NETTRANSPORTVALUES_IP_UDP = exports.NETTRANSPORTVALUES_IP_TCP = exports.FaasInvokedProviderValues = exports.FAASINVOKEDPROVIDERVALUES_GCP = exports.FAASINVOKEDPROVIDERVALUES_AZURE = exports.FAASINVOKEDPROVIDERVALUES_AWS = void 0; +exports.MessageTypeValues = exports.MESSAGETYPEVALUES_RECEIVED = exports.MESSAGETYPEVALUES_SENT = exports.RpcGrpcStatusCodeValues = exports.RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = exports.RPCGRPCSTATUSCODEVALUES_DATA_LOSS = exports.RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = exports.RPCGRPCSTATUSCODEVALUES_INTERNAL = exports.RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = exports.RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = exports.RPCGRPCSTATUSCODEVALUES_ABORTED = exports.RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = exports.RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = exports.RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = exports.RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = exports.RPCGRPCSTATUSCODEVALUES_NOT_FOUND = exports.RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = exports.RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = exports.RPCGRPCSTATUSCODEVALUES_UNKNOWN = exports.RPCGRPCSTATUSCODEVALUES_CANCELLED = exports.RPCGRPCSTATUSCODEVALUES_OK = exports.MessagingOperationValues = exports.MESSAGINGOPERATIONVALUES_PROCESS = void 0; +const utils_1 = __nccwpck_require__(749); +//---------------------------------------------------------------------------------------------------------- +// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2 +//---------------------------------------------------------------------------------------------------------- +//---------------------------------------------------------------------------------------------------------- +// Constant values for SemanticAttributes +//---------------------------------------------------------------------------------------------------------- +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_AWS_LAMBDA_INVOKED_ARN = 'aws.lambda.invoked_arn'; +const TMP_DB_SYSTEM = 'db.system'; +const TMP_DB_CONNECTION_STRING = 'db.connection_string'; +const TMP_DB_USER = 'db.user'; +const TMP_DB_JDBC_DRIVER_CLASSNAME = 'db.jdbc.driver_classname'; +const TMP_DB_NAME = 'db.name'; +const TMP_DB_STATEMENT = 'db.statement'; +const TMP_DB_OPERATION = 'db.operation'; +const TMP_DB_MSSQL_INSTANCE_NAME = 'db.mssql.instance_name'; +const TMP_DB_CASSANDRA_KEYSPACE = 'db.cassandra.keyspace'; +const TMP_DB_CASSANDRA_PAGE_SIZE = 'db.cassandra.page_size'; +const TMP_DB_CASSANDRA_CONSISTENCY_LEVEL = 'db.cassandra.consistency_level'; +const TMP_DB_CASSANDRA_TABLE = 'db.cassandra.table'; +const TMP_DB_CASSANDRA_IDEMPOTENCE = 'db.cassandra.idempotence'; +const TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = 'db.cassandra.speculative_execution_count'; +const TMP_DB_CASSANDRA_COORDINATOR_ID = 'db.cassandra.coordinator.id'; +const TMP_DB_CASSANDRA_COORDINATOR_DC = 'db.cassandra.coordinator.dc'; +const TMP_DB_HBASE_NAMESPACE = 'db.hbase.namespace'; +const TMP_DB_REDIS_DATABASE_INDEX = 'db.redis.database_index'; +const TMP_DB_MONGODB_COLLECTION = 'db.mongodb.collection'; +const TMP_DB_SQL_TABLE = 'db.sql.table'; +const TMP_EXCEPTION_TYPE = 'exception.type'; +const TMP_EXCEPTION_MESSAGE = 'exception.message'; +const TMP_EXCEPTION_STACKTRACE = 'exception.stacktrace'; +const TMP_EXCEPTION_ESCAPED = 'exception.escaped'; +const TMP_FAAS_TRIGGER = 'faas.trigger'; +const TMP_FAAS_EXECUTION = 'faas.execution'; +const TMP_FAAS_DOCUMENT_COLLECTION = 'faas.document.collection'; +const TMP_FAAS_DOCUMENT_OPERATION = 'faas.document.operation'; +const TMP_FAAS_DOCUMENT_TIME = 'faas.document.time'; +const TMP_FAAS_DOCUMENT_NAME = 'faas.document.name'; +const TMP_FAAS_TIME = 'faas.time'; +const TMP_FAAS_CRON = 'faas.cron'; +const TMP_FAAS_COLDSTART = 'faas.coldstart'; +const TMP_FAAS_INVOKED_NAME = 'faas.invoked_name'; +const TMP_FAAS_INVOKED_PROVIDER = 'faas.invoked_provider'; +const TMP_FAAS_INVOKED_REGION = 'faas.invoked_region'; +const TMP_NET_TRANSPORT = 'net.transport'; +const TMP_NET_PEER_IP = 'net.peer.ip'; +const TMP_NET_PEER_PORT = 'net.peer.port'; +const TMP_NET_PEER_NAME = 'net.peer.name'; +const TMP_NET_HOST_IP = 'net.host.ip'; +const TMP_NET_HOST_PORT = 'net.host.port'; +const TMP_NET_HOST_NAME = 'net.host.name'; +const TMP_NET_HOST_CONNECTION_TYPE = 'net.host.connection.type'; +const TMP_NET_HOST_CONNECTION_SUBTYPE = 'net.host.connection.subtype'; +const TMP_NET_HOST_CARRIER_NAME = 'net.host.carrier.name'; +const TMP_NET_HOST_CARRIER_MCC = 'net.host.carrier.mcc'; +const TMP_NET_HOST_CARRIER_MNC = 'net.host.carrier.mnc'; +const TMP_NET_HOST_CARRIER_ICC = 'net.host.carrier.icc'; +const TMP_PEER_SERVICE = 'peer.service'; +const TMP_ENDUSER_ID = 'enduser.id'; +const TMP_ENDUSER_ROLE = 'enduser.role'; +const TMP_ENDUSER_SCOPE = 'enduser.scope'; +const TMP_THREAD_ID = 'thread.id'; +const TMP_THREAD_NAME = 'thread.name'; +const TMP_CODE_FUNCTION = 'code.function'; +const TMP_CODE_NAMESPACE = 'code.namespace'; +const TMP_CODE_FILEPATH = 'code.filepath'; +const TMP_CODE_LINENO = 'code.lineno'; +const TMP_HTTP_METHOD = 'http.method'; +const TMP_HTTP_URL = 'http.url'; +const TMP_HTTP_TARGET = 'http.target'; +const TMP_HTTP_HOST = 'http.host'; +const TMP_HTTP_SCHEME = 'http.scheme'; +const TMP_HTTP_STATUS_CODE = 'http.status_code'; +const TMP_HTTP_FLAVOR = 'http.flavor'; +const TMP_HTTP_USER_AGENT = 'http.user_agent'; +const TMP_HTTP_REQUEST_CONTENT_LENGTH = 'http.request_content_length'; +const TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = 'http.request_content_length_uncompressed'; +const TMP_HTTP_RESPONSE_CONTENT_LENGTH = 'http.response_content_length'; +const TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = 'http.response_content_length_uncompressed'; +const TMP_HTTP_SERVER_NAME = 'http.server_name'; +const TMP_HTTP_ROUTE = 'http.route'; +const TMP_HTTP_CLIENT_IP = 'http.client_ip'; +const TMP_AWS_DYNAMODB_TABLE_NAMES = 'aws.dynamodb.table_names'; +const TMP_AWS_DYNAMODB_CONSUMED_CAPACITY = 'aws.dynamodb.consumed_capacity'; +const TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = 'aws.dynamodb.item_collection_metrics'; +const TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = 'aws.dynamodb.provisioned_read_capacity'; +const TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = 'aws.dynamodb.provisioned_write_capacity'; +const TMP_AWS_DYNAMODB_CONSISTENT_READ = 'aws.dynamodb.consistent_read'; +const TMP_AWS_DYNAMODB_PROJECTION = 'aws.dynamodb.projection'; +const TMP_AWS_DYNAMODB_LIMIT = 'aws.dynamodb.limit'; +const TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET = 'aws.dynamodb.attributes_to_get'; +const TMP_AWS_DYNAMODB_INDEX_NAME = 'aws.dynamodb.index_name'; +const TMP_AWS_DYNAMODB_SELECT = 'aws.dynamodb.select'; +const TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = 'aws.dynamodb.global_secondary_indexes'; +const TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = 'aws.dynamodb.local_secondary_indexes'; +const TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = 'aws.dynamodb.exclusive_start_table'; +const TMP_AWS_DYNAMODB_TABLE_COUNT = 'aws.dynamodb.table_count'; +const TMP_AWS_DYNAMODB_SCAN_FORWARD = 'aws.dynamodb.scan_forward'; +const TMP_AWS_DYNAMODB_SEGMENT = 'aws.dynamodb.segment'; +const TMP_AWS_DYNAMODB_TOTAL_SEGMENTS = 'aws.dynamodb.total_segments'; +const TMP_AWS_DYNAMODB_COUNT = 'aws.dynamodb.count'; +const TMP_AWS_DYNAMODB_SCANNED_COUNT = 'aws.dynamodb.scanned_count'; +const TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = 'aws.dynamodb.attribute_definitions'; +const TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = 'aws.dynamodb.global_secondary_index_updates'; +const TMP_MESSAGING_SYSTEM = 'messaging.system'; +const TMP_MESSAGING_DESTINATION = 'messaging.destination'; +const TMP_MESSAGING_DESTINATION_KIND = 'messaging.destination_kind'; +const TMP_MESSAGING_TEMP_DESTINATION = 'messaging.temp_destination'; +const TMP_MESSAGING_PROTOCOL = 'messaging.protocol'; +const TMP_MESSAGING_PROTOCOL_VERSION = 'messaging.protocol_version'; +const TMP_MESSAGING_URL = 'messaging.url'; +const TMP_MESSAGING_MESSAGE_ID = 'messaging.message_id'; +const TMP_MESSAGING_CONVERSATION_ID = 'messaging.conversation_id'; +const TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = 'messaging.message_payload_size_bytes'; +const TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = 'messaging.message_payload_compressed_size_bytes'; +const TMP_MESSAGING_OPERATION = 'messaging.operation'; +const TMP_MESSAGING_CONSUMER_ID = 'messaging.consumer_id'; +const TMP_MESSAGING_RABBITMQ_ROUTING_KEY = 'messaging.rabbitmq.routing_key'; +const TMP_MESSAGING_KAFKA_MESSAGE_KEY = 'messaging.kafka.message_key'; +const TMP_MESSAGING_KAFKA_CONSUMER_GROUP = 'messaging.kafka.consumer_group'; +const TMP_MESSAGING_KAFKA_CLIENT_ID = 'messaging.kafka.client_id'; +const TMP_MESSAGING_KAFKA_PARTITION = 'messaging.kafka.partition'; +const TMP_MESSAGING_KAFKA_TOMBSTONE = 'messaging.kafka.tombstone'; +const TMP_RPC_SYSTEM = 'rpc.system'; +const TMP_RPC_SERVICE = 'rpc.service'; +const TMP_RPC_METHOD = 'rpc.method'; +const TMP_RPC_GRPC_STATUS_CODE = 'rpc.grpc.status_code'; +const TMP_RPC_JSONRPC_VERSION = 'rpc.jsonrpc.version'; +const TMP_RPC_JSONRPC_REQUEST_ID = 'rpc.jsonrpc.request_id'; +const TMP_RPC_JSONRPC_ERROR_CODE = 'rpc.jsonrpc.error_code'; +const TMP_RPC_JSONRPC_ERROR_MESSAGE = 'rpc.jsonrpc.error_message'; +const TMP_MESSAGE_TYPE = 'message.type'; +const TMP_MESSAGE_ID = 'message.id'; +const TMP_MESSAGE_COMPRESSED_SIZE = 'message.compressed_size'; +const TMP_MESSAGE_UNCOMPRESSED_SIZE = 'message.uncompressed_size'; +/** + * The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). + * + * Note: This may be different from `faas.id` if an alias is involved. + * + * @deprecated Use ATTR_AWS_LAMBDA_INVOKED_ARN in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_LAMBDA_INVOKED_ARN = TMP_AWS_LAMBDA_INVOKED_ARN; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use ATTR_DB_SYSTEM in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_DB_SYSTEM = TMP_DB_SYSTEM; +/** + * The connection string used to connect to the database. It is recommended to remove embedded credentials. + * + * @deprecated Use ATTR_DB_CONNECTION_STRING in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_DB_CONNECTION_STRING = TMP_DB_CONNECTION_STRING; +/** + * Username for accessing the database. + * + * @deprecated Use ATTR_DB_USER in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_DB_USER = TMP_DB_USER; +/** + * The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. + * + * @deprecated Use ATTR_DB_JDBC_DRIVER_CLASSNAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_DB_JDBC_DRIVER_CLASSNAME = TMP_DB_JDBC_DRIVER_CLASSNAME; +/** + * If no [tech-specific attribute](#call-level-attributes-for-specific-technologies) is defined, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). + * + * Note: In some SQL databases, the database name to be used is called "schema name". + * + * @deprecated Use ATTR_DB_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_DB_NAME = TMP_DB_NAME; +/** + * The database statement being executed. + * + * Note: The value may be sanitized to exclude sensitive information. + * + * @deprecated Use ATTR_DB_STATEMENT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_DB_STATEMENT = TMP_DB_STATEMENT; +/** + * The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. + * + * Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. + * + * @deprecated Use ATTR_DB_OPERATION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_DB_OPERATION = TMP_DB_OPERATION; +/** + * The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. + * + * Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard). + * + * @deprecated Use ATTR_DB_MSSQL_INSTANCE_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_DB_MSSQL_INSTANCE_NAME = TMP_DB_MSSQL_INSTANCE_NAME; +/** + * The name of the keyspace being accessed. To be used instead of the generic `db.name` attribute. + * + * @deprecated Use ATTR_DB_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_DB_CASSANDRA_KEYSPACE = TMP_DB_CASSANDRA_KEYSPACE; +/** + * The fetch size used for paging, i.e. how many rows will be returned at once. + * + * @deprecated Use ATTR_DB_CASSANDRA_PAGE_SIZE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_DB_CASSANDRA_PAGE_SIZE = TMP_DB_CASSANDRA_PAGE_SIZE; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL = TMP_DB_CASSANDRA_CONSISTENCY_LEVEL; +/** + * The name of the primary table that the operation is acting upon, including the schema name (if applicable). + * + * Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. + * + * @deprecated Use ATTR_DB_CASSANDRA_TABLE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_DB_CASSANDRA_TABLE = TMP_DB_CASSANDRA_TABLE; +/** + * Whether or not the query is idempotent. + * + * @deprecated Use ATTR_DB_CASSANDRA_IDEMPOTENCE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_DB_CASSANDRA_IDEMPOTENCE = TMP_DB_CASSANDRA_IDEMPOTENCE; +/** + * The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. + * + * @deprecated Use ATTR_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT; +/** + * The ID of the coordinating node for a query. + * + * @deprecated Use ATTR_DB_CASSANDRA_COORDINATOR_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_DB_CASSANDRA_COORDINATOR_ID = TMP_DB_CASSANDRA_COORDINATOR_ID; +/** + * The data center of the coordinating node for a query. + * + * @deprecated Use ATTR_DB_CASSANDRA_COORDINATOR_DC in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_DB_CASSANDRA_COORDINATOR_DC = TMP_DB_CASSANDRA_COORDINATOR_DC; +/** + * The [HBase namespace](https://hbase.apache.org/book.html#_namespace) being accessed. To be used instead of the generic `db.name` attribute. + * + * @deprecated Use ATTR_DB_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_DB_HBASE_NAMESPACE = TMP_DB_HBASE_NAMESPACE; +/** + * The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. + * + * @deprecated Use ATTR_DB_REDIS_DATABASE_INDEX in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_DB_REDIS_DATABASE_INDEX = TMP_DB_REDIS_DATABASE_INDEX; +/** + * The collection being accessed within the database stated in `db.name`. + * + * @deprecated Use ATTR_DB_MONGODB_COLLECTION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_DB_MONGODB_COLLECTION = TMP_DB_MONGODB_COLLECTION; +/** + * The name of the primary table that the operation is acting upon, including the schema name (if applicable). + * + * Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. + * + * @deprecated Use ATTR_DB_SQL_TABLE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_DB_SQL_TABLE = TMP_DB_SQL_TABLE; +/** + * 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. + * + * @deprecated Use ATTR_EXCEPTION_TYPE. + */ +exports.SEMATTRS_EXCEPTION_TYPE = TMP_EXCEPTION_TYPE; +/** + * The exception message. + * + * @deprecated Use ATTR_EXCEPTION_MESSAGE. + */ +exports.SEMATTRS_EXCEPTION_MESSAGE = TMP_EXCEPTION_MESSAGE; +/** + * 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. + * + * @deprecated Use ATTR_EXCEPTION_STACKTRACE. + */ +exports.SEMATTRS_EXCEPTION_STACKTRACE = TMP_EXCEPTION_STACKTRACE; +/** +* SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. +* +* Note: An exception is considered to have escaped (or left) the scope of a span, +if that span is ended while the exception is still logically "in flight". +This may be actually "in flight" in some languages (e.g. if the exception +is passed to a Context manager's `__exit__` method in Python) but will +usually be caught at the point of recording the exception in most languages. + +It is usually not possible to determine at the point where an exception is thrown +whether it will escape the scope of a span. +However, it is trivial to know that an exception +will escape, if one checks for an active exception just before ending the span, +as done in the [example above](#exception-end-example). + +It follows that an exception may still escape the scope of the span +even if the `exception.escaped` attribute was not set or set to false, +since the event might have been recorded at a time where it was not +clear whether the exception will escape. +* +* @deprecated Use ATTR_EXCEPTION_ESCAPED. +*/ +exports.SEMATTRS_EXCEPTION_ESCAPED = TMP_EXCEPTION_ESCAPED; +/** + * Type of the trigger on which the function is executed. + * + * @deprecated Use ATTR_FAAS_TRIGGER in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_FAAS_TRIGGER = TMP_FAAS_TRIGGER; +/** + * The execution ID of the current function execution. + * + * @deprecated Use ATTR_FAAS_INVOCATION_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_FAAS_EXECUTION = TMP_FAAS_EXECUTION; +/** + * The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. + * + * @deprecated Use ATTR_FAAS_DOCUMENT_COLLECTION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_FAAS_DOCUMENT_COLLECTION = TMP_FAAS_DOCUMENT_COLLECTION; +/** + * Describes the type of the operation that was performed on the data. + * + * @deprecated Use ATTR_FAAS_DOCUMENT_OPERATION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_FAAS_DOCUMENT_OPERATION = TMP_FAAS_DOCUMENT_OPERATION; +/** + * A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). + * + * @deprecated Use ATTR_FAAS_DOCUMENT_TIME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_FAAS_DOCUMENT_TIME = TMP_FAAS_DOCUMENT_TIME; +/** + * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. + * + * @deprecated Use ATTR_FAAS_DOCUMENT_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_FAAS_DOCUMENT_NAME = TMP_FAAS_DOCUMENT_NAME; +/** + * A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). + * + * @deprecated Use ATTR_FAAS_TIME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_FAAS_TIME = TMP_FAAS_TIME; +/** + * A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). + * + * @deprecated Use ATTR_FAAS_CRON in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_FAAS_CRON = TMP_FAAS_CRON; +/** + * A boolean that is true if the serverless function is executed for the first time (aka cold-start). + * + * @deprecated Use ATTR_FAAS_COLDSTART in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_FAAS_COLDSTART = TMP_FAAS_COLDSTART; +/** + * The name of the invoked function. + * + * Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. + * + * @deprecated Use ATTR_FAAS_INVOKED_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_FAAS_INVOKED_NAME = TMP_FAAS_INVOKED_NAME; +/** + * The cloud provider of the invoked function. + * + * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. + * + * @deprecated Use ATTR_FAAS_INVOKED_PROVIDER in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_FAAS_INVOKED_PROVIDER = TMP_FAAS_INVOKED_PROVIDER; +/** + * The cloud region of the invoked function. + * + * Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. + * + * @deprecated Use ATTR_FAAS_INVOKED_REGION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_FAAS_INVOKED_REGION = TMP_FAAS_INVOKED_REGION; +/** + * Transport protocol used. See note below. + * + * @deprecated Use ATTR_NET_TRANSPORT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_NET_TRANSPORT = TMP_NET_TRANSPORT; +/** + * Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6). + * + * @deprecated Use ATTR_NET_PEER_IP in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_NET_PEER_IP = TMP_NET_PEER_IP; +/** + * Remote port number. + * + * @deprecated Use ATTR_NET_PEER_PORT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_NET_PEER_PORT = TMP_NET_PEER_PORT; +/** + * Remote hostname or similar, see note below. + * + * @deprecated Use ATTR_NET_PEER_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_NET_PEER_NAME = TMP_NET_PEER_NAME; +/** + * Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host. + * + * @deprecated Use ATTR_NET_HOST_IP in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_NET_HOST_IP = TMP_NET_HOST_IP; +/** + * Like `net.peer.port` but for the host port. + * + * @deprecated Use ATTR_NET_HOST_PORT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_NET_HOST_PORT = TMP_NET_HOST_PORT; +/** + * Local hostname or similar, see note below. + * + * @deprecated Use ATTR_NET_HOST_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_NET_HOST_NAME = TMP_NET_HOST_NAME; +/** + * The internet connection type currently being used by the host. + * + * @deprecated Use ATTR_NETWORK_CONNECTION_TYPE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_NET_HOST_CONNECTION_TYPE = TMP_NET_HOST_CONNECTION_TYPE; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use ATTR_NETWORK_CONNECTION_SUBTYPE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_NET_HOST_CONNECTION_SUBTYPE = TMP_NET_HOST_CONNECTION_SUBTYPE; +/** + * The name of the mobile carrier. + * + * @deprecated Use ATTR_NETWORK_CARRIER_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_NET_HOST_CARRIER_NAME = TMP_NET_HOST_CARRIER_NAME; +/** + * The mobile carrier country code. + * + * @deprecated Use ATTR_NETWORK_CARRIER_MCC in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_NET_HOST_CARRIER_MCC = TMP_NET_HOST_CARRIER_MCC; +/** + * The mobile carrier network code. + * + * @deprecated Use ATTR_NETWORK_CARRIER_MNC in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_NET_HOST_CARRIER_MNC = TMP_NET_HOST_CARRIER_MNC; +/** + * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. + * + * @deprecated Use ATTR_NETWORK_CARRIER_ICC in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_NET_HOST_CARRIER_ICC = TMP_NET_HOST_CARRIER_ICC; +/** + * The [`service.name`](../../resource/semantic_conventions/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. + * + * @deprecated Use ATTR_PEER_SERVICE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_PEER_SERVICE = TMP_PEER_SERVICE; +/** + * Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. + * + * @deprecated Use ATTR_ENDUSER_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_ENDUSER_ID = TMP_ENDUSER_ID; +/** + * Actual/assumed role the client is making the request under extracted from token or application security context. + * + * @deprecated Use ATTR_ENDUSER_ROLE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_ENDUSER_ROLE = TMP_ENDUSER_ROLE; +/** + * Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). + * + * @deprecated Use ATTR_ENDUSER_SCOPE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_ENDUSER_SCOPE = TMP_ENDUSER_SCOPE; +/** + * Current "managed" thread ID (as opposed to OS thread ID). + * + * @deprecated Use ATTR_THREAD_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_THREAD_ID = TMP_THREAD_ID; +/** + * Current thread name. + * + * @deprecated Use ATTR_THREAD_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_THREAD_NAME = TMP_THREAD_NAME; +/** + * The method or function name, or equivalent (usually rightmost part of the code unit's name). + * + * @deprecated Use ATTR_CODE_FUNCTION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_CODE_FUNCTION = TMP_CODE_FUNCTION; +/** + * The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. + * + * @deprecated Use ATTR_CODE_NAMESPACE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_CODE_NAMESPACE = TMP_CODE_NAMESPACE; +/** + * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). + * + * @deprecated Use ATTR_CODE_FILEPATH in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_CODE_FILEPATH = TMP_CODE_FILEPATH; +/** + * The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. + * + * @deprecated Use ATTR_CODE_LINENO in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_CODE_LINENO = TMP_CODE_LINENO; +/** + * HTTP request method. + * + * @deprecated Use ATTR_HTTP_METHOD in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_HTTP_METHOD = TMP_HTTP_METHOD; +/** + * Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. + * + * Note: `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute's value should be `https://www.example.com/`. + * + * @deprecated Use ATTR_HTTP_URL in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_HTTP_URL = TMP_HTTP_URL; +/** + * The full request target as passed in a HTTP request line or equivalent. + * + * @deprecated Use ATTR_HTTP_TARGET in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_HTTP_TARGET = TMP_HTTP_TARGET; +/** + * The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). An empty Host header should also be reported, see note. + * + * Note: When the header is present but empty the attribute SHOULD be set to the empty string. Note that this is a valid situation that is expected in certain cases, according the aforementioned [section of RFC 7230](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is not set the attribute MUST NOT be set. + * + * @deprecated Use ATTR_HTTP_HOST in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_HTTP_HOST = TMP_HTTP_HOST; +/** + * The URI scheme identifying the used protocol. + * + * @deprecated Use ATTR_HTTP_SCHEME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_HTTP_SCHEME = TMP_HTTP_SCHEME; +/** + * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). + * + * @deprecated Use ATTR_HTTP_STATUS_CODE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_HTTP_STATUS_CODE = TMP_HTTP_STATUS_CODE; +/** + * Kind of HTTP protocol used. + * + * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. + * + * @deprecated Use ATTR_HTTP_FLAVOR in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_HTTP_FLAVOR = TMP_HTTP_FLAVOR; +/** + * Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. + * + * @deprecated Use ATTR_HTTP_USER_AGENT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_HTTP_USER_AGENT = TMP_HTTP_USER_AGENT; +/** + * The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size. + * + * @deprecated Use ATTR_HTTP_REQUEST_CONTENT_LENGTH in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH = TMP_HTTP_REQUEST_CONTENT_LENGTH; +/** + * The size of the uncompressed request payload body after transport decoding. Not set if transport encoding not used. + * + * @deprecated Use ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED; +/** + * The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size. + * + * @deprecated Use ATTR_HTTP_RESPONSE_CONTENT_LENGTH in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH = TMP_HTTP_RESPONSE_CONTENT_LENGTH; +/** + * The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used. + * + * @deprecated Use ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED; +/** + * The primary server name of the matched virtual host. This should be obtained via configuration. If no such configuration can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead). + * + * Note: `http.url` is usually not readily available on the server side but would have to be assembled in a cumbersome and sometimes lossy process from other information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus preferred to supply the raw data that is available. + * + * @deprecated Use ATTR_HTTP_SERVER_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_HTTP_SERVER_NAME = TMP_HTTP_SERVER_NAME; +/** + * The matched route (path template). + * + * @deprecated Use ATTR_HTTP_ROUTE. + */ +exports.SEMATTRS_HTTP_ROUTE = TMP_HTTP_ROUTE; +/** +* The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). +* +* Note: This is not necessarily the same as `net.peer.ip`, which would +identify the network-level peer, which may be a proxy. + +This attribute should be set when a source of information different +from the one used for `net.peer.ip`, is available even if that other +source just confirms the same value as `net.peer.ip`. +Rationale: For `net.peer.ip`, one typically does not know if it +comes from a proxy, reverse proxy, or the actual client. Setting +`http.client_ip` when it's the same as `net.peer.ip` means that +one is at least somewhat confident that the address is not that of +the closest proxy. +* +* @deprecated Use ATTR_HTTP_CLIENT_IP in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). +*/ +exports.SEMATTRS_HTTP_CLIENT_IP = TMP_HTTP_CLIENT_IP; +/** + * The keys in the `RequestItems` object field. + * + * @deprecated Use ATTR_AWS_DYNAMODB_TABLE_NAMES in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_TABLE_NAMES = TMP_AWS_DYNAMODB_TABLE_NAMES; +/** + * The JSON-serialized value of each item in the `ConsumedCapacity` response field. + * + * @deprecated Use ATTR_AWS_DYNAMODB_CONSUMED_CAPACITY in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY = TMP_AWS_DYNAMODB_CONSUMED_CAPACITY; +/** + * The JSON-serialized value of the `ItemCollectionMetrics` response field. + * + * @deprecated Use ATTR_AWS_DYNAMODB_ITEM_COLLECTION_METRICS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS; +/** + * The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. + * + * @deprecated Use ATTR_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY; +/** + * The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. + * + * @deprecated Use ATTR_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY; +/** + * The value of the `ConsistentRead` request parameter. + * + * @deprecated Use ATTR_AWS_DYNAMODB_CONSISTENT_READ in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ = TMP_AWS_DYNAMODB_CONSISTENT_READ; +/** + * The value of the `ProjectionExpression` request parameter. + * + * @deprecated Use ATTR_AWS_DYNAMODB_PROJECTION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_PROJECTION = TMP_AWS_DYNAMODB_PROJECTION; +/** + * The value of the `Limit` request parameter. + * + * @deprecated Use ATTR_AWS_DYNAMODB_LIMIT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_LIMIT = TMP_AWS_DYNAMODB_LIMIT; +/** + * The value of the `AttributesToGet` request parameter. + * + * @deprecated Use ATTR_AWS_DYNAMODB_ATTRIBUTES_TO_GET in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET = TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET; +/** + * The value of the `IndexName` request parameter. + * + * @deprecated Use ATTR_AWS_DYNAMODB_INDEX_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_INDEX_NAME = TMP_AWS_DYNAMODB_INDEX_NAME; +/** + * The value of the `Select` request parameter. + * + * @deprecated Use ATTR_AWS_DYNAMODB_SELECT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_SELECT = TMP_AWS_DYNAMODB_SELECT; +/** + * The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. + * + * @deprecated Use ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES; +/** + * The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. + * + * @deprecated Use ATTR_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES; +/** + * The value of the `ExclusiveStartTableName` request parameter. + * + * @deprecated Use ATTR_AWS_DYNAMODB_EXCLUSIVE_START_TABLE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE; +/** + * The the number of items in the `TableNames` response parameter. + * + * @deprecated Use ATTR_AWS_DYNAMODB_TABLE_COUNT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_TABLE_COUNT = TMP_AWS_DYNAMODB_TABLE_COUNT; +/** + * The value of the `ScanIndexForward` request parameter. + * + * @deprecated Use ATTR_AWS_DYNAMODB_SCAN_FORWARD in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD = TMP_AWS_DYNAMODB_SCAN_FORWARD; +/** + * The value of the `Segment` request parameter. + * + * @deprecated Use ATTR_AWS_DYNAMODB_SEGMENT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_SEGMENT = TMP_AWS_DYNAMODB_SEGMENT; +/** + * The value of the `TotalSegments` request parameter. + * + * @deprecated Use ATTR_AWS_DYNAMODB_TOTAL_SEGMENTS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS = TMP_AWS_DYNAMODB_TOTAL_SEGMENTS; +/** + * The value of the `Count` response parameter. + * + * @deprecated Use ATTR_AWS_DYNAMODB_COUNT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_COUNT = TMP_AWS_DYNAMODB_COUNT; +/** + * The value of the `ScannedCount` response parameter. + * + * @deprecated Use ATTR_AWS_DYNAMODB_SCANNED_COUNT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT = TMP_AWS_DYNAMODB_SCANNED_COUNT; +/** + * The JSON-serialized value of each item in the `AttributeDefinitions` request field. + * + * @deprecated Use ATTR_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS; +/** + * The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. + * + * @deprecated Use ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES; +/** + * A string identifying the messaging system. + * + * @deprecated Use ATTR_MESSAGING_SYSTEM in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_MESSAGING_SYSTEM = TMP_MESSAGING_SYSTEM; +/** + * The message destination name. This might be equal to the span name but is required nevertheless. + * + * @deprecated Use ATTR_MESSAGING_DESTINATION_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_MESSAGING_DESTINATION = TMP_MESSAGING_DESTINATION; +/** + * The kind of message destination. + * + * @deprecated Removed in semconv v1.20.0. + */ +exports.SEMATTRS_MESSAGING_DESTINATION_KIND = TMP_MESSAGING_DESTINATION_KIND; +/** + * A boolean that is true if the message destination is temporary. + * + * @deprecated Use ATTR_MESSAGING_DESTINATION_TEMPORARY in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_MESSAGING_TEMP_DESTINATION = TMP_MESSAGING_TEMP_DESTINATION; +/** + * The name of the transport protocol. + * + * @deprecated Use ATTR_NETWORK_PROTOCOL_NAME. + */ +exports.SEMATTRS_MESSAGING_PROTOCOL = TMP_MESSAGING_PROTOCOL; +/** + * The version of the transport protocol. + * + * @deprecated Use ATTR_NETWORK_PROTOCOL_VERSION. + */ +exports.SEMATTRS_MESSAGING_PROTOCOL_VERSION = TMP_MESSAGING_PROTOCOL_VERSION; +/** + * Connection string. + * + * @deprecated Removed in semconv v1.17.0. + */ +exports.SEMATTRS_MESSAGING_URL = TMP_MESSAGING_URL; +/** + * A value used by the messaging system as an identifier for the message, represented as a string. + * + * @deprecated Use ATTR_MESSAGING_MESSAGE_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_MESSAGING_MESSAGE_ID = TMP_MESSAGING_MESSAGE_ID; +/** + * The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". + * + * @deprecated Use ATTR_MESSAGING_MESSAGE_CONVERSATION_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_MESSAGING_CONVERSATION_ID = TMP_MESSAGING_CONVERSATION_ID; +/** + * The (uncompressed) size of the message payload in bytes. Also use this attribute if it is unknown whether the compressed or uncompressed payload size is reported. + * + * @deprecated Use ATTR_MESSAGING_MESSAGE_BODY_SIZE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES; +/** + * The compressed size of the message payload in bytes. + * + * @deprecated Removed in semconv v1.22.0. + */ +exports.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES; +/** + * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case. + * + * @deprecated Use ATTR_MESSAGING_OPERATION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_MESSAGING_OPERATION = TMP_MESSAGING_OPERATION; +/** + * The identifier for the consumer receiving a message. For Kafka, set it to `{messaging.kafka.consumer_group} - {messaging.kafka.client_id}`, if both are present, or only `messaging.kafka.consumer_group`. For brokers, such as RabbitMQ and Artemis, set it to the `client_id` of the client consuming the message. + * + * @deprecated Removed in semconv v1.21.0. + */ +exports.SEMATTRS_MESSAGING_CONSUMER_ID = TMP_MESSAGING_CONSUMER_ID; +/** + * RabbitMQ message routing key. + * + * @deprecated Use ATTR_MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY = TMP_MESSAGING_RABBITMQ_ROUTING_KEY; +/** + * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message_id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. + * + * Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. + * + * @deprecated Use ATTR_MESSAGING_KAFKA_MESSAGE_KEY in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY = TMP_MESSAGING_KAFKA_MESSAGE_KEY; +/** + * Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. + * + * @deprecated Use ATTR_MESSAGING_KAFKA_CONSUMER_GROUP in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP = TMP_MESSAGING_KAFKA_CONSUMER_GROUP; +/** + * Client Id for the Consumer or Producer that is handling the message. + * + * @deprecated Use ATTR_MESSAGING_CLIENT_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_MESSAGING_KAFKA_CLIENT_ID = TMP_MESSAGING_KAFKA_CLIENT_ID; +/** + * Partition the message is sent to. + * + * @deprecated Use ATTR_MESSAGING_KAFKA_DESTINATION_PARTITION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_MESSAGING_KAFKA_PARTITION = TMP_MESSAGING_KAFKA_PARTITION; +/** + * A boolean that is true if the message is a tombstone. + * + * @deprecated Use ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_MESSAGING_KAFKA_TOMBSTONE = TMP_MESSAGING_KAFKA_TOMBSTONE; +/** + * A string identifying the remoting system. + * + * @deprecated Use ATTR_RPC_SYSTEM in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_RPC_SYSTEM = TMP_RPC_SYSTEM; +/** + * The full (logical) name of the service being called, including its package name, if applicable. + * + * Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). + * + * @deprecated Use ATTR_RPC_SERVICE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_RPC_SERVICE = TMP_RPC_SERVICE; +/** + * The name of the (logical) method being called, must be equal to the $method part in the span name. + * + * Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). + * + * @deprecated Use ATTR_RPC_METHOD in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_RPC_METHOD = TMP_RPC_METHOD; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use ATTR_RPC_GRPC_STATUS_CODE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_RPC_GRPC_STATUS_CODE = TMP_RPC_GRPC_STATUS_CODE; +/** + * Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 does not specify this, the value can be omitted. + * + * @deprecated Use ATTR_RPC_JSONRPC_VERSION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_RPC_JSONRPC_VERSION = TMP_RPC_JSONRPC_VERSION; +/** + * `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. + * + * @deprecated Use ATTR_RPC_JSONRPC_REQUEST_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_RPC_JSONRPC_REQUEST_ID = TMP_RPC_JSONRPC_REQUEST_ID; +/** + * `error.code` property of response if it is an error response. + * + * @deprecated Use ATTR_RPC_JSONRPC_ERROR_CODE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_RPC_JSONRPC_ERROR_CODE = TMP_RPC_JSONRPC_ERROR_CODE; +/** + * `error.message` property of response if it is an error response. + * + * @deprecated Use ATTR_RPC_JSONRPC_ERROR_MESSAGE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE = TMP_RPC_JSONRPC_ERROR_MESSAGE; +/** + * Whether this is a received or sent message. + * + * @deprecated Use ATTR_MESSAGE_TYPE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_MESSAGE_TYPE = TMP_MESSAGE_TYPE; +/** + * MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. + * + * Note: This way we guarantee that the values will be consistent between different implementations. + * + * @deprecated Use ATTR_MESSAGE_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_MESSAGE_ID = TMP_MESSAGE_ID; +/** + * Compressed size of the message in bytes. + * + * @deprecated Use ATTR_MESSAGE_COMPRESSED_SIZE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_MESSAGE_COMPRESSED_SIZE = TMP_MESSAGE_COMPRESSED_SIZE; +/** + * Uncompressed size of the message in bytes. + * + * @deprecated Use ATTR_MESSAGE_UNCOMPRESSED_SIZE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE = TMP_MESSAGE_UNCOMPRESSED_SIZE; +/** + * Create exported Value Map for SemanticAttributes values + * @deprecated Use the SEMATTRS_XXXXX constants rather than the SemanticAttributes.XXXXX for bundle minification + */ +exports.SemanticAttributes = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_AWS_LAMBDA_INVOKED_ARN, + TMP_DB_SYSTEM, + TMP_DB_CONNECTION_STRING, + TMP_DB_USER, + TMP_DB_JDBC_DRIVER_CLASSNAME, + TMP_DB_NAME, + TMP_DB_STATEMENT, + TMP_DB_OPERATION, + TMP_DB_MSSQL_INSTANCE_NAME, + TMP_DB_CASSANDRA_KEYSPACE, + TMP_DB_CASSANDRA_PAGE_SIZE, + TMP_DB_CASSANDRA_CONSISTENCY_LEVEL, + TMP_DB_CASSANDRA_TABLE, + TMP_DB_CASSANDRA_IDEMPOTENCE, + TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT, + TMP_DB_CASSANDRA_COORDINATOR_ID, + TMP_DB_CASSANDRA_COORDINATOR_DC, + TMP_DB_HBASE_NAMESPACE, + TMP_DB_REDIS_DATABASE_INDEX, + TMP_DB_MONGODB_COLLECTION, + TMP_DB_SQL_TABLE, + TMP_EXCEPTION_TYPE, + TMP_EXCEPTION_MESSAGE, + TMP_EXCEPTION_STACKTRACE, + TMP_EXCEPTION_ESCAPED, + TMP_FAAS_TRIGGER, + TMP_FAAS_EXECUTION, + TMP_FAAS_DOCUMENT_COLLECTION, + TMP_FAAS_DOCUMENT_OPERATION, + TMP_FAAS_DOCUMENT_TIME, + TMP_FAAS_DOCUMENT_NAME, + TMP_FAAS_TIME, + TMP_FAAS_CRON, + TMP_FAAS_COLDSTART, + TMP_FAAS_INVOKED_NAME, + TMP_FAAS_INVOKED_PROVIDER, + TMP_FAAS_INVOKED_REGION, + TMP_NET_TRANSPORT, + TMP_NET_PEER_IP, + TMP_NET_PEER_PORT, + TMP_NET_PEER_NAME, + TMP_NET_HOST_IP, + TMP_NET_HOST_PORT, + TMP_NET_HOST_NAME, + TMP_NET_HOST_CONNECTION_TYPE, + TMP_NET_HOST_CONNECTION_SUBTYPE, + TMP_NET_HOST_CARRIER_NAME, + TMP_NET_HOST_CARRIER_MCC, + TMP_NET_HOST_CARRIER_MNC, + TMP_NET_HOST_CARRIER_ICC, + TMP_PEER_SERVICE, + TMP_ENDUSER_ID, + TMP_ENDUSER_ROLE, + TMP_ENDUSER_SCOPE, + TMP_THREAD_ID, + TMP_THREAD_NAME, + TMP_CODE_FUNCTION, + TMP_CODE_NAMESPACE, + TMP_CODE_FILEPATH, + TMP_CODE_LINENO, + TMP_HTTP_METHOD, + TMP_HTTP_URL, + TMP_HTTP_TARGET, + TMP_HTTP_HOST, + TMP_HTTP_SCHEME, + TMP_HTTP_STATUS_CODE, + TMP_HTTP_FLAVOR, + TMP_HTTP_USER_AGENT, + TMP_HTTP_REQUEST_CONTENT_LENGTH, + TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED, + TMP_HTTP_RESPONSE_CONTENT_LENGTH, + TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED, + TMP_HTTP_SERVER_NAME, + TMP_HTTP_ROUTE, + TMP_HTTP_CLIENT_IP, + TMP_AWS_DYNAMODB_TABLE_NAMES, + TMP_AWS_DYNAMODB_CONSUMED_CAPACITY, + TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS, + TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY, + TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY, + TMP_AWS_DYNAMODB_CONSISTENT_READ, + TMP_AWS_DYNAMODB_PROJECTION, + TMP_AWS_DYNAMODB_LIMIT, + TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET, + TMP_AWS_DYNAMODB_INDEX_NAME, + TMP_AWS_DYNAMODB_SELECT, + TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES, + TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES, + TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE, + TMP_AWS_DYNAMODB_TABLE_COUNT, + TMP_AWS_DYNAMODB_SCAN_FORWARD, + TMP_AWS_DYNAMODB_SEGMENT, + TMP_AWS_DYNAMODB_TOTAL_SEGMENTS, + TMP_AWS_DYNAMODB_COUNT, + TMP_AWS_DYNAMODB_SCANNED_COUNT, + TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS, + TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES, + TMP_MESSAGING_SYSTEM, + TMP_MESSAGING_DESTINATION, + TMP_MESSAGING_DESTINATION_KIND, + TMP_MESSAGING_TEMP_DESTINATION, + TMP_MESSAGING_PROTOCOL, + TMP_MESSAGING_PROTOCOL_VERSION, + TMP_MESSAGING_URL, + TMP_MESSAGING_MESSAGE_ID, + TMP_MESSAGING_CONVERSATION_ID, + TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, + TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES, + TMP_MESSAGING_OPERATION, + TMP_MESSAGING_CONSUMER_ID, + TMP_MESSAGING_RABBITMQ_ROUTING_KEY, + TMP_MESSAGING_KAFKA_MESSAGE_KEY, + TMP_MESSAGING_KAFKA_CONSUMER_GROUP, + TMP_MESSAGING_KAFKA_CLIENT_ID, + TMP_MESSAGING_KAFKA_PARTITION, + TMP_MESSAGING_KAFKA_TOMBSTONE, + TMP_RPC_SYSTEM, + TMP_RPC_SERVICE, + TMP_RPC_METHOD, + TMP_RPC_GRPC_STATUS_CODE, + TMP_RPC_JSONRPC_VERSION, + TMP_RPC_JSONRPC_REQUEST_ID, + TMP_RPC_JSONRPC_ERROR_CODE, + TMP_RPC_JSONRPC_ERROR_MESSAGE, + TMP_MESSAGE_TYPE, + TMP_MESSAGE_ID, + TMP_MESSAGE_COMPRESSED_SIZE, + TMP_MESSAGE_UNCOMPRESSED_SIZE, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for DbSystemValues enum definition + * + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_DBSYSTEMVALUES_OTHER_SQL = 'other_sql'; +const TMP_DBSYSTEMVALUES_MSSQL = 'mssql'; +const TMP_DBSYSTEMVALUES_MYSQL = 'mysql'; +const TMP_DBSYSTEMVALUES_ORACLE = 'oracle'; +const TMP_DBSYSTEMVALUES_DB2 = 'db2'; +const TMP_DBSYSTEMVALUES_POSTGRESQL = 'postgresql'; +const TMP_DBSYSTEMVALUES_REDSHIFT = 'redshift'; +const TMP_DBSYSTEMVALUES_HIVE = 'hive'; +const TMP_DBSYSTEMVALUES_CLOUDSCAPE = 'cloudscape'; +const TMP_DBSYSTEMVALUES_HSQLDB = 'hsqldb'; +const TMP_DBSYSTEMVALUES_PROGRESS = 'progress'; +const TMP_DBSYSTEMVALUES_MAXDB = 'maxdb'; +const TMP_DBSYSTEMVALUES_HANADB = 'hanadb'; +const TMP_DBSYSTEMVALUES_INGRES = 'ingres'; +const TMP_DBSYSTEMVALUES_FIRSTSQL = 'firstsql'; +const TMP_DBSYSTEMVALUES_EDB = 'edb'; +const TMP_DBSYSTEMVALUES_CACHE = 'cache'; +const TMP_DBSYSTEMVALUES_ADABAS = 'adabas'; +const TMP_DBSYSTEMVALUES_FIREBIRD = 'firebird'; +const TMP_DBSYSTEMVALUES_DERBY = 'derby'; +const TMP_DBSYSTEMVALUES_FILEMAKER = 'filemaker'; +const TMP_DBSYSTEMVALUES_INFORMIX = 'informix'; +const TMP_DBSYSTEMVALUES_INSTANTDB = 'instantdb'; +const TMP_DBSYSTEMVALUES_INTERBASE = 'interbase'; +const TMP_DBSYSTEMVALUES_MARIADB = 'mariadb'; +const TMP_DBSYSTEMVALUES_NETEZZA = 'netezza'; +const TMP_DBSYSTEMVALUES_PERVASIVE = 'pervasive'; +const TMP_DBSYSTEMVALUES_POINTBASE = 'pointbase'; +const TMP_DBSYSTEMVALUES_SQLITE = 'sqlite'; +const TMP_DBSYSTEMVALUES_SYBASE = 'sybase'; +const TMP_DBSYSTEMVALUES_TERADATA = 'teradata'; +const TMP_DBSYSTEMVALUES_VERTICA = 'vertica'; +const TMP_DBSYSTEMVALUES_H2 = 'h2'; +const TMP_DBSYSTEMVALUES_COLDFUSION = 'coldfusion'; +const TMP_DBSYSTEMVALUES_CASSANDRA = 'cassandra'; +const TMP_DBSYSTEMVALUES_HBASE = 'hbase'; +const TMP_DBSYSTEMVALUES_MONGODB = 'mongodb'; +const TMP_DBSYSTEMVALUES_REDIS = 'redis'; +const TMP_DBSYSTEMVALUES_COUCHBASE = 'couchbase'; +const TMP_DBSYSTEMVALUES_COUCHDB = 'couchdb'; +const TMP_DBSYSTEMVALUES_COSMOSDB = 'cosmosdb'; +const TMP_DBSYSTEMVALUES_DYNAMODB = 'dynamodb'; +const TMP_DBSYSTEMVALUES_NEO4J = 'neo4j'; +const TMP_DBSYSTEMVALUES_GEODE = 'geode'; +const TMP_DBSYSTEMVALUES_ELASTICSEARCH = 'elasticsearch'; +const TMP_DBSYSTEMVALUES_MEMCACHED = 'memcached'; +const TMP_DBSYSTEMVALUES_COCKROACHDB = 'cockroachdb'; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_OTHER_SQL in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_OTHER_SQL = TMP_DBSYSTEMVALUES_OTHER_SQL; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_MSSQL in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_MSSQL = TMP_DBSYSTEMVALUES_MSSQL; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_MYSQL in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_MYSQL = TMP_DBSYSTEMVALUES_MYSQL; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_ORACLE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_ORACLE = TMP_DBSYSTEMVALUES_ORACLE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_DB2 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_DB2 = TMP_DBSYSTEMVALUES_DB2; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_POSTGRESQL in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_POSTGRESQL = TMP_DBSYSTEMVALUES_POSTGRESQL; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_REDSHIFT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_REDSHIFT = TMP_DBSYSTEMVALUES_REDSHIFT; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_HIVE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_HIVE = TMP_DBSYSTEMVALUES_HIVE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_CLOUDSCAPE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_CLOUDSCAPE = TMP_DBSYSTEMVALUES_CLOUDSCAPE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_HSQLDB in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_HSQLDB = TMP_DBSYSTEMVALUES_HSQLDB; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_PROGRESS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_PROGRESS = TMP_DBSYSTEMVALUES_PROGRESS; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_MAXDB in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_MAXDB = TMP_DBSYSTEMVALUES_MAXDB; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_HANADB in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_HANADB = TMP_DBSYSTEMVALUES_HANADB; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_INGRES in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_INGRES = TMP_DBSYSTEMVALUES_INGRES; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_FIRSTSQL in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_FIRSTSQL = TMP_DBSYSTEMVALUES_FIRSTSQL; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_EDB in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_EDB = TMP_DBSYSTEMVALUES_EDB; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_CACHE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_CACHE = TMP_DBSYSTEMVALUES_CACHE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_ADABAS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_ADABAS = TMP_DBSYSTEMVALUES_ADABAS; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_FIREBIRD in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_FIREBIRD = TMP_DBSYSTEMVALUES_FIREBIRD; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_DERBY in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_DERBY = TMP_DBSYSTEMVALUES_DERBY; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_FILEMAKER in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_FILEMAKER = TMP_DBSYSTEMVALUES_FILEMAKER; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_INFORMIX in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_INFORMIX = TMP_DBSYSTEMVALUES_INFORMIX; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_INSTANTDB in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_INSTANTDB = TMP_DBSYSTEMVALUES_INSTANTDB; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_INTERBASE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_INTERBASE = TMP_DBSYSTEMVALUES_INTERBASE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_MARIADB in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_MARIADB = TMP_DBSYSTEMVALUES_MARIADB; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_NETEZZA in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_NETEZZA = TMP_DBSYSTEMVALUES_NETEZZA; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_PERVASIVE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_PERVASIVE = TMP_DBSYSTEMVALUES_PERVASIVE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_POINTBASE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_POINTBASE = TMP_DBSYSTEMVALUES_POINTBASE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_SQLITE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_SQLITE = TMP_DBSYSTEMVALUES_SQLITE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_SYBASE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_SYBASE = TMP_DBSYSTEMVALUES_SYBASE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_TERADATA in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_TERADATA = TMP_DBSYSTEMVALUES_TERADATA; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_VERTICA in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_VERTICA = TMP_DBSYSTEMVALUES_VERTICA; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_H2 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_H2 = TMP_DBSYSTEMVALUES_H2; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_COLDFUSION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_COLDFUSION = TMP_DBSYSTEMVALUES_COLDFUSION; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_CASSANDRA in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_CASSANDRA = TMP_DBSYSTEMVALUES_CASSANDRA; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_HBASE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_HBASE = TMP_DBSYSTEMVALUES_HBASE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_MONGODB in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_MONGODB = TMP_DBSYSTEMVALUES_MONGODB; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_REDIS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_REDIS = TMP_DBSYSTEMVALUES_REDIS; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_COUCHBASE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_COUCHBASE = TMP_DBSYSTEMVALUES_COUCHBASE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_COUCHDB in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_COUCHDB = TMP_DBSYSTEMVALUES_COUCHDB; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_COSMOSDB in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_COSMOSDB = TMP_DBSYSTEMVALUES_COSMOSDB; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_DYNAMODB in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_DYNAMODB = TMP_DBSYSTEMVALUES_DYNAMODB; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_NEO4J in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_NEO4J = TMP_DBSYSTEMVALUES_NEO4J; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_GEODE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_GEODE = TMP_DBSYSTEMVALUES_GEODE; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_ELASTICSEARCH in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_ELASTICSEARCH = TMP_DBSYSTEMVALUES_ELASTICSEARCH; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_MEMCACHED in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_MEMCACHED = TMP_DBSYSTEMVALUES_MEMCACHED; +/** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + * + * @deprecated Use DB_SYSTEM_VALUE_COCKROACHDB in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBSYSTEMVALUES_COCKROACHDB = TMP_DBSYSTEMVALUES_COCKROACHDB; +/** + * The constant map of values for DbSystemValues. + * @deprecated Use the DBSYSTEMVALUES_XXXXX constants rather than the DbSystemValues.XXXXX for bundle minification. + */ +exports.DbSystemValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_DBSYSTEMVALUES_OTHER_SQL, + TMP_DBSYSTEMVALUES_MSSQL, + TMP_DBSYSTEMVALUES_MYSQL, + TMP_DBSYSTEMVALUES_ORACLE, + TMP_DBSYSTEMVALUES_DB2, + TMP_DBSYSTEMVALUES_POSTGRESQL, + TMP_DBSYSTEMVALUES_REDSHIFT, + TMP_DBSYSTEMVALUES_HIVE, + TMP_DBSYSTEMVALUES_CLOUDSCAPE, + TMP_DBSYSTEMVALUES_HSQLDB, + TMP_DBSYSTEMVALUES_PROGRESS, + TMP_DBSYSTEMVALUES_MAXDB, + TMP_DBSYSTEMVALUES_HANADB, + TMP_DBSYSTEMVALUES_INGRES, + TMP_DBSYSTEMVALUES_FIRSTSQL, + TMP_DBSYSTEMVALUES_EDB, + TMP_DBSYSTEMVALUES_CACHE, + TMP_DBSYSTEMVALUES_ADABAS, + TMP_DBSYSTEMVALUES_FIREBIRD, + TMP_DBSYSTEMVALUES_DERBY, + TMP_DBSYSTEMVALUES_FILEMAKER, + TMP_DBSYSTEMVALUES_INFORMIX, + TMP_DBSYSTEMVALUES_INSTANTDB, + TMP_DBSYSTEMVALUES_INTERBASE, + TMP_DBSYSTEMVALUES_MARIADB, + TMP_DBSYSTEMVALUES_NETEZZA, + TMP_DBSYSTEMVALUES_PERVASIVE, + TMP_DBSYSTEMVALUES_POINTBASE, + TMP_DBSYSTEMVALUES_SQLITE, + TMP_DBSYSTEMVALUES_SYBASE, + TMP_DBSYSTEMVALUES_TERADATA, + TMP_DBSYSTEMVALUES_VERTICA, + TMP_DBSYSTEMVALUES_H2, + TMP_DBSYSTEMVALUES_COLDFUSION, + TMP_DBSYSTEMVALUES_CASSANDRA, + TMP_DBSYSTEMVALUES_HBASE, + TMP_DBSYSTEMVALUES_MONGODB, + TMP_DBSYSTEMVALUES_REDIS, + TMP_DBSYSTEMVALUES_COUCHBASE, + TMP_DBSYSTEMVALUES_COUCHDB, + TMP_DBSYSTEMVALUES_COSMOSDB, + TMP_DBSYSTEMVALUES_DYNAMODB, + TMP_DBSYSTEMVALUES_NEO4J, + TMP_DBSYSTEMVALUES_GEODE, + TMP_DBSYSTEMVALUES_ELASTICSEARCH, + TMP_DBSYSTEMVALUES_MEMCACHED, + TMP_DBSYSTEMVALUES_COCKROACHDB, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for DbCassandraConsistencyLevelValues enum definition + * + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL = 'all'; +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = 'each_quorum'; +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = 'quorum'; +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = 'local_quorum'; +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE = 'one'; +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO = 'two'; +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE = 'three'; +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = 'local_one'; +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY = 'any'; +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = 'serial'; +const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = 'local_serial'; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ALL in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_ALL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_EACH_QUORUM in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_QUORUM in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_QUORUM in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ONE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_ONE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_TWO in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_TWO = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_THREE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_THREE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_ONE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ANY in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_ANY = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_SERIAL in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL; +/** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * + * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_SERIAL in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL; +/** + * The constant map of values for DbCassandraConsistencyLevelValues. + * @deprecated Use the DBCASSANDRACONSISTENCYLEVELVALUES_XXXXX constants rather than the DbCassandraConsistencyLevelValues.XXXXX for bundle minification. + */ +exports.DbCassandraConsistencyLevelValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for FaasTriggerValues enum definition + * + * Type of the trigger on which the function is executed. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_FAASTRIGGERVALUES_DATASOURCE = 'datasource'; +const TMP_FAASTRIGGERVALUES_HTTP = 'http'; +const TMP_FAASTRIGGERVALUES_PUBSUB = 'pubsub'; +const TMP_FAASTRIGGERVALUES_TIMER = 'timer'; +const TMP_FAASTRIGGERVALUES_OTHER = 'other'; +/** + * Type of the trigger on which the function is executed. + * + * @deprecated Use FAAS_TRIGGER_VALUE_DATASOURCE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.FAASTRIGGERVALUES_DATASOURCE = TMP_FAASTRIGGERVALUES_DATASOURCE; +/** + * Type of the trigger on which the function is executed. + * + * @deprecated Use FAAS_TRIGGER_VALUE_HTTP in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.FAASTRIGGERVALUES_HTTP = TMP_FAASTRIGGERVALUES_HTTP; +/** + * Type of the trigger on which the function is executed. + * + * @deprecated Use FAAS_TRIGGER_VALUE_PUBSUB in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.FAASTRIGGERVALUES_PUBSUB = TMP_FAASTRIGGERVALUES_PUBSUB; +/** + * Type of the trigger on which the function is executed. + * + * @deprecated Use FAAS_TRIGGER_VALUE_TIMER in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.FAASTRIGGERVALUES_TIMER = TMP_FAASTRIGGERVALUES_TIMER; +/** + * Type of the trigger on which the function is executed. + * + * @deprecated Use FAAS_TRIGGER_VALUE_OTHER in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.FAASTRIGGERVALUES_OTHER = TMP_FAASTRIGGERVALUES_OTHER; +/** + * The constant map of values for FaasTriggerValues. + * @deprecated Use the FAASTRIGGERVALUES_XXXXX constants rather than the FaasTriggerValues.XXXXX for bundle minification. + */ +exports.FaasTriggerValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_FAASTRIGGERVALUES_DATASOURCE, + TMP_FAASTRIGGERVALUES_HTTP, + TMP_FAASTRIGGERVALUES_PUBSUB, + TMP_FAASTRIGGERVALUES_TIMER, + TMP_FAASTRIGGERVALUES_OTHER, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for FaasDocumentOperationValues enum definition + * + * Describes the type of the operation that was performed on the data. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_FAASDOCUMENTOPERATIONVALUES_INSERT = 'insert'; +const TMP_FAASDOCUMENTOPERATIONVALUES_EDIT = 'edit'; +const TMP_FAASDOCUMENTOPERATIONVALUES_DELETE = 'delete'; +/** + * Describes the type of the operation that was performed on the data. + * + * @deprecated Use FAAS_DOCUMENT_OPERATION_VALUE_INSERT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.FAASDOCUMENTOPERATIONVALUES_INSERT = TMP_FAASDOCUMENTOPERATIONVALUES_INSERT; +/** + * Describes the type of the operation that was performed on the data. + * + * @deprecated Use FAAS_DOCUMENT_OPERATION_VALUE_EDIT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.FAASDOCUMENTOPERATIONVALUES_EDIT = TMP_FAASDOCUMENTOPERATIONVALUES_EDIT; +/** + * Describes the type of the operation that was performed on the data. + * + * @deprecated Use FAAS_DOCUMENT_OPERATION_VALUE_DELETE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.FAASDOCUMENTOPERATIONVALUES_DELETE = TMP_FAASDOCUMENTOPERATIONVALUES_DELETE; +/** + * The constant map of values for FaasDocumentOperationValues. + * @deprecated Use the FAASDOCUMENTOPERATIONVALUES_XXXXX constants rather than the FaasDocumentOperationValues.XXXXX for bundle minification. + */ +exports.FaasDocumentOperationValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_FAASDOCUMENTOPERATIONVALUES_INSERT, + TMP_FAASDOCUMENTOPERATIONVALUES_EDIT, + TMP_FAASDOCUMENTOPERATIONVALUES_DELETE, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for FaasInvokedProviderValues enum definition + * + * The cloud provider of the invoked function. + * + * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = 'alibaba_cloud'; +const TMP_FAASINVOKEDPROVIDERVALUES_AWS = 'aws'; +const TMP_FAASINVOKEDPROVIDERVALUES_AZURE = 'azure'; +const TMP_FAASINVOKEDPROVIDERVALUES_GCP = 'gcp'; +/** + * The cloud provider of the invoked function. + * + * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. + * + * @deprecated Use FAAS_INVOKED_PROVIDER_VALUE_ALIBABA_CLOUD in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD; +/** + * The cloud provider of the invoked function. + * + * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. + * + * @deprecated Use FAAS_INVOKED_PROVIDER_VALUE_AWS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.FAASINVOKEDPROVIDERVALUES_AWS = TMP_FAASINVOKEDPROVIDERVALUES_AWS; +/** + * The cloud provider of the invoked function. + * + * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. + * + * @deprecated Use FAAS_INVOKED_PROVIDER_VALUE_AZURE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.FAASINVOKEDPROVIDERVALUES_AZURE = TMP_FAASINVOKEDPROVIDERVALUES_AZURE; +/** + * The cloud provider of the invoked function. + * + * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. + * + * @deprecated Use FAAS_INVOKED_PROVIDER_VALUE_GCP in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.FAASINVOKEDPROVIDERVALUES_GCP = TMP_FAASINVOKEDPROVIDERVALUES_GCP; +/** + * The constant map of values for FaasInvokedProviderValues. + * @deprecated Use the FAASINVOKEDPROVIDERVALUES_XXXXX constants rather than the FaasInvokedProviderValues.XXXXX for bundle minification. + */ +exports.FaasInvokedProviderValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD, + TMP_FAASINVOKEDPROVIDERVALUES_AWS, + TMP_FAASINVOKEDPROVIDERVALUES_AZURE, + TMP_FAASINVOKEDPROVIDERVALUES_GCP, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for NetTransportValues enum definition + * + * Transport protocol used. See note below. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_NETTRANSPORTVALUES_IP_TCP = 'ip_tcp'; +const TMP_NETTRANSPORTVALUES_IP_UDP = 'ip_udp'; +const TMP_NETTRANSPORTVALUES_IP = 'ip'; +const TMP_NETTRANSPORTVALUES_UNIX = 'unix'; +const TMP_NETTRANSPORTVALUES_PIPE = 'pipe'; +const TMP_NETTRANSPORTVALUES_INPROC = 'inproc'; +const TMP_NETTRANSPORTVALUES_OTHER = 'other'; +/** + * Transport protocol used. See note below. + * + * @deprecated Use NET_TRANSPORT_VALUE_IP_TCP in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETTRANSPORTVALUES_IP_TCP = TMP_NETTRANSPORTVALUES_IP_TCP; +/** + * Transport protocol used. See note below. + * + * @deprecated Use NET_TRANSPORT_VALUE_IP_UDP in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETTRANSPORTVALUES_IP_UDP = TMP_NETTRANSPORTVALUES_IP_UDP; +/** + * Transport protocol used. See note below. + * + * @deprecated Removed in v1.21.0. + */ +exports.NETTRANSPORTVALUES_IP = TMP_NETTRANSPORTVALUES_IP; +/** + * Transport protocol used. See note below. + * + * @deprecated Removed in v1.21.0. + */ +exports.NETTRANSPORTVALUES_UNIX = TMP_NETTRANSPORTVALUES_UNIX; +/** + * Transport protocol used. See note below. + * + * @deprecated Use NET_TRANSPORT_VALUE_PIPE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETTRANSPORTVALUES_PIPE = TMP_NETTRANSPORTVALUES_PIPE; +/** + * Transport protocol used. See note below. + * + * @deprecated Use NET_TRANSPORT_VALUE_INPROC in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETTRANSPORTVALUES_INPROC = TMP_NETTRANSPORTVALUES_INPROC; +/** + * Transport protocol used. See note below. + * + * @deprecated Use NET_TRANSPORT_VALUE_OTHER in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETTRANSPORTVALUES_OTHER = TMP_NETTRANSPORTVALUES_OTHER; +/** + * The constant map of values for NetTransportValues. + * @deprecated Use the NETTRANSPORTVALUES_XXXXX constants rather than the NetTransportValues.XXXXX for bundle minification. + */ +exports.NetTransportValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_NETTRANSPORTVALUES_IP_TCP, + TMP_NETTRANSPORTVALUES_IP_UDP, + TMP_NETTRANSPORTVALUES_IP, + TMP_NETTRANSPORTVALUES_UNIX, + TMP_NETTRANSPORTVALUES_PIPE, + TMP_NETTRANSPORTVALUES_INPROC, + TMP_NETTRANSPORTVALUES_OTHER, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for NetHostConnectionTypeValues enum definition + * + * The internet connection type currently being used by the host. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI = 'wifi'; +const TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED = 'wired'; +const TMP_NETHOSTCONNECTIONTYPEVALUES_CELL = 'cell'; +const TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = 'unavailable'; +const TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = 'unknown'; +/** + * The internet connection type currently being used by the host. + * + * @deprecated Use NETWORK_CONNECTION_TYPE_VALUE_WIFI in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONTYPEVALUES_WIFI = TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI; +/** + * The internet connection type currently being used by the host. + * + * @deprecated Use NETWORK_CONNECTION_TYPE_VALUE_WIRED in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONTYPEVALUES_WIRED = TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED; +/** + * The internet connection type currently being used by the host. + * + * @deprecated Use NETWORK_CONNECTION_TYPE_VALUE_CELL in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONTYPEVALUES_CELL = TMP_NETHOSTCONNECTIONTYPEVALUES_CELL; +/** + * The internet connection type currently being used by the host. + * + * @deprecated Use NETWORK_CONNECTION_TYPE_VALUE_UNAVAILABLE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE; +/** + * The internet connection type currently being used by the host. + * + * @deprecated Use NETWORK_CONNECTION_TYPE_VALUE_UNKNOWN in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN; +/** + * The constant map of values for NetHostConnectionTypeValues. + * @deprecated Use the NETHOSTCONNECTIONTYPEVALUES_XXXXX constants rather than the NetHostConnectionTypeValues.XXXXX for bundle minification. + */ +exports.NetHostConnectionTypeValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI, + TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED, + TMP_NETHOSTCONNECTIONTYPEVALUES_CELL, + TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE, + TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for NetHostConnectionSubtypeValues enum definition + * + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = 'gprs'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = 'edge'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = 'umts'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = 'cdma'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = 'evdo_0'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = 'evdo_a'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = 'cdma2000_1xrtt'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = 'hsdpa'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = 'hsupa'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = 'hspa'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = 'iden'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = 'evdo_b'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE = 'lte'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = 'ehrpd'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = 'hspap'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM = 'gsm'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = 'td_scdma'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = 'iwlan'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR = 'nr'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = 'nrnsa'; +const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = 'lte_ca'; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_GPRS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_EDGE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_UMTS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_CDMA in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_EVDO_0 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_EVDO_A in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_CDMA2000_1XRTT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_HSDPA in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_HSUPA in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_HSPA in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_IDEN in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_EVDO_B in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_LTE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_EHRPD in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_HSPAP in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_GSM in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_GSM = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_TD_SCDMA in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_IWLAN in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_NR in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_NR = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_NRNSA in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA; +/** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @deprecated Use NETWORK_CONNECTION_SUBTYPE_VALUE_LTE_CA in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA; +/** + * The constant map of values for NetHostConnectionSubtypeValues. + * @deprecated Use the NETHOSTCONNECTIONSUBTYPEVALUES_XXXXX constants rather than the NetHostConnectionSubtypeValues.XXXXX for bundle minification. + */ +exports.NetHostConnectionSubtypeValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for HttpFlavorValues enum definition + * + * Kind of HTTP protocol used. + * + * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_HTTPFLAVORVALUES_HTTP_1_0 = '1.0'; +const TMP_HTTPFLAVORVALUES_HTTP_1_1 = '1.1'; +const TMP_HTTPFLAVORVALUES_HTTP_2_0 = '2.0'; +const TMP_HTTPFLAVORVALUES_SPDY = 'SPDY'; +const TMP_HTTPFLAVORVALUES_QUIC = 'QUIC'; +/** + * Kind of HTTP protocol used. + * + * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. + * + * @deprecated Use HTTP_FLAVOR_VALUE_HTTP_1_0 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.HTTPFLAVORVALUES_HTTP_1_0 = TMP_HTTPFLAVORVALUES_HTTP_1_0; +/** + * Kind of HTTP protocol used. + * + * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. + * + * @deprecated Use HTTP_FLAVOR_VALUE_HTTP_1_1 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.HTTPFLAVORVALUES_HTTP_1_1 = TMP_HTTPFLAVORVALUES_HTTP_1_1; +/** + * Kind of HTTP protocol used. + * + * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. + * + * @deprecated Use HTTP_FLAVOR_VALUE_HTTP_2_0 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.HTTPFLAVORVALUES_HTTP_2_0 = TMP_HTTPFLAVORVALUES_HTTP_2_0; +/** + * Kind of HTTP protocol used. + * + * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. + * + * @deprecated Use HTTP_FLAVOR_VALUE_SPDY in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.HTTPFLAVORVALUES_SPDY = TMP_HTTPFLAVORVALUES_SPDY; +/** + * Kind of HTTP protocol used. + * + * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. + * + * @deprecated Use HTTP_FLAVOR_VALUE_QUIC in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.HTTPFLAVORVALUES_QUIC = TMP_HTTPFLAVORVALUES_QUIC; +/** + * The constant map of values for HttpFlavorValues. + * @deprecated Use the HTTPFLAVORVALUES_XXXXX constants rather than the HttpFlavorValues.XXXXX for bundle minification. + */ +exports.HttpFlavorValues = { + HTTP_1_0: TMP_HTTPFLAVORVALUES_HTTP_1_0, + HTTP_1_1: TMP_HTTPFLAVORVALUES_HTTP_1_1, + HTTP_2_0: TMP_HTTPFLAVORVALUES_HTTP_2_0, + SPDY: TMP_HTTPFLAVORVALUES_SPDY, + QUIC: TMP_HTTPFLAVORVALUES_QUIC, +}; +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for MessagingDestinationKindValues enum definition + * + * The kind of message destination. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE = 'queue'; +const TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC = 'topic'; +/** + * The kind of message destination. + * + * @deprecated Removed in semconv v1.20.0. + */ +exports.MESSAGINGDESTINATIONKINDVALUES_QUEUE = TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE; +/** + * The kind of message destination. + * + * @deprecated Removed in semconv v1.20.0. + */ +exports.MESSAGINGDESTINATIONKINDVALUES_TOPIC = TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC; +/** + * The constant map of values for MessagingDestinationKindValues. + * @deprecated Use the MESSAGINGDESTINATIONKINDVALUES_XXXXX constants rather than the MessagingDestinationKindValues.XXXXX for bundle minification. + */ +exports.MessagingDestinationKindValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE, + TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for MessagingOperationValues enum definition + * + * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_MESSAGINGOPERATIONVALUES_RECEIVE = 'receive'; +const TMP_MESSAGINGOPERATIONVALUES_PROCESS = 'process'; +/** + * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case. + * + * @deprecated Use MESSAGING_OPERATION_TYPE_VALUE_RECEIVE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.MESSAGINGOPERATIONVALUES_RECEIVE = TMP_MESSAGINGOPERATIONVALUES_RECEIVE; +/** + * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case. + * + * @deprecated Use MESSAGING_OPERATION_TYPE_VALUE_PROCESS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.MESSAGINGOPERATIONVALUES_PROCESS = TMP_MESSAGINGOPERATIONVALUES_PROCESS; +/** + * The constant map of values for MessagingOperationValues. + * @deprecated Use the MESSAGINGOPERATIONVALUES_XXXXX constants rather than the MessagingOperationValues.XXXXX for bundle minification. + */ +exports.MessagingOperationValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_MESSAGINGOPERATIONVALUES_RECEIVE, + TMP_MESSAGINGOPERATIONVALUES_PROCESS, +]); +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for RpcGrpcStatusCodeValues enum definition + * + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_RPCGRPCSTATUSCODEVALUES_OK = 0; +const TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED = 1; +const TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN = 2; +const TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = 3; +const TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = 4; +const TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND = 5; +const TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = 6; +const TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = 7; +const TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = 8; +const TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = 9; +const TMP_RPCGRPCSTATUSCODEVALUES_ABORTED = 10; +const TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = 11; +const TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = 12; +const TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL = 13; +const TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = 14; +const TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS = 15; +const TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = 16; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_OK in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.RPCGRPCSTATUSCODEVALUES_OK = TMP_RPCGRPCSTATUSCODEVALUES_OK; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_CANCELLED in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.RPCGRPCSTATUSCODEVALUES_CANCELLED = TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_UNKNOWN in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.RPCGRPCSTATUSCODEVALUES_UNKNOWN = TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_INVALID_ARGUMENT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_DEADLINE_EXCEEDED in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_NOT_FOUND in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.RPCGRPCSTATUSCODEVALUES_NOT_FOUND = TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_ALREADY_EXISTS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_PERMISSION_DENIED in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_RESOURCE_EXHAUSTED in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_FAILED_PRECONDITION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_ABORTED in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.RPCGRPCSTATUSCODEVALUES_ABORTED = TMP_RPCGRPCSTATUSCODEVALUES_ABORTED; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_OUT_OF_RANGE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_UNIMPLEMENTED in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_INTERNAL in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.RPCGRPCSTATUSCODEVALUES_INTERNAL = TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_UNAVAILABLE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_DATA_LOSS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.RPCGRPCSTATUSCODEVALUES_DATA_LOSS = TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS; +/** + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + * + * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_UNAUTHENTICATED in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED; +/** + * The constant map of values for RpcGrpcStatusCodeValues. + * @deprecated Use the RPCGRPCSTATUSCODEVALUES_XXXXX constants rather than the RpcGrpcStatusCodeValues.XXXXX for bundle minification. + */ +exports.RpcGrpcStatusCodeValues = { + OK: TMP_RPCGRPCSTATUSCODEVALUES_OK, + CANCELLED: TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED, + UNKNOWN: TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN, + INVALID_ARGUMENT: TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT, + DEADLINE_EXCEEDED: TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED, + NOT_FOUND: TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND, + ALREADY_EXISTS: TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS, + PERMISSION_DENIED: TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED, + RESOURCE_EXHAUSTED: TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED, + FAILED_PRECONDITION: TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION, + ABORTED: TMP_RPCGRPCSTATUSCODEVALUES_ABORTED, + OUT_OF_RANGE: TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE, + UNIMPLEMENTED: TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED, + INTERNAL: TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL, + UNAVAILABLE: TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE, + DATA_LOSS: TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS, + UNAUTHENTICATED: TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED, +}; +/* ---------------------------------------------------------------------------------------------------------- + * Constant values for MessageTypeValues enum definition + * + * Whether this is a received or sent message. + * ---------------------------------------------------------------------------------------------------------- */ +// Temporary local constants to assign to the individual exports and the namespaced version +// Required to avoid the namespace exports using the unminifiable export names for some package types +const TMP_MESSAGETYPEVALUES_SENT = 'SENT'; +const TMP_MESSAGETYPEVALUES_RECEIVED = 'RECEIVED'; +/** + * Whether this is a received or sent message. + * + * @deprecated Use MESSAGE_TYPE_VALUE_SENT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.MESSAGETYPEVALUES_SENT = TMP_MESSAGETYPEVALUES_SENT; +/** + * Whether this is a received or sent message. + * + * @deprecated Use MESSAGE_TYPE_VALUE_RECEIVED in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). + */ +exports.MESSAGETYPEVALUES_RECEIVED = TMP_MESSAGETYPEVALUES_RECEIVED; +/** + * The constant map of values for MessageTypeValues. + * @deprecated Use the MESSAGETYPEVALUES_XXXXX constants rather than the MessageTypeValues.XXXXX for bundle minification. + */ +exports.MessageTypeValues = +/*#__PURE__*/ (0, utils_1.createConstMap)([ + TMP_MESSAGETYPEVALUES_SENT, + TMP_MESSAGETYPEVALUES_RECEIVED, +]); +//# sourceMappingURL=SemanticAttributes.js.map + +/***/ }), + +/***/ 45836: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +/* eslint-disable no-restricted-syntax -- + * These re-exports are only of constants, only one-level deep at this point, + * and should not cause problems for tree-shakers. + */ +__exportStar(__nccwpck_require__(89943), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 58156: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.addSqlCommenterComment = void 0; +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(89736); +// NOTE: This function currently is returning false-positives +// in cases where comment characters appear in string literals +// ("SELECT '-- not a comment';" would return true, although has no comment) +function hasValidSqlComment(query) { + const indexOpeningDashDashComment = query.indexOf('--'); + if (indexOpeningDashDashComment >= 0) { + return true; + } + const indexOpeningSlashComment = query.indexOf('/*'); + if (indexOpeningSlashComment < 0) { + return false; + } + const indexClosingSlashComment = query.indexOf('*/'); + return indexOpeningDashDashComment < indexClosingSlashComment; +} +// sqlcommenter specification (https://google.github.io/sqlcommenter/spec/#value-serialization) +// expects us to URL encode based on the RFC 3986 spec (https://en.wikipedia.org/wiki/Percent-encoding), +// but encodeURIComponent does not handle some characters correctly (! ' ( ) *), +// which means we need special handling for this +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent +function fixedEncodeURIComponent(str) { + return encodeURIComponent(str).replace(/[!'()*]/g, c => `%${c.charCodeAt(0).toString(16).toUpperCase()}`); +} +function addSqlCommenterComment(span, query) { + if (typeof query !== 'string' || query.length === 0) { + return query; + } + // As per sqlcommenter spec we shall not add a comment if there already is a comment + // in the query + if (hasValidSqlComment(query)) { + return query; + } + const propagator = new core_1.W3CTraceContextPropagator(); + const headers = {}; + propagator.inject(api_1.trace.setSpan(api_1.ROOT_CONTEXT, span), headers, api_1.defaultTextMapSetter); + // sqlcommenter spec requires keys in the comment to be sorted lexicographically + const sortedKeys = Object.keys(headers).sort(); + if (sortedKeys.length === 0) { + return query; + } + const commentString = sortedKeys + .map(key => { + const encodedValue = fixedEncodeURIComponent(headers[key]); + return `${key}='${encodedValue}'`; + }) + .join(','); + return `${query} /*${commentString}*/`; +} +exports.addSqlCommenterComment = addSqlCommenterComment; +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 84656: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name2 in all) + __defProp(target, name2, { get: all[name2], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var chunk_5J6RGI77_exports = {}; +__export(chunk_5J6RGI77_exports, { + GLOBAL_KEY: () => GLOBAL_KEY, + MODULE_NAME: () => MODULE_NAME, + NAME: () => NAME, + VERSION: () => VERSION +}); +module.exports = __toCommonJS(chunk_5J6RGI77_exports); +var import_chunk_FTA5RKYX = __nccwpck_require__(20435); +var require_package = (0, import_chunk_FTA5RKYX.__commonJS)({ + "package.json"(exports, module2) { + module2.exports = { + name: "@prisma/instrumentation", + version: "5.22.0", + description: "OpenTelemetry compliant instrumentation for Prisma Client", + main: "dist/index.js", + types: "dist/index.d.ts", + license: "Apache-2.0", + homepage: "https://www.prisma.io", + repository: { + type: "git", + url: "https://github.com/prisma/prisma.git", + directory: "packages/instrumentation" + }, + bugs: "https://github.com/prisma/prisma/issues", + devDependencies: { + "@prisma/internals": "workspace:*", + "@swc/core": "1.6.13", + "@types/jest": "29.5.12", + "@types/node": "18.19.31", + jest: "29.7.0", + "jest-junit": "16.0.0", + typescript: "5.4.5" + }, + dependencies: { + "@opentelemetry/api": "^1.8", + "@opentelemetry/instrumentation": "^0.49 || ^0.50 || ^0.51 || ^0.52.0 || ^0.53.0", + "@opentelemetry/sdk-trace-base": "^1.22" + }, + files: [ + "dist" + ], + keywords: [ + "prisma", + "instrumentation", + "opentelemetry", + "otel" + ], + scripts: { + dev: "DEV=true tsx helpers/build.ts", + build: "tsx helpers/build.ts", + prepublishOnly: "pnpm run build", + test: "jest" + }, + sideEffects: false + }; + } +}); +var { version, name } = require_package(); +var GLOBAL_KEY = "PRISMA_INSTRUMENTATION"; +var VERSION = version; +var NAME = name; +var MODULE_NAME = "prisma"; + + +/***/ }), + +/***/ 20435: +/***/ ((module) => { + +"use strict"; + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var chunk_FTA5RKYX_exports = {}; +__export(chunk_FTA5RKYX_exports, { + __commonJS: () => __commonJS +}); +module.exports = __toCommonJS(chunk_FTA5RKYX_exports); +var __getOwnPropNames2 = Object.getOwnPropertyNames; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; + + +/***/ }), + +/***/ 69525: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var chunk_O7OBHTYQ_exports = {}; +__export(chunk_O7OBHTYQ_exports, { + ActiveTracingHelper: () => ActiveTracingHelper +}); +module.exports = __toCommonJS(chunk_O7OBHTYQ_exports); +var import_api = __nccwpck_require__(65163); +var import_sdk_trace_base = __nccwpck_require__(67030); +var showAllTraces = process.env.PRISMA_SHOW_ALL_TRACES === "true"; +var nonSampledTraceParent = `00-10-10-00`; +function engineSpanKindToOTELSpanKind(engineSpanKind) { + switch (engineSpanKind) { + case "client": + return import_api.SpanKind.CLIENT; + case "internal": + default: + return import_api.SpanKind.INTERNAL; + } +} +var ActiveTracingHelper = class { + constructor({ traceMiddleware }) { + this.traceMiddleware = traceMiddleware; + } + isEnabled() { + return true; + } + getTraceParent(context) { + const span = import_api.trace.getSpanContext(context ?? import_api.context.active()); + if (span) { + return `00-${span.traceId}-${span.spanId}-0${span.traceFlags}`; + } + return nonSampledTraceParent; + } + createEngineSpan(engineSpanEvent) { + const tracer = import_api.trace.getTracer("prisma"); + engineSpanEvent.spans.forEach((engineSpan) => { + const spanKind = engineSpanKindToOTELSpanKind(engineSpan.kind); + const spanContext = { + traceId: engineSpan.trace_id, + spanId: engineSpan.span_id, + traceFlags: import_api.TraceFlags.SAMPLED + }; + const links = engineSpan.links?.map((link) => { + return { + context: { + traceId: link.trace_id, + spanId: link.span_id, + traceFlags: import_api.TraceFlags.SAMPLED + } + }; + }); + const span = new import_sdk_trace_base.Span( + tracer, + import_api.ROOT_CONTEXT, + engineSpan.name, + spanContext, + spanKind, + engineSpan.parent_span_id, + links, + engineSpan.start_time + ); + if (engineSpan.attributes) { + span.setAttributes(engineSpan.attributes); + } + span.end(engineSpan.end_time); + }); + } + getActiveContext() { + return import_api.context.active(); + } + runInChildSpan(options, callback) { + if (typeof options === "string") { + options = { name: options }; + } + if (options.internal && !showAllTraces) { + return callback(); + } + if (options.middleware && !this.traceMiddleware) { + return callback(); + } + const tracer = import_api.trace.getTracer("prisma"); + const context = options.context ?? this.getActiveContext(); + const name = `prisma:client:${options.name}`; + if (options.active === false) { + const span = tracer.startSpan(name, options, context); + return endSpan(span, callback(span, context)); + } + return tracer.startActiveSpan(name, options, (span) => endSpan(span, callback(span, context))); + } +}; +function endSpan(span, result) { + if (isPromiseLike(result)) { + return result.then( + (value) => { + span.end(); + return value; + }, + (reason) => { + span.end(); + throw reason; + } + ); + } + span.end(); + return result; +} +function isPromiseLike(value) { + return value != null && typeof value["then"] === "function"; +} + + +/***/ }), + +/***/ 91897: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var chunk_PVBRMQBZ_exports = {}; +__export(chunk_PVBRMQBZ_exports, { + PrismaInstrumentation: () => PrismaInstrumentation +}); +module.exports = __toCommonJS(chunk_PVBRMQBZ_exports); +var import_chunk_O7OBHTYQ = __nccwpck_require__(69525); +var import_chunk_5J6RGI77 = __nccwpck_require__(84656); +var import_instrumentation = __nccwpck_require__(52007); +var PrismaInstrumentation = class extends import_instrumentation.InstrumentationBase { + constructor(config = {}) { + super(import_chunk_5J6RGI77.NAME, import_chunk_5J6RGI77.VERSION, config); + } + init() { + const module2 = new import_instrumentation.InstrumentationNodeModuleDefinition(import_chunk_5J6RGI77.MODULE_NAME, [import_chunk_5J6RGI77.VERSION]); + return [module2]; + } + enable() { + const config = this._config; + const globalValue = { + helper: new import_chunk_O7OBHTYQ.ActiveTracingHelper({ traceMiddleware: config.middleware ?? false }) + }; + global[import_chunk_5J6RGI77.GLOBAL_KEY] = globalValue; + } + disable() { + delete global[import_chunk_5J6RGI77.GLOBAL_KEY]; + } + isEnabled() { + return Boolean(global[import_chunk_5J6RGI77.GLOBAL_KEY]); + } +}; + + +/***/ }), + +/***/ 50976: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var dist_exports = {}; +__export(dist_exports, { + PrismaInstrumentation: () => import_chunk_PVBRMQBZ.PrismaInstrumentation +}); +module.exports = __toCommonJS(dist_exports); +var import_chunk_PVBRMQBZ = __nccwpck_require__(91897); +var import_chunk_O7OBHTYQ = __nccwpck_require__(69525); +var import_chunk_5J6RGI77 = __nccwpck_require__(84656); +var import_chunk_FTA5RKYX = __nccwpck_require__(20435); + + +/***/ }), + +/***/ 19670: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NOOP_LOGGER = exports.NoopLogger = void 0; +class NoopLogger { + emit(_logRecord) { } +} +exports.NoopLogger = NoopLogger; +exports.NOOP_LOGGER = new NoopLogger(); +//# sourceMappingURL=NoopLogger.js.map + +/***/ }), + +/***/ 89568: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NOOP_LOGGER_PROVIDER = exports.NoopLoggerProvider = void 0; +const NoopLogger_1 = __nccwpck_require__(19670); +class NoopLoggerProvider { + getLogger(_name, _version, _options) { + return new NoopLogger_1.NoopLogger(); + } +} +exports.NoopLoggerProvider = NoopLoggerProvider; +exports.NOOP_LOGGER_PROVIDER = new NoopLoggerProvider(); +//# sourceMappingURL=NoopLoggerProvider.js.map + +/***/ }), + +/***/ 897: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.LogsAPI = void 0; +const global_utils_1 = __nccwpck_require__(70960); +const NoopLoggerProvider_1 = __nccwpck_require__(89568); +class LogsAPI { + constructor() { } + static getInstance() { + if (!this._instance) { + this._instance = new LogsAPI(); + } + return this._instance; + } + setGlobalLoggerProvider(provider) { + if (global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY]) { + return this.getLoggerProvider(); + } + global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY] = (0, global_utils_1.makeGetter)(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, provider, NoopLoggerProvider_1.NOOP_LOGGER_PROVIDER); + return provider; + } + /** + * Returns the global logger provider. + * + * @returns LoggerProvider + */ + getLoggerProvider() { + var _a, _b; + return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : NoopLoggerProvider_1.NOOP_LOGGER_PROVIDER); + } + /** + * Returns a logger from the global logger provider. + * + * @returns Logger + */ + getLogger(name, version, options) { + return this.getLoggerProvider().getLogger(name, version, options); + } + /** Remove the global logger provider */ + disable() { + delete global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY]; + } +} +exports.LogsAPI = LogsAPI; +//# sourceMappingURL=logs.js.map + +/***/ }), + +/***/ 8689: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.logs = exports.NoopLoggerProvider = exports.NOOP_LOGGER_PROVIDER = exports.NoopLogger = exports.NOOP_LOGGER = exports.SeverityNumber = void 0; +var LogRecord_1 = __nccwpck_require__(61481); +Object.defineProperty(exports, "SeverityNumber", ({ enumerable: true, get: function () { return LogRecord_1.SeverityNumber; } })); +var NoopLogger_1 = __nccwpck_require__(19670); +Object.defineProperty(exports, "NOOP_LOGGER", ({ enumerable: true, get: function () { return NoopLogger_1.NOOP_LOGGER; } })); +Object.defineProperty(exports, "NoopLogger", ({ enumerable: true, get: function () { return NoopLogger_1.NoopLogger; } })); +var NoopLoggerProvider_1 = __nccwpck_require__(89568); +Object.defineProperty(exports, "NOOP_LOGGER_PROVIDER", ({ enumerable: true, get: function () { return NoopLoggerProvider_1.NOOP_LOGGER_PROVIDER; } })); +Object.defineProperty(exports, "NoopLoggerProvider", ({ enumerable: true, get: function () { return NoopLoggerProvider_1.NoopLoggerProvider; } })); +const logs_1 = __nccwpck_require__(897); +exports.logs = logs_1.LogsAPI.getInstance(); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 70960: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.API_BACKWARDS_COMPATIBILITY_VERSION = exports.makeGetter = exports._global = exports.GLOBAL_LOGS_API_KEY = void 0; +const platform_1 = __nccwpck_require__(19117); +exports.GLOBAL_LOGS_API_KEY = Symbol.for('io.opentelemetry.js.api.logs'); +exports._global = platform_1._globalThis; +/** + * Make a function which accepts a version integer and returns the instance of an API if the version + * is compatible, or a fallback version (usually NOOP) if it is not. + * + * @param requiredVersion Backwards compatibility version which is required to return the instance + * @param instance Instance which should be returned if the required version is compatible + * @param fallback Fallback instance, usually NOOP, which will be returned if the required version is not compatible + */ +function makeGetter(requiredVersion, instance, fallback) { + return (version) => version === requiredVersion ? instance : fallback; +} +exports.makeGetter = makeGetter; +/** + * A number which should be incremented each time a backwards incompatible + * change is made to the API. This number is used when an API package + * attempts to access the global API to ensure it is getting a compatible + * version. If the global API is not compatible with the API package + * attempting to get it, a NOOP API implementation will be returned. + */ +exports.API_BACKWARDS_COMPATIBILITY_VERSION = 1; +//# sourceMappingURL=global-utils.js.map + +/***/ }), + +/***/ 19117: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._globalThis = void 0; +var node_1 = __nccwpck_require__(10096); +Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return node_1._globalThis; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 66826: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._globalThis = void 0; +/** only globals that common to node and browsers are allowed */ +// eslint-disable-next-line node/no-unsupported-features/es-builtins +exports._globalThis = typeof globalThis === 'object' ? globalThis : global; +//# sourceMappingURL=globalThis.js.map + +/***/ }), + +/***/ 10096: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._globalThis = void 0; +var globalThis_1 = __nccwpck_require__(66826); +Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return globalThis_1._globalThis; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 61481: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SeverityNumber = void 0; +var SeverityNumber; +(function (SeverityNumber) { + SeverityNumber[SeverityNumber["UNSPECIFIED"] = 0] = "UNSPECIFIED"; + SeverityNumber[SeverityNumber["TRACE"] = 1] = "TRACE"; + SeverityNumber[SeverityNumber["TRACE2"] = 2] = "TRACE2"; + SeverityNumber[SeverityNumber["TRACE3"] = 3] = "TRACE3"; + SeverityNumber[SeverityNumber["TRACE4"] = 4] = "TRACE4"; + SeverityNumber[SeverityNumber["DEBUG"] = 5] = "DEBUG"; + SeverityNumber[SeverityNumber["DEBUG2"] = 6] = "DEBUG2"; + SeverityNumber[SeverityNumber["DEBUG3"] = 7] = "DEBUG3"; + SeverityNumber[SeverityNumber["DEBUG4"] = 8] = "DEBUG4"; + SeverityNumber[SeverityNumber["INFO"] = 9] = "INFO"; + SeverityNumber[SeverityNumber["INFO2"] = 10] = "INFO2"; + SeverityNumber[SeverityNumber["INFO3"] = 11] = "INFO3"; + SeverityNumber[SeverityNumber["INFO4"] = 12] = "INFO4"; + SeverityNumber[SeverityNumber["WARN"] = 13] = "WARN"; + SeverityNumber[SeverityNumber["WARN2"] = 14] = "WARN2"; + SeverityNumber[SeverityNumber["WARN3"] = 15] = "WARN3"; + SeverityNumber[SeverityNumber["WARN4"] = 16] = "WARN4"; + SeverityNumber[SeverityNumber["ERROR"] = 17] = "ERROR"; + SeverityNumber[SeverityNumber["ERROR2"] = 18] = "ERROR2"; + SeverityNumber[SeverityNumber["ERROR3"] = 19] = "ERROR3"; + SeverityNumber[SeverityNumber["ERROR4"] = 20] = "ERROR4"; + SeverityNumber[SeverityNumber["FATAL"] = 21] = "FATAL"; + SeverityNumber[SeverityNumber["FATAL2"] = 22] = "FATAL2"; + SeverityNumber[SeverityNumber["FATAL3"] = 23] = "FATAL3"; + SeverityNumber[SeverityNumber["FATAL4"] = 24] = "FATAL4"; +})(SeverityNumber = exports.SeverityNumber || (exports.SeverityNumber = {})); +//# sourceMappingURL=LogRecord.js.map + +/***/ }), + +/***/ 55775: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.registerInstrumentations = void 0; +const api_1 = __nccwpck_require__(65163); +const api_logs_1 = __nccwpck_require__(8689); +const autoLoaderUtils_1 = __nccwpck_require__(97587); +/** + * It will register instrumentations and plugins + * @param options + * @return returns function to unload instrumentation and plugins that were + * registered + */ +function registerInstrumentations(options) { + var _a, _b; + const tracerProvider = options.tracerProvider || api_1.trace.getTracerProvider(); + const meterProvider = options.meterProvider || api_1.metrics.getMeterProvider(); + const loggerProvider = options.loggerProvider || api_logs_1.logs.getLoggerProvider(); + const instrumentations = (_b = (_a = options.instrumentations) === null || _a === void 0 ? void 0 : _a.flat()) !== null && _b !== void 0 ? _b : []; + (0, autoLoaderUtils_1.enableInstrumentations)(instrumentations, tracerProvider, meterProvider, loggerProvider); + return () => { + (0, autoLoaderUtils_1.disableInstrumentations)(instrumentations); + }; +} +exports.registerInstrumentations = registerInstrumentations; +//# sourceMappingURL=autoLoader.js.map + +/***/ }), + +/***/ 97587: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.disableInstrumentations = exports.enableInstrumentations = void 0; +/** + * Enable instrumentations + * @param instrumentations + * @param tracerProvider + * @param meterProvider + */ +function enableInstrumentations(instrumentations, tracerProvider, meterProvider, loggerProvider) { + for (let i = 0, j = instrumentations.length; i < j; i++) { + const instrumentation = instrumentations[i]; + if (tracerProvider) { + instrumentation.setTracerProvider(tracerProvider); + } + if (meterProvider) { + instrumentation.setMeterProvider(meterProvider); + } + if (loggerProvider && instrumentation.setLoggerProvider) { + instrumentation.setLoggerProvider(loggerProvider); + } + // instrumentations have been already enabled during creation + // so enable only if user prevented that by setting enabled to false + // this is to prevent double enabling but when calling register all + // instrumentations should be now enabled + if (!instrumentation.getConfig().enabled) { + instrumentation.enable(); + } + } +} +exports.enableInstrumentations = enableInstrumentations; +/** + * Disable instrumentations + * @param instrumentations + */ +function disableInstrumentations(instrumentations) { + instrumentations.forEach(instrumentation => instrumentation.disable()); +} +exports.disableInstrumentations = disableInstrumentations; +//# sourceMappingURL=autoLoaderUtils.js.map + +/***/ }), + +/***/ 52007: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.safeExecuteInTheMiddleAsync = exports.safeExecuteInTheMiddle = exports.isWrapped = exports.InstrumentationNodeModuleFile = exports.InstrumentationNodeModuleDefinition = exports.InstrumentationBase = exports.registerInstrumentations = void 0; +var autoLoader_1 = __nccwpck_require__(55775); +Object.defineProperty(exports, "registerInstrumentations", ({ enumerable: true, get: function () { return autoLoader_1.registerInstrumentations; } })); +var index_1 = __nccwpck_require__(58114); +Object.defineProperty(exports, "InstrumentationBase", ({ enumerable: true, get: function () { return index_1.InstrumentationBase; } })); +var instrumentationNodeModuleDefinition_1 = __nccwpck_require__(32834); +Object.defineProperty(exports, "InstrumentationNodeModuleDefinition", ({ enumerable: true, get: function () { return instrumentationNodeModuleDefinition_1.InstrumentationNodeModuleDefinition; } })); +var instrumentationNodeModuleFile_1 = __nccwpck_require__(67915); +Object.defineProperty(exports, "InstrumentationNodeModuleFile", ({ enumerable: true, get: function () { return instrumentationNodeModuleFile_1.InstrumentationNodeModuleFile; } })); +var utils_1 = __nccwpck_require__(42941); +Object.defineProperty(exports, "isWrapped", ({ enumerable: true, get: function () { return utils_1.isWrapped; } })); +Object.defineProperty(exports, "safeExecuteInTheMiddle", ({ enumerable: true, get: function () { return utils_1.safeExecuteInTheMiddle; } })); +Object.defineProperty(exports, "safeExecuteInTheMiddleAsync", ({ enumerable: true, get: function () { return utils_1.safeExecuteInTheMiddleAsync; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 83972: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.InstrumentationAbstract = void 0; +const api_1 = __nccwpck_require__(65163); +const api_logs_1 = __nccwpck_require__(8689); +const shimmer = __nccwpck_require__(16672); +/** + * Base abstract internal class for instrumenting node and web plugins + */ +class InstrumentationAbstract { + constructor(instrumentationName, instrumentationVersion, config) { + this.instrumentationName = instrumentationName; + this.instrumentationVersion = instrumentationVersion; + this._config = {}; + /* Api to wrap instrumented method */ + this._wrap = shimmer.wrap; + /* Api to unwrap instrumented methods */ + this._unwrap = shimmer.unwrap; + /* Api to mass wrap instrumented method */ + this._massWrap = shimmer.massWrap; + /* Api to mass unwrap instrumented methods */ + this._massUnwrap = shimmer.massUnwrap; + this.setConfig(config); + this._diag = api_1.diag.createComponentLogger({ + namespace: instrumentationName, + }); + this._tracer = api_1.trace.getTracer(instrumentationName, instrumentationVersion); + this._meter = api_1.metrics.getMeter(instrumentationName, instrumentationVersion); + this._logger = api_logs_1.logs.getLogger(instrumentationName, instrumentationVersion); + this._updateMetricInstruments(); + } + /* Returns meter */ + get meter() { + return this._meter; + } + /** + * Sets MeterProvider to this plugin + * @param meterProvider + */ + setMeterProvider(meterProvider) { + this._meter = meterProvider.getMeter(this.instrumentationName, this.instrumentationVersion); + this._updateMetricInstruments(); + } + /* Returns logger */ + get logger() { + return this._logger; + } + /** + * Sets LoggerProvider to this plugin + * @param loggerProvider + */ + setLoggerProvider(loggerProvider) { + this._logger = loggerProvider.getLogger(this.instrumentationName, this.instrumentationVersion); + } + /** + * @experimental + * + * Get module definitions defined by {@link init}. + * This can be used for experimental compile-time instrumentation. + * + * @returns an array of {@link InstrumentationModuleDefinition} + */ + getModuleDefinitions() { + var _a; + const initResult = (_a = this.init()) !== null && _a !== void 0 ? _a : []; + if (!Array.isArray(initResult)) { + return [initResult]; + } + return initResult; + } + /** + * Sets the new metric instruments with the current Meter. + */ + _updateMetricInstruments() { + return; + } + /* Returns InstrumentationConfig */ + getConfig() { + return this._config; + } + /** + * Sets InstrumentationConfig to this plugin + * @param config + */ + setConfig(config) { + // copy config first level properties to ensure they are immutable. + // nested properties are not copied, thus are mutable from the outside. + this._config = Object.assign({ enabled: true }, config); + } + /** + * Sets TraceProvider to this plugin + * @param tracerProvider + */ + setTracerProvider(tracerProvider) { + this._tracer = tracerProvider.getTracer(this.instrumentationName, this.instrumentationVersion); + } + /* Returns tracer */ + get tracer() { + return this._tracer; + } + /** + * Execute span customization hook, if configured, and log any errors. + * Any semantics of the trigger and info are defined by the specific instrumentation. + * @param hookHandler The optional hook handler which the user has configured via instrumentation config + * @param triggerName The name of the trigger for executing the hook for logging purposes + * @param span The span to which the hook should be applied + * @param info The info object to be passed to the hook, with useful data the hook may use + */ + _runSpanCustomizationHook(hookHandler, triggerName, span, info) { + if (!hookHandler) { + return; + } + try { + hookHandler(span, info); + } + catch (e) { + this._diag.error(`Error running span customization hook due to exception in handler`, { triggerName }, e); + } + } +} +exports.InstrumentationAbstract = InstrumentationAbstract; +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 32834: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.InstrumentationNodeModuleDefinition = void 0; +class InstrumentationNodeModuleDefinition { + constructor(name, supportedVersions, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + patch, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + unpatch, files) { + this.name = name; + this.supportedVersions = supportedVersions; + this.patch = patch; + this.unpatch = unpatch; + this.files = files || []; + } +} +exports.InstrumentationNodeModuleDefinition = InstrumentationNodeModuleDefinition; +//# sourceMappingURL=instrumentationNodeModuleDefinition.js.map + +/***/ }), + +/***/ 67915: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.InstrumentationNodeModuleFile = void 0; +const index_1 = __nccwpck_require__(58114); +class InstrumentationNodeModuleFile { + constructor(name, supportedVersions, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + patch, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + unpatch) { + this.supportedVersions = supportedVersions; + this.patch = patch; + this.unpatch = unpatch; + this.name = (0, index_1.normalize)(name); + } +} +exports.InstrumentationNodeModuleFile = InstrumentationNodeModuleFile; +//# sourceMappingURL=instrumentationNodeModuleFile.js.map + +/***/ }), + +/***/ 58114: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.normalize = exports.InstrumentationBase = void 0; +var node_1 = __nccwpck_require__(92870); +Object.defineProperty(exports, "InstrumentationBase", ({ enumerable: true, get: function () { return node_1.InstrumentationBase; } })); +Object.defineProperty(exports, "normalize", ({ enumerable: true, get: function () { return node_1.normalize; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 62934: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ModuleNameTrie = exports.ModuleNameSeparator = void 0; +exports.ModuleNameSeparator = '/'; +/** + * Node in a `ModuleNameTrie` + */ +class ModuleNameTrieNode { + constructor() { + this.hooks = []; + this.children = new Map(); + } +} +/** + * Trie containing nodes that represent a part of a module name (i.e. the parts separated by forward slash) + */ +class ModuleNameTrie { + constructor() { + this._trie = new ModuleNameTrieNode(); + this._counter = 0; + } + /** + * Insert a module hook into the trie + * + * @param {Hooked} hook Hook + */ + insert(hook) { + let trieNode = this._trie; + for (const moduleNamePart of hook.moduleName.split(exports.ModuleNameSeparator)) { + let nextNode = trieNode.children.get(moduleNamePart); + if (!nextNode) { + nextNode = new ModuleNameTrieNode(); + trieNode.children.set(moduleNamePart, nextNode); + } + trieNode = nextNode; + } + trieNode.hooks.push({ hook, insertedId: this._counter++ }); + } + /** + * Search for matching hooks in the trie + * + * @param {string} moduleName Module name + * @param {boolean} maintainInsertionOrder Whether to return the results in insertion order + * @param {boolean} fullOnly Whether to return only full matches + * @returns {Hooked[]} Matching hooks + */ + search(moduleName, { maintainInsertionOrder, fullOnly } = {}) { + let trieNode = this._trie; + const results = []; + let foundFull = true; + for (const moduleNamePart of moduleName.split(exports.ModuleNameSeparator)) { + const nextNode = trieNode.children.get(moduleNamePart); + if (!nextNode) { + foundFull = false; + break; + } + if (!fullOnly) { + results.push(...nextNode.hooks); + } + trieNode = nextNode; + } + if (fullOnly && foundFull) { + results.push(...trieNode.hooks); + } + if (results.length === 0) { + return []; + } + if (results.length === 1) { + return [results[0].hook]; + } + if (maintainInsertionOrder) { + results.sort((a, b) => a.insertedId - b.insertedId); + } + return results.map(({ hook }) => hook); + } +} +exports.ModuleNameTrie = ModuleNameTrie; +//# sourceMappingURL=ModuleNameTrie.js.map + +/***/ }), + +/***/ 4218: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RequireInTheMiddleSingleton = void 0; +const require_in_the_middle_1 = __nccwpck_require__(62009); +const path = __nccwpck_require__(71017); +const ModuleNameTrie_1 = __nccwpck_require__(62934); +/** + * Whether Mocha is running in this process + * Inspired by https://github.com/AndreasPizsa/detect-mocha + * + * @type {boolean} + */ +const isMocha = [ + 'afterEach', + 'after', + 'beforeEach', + 'before', + 'describe', + 'it', +].every(fn => { + // @ts-expect-error TS7053: Element implicitly has an 'any' type + return typeof global[fn] === 'function'; +}); +/** + * Singleton class for `require-in-the-middle` + * Allows instrumentation plugins to patch modules with only a single `require` patch + * WARNING: Because this class will create its own `require-in-the-middle` (RITM) instance, + * we should minimize the number of new instances of this class. + * Multiple instances of `@opentelemetry/instrumentation` (e.g. multiple versions) in a single process + * will result in multiple instances of RITM, which will have an impact + * on the performance of instrumentation hooks being applied. + */ +class RequireInTheMiddleSingleton { + constructor() { + this._moduleNameTrie = new ModuleNameTrie_1.ModuleNameTrie(); + this._initialize(); + } + _initialize() { + new require_in_the_middle_1.Hook( + // Intercept all `require` calls; we will filter the matching ones below + null, { internals: true }, (exports, name, basedir) => { + // For internal files on Windows, `name` will use backslash as the path separator + const normalizedModuleName = normalizePathSeparators(name); + const matches = this._moduleNameTrie.search(normalizedModuleName, { + maintainInsertionOrder: true, + // For core modules (e.g. `fs`), do not match on sub-paths (e.g. `fs/promises'). + // This matches the behavior of `require-in-the-middle`. + // `basedir` is always `undefined` for core modules. + fullOnly: basedir === undefined, + }); + for (const { onRequire } of matches) { + exports = onRequire(exports, name, basedir); + } + return exports; + }); + } + /** + * Register a hook with `require-in-the-middle` + * + * @param {string} moduleName Module name + * @param {OnRequireFn} onRequire Hook function + * @returns {Hooked} Registered hook + */ + register(moduleName, onRequire) { + const hooked = { moduleName, onRequire }; + this._moduleNameTrie.insert(hooked); + return hooked; + } + /** + * Get the `RequireInTheMiddleSingleton` singleton + * + * @returns {RequireInTheMiddleSingleton} Singleton of `RequireInTheMiddleSingleton` + */ + static getInstance() { + var _a; + // Mocha runs all test suites in the same process + // This prevents test suites from sharing a singleton + if (isMocha) + return new RequireInTheMiddleSingleton(); + return (this._instance = + (_a = this._instance) !== null && _a !== void 0 ? _a : new RequireInTheMiddleSingleton()); + } +} +exports.RequireInTheMiddleSingleton = RequireInTheMiddleSingleton; +/** + * Normalize the path separators to forward slash in a module name or path + * + * @param {string} moduleNameOrPath Module name or path + * @returns {string} Normalized module name or path + */ +function normalizePathSeparators(moduleNameOrPath) { + return path.sep !== ModuleNameTrie_1.ModuleNameSeparator + ? moduleNameOrPath.split(path.sep).join(ModuleNameTrie_1.ModuleNameSeparator) + : moduleNameOrPath; +} +//# sourceMappingURL=RequireInTheMiddleSingleton.js.map + +/***/ }), + +/***/ 92870: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.normalize = exports.InstrumentationBase = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var instrumentation_1 = __nccwpck_require__(27785); +Object.defineProperty(exports, "InstrumentationBase", ({ enumerable: true, get: function () { return instrumentation_1.InstrumentationBase; } })); +var normalize_1 = __nccwpck_require__(36197); +Object.defineProperty(exports, "normalize", ({ enumerable: true, get: function () { return normalize_1.normalize; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 27785: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.InstrumentationBase = void 0; +const path = __nccwpck_require__(71017); +const util_1 = __nccwpck_require__(73837); +const semver_1 = __nccwpck_require__(52023); +const shimmer_1 = __nccwpck_require__(16672); +const instrumentation_1 = __nccwpck_require__(83972); +const RequireInTheMiddleSingleton_1 = __nccwpck_require__(4218); +const import_in_the_middle_1 = __nccwpck_require__(36151); +const api_1 = __nccwpck_require__(65163); +const require_in_the_middle_1 = __nccwpck_require__(62009); +const fs_1 = __nccwpck_require__(57147); +const utils_1 = __nccwpck_require__(42941); +/** + * Base abstract class for instrumenting node plugins + */ +class InstrumentationBase extends instrumentation_1.InstrumentationAbstract { + constructor(instrumentationName, instrumentationVersion, config) { + super(instrumentationName, instrumentationVersion, config); + this._hooks = []; + this._requireInTheMiddleSingleton = RequireInTheMiddleSingleton_1.RequireInTheMiddleSingleton.getInstance(); + this._enabled = false; + this._wrap = (moduleExports, name, wrapper) => { + if ((0, utils_1.isWrapped)(moduleExports[name])) { + this._unwrap(moduleExports, name); + } + if (!util_1.types.isProxy(moduleExports)) { + return (0, shimmer_1.wrap)(moduleExports, name, wrapper); + } + else { + const wrapped = (0, shimmer_1.wrap)(Object.assign({}, moduleExports), name, wrapper); + Object.defineProperty(moduleExports, name, { + value: wrapped, + }); + return wrapped; + } + }; + this._unwrap = (moduleExports, name) => { + if (!util_1.types.isProxy(moduleExports)) { + return (0, shimmer_1.unwrap)(moduleExports, name); + } + else { + return Object.defineProperty(moduleExports, name, { + value: moduleExports[name], + }); + } + }; + this._massWrap = (moduleExportsArray, names, wrapper) => { + if (!moduleExportsArray) { + api_1.diag.error('must provide one or more modules to patch'); + return; + } + else if (!Array.isArray(moduleExportsArray)) { + moduleExportsArray = [moduleExportsArray]; + } + if (!(names && Array.isArray(names))) { + api_1.diag.error('must provide one or more functions to wrap on modules'); + return; + } + moduleExportsArray.forEach(moduleExports => { + names.forEach(name => { + this._wrap(moduleExports, name, wrapper); + }); + }); + }; + this._massUnwrap = (moduleExportsArray, names) => { + if (!moduleExportsArray) { + api_1.diag.error('must provide one or more modules to patch'); + return; + } + else if (!Array.isArray(moduleExportsArray)) { + moduleExportsArray = [moduleExportsArray]; + } + if (!(names && Array.isArray(names))) { + api_1.diag.error('must provide one or more functions to wrap on modules'); + return; + } + moduleExportsArray.forEach(moduleExports => { + names.forEach(name => { + this._unwrap(moduleExports, name); + }); + }); + }; + let modules = this.init(); + if (modules && !Array.isArray(modules)) { + modules = [modules]; + } + this._modules = modules || []; + if (this._config.enabled) { + this.enable(); + } + } + _warnOnPreloadedModules() { + this._modules.forEach((module) => { + const { name } = module; + try { + const resolvedModule = require.resolve(name); + if (require.cache[resolvedModule]) { + // Module is already cached, which means the instrumentation hook might not work + this._diag.warn(`Module ${name} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${name}`); + } + } + catch (_a) { + // Module isn't available, we can simply skip + } + }); + } + _extractPackageVersion(baseDir) { + try { + const json = (0, fs_1.readFileSync)(path.join(baseDir, 'package.json'), { + encoding: 'utf8', + }); + const version = JSON.parse(json).version; + return typeof version === 'string' ? version : undefined; + } + catch (error) { + api_1.diag.warn('Failed extracting version', baseDir); + } + return undefined; + } + _onRequire(module, exports, name, baseDir) { + var _a; + if (!baseDir) { + if (typeof module.patch === 'function') { + module.moduleExports = exports; + if (this._enabled) { + this._diag.debug('Applying instrumentation patch for nodejs core module on require hook', { + module: module.name, + }); + return module.patch(exports); + } + } + return exports; + } + const version = this._extractPackageVersion(baseDir); + module.moduleVersion = version; + if (module.name === name) { + // main module + if (isSupported(module.supportedVersions, version, module.includePrerelease)) { + if (typeof module.patch === 'function') { + module.moduleExports = exports; + if (this._enabled) { + this._diag.debug('Applying instrumentation patch for module on require hook', { + module: module.name, + version: module.moduleVersion, + baseDir, + }); + return module.patch(exports, module.moduleVersion); + } + } + } + return exports; + } + // internal file + const files = (_a = module.files) !== null && _a !== void 0 ? _a : []; + const normalizedName = path.normalize(name); + const supportedFileInstrumentations = files + .filter(f => f.name === normalizedName) + .filter(f => isSupported(f.supportedVersions, version, module.includePrerelease)); + return supportedFileInstrumentations.reduce((patchedExports, file) => { + file.moduleExports = patchedExports; + if (this._enabled) { + this._diag.debug('Applying instrumentation patch for nodejs module file on require hook', { + module: module.name, + version: module.moduleVersion, + fileName: file.name, + baseDir, + }); + // patch signature is not typed, so we cast it assuming it's correct + return file.patch(patchedExports, module.moduleVersion); + } + return patchedExports; + }, exports); + } + enable() { + if (this._enabled) { + return; + } + this._enabled = true; + // already hooked, just call patch again + if (this._hooks.length > 0) { + for (const module of this._modules) { + if (typeof module.patch === 'function' && module.moduleExports) { + this._diag.debug('Applying instrumentation patch for nodejs module on instrumentation enabled', { + module: module.name, + version: module.moduleVersion, + }); + module.patch(module.moduleExports, module.moduleVersion); + } + for (const file of module.files) { + if (file.moduleExports) { + this._diag.debug('Applying instrumentation patch for nodejs module file on instrumentation enabled', { + module: module.name, + version: module.moduleVersion, + fileName: file.name, + }); + file.patch(file.moduleExports, module.moduleVersion); + } + } + } + return; + } + this._warnOnPreloadedModules(); + for (const module of this._modules) { + const hookFn = (exports, name, baseDir) => { + return this._onRequire(module, exports, name, baseDir); + }; + const onRequire = (exports, name, baseDir) => { + return this._onRequire(module, exports, name, baseDir); + }; + // `RequireInTheMiddleSingleton` does not support absolute paths. + // For an absolute paths, we must create a separate instance of the + // require-in-the-middle `Hook`. + const hook = path.isAbsolute(module.name) + ? new require_in_the_middle_1.Hook([module.name], { internals: true }, onRequire) + : this._requireInTheMiddleSingleton.register(module.name, onRequire); + this._hooks.push(hook); + const esmHook = new import_in_the_middle_1.Hook([module.name], { internals: false }, hookFn); + this._hooks.push(esmHook); + } + } + disable() { + if (!this._enabled) { + return; + } + this._enabled = false; + for (const module of this._modules) { + if (typeof module.unpatch === 'function' && module.moduleExports) { + this._diag.debug('Removing instrumentation patch for nodejs module on instrumentation disabled', { + module: module.name, + version: module.moduleVersion, + }); + module.unpatch(module.moduleExports, module.moduleVersion); + } + for (const file of module.files) { + if (file.moduleExports) { + this._diag.debug('Removing instrumentation patch for nodejs module file on instrumentation disabled', { + module: module.name, + version: module.moduleVersion, + fileName: file.name, + }); + file.unpatch(file.moduleExports, module.moduleVersion); + } + } + } + } + isEnabled() { + return this._enabled; + } +} +exports.InstrumentationBase = InstrumentationBase; +function isSupported(supportedVersions, version, includePrerelease) { + if (typeof version === 'undefined') { + // If we don't have the version, accept the wildcard case only + return supportedVersions.includes('*'); + } + return supportedVersions.some(supportedVersion => { + return (0, semver_1.satisfies)(version, supportedVersion, { includePrerelease }); + }); +} +//# sourceMappingURL=instrumentation.js.map + +/***/ }), + +/***/ 36197: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.normalize = void 0; +var path_1 = __nccwpck_require__(71017); +Object.defineProperty(exports, "normalize", ({ enumerable: true, get: function () { return path_1.normalize; } })); +//# sourceMappingURL=normalize.js.map + +/***/ }), + +/***/ 42941: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isWrapped = exports.safeExecuteInTheMiddleAsync = exports.safeExecuteInTheMiddle = void 0; +/** + * function to execute patched function and being able to catch errors + * @param execute - function to be executed + * @param onFinish - callback to run when execute finishes + */ +function safeExecuteInTheMiddle(execute, onFinish, preventThrowingError) { + let error; + let result; + try { + result = execute(); + } + catch (e) { + error = e; + } + finally { + onFinish(error, result); + if (error && !preventThrowingError) { + // eslint-disable-next-line no-unsafe-finally + throw error; + } + // eslint-disable-next-line no-unsafe-finally + return result; + } +} +exports.safeExecuteInTheMiddle = safeExecuteInTheMiddle; +/** + * Async function to execute patched function and being able to catch errors + * @param execute - function to be executed + * @param onFinish - callback to run when execute finishes + */ +async function safeExecuteInTheMiddleAsync(execute, onFinish, preventThrowingError) { + let error; + let result; + try { + result = await execute(); + } + catch (e) { + error = e; + } + finally { + onFinish(error, result); + if (error && !preventThrowingError) { + // eslint-disable-next-line no-unsafe-finally + throw error; + } + // eslint-disable-next-line no-unsafe-finally + return result; + } +} +exports.safeExecuteInTheMiddleAsync = safeExecuteInTheMiddleAsync; +/** + * Checks if certain function has been already wrapped + * @param func + */ +function isWrapped(func) { + return (typeof func === 'function' && + typeof func.__original === 'function' && + typeof func.__unwrap === 'function' && + func.__wrapped === true); +} +exports.isWrapped = isWrapped; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 89973: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Resource = void 0; +const api_1 = __nccwpck_require__(65163); +const semantic_conventions_1 = __nccwpck_require__(67275); +const core_1 = __nccwpck_require__(89736); +const platform_1 = __nccwpck_require__(63669); +/** + * A Resource describes the entity for which a signals (metrics or trace) are + * collected. + */ +class Resource { + constructor( + /** + * A dictionary of attributes with string keys and values that provide + * information about the entity as numbers, strings or booleans + * TODO: Consider to add check/validation on attributes. + */ + attributes, asyncAttributesPromise) { + var _a; + this._attributes = attributes; + this.asyncAttributesPending = asyncAttributesPromise != null; + this._syncAttributes = (_a = this._attributes) !== null && _a !== void 0 ? _a : {}; + this._asyncAttributesPromise = asyncAttributesPromise === null || asyncAttributesPromise === void 0 ? void 0 : asyncAttributesPromise.then(asyncAttributes => { + this._attributes = Object.assign({}, this._attributes, asyncAttributes); + this.asyncAttributesPending = false; + return asyncAttributes; + }, err => { + api_1.diag.debug("a resource's async attributes promise rejected: %s", err); + this.asyncAttributesPending = false; + return {}; + }); + } + /** + * Returns an empty Resource + */ + static empty() { + return Resource.EMPTY; + } + /** + * Returns a Resource that identifies the SDK in use. + */ + static default() { + return new Resource({ + [semantic_conventions_1.SEMRESATTRS_SERVICE_NAME]: (0, platform_1.defaultServiceName)(), + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]: core_1.SDK_INFO[semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE], + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME]: core_1.SDK_INFO[semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME], + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_VERSION]: core_1.SDK_INFO[semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_VERSION], + }); + } + get attributes() { + var _a; + if (this.asyncAttributesPending) { + api_1.diag.error('Accessing resource attributes before async attributes settled'); + } + return (_a = this._attributes) !== null && _a !== void 0 ? _a : {}; + } + /** + * Returns a promise that will never be rejected. Resolves when all async attributes have finished being added to + * this Resource's attributes. This is useful in exporters to block until resource detection + * has finished. + */ + async waitForAsyncAttributes() { + if (this.asyncAttributesPending) { + await this._asyncAttributesPromise; + } + } + /** + * Returns a new, merged {@link Resource} by merging the current Resource + * with the other Resource. In case of a collision, other Resource takes + * precedence. + * + * @param other the Resource that will be merged with this. + * @returns the newly merged Resource. + */ + merge(other) { + var _a; + if (!other) + return this; + // SpanAttributes from other resource overwrite attributes from this resource. + const mergedSyncAttributes = Object.assign(Object.assign({}, this._syncAttributes), ((_a = other._syncAttributes) !== null && _a !== void 0 ? _a : other.attributes)); + if (!this._asyncAttributesPromise && + !other._asyncAttributesPromise) { + return new Resource(mergedSyncAttributes); + } + const mergedAttributesPromise = Promise.all([ + this._asyncAttributesPromise, + other._asyncAttributesPromise, + ]).then(([thisAsyncAttributes, otherAsyncAttributes]) => { + var _a; + return Object.assign(Object.assign(Object.assign(Object.assign({}, this._syncAttributes), thisAsyncAttributes), ((_a = other._syncAttributes) !== null && _a !== void 0 ? _a : other.attributes)), otherAsyncAttributes); + }); + return new Resource(mergedSyncAttributes, mergedAttributesPromise); + } +} +exports.Resource = Resource; +Resource.EMPTY = new Resource({}); +//# sourceMappingURL=Resource.js.map + +/***/ }), + +/***/ 89224: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.detectResourcesSync = exports.detectResources = void 0; +const Resource_1 = __nccwpck_require__(89973); +const api_1 = __nccwpck_require__(65163); +const utils_1 = __nccwpck_require__(76620); +/** + * Runs all resource detectors and returns the results merged into a single Resource. Promise + * does not resolve until all the underlying detectors have resolved, unlike + * detectResourcesSync. + * + * @deprecated use detectResourcesSync() instead. + * @param config Configuration for resource detection + */ +const detectResources = async (config = {}) => { + const resources = await Promise.all((config.detectors || []).map(async (d) => { + try { + const resource = await d.detect(config); + api_1.diag.debug(`${d.constructor.name} found resource.`, resource); + return resource; + } + catch (e) { + api_1.diag.debug(`${d.constructor.name} failed: ${e.message}`); + return Resource_1.Resource.empty(); + } + })); + // Future check if verbose logging is enabled issue #1903 + logResources(resources); + return resources.reduce((acc, resource) => acc.merge(resource), Resource_1.Resource.empty()); +}; +exports.detectResources = detectResources; +/** + * Runs all resource detectors synchronously, merging their results. In case of attribute collision later resources will take precedence. + * + * @param config Configuration for resource detection + */ +const detectResourcesSync = (config = {}) => { + var _a; + const resources = ((_a = config.detectors) !== null && _a !== void 0 ? _a : []).map((d) => { + try { + const resourceOrPromise = d.detect(config); + let resource; + if ((0, utils_1.isPromiseLike)(resourceOrPromise)) { + const createPromise = async () => { + var _a; + const resolvedResource = await resourceOrPromise; + await ((_a = resolvedResource.waitForAsyncAttributes) === null || _a === void 0 ? void 0 : _a.call(resolvedResource)); + return resolvedResource.attributes; + }; + resource = new Resource_1.Resource({}, createPromise()); + } + else { + resource = resourceOrPromise; + } + if (resource.waitForAsyncAttributes) { + void resource + .waitForAsyncAttributes() + .then(() => api_1.diag.debug(`${d.constructor.name} found resource.`, resource)); + } + else { + api_1.diag.debug(`${d.constructor.name} found resource.`, resource); + } + return resource; + } + catch (e) { + api_1.diag.error(`${d.constructor.name} failed: ${e.message}`); + return Resource_1.Resource.empty(); + } + }); + const mergedResources = resources.reduce((acc, resource) => acc.merge(resource), Resource_1.Resource.empty()); + if (mergedResources.waitForAsyncAttributes) { + void mergedResources.waitForAsyncAttributes().then(() => { + // Future check if verbose logging is enabled issue #1903 + logResources(resources); + }); + } + return mergedResources; +}; +exports.detectResourcesSync = detectResourcesSync; +/** + * Writes debug information about the detected resources to the logger defined in the resource detection config, if one is provided. + * + * @param resources The array of {@link Resource} that should be logged. Empty entries will be ignored. + */ +const logResources = (resources) => { + resources.forEach(resource => { + // Print only populated resources + if (Object.keys(resource.attributes).length > 0) { + const resourceDebugString = JSON.stringify(resource.attributes, null, 4); + api_1.diag.verbose(resourceDebugString); + } + }); +}; +//# sourceMappingURL=detect-resources.js.map + +/***/ }), + +/***/ 51756: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.browserDetector = void 0; +const BrowserDetectorSync_1 = __nccwpck_require__(86107); +/** + * BrowserDetector will be used to detect the resources related to browser. + */ +class BrowserDetector { + detect(config) { + return Promise.resolve(BrowserDetectorSync_1.browserDetectorSync.detect(config)); + } +} +exports.browserDetector = new BrowserDetector(); +//# sourceMappingURL=BrowserDetector.js.map + +/***/ }), + +/***/ 86107: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.browserDetectorSync = void 0; +const semantic_conventions_1 = __nccwpck_require__(67275); +const api_1 = __nccwpck_require__(65163); +const Resource_1 = __nccwpck_require__(89973); +/** + * BrowserDetectorSync will be used to detect the resources related to browser. + */ +class BrowserDetectorSync { + detect(config) { + var _a, _b, _c; + const isBrowser = typeof navigator !== 'undefined' && + ((_b = (_a = global.process) === null || _a === void 0 ? void 0 : _a.versions) === null || _b === void 0 ? void 0 : _b.node) === undefined && // Node.js v21 adds `navigator` + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore don't have Bun types + ((_c = global.Bun) === null || _c === void 0 ? void 0 : _c.version) === undefined; // Bun (bun.sh) defines `navigator` + if (!isBrowser) { + return Resource_1.Resource.empty(); + } + const browserResource = { + [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'browser', + [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION]: 'Web Browser', + [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_VERSION]: navigator.userAgent, + }; + return this._getResourceAttributes(browserResource, config); + } + /** + * Validates process resource attribute map from process variables + * + * @param browserResource The un-sanitized resource attributes from process as key/value pairs. + * @param config: Config + * @returns The sanitized resource attributes. + */ + _getResourceAttributes(browserResource, _config) { + if (browserResource[semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_VERSION] === '') { + api_1.diag.debug('BrowserDetector failed: Unable to find required browser resources. '); + return Resource_1.Resource.empty(); + } + else { + return new Resource_1.Resource(Object.assign({}, browserResource)); + } + } +} +exports.browserDetectorSync = new BrowserDetectorSync(); +//# sourceMappingURL=BrowserDetectorSync.js.map + +/***/ }), + +/***/ 97540: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.envDetector = void 0; +const EnvDetectorSync_1 = __nccwpck_require__(36390); +/** + * EnvDetector can be used to detect the presence of and create a Resource + * from the OTEL_RESOURCE_ATTRIBUTES environment variable. + */ +class EnvDetector { + /** + * Returns a {@link Resource} populated with attributes from the + * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async + * function to conform to the Detector interface. + * + * @param config The resource detection config + */ + detect(config) { + return Promise.resolve(EnvDetectorSync_1.envDetectorSync.detect(config)); + } +} +exports.envDetector = new EnvDetector(); +//# sourceMappingURL=EnvDetector.js.map + +/***/ }), + +/***/ 36390: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.envDetectorSync = void 0; +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(89736); +const semantic_conventions_1 = __nccwpck_require__(67275); +const Resource_1 = __nccwpck_require__(89973); +/** + * EnvDetectorSync can be used to detect the presence of and create a Resource + * from the OTEL_RESOURCE_ATTRIBUTES environment variable. + */ +class EnvDetectorSync { + constructor() { + // Type, attribute keys, and attribute values should not exceed 256 characters. + this._MAX_LENGTH = 255; + // OTEL_RESOURCE_ATTRIBUTES is a comma-separated list of attributes. + this._COMMA_SEPARATOR = ','; + // OTEL_RESOURCE_ATTRIBUTES contains key value pair separated by '='. + this._LABEL_KEY_VALUE_SPLITTER = '='; + this._ERROR_MESSAGE_INVALID_CHARS = 'should be a ASCII string with a length greater than 0 and not exceed ' + + this._MAX_LENGTH + + ' characters.'; + this._ERROR_MESSAGE_INVALID_VALUE = 'should be a ASCII string with a length not exceed ' + + this._MAX_LENGTH + + ' characters.'; + } + /** + * Returns a {@link Resource} populated with attributes from the + * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async + * function to conform to the Detector interface. + * + * @param config The resource detection config + */ + detect(_config) { + const attributes = {}; + const env = (0, core_1.getEnv)(); + const rawAttributes = env.OTEL_RESOURCE_ATTRIBUTES; + const serviceName = env.OTEL_SERVICE_NAME; + if (rawAttributes) { + try { + const parsedAttributes = this._parseResourceAttributes(rawAttributes); + Object.assign(attributes, parsedAttributes); + } + catch (e) { + api_1.diag.debug(`EnvDetector failed: ${e.message}`); + } + } + if (serviceName) { + attributes[semantic_conventions_1.SEMRESATTRS_SERVICE_NAME] = serviceName; + } + return new Resource_1.Resource(attributes); + } + /** + * Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment + * variable. + * + * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes describing + * the source in more detail, e.g. “key1=val1,key2=val2”. Domain names and + * paths are accepted as attribute keys. Values may be quoted or unquoted in + * general. If a value contains whitespace, =, or " characters, it must + * always be quoted. + * + * @param rawEnvAttributes The resource attributes as a comma-separated list + * of key/value pairs. + * @returns The sanitized resource attributes. + */ + _parseResourceAttributes(rawEnvAttributes) { + if (!rawEnvAttributes) + return {}; + const attributes = {}; + const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR, -1); + for (const rawAttribute of rawAttributes) { + const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER, -1); + if (keyValuePair.length !== 2) { + continue; + } + let [key, value] = keyValuePair; + // Leading and trailing whitespaces are trimmed. + key = key.trim(); + value = value.trim().split(/^"|"$/).join(''); + if (!this._isValidAndNotEmpty(key)) { + throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`); + } + if (!this._isValid(value)) { + throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`); + } + attributes[key] = decodeURIComponent(value); + } + return attributes; + } + /** + * Determines whether the given String is a valid printable ASCII string with + * a length not exceed _MAX_LENGTH characters. + * + * @param str The String to be validated. + * @returns Whether the String is valid. + */ + _isValid(name) { + return name.length <= this._MAX_LENGTH && this._isBaggageOctetString(name); + } + // https://www.w3.org/TR/baggage/#definition + _isBaggageOctetString(str) { + for (let i = 0; i < str.length; i++) { + const ch = str.charCodeAt(i); + if (ch < 0x21 || ch === 0x2c || ch === 0x3b || ch === 0x5c || ch > 0x7e) { + return false; + } + } + return true; + } + /** + * Determines whether the given String is a valid printable ASCII string with + * a length greater than 0 and not exceed _MAX_LENGTH characters. + * + * @param str The String to be validated. + * @returns Whether the String is valid and not empty. + */ + _isValidAndNotEmpty(str) { + return str.length > 0 && this._isValid(str); + } +} +exports.envDetectorSync = new EnvDetectorSync(); +//# sourceMappingURL=EnvDetectorSync.js.map + +/***/ }), + +/***/ 50622: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.envDetectorSync = exports.browserDetectorSync = exports.envDetector = exports.browserDetector = exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = void 0; +var platform_1 = __nccwpck_require__(2327); +Object.defineProperty(exports, "hostDetector", ({ enumerable: true, get: function () { return platform_1.hostDetector; } })); +Object.defineProperty(exports, "hostDetectorSync", ({ enumerable: true, get: function () { return platform_1.hostDetectorSync; } })); +Object.defineProperty(exports, "osDetector", ({ enumerable: true, get: function () { return platform_1.osDetector; } })); +Object.defineProperty(exports, "osDetectorSync", ({ enumerable: true, get: function () { return platform_1.osDetectorSync; } })); +Object.defineProperty(exports, "processDetector", ({ enumerable: true, get: function () { return platform_1.processDetector; } })); +Object.defineProperty(exports, "processDetectorSync", ({ enumerable: true, get: function () { return platform_1.processDetectorSync; } })); +Object.defineProperty(exports, "serviceInstanceIdDetectorSync", ({ enumerable: true, get: function () { return platform_1.serviceInstanceIdDetectorSync; } })); +var BrowserDetector_1 = __nccwpck_require__(51756); +Object.defineProperty(exports, "browserDetector", ({ enumerable: true, get: function () { return BrowserDetector_1.browserDetector; } })); +var EnvDetector_1 = __nccwpck_require__(97540); +Object.defineProperty(exports, "envDetector", ({ enumerable: true, get: function () { return EnvDetector_1.envDetector; } })); +var BrowserDetectorSync_1 = __nccwpck_require__(86107); +Object.defineProperty(exports, "browserDetectorSync", ({ enumerable: true, get: function () { return BrowserDetectorSync_1.browserDetectorSync; } })); +var EnvDetectorSync_1 = __nccwpck_require__(36390); +Object.defineProperty(exports, "envDetectorSync", ({ enumerable: true, get: function () { return EnvDetectorSync_1.envDetectorSync; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 2327: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var node_1 = __nccwpck_require__(60551); +Object.defineProperty(exports, "hostDetector", ({ enumerable: true, get: function () { return node_1.hostDetector; } })); +Object.defineProperty(exports, "hostDetectorSync", ({ enumerable: true, get: function () { return node_1.hostDetectorSync; } })); +Object.defineProperty(exports, "osDetector", ({ enumerable: true, get: function () { return node_1.osDetector; } })); +Object.defineProperty(exports, "osDetectorSync", ({ enumerable: true, get: function () { return node_1.osDetectorSync; } })); +Object.defineProperty(exports, "processDetector", ({ enumerable: true, get: function () { return node_1.processDetector; } })); +Object.defineProperty(exports, "processDetectorSync", ({ enumerable: true, get: function () { return node_1.processDetectorSync; } })); +Object.defineProperty(exports, "serviceInstanceIdDetectorSync", ({ enumerable: true, get: function () { return node_1.serviceInstanceIdDetectorSync; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 81322: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.hostDetector = void 0; +const HostDetectorSync_1 = __nccwpck_require__(35715); +/** + * HostDetector detects the resources related to the host current process is + * running on. Currently only non-cloud-based attributes are included. + */ +class HostDetector { + detect(_config) { + return Promise.resolve(HostDetectorSync_1.hostDetectorSync.detect(_config)); + } +} +exports.hostDetector = new HostDetector(); +//# sourceMappingURL=HostDetector.js.map + +/***/ }), + +/***/ 35715: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.hostDetectorSync = void 0; +const semantic_conventions_1 = __nccwpck_require__(67275); +const Resource_1 = __nccwpck_require__(89973); +const os_1 = __nccwpck_require__(22037); +const utils_1 = __nccwpck_require__(42090); +const getMachineId_1 = __nccwpck_require__(49090); +/** + * HostDetectorSync detects the resources related to the host current process is + * running on. Currently only non-cloud-based attributes are included. + */ +class HostDetectorSync { + detect(_config) { + const attributes = { + [semantic_conventions_1.SEMRESATTRS_HOST_NAME]: (0, os_1.hostname)(), + [semantic_conventions_1.SEMRESATTRS_HOST_ARCH]: (0, utils_1.normalizeArch)((0, os_1.arch)()), + }; + return new Resource_1.Resource(attributes, this._getAsyncAttributes()); + } + _getAsyncAttributes() { + return (0, getMachineId_1.getMachineId)().then(machineId => { + const attributes = {}; + if (machineId) { + attributes[semantic_conventions_1.SEMRESATTRS_HOST_ID] = machineId; + } + return attributes; + }); + } +} +exports.hostDetectorSync = new HostDetectorSync(); +//# sourceMappingURL=HostDetectorSync.js.map + +/***/ }), + +/***/ 80863: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.osDetector = void 0; +const OSDetectorSync_1 = __nccwpck_require__(55240); +/** + * OSDetector detects the resources related to the operating system (OS) on + * which the process represented by this resource is running. + */ +class OSDetector { + detect(_config) { + return Promise.resolve(OSDetectorSync_1.osDetectorSync.detect(_config)); + } +} +exports.osDetector = new OSDetector(); +//# sourceMappingURL=OSDetector.js.map + +/***/ }), + +/***/ 55240: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.osDetectorSync = void 0; +const semantic_conventions_1 = __nccwpck_require__(67275); +const Resource_1 = __nccwpck_require__(89973); +const os_1 = __nccwpck_require__(22037); +const utils_1 = __nccwpck_require__(42090); +/** + * OSDetectorSync detects the resources related to the operating system (OS) on + * which the process represented by this resource is running. + */ +class OSDetectorSync { + detect(_config) { + const attributes = { + [semantic_conventions_1.SEMRESATTRS_OS_TYPE]: (0, utils_1.normalizeType)((0, os_1.platform)()), + [semantic_conventions_1.SEMRESATTRS_OS_VERSION]: (0, os_1.release)(), + }; + return new Resource_1.Resource(attributes); + } +} +exports.osDetectorSync = new OSDetectorSync(); +//# sourceMappingURL=OSDetectorSync.js.map + +/***/ }), + +/***/ 78924: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.processDetector = void 0; +const ProcessDetectorSync_1 = __nccwpck_require__(1167); +/** + * ProcessDetector will be used to detect the resources related current process running + * and being instrumented from the NodeJS Process module. + */ +class ProcessDetector { + detect(config) { + return Promise.resolve(ProcessDetectorSync_1.processDetectorSync.detect(config)); + } +} +exports.processDetector = new ProcessDetector(); +//# sourceMappingURL=ProcessDetector.js.map + +/***/ }), + +/***/ 1167: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.processDetectorSync = void 0; +const api_1 = __nccwpck_require__(65163); +const semantic_conventions_1 = __nccwpck_require__(67275); +const Resource_1 = __nccwpck_require__(89973); +const os = __nccwpck_require__(22037); +/** + * ProcessDetectorSync will be used to detect the resources related current process running + * and being instrumented from the NodeJS Process module. + */ +class ProcessDetectorSync { + detect(_config) { + const attributes = { + [semantic_conventions_1.SEMRESATTRS_PROCESS_PID]: process.pid, + [semantic_conventions_1.SEMRESATTRS_PROCESS_EXECUTABLE_NAME]: process.title, + [semantic_conventions_1.SEMRESATTRS_PROCESS_EXECUTABLE_PATH]: process.execPath, + [semantic_conventions_1.SEMRESATTRS_PROCESS_COMMAND_ARGS]: [ + process.argv[0], + ...process.execArgv, + ...process.argv.slice(1), + ], + [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_VERSION]: process.versions.node, + [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'nodejs', + [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION]: 'Node.js', + }; + if (process.argv.length > 1) { + attributes[semantic_conventions_1.SEMRESATTRS_PROCESS_COMMAND] = process.argv[1]; + } + try { + const userInfo = os.userInfo(); + attributes[semantic_conventions_1.SEMRESATTRS_PROCESS_OWNER] = userInfo.username; + } + catch (e) { + api_1.diag.debug(`error obtaining process owner: ${e}`); + } + return new Resource_1.Resource(attributes); + } +} +exports.processDetectorSync = new ProcessDetectorSync(); +//# sourceMappingURL=ProcessDetectorSync.js.map + +/***/ }), + +/***/ 91077: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.serviceInstanceIdDetectorSync = void 0; +const semantic_conventions_1 = __nccwpck_require__(67275); +const Resource_1 = __nccwpck_require__(89973); +const crypto_1 = __nccwpck_require__(6113); +/** + * ServiceInstanceIdDetectorSync detects the resources related to the service instance ID. + */ +class ServiceInstanceIdDetectorSync { + detect(_config) { + const attributes = { + [semantic_conventions_1.SEMRESATTRS_SERVICE_INSTANCE_ID]: (0, crypto_1.randomUUID)(), + }; + return new Resource_1.Resource(attributes); + } +} +/** + * @experimental + */ +exports.serviceInstanceIdDetectorSync = new ServiceInstanceIdDetectorSync(); +//# sourceMappingURL=ServiceInstanceIdDetectorSync.js.map + +/***/ }), + +/***/ 60551: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = void 0; +var HostDetector_1 = __nccwpck_require__(81322); +Object.defineProperty(exports, "hostDetector", ({ enumerable: true, get: function () { return HostDetector_1.hostDetector; } })); +var HostDetectorSync_1 = __nccwpck_require__(35715); +Object.defineProperty(exports, "hostDetectorSync", ({ enumerable: true, get: function () { return HostDetectorSync_1.hostDetectorSync; } })); +var OSDetector_1 = __nccwpck_require__(80863); +Object.defineProperty(exports, "osDetector", ({ enumerable: true, get: function () { return OSDetector_1.osDetector; } })); +var OSDetectorSync_1 = __nccwpck_require__(55240); +Object.defineProperty(exports, "osDetectorSync", ({ enumerable: true, get: function () { return OSDetectorSync_1.osDetectorSync; } })); +var ProcessDetector_1 = __nccwpck_require__(78924); +Object.defineProperty(exports, "processDetector", ({ enumerable: true, get: function () { return ProcessDetector_1.processDetector; } })); +var ProcessDetectorSync_1 = __nccwpck_require__(1167); +Object.defineProperty(exports, "processDetectorSync", ({ enumerable: true, get: function () { return ProcessDetectorSync_1.processDetectorSync; } })); +var ServiceInstanceIdDetectorSync_1 = __nccwpck_require__(91077); +Object.defineProperty(exports, "serviceInstanceIdDetectorSync", ({ enumerable: true, get: function () { return ServiceInstanceIdDetectorSync_1.serviceInstanceIdDetectorSync; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 68242: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.execAsync = void 0; +const child_process = __nccwpck_require__(32081); +const util = __nccwpck_require__(73837); +exports.execAsync = util.promisify(child_process.exec); +//# sourceMappingURL=execAsync.js.map + +/***/ }), + +/***/ 71309: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +__webpack_unused_export__ = ({ value: true }); +exports.$ = void 0; +const fs_1 = __nccwpck_require__(57147); +const execAsync_1 = __nccwpck_require__(68242); +const api_1 = __nccwpck_require__(65163); +async function getMachineId() { + try { + const result = await fs_1.promises.readFile('/etc/hostid', { encoding: 'utf8' }); + return result.trim(); + } + catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + try { + const result = await (0, execAsync_1.execAsync)('kenv -q smbios.system.uuid'); + return result.stdout.trim(); + } + catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + return ''; +} +exports.$ = getMachineId; +//# sourceMappingURL=getMachineId-bsd.js.map + +/***/ }), + +/***/ 57327: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +__webpack_unused_export__ = ({ value: true }); +exports.$ = void 0; +const execAsync_1 = __nccwpck_require__(68242); +const api_1 = __nccwpck_require__(65163); +async function getMachineId() { + try { + const result = await (0, execAsync_1.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"'); + const idLine = result.stdout + .split('\n') + .find(line => line.includes('IOPlatformUUID')); + if (!idLine) { + return ''; + } + const parts = idLine.split('" = "'); + if (parts.length === 2) { + return parts[1].slice(0, -1); + } + } + catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + return ''; +} +exports.$ = getMachineId; +//# sourceMappingURL=getMachineId-darwin.js.map + +/***/ }), + +/***/ 88540: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + +__webpack_unused_export__ = ({ value: true }); +exports.$ = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const fs_1 = __nccwpck_require__(57147); +const api_1 = __nccwpck_require__(65163); +async function getMachineId() { + const paths = ['/etc/machine-id', '/var/lib/dbus/machine-id']; + for (const path of paths) { + try { + const result = await fs_1.promises.readFile(path, { encoding: 'utf8' }); + return result.trim(); + } + catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + } + return ''; +} +exports.$ = getMachineId; +//# sourceMappingURL=getMachineId-linux.js.map + +/***/ }), + +/***/ 66091: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +__webpack_unused_export__ = ({ value: true }); +exports.$ = void 0; +const api_1 = __nccwpck_require__(65163); +async function getMachineId() { + api_1.diag.debug('could not read machine-id: unsupported platform'); + return ''; +} +exports.$ = getMachineId; +//# sourceMappingURL=getMachineId-unsupported.js.map + +/***/ }), + +/***/ 29607: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +__webpack_unused_export__ = ({ value: true }); +exports.$ = void 0; +const process = __nccwpck_require__(77282); +const execAsync_1 = __nccwpck_require__(68242); +const api_1 = __nccwpck_require__(65163); +async function getMachineId() { + const args = 'QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid'; + let command = '%windir%\\System32\\REG.exe'; + if (process.arch === 'ia32' && 'PROCESSOR_ARCHITEW6432' in process.env) { + command = '%windir%\\sysnative\\cmd.exe /c ' + command; + } + try { + const result = await (0, execAsync_1.execAsync)(`${command} ${args}`); + const parts = result.stdout.split('REG_SZ'); + if (parts.length === 2) { + return parts[1].trim(); + } + } + catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + return ''; +} +exports.$ = getMachineId; +//# sourceMappingURL=getMachineId-win.js.map + +/***/ }), + +/***/ 49090: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getMachineId = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const process = __nccwpck_require__(77282); +let getMachineId; +exports.getMachineId = getMachineId; +switch (process.platform) { + case 'darwin': + (exports.getMachineId = getMachineId = (__nccwpck_require__(57327)/* .getMachineId */ .$)); + break; + case 'linux': + (exports.getMachineId = getMachineId = (__nccwpck_require__(88540)/* .getMachineId */ .$)); + break; + case 'freebsd': + (exports.getMachineId = getMachineId = (__nccwpck_require__(71309)/* .getMachineId */ .$)); + break; + case 'win32': + (exports.getMachineId = getMachineId = (__nccwpck_require__(29607)/* .getMachineId */ .$)); + break; + default: + (exports.getMachineId = getMachineId = (__nccwpck_require__(66091)/* .getMachineId */ .$)); +} +//# sourceMappingURL=getMachineId.js.map + +/***/ }), + +/***/ 42090: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.normalizeType = exports.normalizeArch = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const normalizeArch = (nodeArchString) => { + // Maps from https://nodejs.org/api/os.html#osarch to arch values in spec: + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/host.md + switch (nodeArchString) { + case 'arm': + return 'arm32'; + case 'ppc': + return 'ppc32'; + case 'x64': + return 'amd64'; + default: + return nodeArchString; + } +}; +exports.normalizeArch = normalizeArch; +const normalizeType = (nodePlatform) => { + // Maps from https://nodejs.org/api/os.html#osplatform to arch values in spec: + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/os.md + switch (nodePlatform) { + case 'sunos': + return 'solaris'; + case 'win32': + return 'windows'; + default: + return nodePlatform; + } +}; +exports.normalizeType = normalizeType; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 32972: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.detectResources = exports.detectResourcesSync = exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = exports.envDetectorSync = exports.envDetector = exports.browserDetectorSync = exports.browserDetector = exports.defaultServiceName = exports.Resource = void 0; +var Resource_1 = __nccwpck_require__(89973); +Object.defineProperty(exports, "Resource", ({ enumerable: true, get: function () { return Resource_1.Resource; } })); +var platform_1 = __nccwpck_require__(63669); +Object.defineProperty(exports, "defaultServiceName", ({ enumerable: true, get: function () { return platform_1.defaultServiceName; } })); +var detectors_1 = __nccwpck_require__(50622); +Object.defineProperty(exports, "browserDetector", ({ enumerable: true, get: function () { return detectors_1.browserDetector; } })); +Object.defineProperty(exports, "browserDetectorSync", ({ enumerable: true, get: function () { return detectors_1.browserDetectorSync; } })); +Object.defineProperty(exports, "envDetector", ({ enumerable: true, get: function () { return detectors_1.envDetector; } })); +Object.defineProperty(exports, "envDetectorSync", ({ enumerable: true, get: function () { return detectors_1.envDetectorSync; } })); +Object.defineProperty(exports, "hostDetector", ({ enumerable: true, get: function () { return detectors_1.hostDetector; } })); +Object.defineProperty(exports, "hostDetectorSync", ({ enumerable: true, get: function () { return detectors_1.hostDetectorSync; } })); +Object.defineProperty(exports, "osDetector", ({ enumerable: true, get: function () { return detectors_1.osDetector; } })); +Object.defineProperty(exports, "osDetectorSync", ({ enumerable: true, get: function () { return detectors_1.osDetectorSync; } })); +Object.defineProperty(exports, "processDetector", ({ enumerable: true, get: function () { return detectors_1.processDetector; } })); +Object.defineProperty(exports, "processDetectorSync", ({ enumerable: true, get: function () { return detectors_1.processDetectorSync; } })); +Object.defineProperty(exports, "serviceInstanceIdDetectorSync", ({ enumerable: true, get: function () { return detectors_1.serviceInstanceIdDetectorSync; } })); +var detect_resources_1 = __nccwpck_require__(89224); +Object.defineProperty(exports, "detectResourcesSync", ({ enumerable: true, get: function () { return detect_resources_1.detectResourcesSync; } })); +Object.defineProperty(exports, "detectResources", ({ enumerable: true, get: function () { return detect_resources_1.detectResources; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 63669: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.defaultServiceName = void 0; +var node_1 = __nccwpck_require__(82491); +Object.defineProperty(exports, "defaultServiceName", ({ enumerable: true, get: function () { return node_1.defaultServiceName; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 82157: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.defaultServiceName = void 0; +function defaultServiceName() { + return `unknown_service:${process.argv0}`; +} +exports.defaultServiceName = defaultServiceName; +//# sourceMappingURL=default-service-name.js.map + +/***/ }), + +/***/ 82491: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.defaultServiceName = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var default_service_name_1 = __nccwpck_require__(82157); +Object.defineProperty(exports, "defaultServiceName", ({ enumerable: true, get: function () { return default_service_name_1.defaultServiceName; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 76620: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isPromiseLike = void 0; +const isPromiseLike = (val) => { + return (val !== null && typeof val === 'object' && typeof val.then === 'function'); +}; +exports.isPromiseLike = isPromiseLike; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 83795: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BasicTracerProvider = exports.ForceFlushState = void 0; +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(89736); +const resources_1 = __nccwpck_require__(32972); +const Tracer_1 = __nccwpck_require__(8914); +const config_1 = __nccwpck_require__(90897); +const MultiSpanProcessor_1 = __nccwpck_require__(49060); +const NoopSpanProcessor_1 = __nccwpck_require__(36280); +const platform_1 = __nccwpck_require__(85583); +const utility_1 = __nccwpck_require__(44636); +var ForceFlushState; +(function (ForceFlushState) { + ForceFlushState[ForceFlushState["resolved"] = 0] = "resolved"; + ForceFlushState[ForceFlushState["timeout"] = 1] = "timeout"; + ForceFlushState[ForceFlushState["error"] = 2] = "error"; + ForceFlushState[ForceFlushState["unresolved"] = 3] = "unresolved"; +})(ForceFlushState = exports.ForceFlushState || (exports.ForceFlushState = {})); +/** + * This class represents a basic tracer provider which platform libraries can extend + */ +class BasicTracerProvider { + constructor(config = {}) { + var _a, _b; + this._registeredSpanProcessors = []; + this._tracers = new Map(); + const mergedConfig = (0, core_1.merge)({}, (0, config_1.loadDefaultConfig)(), (0, utility_1.reconfigureLimits)(config)); + this.resource = (_a = mergedConfig.resource) !== null && _a !== void 0 ? _a : resources_1.Resource.empty(); + if (mergedConfig.mergeResourceWithDefaults) { + this.resource = resources_1.Resource.default().merge(this.resource); + } + this._config = Object.assign({}, mergedConfig, { + resource: this.resource, + }); + if ((_b = config.spanProcessors) === null || _b === void 0 ? void 0 : _b.length) { + this._registeredSpanProcessors = [...config.spanProcessors]; + this.activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(this._registeredSpanProcessors); + } + else { + const defaultExporter = this._buildExporterFromEnv(); + if (defaultExporter !== undefined) { + const batchProcessor = new platform_1.BatchSpanProcessor(defaultExporter); + this.activeSpanProcessor = batchProcessor; + } + else { + this.activeSpanProcessor = new NoopSpanProcessor_1.NoopSpanProcessor(); + } + } + } + getTracer(name, version, options) { + const key = `${name}@${version || ''}:${(options === null || options === void 0 ? void 0 : options.schemaUrl) || ''}`; + if (!this._tracers.has(key)) { + this._tracers.set(key, new Tracer_1.Tracer({ name, version, schemaUrl: options === null || options === void 0 ? void 0 : options.schemaUrl }, this._config, this)); + } + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return this._tracers.get(key); + } + /** + * @deprecated please use {@link TracerConfig} spanProcessors property + * Adds a new {@link SpanProcessor} to this tracer. + * @param spanProcessor the new SpanProcessor to be added. + */ + addSpanProcessor(spanProcessor) { + if (this._registeredSpanProcessors.length === 0) { + // since we might have enabled by default a batchProcessor, we disable it + // before adding the new one + this.activeSpanProcessor + .shutdown() + .catch(err => api_1.diag.error('Error while trying to shutdown current span processor', err)); + } + this._registeredSpanProcessors.push(spanProcessor); + this.activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(this._registeredSpanProcessors); + } + getActiveSpanProcessor() { + return this.activeSpanProcessor; + } + /** + * Register this TracerProvider for use with the OpenTelemetry API. + * Undefined values may be replaced with defaults, and + * null values will be skipped. + * + * @param config Configuration object for SDK registration + */ + register(config = {}) { + api_1.trace.setGlobalTracerProvider(this); + if (config.propagator === undefined) { + config.propagator = this._buildPropagatorFromEnv(); + } + if (config.contextManager) { + api_1.context.setGlobalContextManager(config.contextManager); + } + if (config.propagator) { + api_1.propagation.setGlobalPropagator(config.propagator); + } + } + forceFlush() { + const timeout = this._config.forceFlushTimeoutMillis; + const promises = this._registeredSpanProcessors.map((spanProcessor) => { + return new Promise(resolve => { + let state; + const timeoutInterval = setTimeout(() => { + resolve(new Error(`Span processor did not completed within timeout period of ${timeout} ms`)); + state = ForceFlushState.timeout; + }, timeout); + spanProcessor + .forceFlush() + .then(() => { + clearTimeout(timeoutInterval); + if (state !== ForceFlushState.timeout) { + state = ForceFlushState.resolved; + resolve(state); + } + }) + .catch(error => { + clearTimeout(timeoutInterval); + state = ForceFlushState.error; + resolve(error); + }); + }); + }); + return new Promise((resolve, reject) => { + Promise.all(promises) + .then(results => { + const errors = results.filter(result => result !== ForceFlushState.resolved); + if (errors.length > 0) { + reject(errors); + } + else { + resolve(); + } + }) + .catch(error => reject([error])); + }); + } + shutdown() { + return this.activeSpanProcessor.shutdown(); + } + /** + * TS cannot yet infer the type of this.constructor: + * https://github.com/Microsoft/TypeScript/issues/3841#issuecomment-337560146 + * There is no need to override either of the getters in your child class. + * The type of the registered component maps should be the same across all + * classes in the inheritance tree. + */ + _getPropagator(name) { + var _a; + return (_a = this.constructor._registeredPropagators.get(name)) === null || _a === void 0 ? void 0 : _a(); + } + _getSpanExporter(name) { + var _a; + return (_a = this.constructor._registeredExporters.get(name)) === null || _a === void 0 ? void 0 : _a(); + } + _buildPropagatorFromEnv() { + // per spec, propagators from env must be deduplicated + const uniquePropagatorNames = Array.from(new Set((0, core_1.getEnv)().OTEL_PROPAGATORS)); + const propagators = uniquePropagatorNames.map(name => { + const propagator = this._getPropagator(name); + if (!propagator) { + api_1.diag.warn(`Propagator "${name}" requested through environment variable is unavailable.`); + } + return propagator; + }); + const validPropagators = propagators.reduce((list, item) => { + if (item) { + list.push(item); + } + return list; + }, []); + if (validPropagators.length === 0) { + return; + } + else if (uniquePropagatorNames.length === 1) { + return validPropagators[0]; + } + else { + return new core_1.CompositePropagator({ + propagators: validPropagators, + }); + } + } + _buildExporterFromEnv() { + const exporterName = (0, core_1.getEnv)().OTEL_TRACES_EXPORTER; + if (exporterName === 'none' || exporterName === '') + return; + const exporter = this._getSpanExporter(exporterName); + if (!exporter) { + api_1.diag.error(`Exporter "${exporterName}" requested through environment variable is unavailable.`); + } + return exporter; + } +} +exports.BasicTracerProvider = BasicTracerProvider; +BasicTracerProvider._registeredPropagators = new Map([ + ['tracecontext', () => new core_1.W3CTraceContextPropagator()], + ['baggage', () => new core_1.W3CBaggagePropagator()], +]); +BasicTracerProvider._registeredExporters = new Map(); +//# sourceMappingURL=BasicTracerProvider.js.map + +/***/ }), + +/***/ 49060: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MultiSpanProcessor = void 0; +const core_1 = __nccwpck_require__(89736); +/** + * Implementation of the {@link SpanProcessor} that simply forwards all + * received events to a list of {@link SpanProcessor}s. + */ +class MultiSpanProcessor { + constructor(_spanProcessors) { + this._spanProcessors = _spanProcessors; + } + forceFlush() { + const promises = []; + for (const spanProcessor of this._spanProcessors) { + promises.push(spanProcessor.forceFlush()); + } + return new Promise(resolve => { + Promise.all(promises) + .then(() => { + resolve(); + }) + .catch(error => { + (0, core_1.globalErrorHandler)(error || new Error('MultiSpanProcessor: forceFlush failed')); + resolve(); + }); + }); + } + onStart(span, context) { + for (const spanProcessor of this._spanProcessors) { + spanProcessor.onStart(span, context); + } + } + onEnd(span) { + for (const spanProcessor of this._spanProcessors) { + spanProcessor.onEnd(span); + } + } + shutdown() { + const promises = []; + for (const spanProcessor of this._spanProcessors) { + promises.push(spanProcessor.shutdown()); + } + return new Promise((resolve, reject) => { + Promise.all(promises).then(() => { + resolve(); + }, reject); + }); + } +} +exports.MultiSpanProcessor = MultiSpanProcessor; +//# sourceMappingURL=MultiSpanProcessor.js.map + +/***/ }), + +/***/ 89427: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SamplingDecision = void 0; +/** + * A sampling decision that determines how a {@link Span} will be recorded + * and collected. + */ +var SamplingDecision; +(function (SamplingDecision) { + /** + * `Span.isRecording() === false`, span will not be recorded and all events + * and attributes will be dropped. + */ + SamplingDecision[SamplingDecision["NOT_RECORD"] = 0] = "NOT_RECORD"; + /** + * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags} + * MUST NOT be set. + */ + SamplingDecision[SamplingDecision["RECORD"] = 1] = "RECORD"; + /** + * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags} + * MUST be set. + */ + SamplingDecision[SamplingDecision["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; +})(SamplingDecision = exports.SamplingDecision || (exports.SamplingDecision = {})); +//# sourceMappingURL=Sampler.js.map + +/***/ }), + +/***/ 49837: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Span = void 0; +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(89736); +const semantic_conventions_1 = __nccwpck_require__(67275); +const enums_1 = __nccwpck_require__(94962); +/** + * This class represents a span. + */ +class Span { + /** + * Constructs a new Span instance. + * + * @deprecated calling Span constructor directly is not supported. Please use tracer.startSpan. + * */ + constructor(parentTracer, context, spanName, spanContext, kind, parentSpanId, links = [], startTime, _deprecatedClock, // keeping this argument even though it is unused to ensure backwards compatibility + attributes) { + this.attributes = {}; + this.links = []; + this.events = []; + this._droppedAttributesCount = 0; + this._droppedEventsCount = 0; + this._droppedLinksCount = 0; + this.status = { + code: api_1.SpanStatusCode.UNSET, + }; + this.endTime = [0, 0]; + this._ended = false; + this._duration = [-1, -1]; + this.name = spanName; + this._spanContext = spanContext; + this.parentSpanId = parentSpanId; + this.kind = kind; + this.links = links; + const now = Date.now(); + this._performanceStartTime = core_1.otperformance.now(); + this._performanceOffset = + now - (this._performanceStartTime + (0, core_1.getTimeOrigin)()); + this._startTimeProvided = startTime != null; + this.startTime = this._getTime(startTime !== null && startTime !== void 0 ? startTime : now); + this.resource = parentTracer.resource; + this.instrumentationLibrary = parentTracer.instrumentationLibrary; + this._spanLimits = parentTracer.getSpanLimits(); + this._attributeValueLengthLimit = + this._spanLimits.attributeValueLengthLimit || 0; + if (attributes != null) { + this.setAttributes(attributes); + } + this._spanProcessor = parentTracer.getActiveSpanProcessor(); + this._spanProcessor.onStart(this, context); + } + spanContext() { + return this._spanContext; + } + setAttribute(key, value) { + if (value == null || this._isSpanEnded()) + return this; + if (key.length === 0) { + api_1.diag.warn(`Invalid attribute key: ${key}`); + return this; + } + if (!(0, core_1.isAttributeValue)(value)) { + api_1.diag.warn(`Invalid attribute value set for key: ${key}`); + return this; + } + if (Object.keys(this.attributes).length >= + this._spanLimits.attributeCountLimit && + !Object.prototype.hasOwnProperty.call(this.attributes, key)) { + this._droppedAttributesCount++; + return this; + } + this.attributes[key] = this._truncateToSize(value); + return this; + } + setAttributes(attributes) { + for (const [k, v] of Object.entries(attributes)) { + this.setAttribute(k, v); + } + return this; + } + /** + * + * @param name Span Name + * @param [attributesOrStartTime] Span attributes or start time + * if type is {@type TimeInput} and 3rd param is undefined + * @param [timeStamp] Specified time stamp for the event + */ + addEvent(name, attributesOrStartTime, timeStamp) { + if (this._isSpanEnded()) + return this; + if (this._spanLimits.eventCountLimit === 0) { + api_1.diag.warn('No events allowed.'); + this._droppedEventsCount++; + return this; + } + if (this.events.length >= this._spanLimits.eventCountLimit) { + if (this._droppedEventsCount === 0) { + api_1.diag.debug('Dropping extra events.'); + } + this.events.shift(); + this._droppedEventsCount++; + } + if ((0, core_1.isTimeInput)(attributesOrStartTime)) { + if (!(0, core_1.isTimeInput)(timeStamp)) { + timeStamp = attributesOrStartTime; + } + attributesOrStartTime = undefined; + } + const attributes = (0, core_1.sanitizeAttributes)(attributesOrStartTime); + this.events.push({ + name, + attributes, + time: this._getTime(timeStamp), + droppedAttributesCount: 0, + }); + return this; + } + addLink(link) { + this.links.push(link); + return this; + } + addLinks(links) { + this.links.push(...links); + return this; + } + setStatus(status) { + if (this._isSpanEnded()) + return this; + this.status = Object.assign({}, status); + // When using try-catch, the caught "error" is of type `any`. When then assigning `any` to `status.message`, + // TypeScript will not error. While this can happen during use of any API, it is more common on Span#setStatus() + // as it's likely used in a catch-block. Therefore, we validate if `status.message` is actually a string, null, or + // undefined to avoid an incorrect type causing issues downstream. + if (this.status.message != null && typeof status.message !== 'string') { + api_1.diag.warn(`Dropping invalid status.message of type '${typeof status.message}', expected 'string'`); + delete this.status.message; + } + return this; + } + updateName(name) { + if (this._isSpanEnded()) + return this; + this.name = name; + return this; + } + end(endTime) { + if (this._isSpanEnded()) { + api_1.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`); + return; + } + this._ended = true; + this.endTime = this._getTime(endTime); + this._duration = (0, core_1.hrTimeDuration)(this.startTime, this.endTime); + if (this._duration[0] < 0) { + api_1.diag.warn('Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.', this.startTime, this.endTime); + this.endTime = this.startTime.slice(); + this._duration = [0, 0]; + } + if (this._droppedEventsCount > 0) { + api_1.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`); + } + this._spanProcessor.onEnd(this); + } + _getTime(inp) { + if (typeof inp === 'number' && inp <= core_1.otperformance.now()) { + // must be a performance timestamp + // apply correction and convert to hrtime + return (0, core_1.hrTime)(inp + this._performanceOffset); + } + if (typeof inp === 'number') { + return (0, core_1.millisToHrTime)(inp); + } + if (inp instanceof Date) { + return (0, core_1.millisToHrTime)(inp.getTime()); + } + if ((0, core_1.isTimeInputHrTime)(inp)) { + return inp; + } + if (this._startTimeProvided) { + // if user provided a time for the start manually + // we can't use duration to calculate event/end times + return (0, core_1.millisToHrTime)(Date.now()); + } + const msDuration = core_1.otperformance.now() - this._performanceStartTime; + return (0, core_1.addHrTimes)(this.startTime, (0, core_1.millisToHrTime)(msDuration)); + } + isRecording() { + return this._ended === false; + } + recordException(exception, time) { + const attributes = {}; + if (typeof exception === 'string') { + attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_MESSAGE] = exception; + } + else if (exception) { + if (exception.code) { + attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_TYPE] = exception.code.toString(); + } + else if (exception.name) { + attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_TYPE] = exception.name; + } + if (exception.message) { + attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_MESSAGE] = exception.message; + } + if (exception.stack) { + attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_STACKTRACE] = exception.stack; + } + } + // these are minimum requirements from spec + if (attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_TYPE] || + attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_MESSAGE]) { + this.addEvent(enums_1.ExceptionEventName, attributes, time); + } + else { + api_1.diag.warn(`Failed to record an exception ${exception}`); + } + } + get duration() { + return this._duration; + } + get ended() { + return this._ended; + } + get droppedAttributesCount() { + return this._droppedAttributesCount; + } + get droppedEventsCount() { + return this._droppedEventsCount; + } + get droppedLinksCount() { + return this._droppedLinksCount; + } + _isSpanEnded() { + if (this._ended) { + api_1.diag.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`); + } + return this._ended; + } + // Utility function to truncate given value within size + // for value type of string, will truncate to given limit + // for type of non-string, will return same value + _truncateToLimitUtil(value, limit) { + if (value.length <= limit) { + return value; + } + return value.substring(0, limit); + } + /** + * If the given attribute value is of type string and has more characters than given {@code attributeValueLengthLimit} then + * return string with truncated to {@code attributeValueLengthLimit} characters + * + * If the given attribute value is array of strings then + * return new array of strings with each element truncated to {@code attributeValueLengthLimit} characters + * + * Otherwise return same Attribute {@code value} + * + * @param value Attribute value + * @returns truncated attribute value if required, otherwise same value + */ + _truncateToSize(value) { + const limit = this._attributeValueLengthLimit; + // Check limit + if (limit <= 0) { + // Negative values are invalid, so do not truncate + api_1.diag.warn(`Attribute value limit must be positive, got ${limit}`); + return value; + } + // String + if (typeof value === 'string') { + return this._truncateToLimitUtil(value, limit); + } + // Array of strings + if (Array.isArray(value)) { + return value.map(val => typeof val === 'string' ? this._truncateToLimitUtil(val, limit) : val); + } + // Other types, no need to apply value length limit + return value; + } +} +exports.Span = Span; +//# sourceMappingURL=Span.js.map + +/***/ }), + +/***/ 8914: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Tracer = void 0; +const api = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(89736); +const Span_1 = __nccwpck_require__(49837); +const utility_1 = __nccwpck_require__(44636); +const platform_1 = __nccwpck_require__(85583); +/** + * This class represents a basic tracer. + */ +class Tracer { + /** + * Constructs a new Tracer instance. + */ + constructor(instrumentationLibrary, config, _tracerProvider) { + this._tracerProvider = _tracerProvider; + const localConfig = (0, utility_1.mergeConfig)(config); + this._sampler = localConfig.sampler; + this._generalLimits = localConfig.generalLimits; + this._spanLimits = localConfig.spanLimits; + this._idGenerator = config.idGenerator || new platform_1.RandomIdGenerator(); + this.resource = _tracerProvider.resource; + this.instrumentationLibrary = instrumentationLibrary; + } + /** + * Starts a new Span or returns the default NoopSpan based on the sampling + * decision. + */ + startSpan(name, options = {}, context = api.context.active()) { + var _a, _b, _c; + // remove span from context in case a root span is requested via options + if (options.root) { + context = api.trace.deleteSpan(context); + } + const parentSpan = api.trace.getSpan(context); + if ((0, core_1.isTracingSuppressed)(context)) { + api.diag.debug('Instrumentation suppressed, returning Noop Span'); + const nonRecordingSpan = api.trace.wrapSpanContext(api.INVALID_SPAN_CONTEXT); + return nonRecordingSpan; + } + const parentSpanContext = parentSpan === null || parentSpan === void 0 ? void 0 : parentSpan.spanContext(); + const spanId = this._idGenerator.generateSpanId(); + let traceId; + let traceState; + let parentSpanId; + if (!parentSpanContext || + !api.trace.isSpanContextValid(parentSpanContext)) { + // New root span. + traceId = this._idGenerator.generateTraceId(); + } + else { + // New child span. + traceId = parentSpanContext.traceId; + traceState = parentSpanContext.traceState; + parentSpanId = parentSpanContext.spanId; + } + const spanKind = (_a = options.kind) !== null && _a !== void 0 ? _a : api.SpanKind.INTERNAL; + const links = ((_b = options.links) !== null && _b !== void 0 ? _b : []).map(link => { + return { + context: link.context, + attributes: (0, core_1.sanitizeAttributes)(link.attributes), + }; + }); + const attributes = (0, core_1.sanitizeAttributes)(options.attributes); + // make sampling decision + const samplingResult = this._sampler.shouldSample(context, traceId, name, spanKind, attributes, links); + traceState = (_c = samplingResult.traceState) !== null && _c !== void 0 ? _c : traceState; + const traceFlags = samplingResult.decision === api.SamplingDecision.RECORD_AND_SAMPLED + ? api.TraceFlags.SAMPLED + : api.TraceFlags.NONE; + const spanContext = { traceId, spanId, traceFlags, traceState }; + if (samplingResult.decision === api.SamplingDecision.NOT_RECORD) { + api.diag.debug('Recording is off, propagating context in a non-recording span'); + const nonRecordingSpan = api.trace.wrapSpanContext(spanContext); + return nonRecordingSpan; + } + // Set initial span attributes. The attributes object may have been mutated + // by the sampler, so we sanitize the merged attributes before setting them. + const initAttributes = (0, core_1.sanitizeAttributes)(Object.assign(attributes, samplingResult.attributes)); + const span = new Span_1.Span(this, context, name, spanContext, spanKind, parentSpanId, links, options.startTime, undefined, initAttributes); + return span; + } + startActiveSpan(name, arg2, arg3, arg4) { + let opts; + let ctx; + let fn; + if (arguments.length < 2) { + return; + } + else if (arguments.length === 2) { + fn = arg2; + } + else if (arguments.length === 3) { + opts = arg2; + fn = arg3; + } + else { + opts = arg2; + ctx = arg3; + fn = arg4; + } + const parentContext = ctx !== null && ctx !== void 0 ? ctx : api.context.active(); + const span = this.startSpan(name, opts, parentContext); + const contextWithSpanSet = api.trace.setSpan(parentContext, span); + return api.context.with(contextWithSpanSet, fn, undefined, span); + } + /** Returns the active {@link GeneralLimits}. */ + getGeneralLimits() { + return this._generalLimits; + } + /** Returns the active {@link SpanLimits}. */ + getSpanLimits() { + return this._spanLimits; + } + getActiveSpanProcessor() { + return this._tracerProvider.getActiveSpanProcessor(); + } +} +exports.Tracer = Tracer; +//# sourceMappingURL=Tracer.js.map + +/***/ }), + +/***/ 90897: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.buildSamplerFromEnv = exports.loadDefaultConfig = void 0; +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(89736); +const AlwaysOffSampler_1 = __nccwpck_require__(30524); +const AlwaysOnSampler_1 = __nccwpck_require__(37870); +const ParentBasedSampler_1 = __nccwpck_require__(91943); +const TraceIdRatioBasedSampler_1 = __nccwpck_require__(5791); +const FALLBACK_OTEL_TRACES_SAMPLER = core_1.TracesSamplerValues.AlwaysOn; +const DEFAULT_RATIO = 1; +/** + * Load default configuration. For fields with primitive values, any user-provided + * value will override the corresponding default value. For fields with + * non-primitive values (like `spanLimits`), the user-provided value will be + * used to extend the default value. + */ +// object needs to be wrapped in this function and called when needed otherwise +// envs are parsed before tests are ran - causes tests using these envs to fail +function loadDefaultConfig() { + const env = (0, core_1.getEnv)(); + return { + sampler: buildSamplerFromEnv(env), + forceFlushTimeoutMillis: 30000, + generalLimits: { + attributeValueLengthLimit: env.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT, + attributeCountLimit: env.OTEL_ATTRIBUTE_COUNT_LIMIT, + }, + spanLimits: { + attributeValueLengthLimit: env.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, + attributeCountLimit: env.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, + linkCountLimit: env.OTEL_SPAN_LINK_COUNT_LIMIT, + eventCountLimit: env.OTEL_SPAN_EVENT_COUNT_LIMIT, + attributePerEventCountLimit: env.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, + attributePerLinkCountLimit: env.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT, + }, + mergeResourceWithDefaults: true, + }; +} +exports.loadDefaultConfig = loadDefaultConfig; +/** + * Based on environment, builds a sampler, complies with specification. + * @param environment optional, by default uses getEnv(), but allows passing a value to reuse parsed environment + */ +function buildSamplerFromEnv(environment = (0, core_1.getEnv)()) { + switch (environment.OTEL_TRACES_SAMPLER) { + case core_1.TracesSamplerValues.AlwaysOn: + return new AlwaysOnSampler_1.AlwaysOnSampler(); + case core_1.TracesSamplerValues.AlwaysOff: + return new AlwaysOffSampler_1.AlwaysOffSampler(); + case core_1.TracesSamplerValues.ParentBasedAlwaysOn: + return new ParentBasedSampler_1.ParentBasedSampler({ + root: new AlwaysOnSampler_1.AlwaysOnSampler(), + }); + case core_1.TracesSamplerValues.ParentBasedAlwaysOff: + return new ParentBasedSampler_1.ParentBasedSampler({ + root: new AlwaysOffSampler_1.AlwaysOffSampler(), + }); + case core_1.TracesSamplerValues.TraceIdRatio: + return new TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(environment)); + case core_1.TracesSamplerValues.ParentBasedTraceIdRatio: + return new ParentBasedSampler_1.ParentBasedSampler({ + root: new TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(environment)), + }); + default: + api_1.diag.error(`OTEL_TRACES_SAMPLER value "${environment.OTEL_TRACES_SAMPLER} invalid, defaulting to ${FALLBACK_OTEL_TRACES_SAMPLER}".`); + return new AlwaysOnSampler_1.AlwaysOnSampler(); + } +} +exports.buildSamplerFromEnv = buildSamplerFromEnv; +function getSamplerProbabilityFromEnv(environment) { + if (environment.OTEL_TRACES_SAMPLER_ARG === undefined || + environment.OTEL_TRACES_SAMPLER_ARG === '') { + api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${DEFAULT_RATIO}.`); + return DEFAULT_RATIO; + } + const probability = Number(environment.OTEL_TRACES_SAMPLER_ARG); + if (isNaN(probability)) { + api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${environment.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${DEFAULT_RATIO}.`); + return DEFAULT_RATIO; + } + if (probability < 0 || probability > 1) { + api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${environment.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${DEFAULT_RATIO}.`); + return DEFAULT_RATIO; + } + return probability; +} +//# sourceMappingURL=config.js.map + +/***/ }), + +/***/ 94962: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ExceptionEventName = void 0; +// Event name definitions +exports.ExceptionEventName = 'exception'; +//# sourceMappingURL=enums.js.map + +/***/ }), + +/***/ 4647: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BatchSpanProcessorBase = void 0; +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(89736); +/** + * Implementation of the {@link SpanProcessor} that batches spans exported by + * the SDK then pushes them to the exporter pipeline. + */ +class BatchSpanProcessorBase { + constructor(_exporter, config) { + this._exporter = _exporter; + this._isExporting = false; + this._finishedSpans = []; + this._droppedSpansCount = 0; + const env = (0, core_1.getEnv)(); + this._maxExportBatchSize = + typeof (config === null || config === void 0 ? void 0 : config.maxExportBatchSize) === 'number' + ? config.maxExportBatchSize + : env.OTEL_BSP_MAX_EXPORT_BATCH_SIZE; + this._maxQueueSize = + typeof (config === null || config === void 0 ? void 0 : config.maxQueueSize) === 'number' + ? config.maxQueueSize + : env.OTEL_BSP_MAX_QUEUE_SIZE; + this._scheduledDelayMillis = + typeof (config === null || config === void 0 ? void 0 : config.scheduledDelayMillis) === 'number' + ? config.scheduledDelayMillis + : env.OTEL_BSP_SCHEDULE_DELAY; + this._exportTimeoutMillis = + typeof (config === null || config === void 0 ? void 0 : config.exportTimeoutMillis) === 'number' + ? config.exportTimeoutMillis + : env.OTEL_BSP_EXPORT_TIMEOUT; + this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); + if (this._maxExportBatchSize > this._maxQueueSize) { + api_1.diag.warn('BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize'); + this._maxExportBatchSize = this._maxQueueSize; + } + } + forceFlush() { + if (this._shutdownOnce.isCalled) { + return this._shutdownOnce.promise; + } + return this._flushAll(); + } + // does nothing. + onStart(_span, _parentContext) { } + onEnd(span) { + if (this._shutdownOnce.isCalled) { + return; + } + if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) { + return; + } + this._addToBuffer(span); + } + shutdown() { + return this._shutdownOnce.call(); + } + _shutdown() { + return Promise.resolve() + .then(() => { + return this.onShutdown(); + }) + .then(() => { + return this._flushAll(); + }) + .then(() => { + return this._exporter.shutdown(); + }); + } + /** Add a span in the buffer. */ + _addToBuffer(span) { + if (this._finishedSpans.length >= this._maxQueueSize) { + // limit reached, drop span + if (this._droppedSpansCount === 0) { + api_1.diag.debug('maxQueueSize reached, dropping spans'); + } + this._droppedSpansCount++; + return; + } + if (this._droppedSpansCount > 0) { + // some spans were dropped, log once with count of spans dropped + api_1.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`); + this._droppedSpansCount = 0; + } + this._finishedSpans.push(span); + this._maybeStartTimer(); + } + /** + * Send all spans to the exporter respecting the batch size limit + * This function is used only on forceFlush or shutdown, + * for all other cases _flush should be used + * */ + _flushAll() { + return new Promise((resolve, reject) => { + const promises = []; + // calculate number of batches + const count = Math.ceil(this._finishedSpans.length / this._maxExportBatchSize); + for (let i = 0, j = count; i < j; i++) { + promises.push(this._flushOneBatch()); + } + Promise.all(promises) + .then(() => { + resolve(); + }) + .catch(reject); + }); + } + _flushOneBatch() { + this._clearTimer(); + if (this._finishedSpans.length === 0) { + return Promise.resolve(); + } + return new Promise((resolve, reject) => { + const timer = setTimeout(() => { + // don't wait anymore for export, this way the next batch can start + reject(new Error('Timeout')); + }, this._exportTimeoutMillis); + // prevent downstream exporter calls from generating spans + api_1.context.with((0, core_1.suppressTracing)(api_1.context.active()), () => { + // Reset the finished spans buffer here because the next invocations of the _flush method + // could pass the same finished spans to the exporter if the buffer is cleared + // outside the execution of this callback. + let spans; + if (this._finishedSpans.length <= this._maxExportBatchSize) { + spans = this._finishedSpans; + this._finishedSpans = []; + } + else { + spans = this._finishedSpans.splice(0, this._maxExportBatchSize); + } + const doExport = () => this._exporter.export(spans, result => { + var _a; + clearTimeout(timer); + if (result.code === core_1.ExportResultCode.SUCCESS) { + resolve(); + } + else { + reject((_a = result.error) !== null && _a !== void 0 ? _a : new Error('BatchSpanProcessor: span export failed')); + } + }); + let pendingResources = null; + for (let i = 0, len = spans.length; i < len; i++) { + const span = spans[i]; + if (span.resource.asyncAttributesPending && + span.resource.waitForAsyncAttributes) { + pendingResources !== null && pendingResources !== void 0 ? pendingResources : (pendingResources = []); + pendingResources.push(span.resource.waitForAsyncAttributes()); + } + } + // Avoid scheduling a promise to make the behavior more predictable and easier to test + if (pendingResources === null) { + doExport(); + } + else { + Promise.all(pendingResources).then(doExport, err => { + (0, core_1.globalErrorHandler)(err); + reject(err); + }); + } + }); + }); + } + _maybeStartTimer() { + if (this._isExporting) + return; + const flush = () => { + this._isExporting = true; + this._flushOneBatch() + .finally(() => { + this._isExporting = false; + if (this._finishedSpans.length > 0) { + this._clearTimer(); + this._maybeStartTimer(); + } + }) + .catch(e => { + this._isExporting = false; + (0, core_1.globalErrorHandler)(e); + }); + }; + // we only wait if the queue doesn't have enough elements yet + if (this._finishedSpans.length >= this._maxExportBatchSize) { + return flush(); + } + if (this._timer !== undefined) + return; + this._timer = setTimeout(() => flush(), this._scheduledDelayMillis); + (0, core_1.unrefTimer)(this._timer); + } + _clearTimer() { + if (this._timer !== undefined) { + clearTimeout(this._timer); + this._timer = undefined; + } + } +} +exports.BatchSpanProcessorBase = BatchSpanProcessorBase; +//# sourceMappingURL=BatchSpanProcessorBase.js.map + +/***/ }), + +/***/ 56239: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ConsoleSpanExporter = void 0; +const core_1 = __nccwpck_require__(89736); +/** + * This is implementation of {@link SpanExporter} that prints spans to the + * console. This class can be used for diagnostic purposes. + * + * NOTE: This {@link SpanExporter} is intended for diagnostics use only, output rendered to the console may change at any time. + */ +/* eslint-disable no-console */ +class ConsoleSpanExporter { + /** + * Export spans. + * @param spans + * @param resultCallback + */ + export(spans, resultCallback) { + return this._sendSpans(spans, resultCallback); + } + /** + * Shutdown the exporter. + */ + shutdown() { + this._sendSpans([]); + return this.forceFlush(); + } + /** + * Exports any pending spans in exporter + */ + forceFlush() { + return Promise.resolve(); + } + /** + * converts span info into more readable format + * @param span + */ + _exportInfo(span) { + var _a; + return { + resource: { + attributes: span.resource.attributes, + }, + instrumentationScope: span.instrumentationLibrary, + traceId: span.spanContext().traceId, + parentId: span.parentSpanId, + traceState: (_a = span.spanContext().traceState) === null || _a === void 0 ? void 0 : _a.serialize(), + name: span.name, + id: span.spanContext().spanId, + kind: span.kind, + timestamp: (0, core_1.hrTimeToMicroseconds)(span.startTime), + duration: (0, core_1.hrTimeToMicroseconds)(span.duration), + attributes: span.attributes, + status: span.status, + events: span.events, + links: span.links, + }; + } + /** + * Showing spans in console + * @param spans + * @param done + */ + _sendSpans(spans, done) { + for (const span of spans) { + console.dir(this._exportInfo(span), { depth: 3 }); + } + if (done) { + return done({ code: core_1.ExportResultCode.SUCCESS }); + } + } +} +exports.ConsoleSpanExporter = ConsoleSpanExporter; +//# sourceMappingURL=ConsoleSpanExporter.js.map + +/***/ }), + +/***/ 33505: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.InMemorySpanExporter = void 0; +const core_1 = __nccwpck_require__(89736); +/** + * This class can be used for testing purposes. It stores the exported spans + * in a list in memory that can be retrieved using the `getFinishedSpans()` + * method. + */ +class InMemorySpanExporter { + constructor() { + this._finishedSpans = []; + /** + * Indicates if the exporter has been "shutdown." + * When false, exported spans will not be stored in-memory. + */ + this._stopped = false; + } + export(spans, resultCallback) { + if (this._stopped) + return resultCallback({ + code: core_1.ExportResultCode.FAILED, + error: new Error('Exporter has been stopped'), + }); + this._finishedSpans.push(...spans); + setTimeout(() => resultCallback({ code: core_1.ExportResultCode.SUCCESS }), 0); + } + shutdown() { + this._stopped = true; + this._finishedSpans = []; + return this.forceFlush(); + } + /** + * Exports any pending spans in the exporter + */ + forceFlush() { + return Promise.resolve(); + } + reset() { + this._finishedSpans = []; + } + getFinishedSpans() { + return this._finishedSpans; + } +} +exports.InMemorySpanExporter = InMemorySpanExporter; +//# sourceMappingURL=InMemorySpanExporter.js.map + +/***/ }), + +/***/ 36280: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NoopSpanProcessor = void 0; +/** No-op implementation of SpanProcessor */ +class NoopSpanProcessor { + onStart(_span, _context) { } + onEnd(_span) { } + shutdown() { + return Promise.resolve(); + } + forceFlush() { + return Promise.resolve(); + } +} +exports.NoopSpanProcessor = NoopSpanProcessor; +//# sourceMappingURL=NoopSpanProcessor.js.map + +/***/ }), + +/***/ 20187: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SimpleSpanProcessor = void 0; +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(89736); +/** + * An implementation of the {@link SpanProcessor} that converts the {@link Span} + * to {@link ReadableSpan} and passes it to the configured exporter. + * + * Only spans that are sampled are converted. + * + * 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. + */ +class SimpleSpanProcessor { + constructor(_exporter) { + this._exporter = _exporter; + this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); + this._unresolvedExports = new Set(); + } + async forceFlush() { + // await unresolved resources before resolving + await Promise.all(Array.from(this._unresolvedExports)); + if (this._exporter.forceFlush) { + await this._exporter.forceFlush(); + } + } + onStart(_span, _parentContext) { } + onEnd(span) { + var _a, _b; + if (this._shutdownOnce.isCalled) { + return; + } + if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) { + return; + } + const doExport = () => core_1.internal + ._export(this._exporter, [span]) + .then((result) => { + var _a; + if (result.code !== core_1.ExportResultCode.SUCCESS) { + (0, core_1.globalErrorHandler)((_a = result.error) !== null && _a !== void 0 ? _a : new Error(`SimpleSpanProcessor: span export failed (status ${result})`)); + } + }) + .catch(error => { + (0, core_1.globalErrorHandler)(error); + }); + // Avoid scheduling a promise to make the behavior more predictable and easier to test + if (span.resource.asyncAttributesPending) { + const exportPromise = (_b = (_a = span.resource).waitForAsyncAttributes) === null || _b === void 0 ? void 0 : _b.call(_a).then(() => { + if (exportPromise != null) { + this._unresolvedExports.delete(exportPromise); + } + return doExport(); + }, err => (0, core_1.globalErrorHandler)(err)); + // store the unresolved exports + if (exportPromise != null) { + this._unresolvedExports.add(exportPromise); + } + } + else { + void doExport(); + } + } + shutdown() { + return this._shutdownOnce.call(); + } + _shutdown() { + return this._exporter.shutdown(); + } +} +exports.SimpleSpanProcessor = SimpleSpanProcessor; +//# sourceMappingURL=SimpleSpanProcessor.js.map + +/***/ }), + +/***/ 67030: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Span = exports.SamplingDecision = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.NoopSpanProcessor = exports.SimpleSpanProcessor = exports.InMemorySpanExporter = exports.ConsoleSpanExporter = exports.RandomIdGenerator = exports.BatchSpanProcessor = exports.ForceFlushState = exports.BasicTracerProvider = exports.Tracer = void 0; +var Tracer_1 = __nccwpck_require__(8914); +Object.defineProperty(exports, "Tracer", ({ enumerable: true, get: function () { return Tracer_1.Tracer; } })); +var BasicTracerProvider_1 = __nccwpck_require__(83795); +Object.defineProperty(exports, "BasicTracerProvider", ({ enumerable: true, get: function () { return BasicTracerProvider_1.BasicTracerProvider; } })); +Object.defineProperty(exports, "ForceFlushState", ({ enumerable: true, get: function () { return BasicTracerProvider_1.ForceFlushState; } })); +var platform_1 = __nccwpck_require__(85583); +Object.defineProperty(exports, "BatchSpanProcessor", ({ enumerable: true, get: function () { return platform_1.BatchSpanProcessor; } })); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return platform_1.RandomIdGenerator; } })); +var ConsoleSpanExporter_1 = __nccwpck_require__(56239); +Object.defineProperty(exports, "ConsoleSpanExporter", ({ enumerable: true, get: function () { return ConsoleSpanExporter_1.ConsoleSpanExporter; } })); +var InMemorySpanExporter_1 = __nccwpck_require__(33505); +Object.defineProperty(exports, "InMemorySpanExporter", ({ enumerable: true, get: function () { return InMemorySpanExporter_1.InMemorySpanExporter; } })); +var SimpleSpanProcessor_1 = __nccwpck_require__(20187); +Object.defineProperty(exports, "SimpleSpanProcessor", ({ enumerable: true, get: function () { return SimpleSpanProcessor_1.SimpleSpanProcessor; } })); +var NoopSpanProcessor_1 = __nccwpck_require__(36280); +Object.defineProperty(exports, "NoopSpanProcessor", ({ enumerable: true, get: function () { return NoopSpanProcessor_1.NoopSpanProcessor; } })); +var AlwaysOffSampler_1 = __nccwpck_require__(30524); +Object.defineProperty(exports, "AlwaysOffSampler", ({ enumerable: true, get: function () { return AlwaysOffSampler_1.AlwaysOffSampler; } })); +var AlwaysOnSampler_1 = __nccwpck_require__(37870); +Object.defineProperty(exports, "AlwaysOnSampler", ({ enumerable: true, get: function () { return AlwaysOnSampler_1.AlwaysOnSampler; } })); +var ParentBasedSampler_1 = __nccwpck_require__(91943); +Object.defineProperty(exports, "ParentBasedSampler", ({ enumerable: true, get: function () { return ParentBasedSampler_1.ParentBasedSampler; } })); +var TraceIdRatioBasedSampler_1 = __nccwpck_require__(5791); +Object.defineProperty(exports, "TraceIdRatioBasedSampler", ({ enumerable: true, get: function () { return TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler; } })); +var Sampler_1 = __nccwpck_require__(89427); +Object.defineProperty(exports, "SamplingDecision", ({ enumerable: true, get: function () { return Sampler_1.SamplingDecision; } })); +var Span_1 = __nccwpck_require__(49837); +Object.defineProperty(exports, "Span", ({ enumerable: true, get: function () { return Span_1.Span; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 85583: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RandomIdGenerator = exports.BatchSpanProcessor = void 0; +var node_1 = __nccwpck_require__(2252); +Object.defineProperty(exports, "BatchSpanProcessor", ({ enumerable: true, get: function () { return node_1.BatchSpanProcessor; } })); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return node_1.RandomIdGenerator; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 24010: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RandomIdGenerator = void 0; +const SPAN_ID_BYTES = 8; +const TRACE_ID_BYTES = 16; +class RandomIdGenerator { + constructor() { + /** + * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex + * characters corresponding to 128 bits. + */ + this.generateTraceId = getIdGenerator(TRACE_ID_BYTES); + /** + * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex + * characters corresponding to 64 bits. + */ + this.generateSpanId = getIdGenerator(SPAN_ID_BYTES); + } +} +exports.RandomIdGenerator = RandomIdGenerator; +const SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES); +function getIdGenerator(bytes) { + return function generateId() { + for (let i = 0; i < bytes / 4; i++) { + // unsigned right shift drops decimal part of the number + // it is required because if a number between 2**32 and 2**32 - 1 is generated, an out of range error is thrown by writeUInt32BE + SHARED_BUFFER.writeUInt32BE((Math.random() * 2 ** 32) >>> 0, i * 4); + } + // If buffer is all 0, set the last byte to 1 to guarantee a valid w3c id is generated + for (let i = 0; i < bytes; i++) { + if (SHARED_BUFFER[i] > 0) { + break; + } + else if (i === bytes - 1) { + SHARED_BUFFER[bytes - 1] = 1; + } + } + return SHARED_BUFFER.toString('hex', 0, bytes); + }; +} +//# sourceMappingURL=RandomIdGenerator.js.map + +/***/ }), + +/***/ 63575: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BatchSpanProcessor = void 0; +const BatchSpanProcessorBase_1 = __nccwpck_require__(4647); +class BatchSpanProcessor extends BatchSpanProcessorBase_1.BatchSpanProcessorBase { + onShutdown() { } +} +exports.BatchSpanProcessor = BatchSpanProcessor; +//# sourceMappingURL=BatchSpanProcessor.js.map + +/***/ }), + +/***/ 2252: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RandomIdGenerator = exports.BatchSpanProcessor = void 0; +var BatchSpanProcessor_1 = __nccwpck_require__(63575); +Object.defineProperty(exports, "BatchSpanProcessor", ({ enumerable: true, get: function () { return BatchSpanProcessor_1.BatchSpanProcessor; } })); +var RandomIdGenerator_1 = __nccwpck_require__(24010); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return RandomIdGenerator_1.RandomIdGenerator; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 30524: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AlwaysOffSampler = void 0; +const Sampler_1 = __nccwpck_require__(89427); +/** Sampler that samples no traces. */ +class AlwaysOffSampler { + shouldSample() { + return { + decision: Sampler_1.SamplingDecision.NOT_RECORD, + }; + } + toString() { + return 'AlwaysOffSampler'; + } +} +exports.AlwaysOffSampler = AlwaysOffSampler; +//# sourceMappingURL=AlwaysOffSampler.js.map + +/***/ }), + +/***/ 37870: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AlwaysOnSampler = void 0; +const Sampler_1 = __nccwpck_require__(89427); +/** Sampler that samples all traces. */ +class AlwaysOnSampler { + shouldSample() { + return { + decision: Sampler_1.SamplingDecision.RECORD_AND_SAMPLED, + }; + } + toString() { + return 'AlwaysOnSampler'; + } +} +exports.AlwaysOnSampler = AlwaysOnSampler; +//# sourceMappingURL=AlwaysOnSampler.js.map + +/***/ }), + +/***/ 91943: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ParentBasedSampler = void 0; +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(89736); +const AlwaysOffSampler_1 = __nccwpck_require__(30524); +const AlwaysOnSampler_1 = __nccwpck_require__(37870); +/** + * A composite sampler that either respects the parent span's sampling decision + * or delegates to `delegateSampler` for root spans. + */ +class ParentBasedSampler { + constructor(config) { + var _a, _b, _c, _d; + this._root = config.root; + if (!this._root) { + (0, core_1.globalErrorHandler)(new Error('ParentBasedSampler must have a root sampler configured')); + this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); + } + this._remoteParentSampled = + (_a = config.remoteParentSampled) !== null && _a !== void 0 ? _a : new AlwaysOnSampler_1.AlwaysOnSampler(); + this._remoteParentNotSampled = + (_b = config.remoteParentNotSampled) !== null && _b !== void 0 ? _b : new AlwaysOffSampler_1.AlwaysOffSampler(); + this._localParentSampled = + (_c = config.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler_1.AlwaysOnSampler(); + this._localParentNotSampled = + (_d = config.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler_1.AlwaysOffSampler(); + } + shouldSample(context, traceId, spanName, spanKind, attributes, links) { + const parentContext = api_1.trace.getSpanContext(context); + if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) { + return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.isRemote) { + if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { + return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { + return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + toString() { + return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; + } +} +exports.ParentBasedSampler = ParentBasedSampler; +//# sourceMappingURL=ParentBasedSampler.js.map + +/***/ }), + +/***/ 5791: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TraceIdRatioBasedSampler = void 0; +const api_1 = __nccwpck_require__(65163); +const Sampler_1 = __nccwpck_require__(89427); +/** Sampler that samples a given fraction of traces based of trace id deterministically. */ +class TraceIdRatioBasedSampler { + constructor(_ratio = 0) { + this._ratio = _ratio; + this._ratio = this._normalize(_ratio); + this._upperBound = Math.floor(this._ratio * 0xffffffff); + } + shouldSample(context, traceId) { + return { + decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound + ? Sampler_1.SamplingDecision.RECORD_AND_SAMPLED + : Sampler_1.SamplingDecision.NOT_RECORD, + }; + } + toString() { + return `TraceIdRatioBased{${this._ratio}}`; + } + _normalize(ratio) { + if (typeof ratio !== 'number' || isNaN(ratio)) + return 0; + return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio; + } + _accumulate(traceId) { + let accumulation = 0; + for (let i = 0; i < traceId.length / 8; i++) { + const pos = i * 8; + const part = parseInt(traceId.slice(pos, pos + 8), 16); + accumulation = (accumulation ^ part) >>> 0; + } + return accumulation; + } +} +exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; +//# sourceMappingURL=TraceIdRatioBasedSampler.js.map + +/***/ }), + +/***/ 44636: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.reconfigureLimits = exports.mergeConfig = void 0; +const config_1 = __nccwpck_require__(90897); +const core_1 = __nccwpck_require__(89736); +/** + * Function to merge Default configuration (as specified in './config') with + * user provided configurations. + */ +function mergeConfig(userConfig) { + const perInstanceDefaults = { + sampler: (0, config_1.buildSamplerFromEnv)(), + }; + const DEFAULT_CONFIG = (0, config_1.loadDefaultConfig)(); + const target = Object.assign({}, DEFAULT_CONFIG, perInstanceDefaults, userConfig); + target.generalLimits = Object.assign({}, DEFAULT_CONFIG.generalLimits, userConfig.generalLimits || {}); + target.spanLimits = Object.assign({}, DEFAULT_CONFIG.spanLimits, userConfig.spanLimits || {}); + return target; +} +exports.mergeConfig = mergeConfig; +/** + * When general limits are provided and model specific limits are not, + * configures the model specific limits by using the values from the general ones. + * @param userConfig User provided tracer configuration + */ +function reconfigureLimits(userConfig) { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; + const spanLimits = Object.assign({}, userConfig.spanLimits); + const parsedEnvConfig = (0, core_1.getEnvWithoutDefaults)(); + /** + * Reassign span attribute count limit to use first non null value defined by user or use default value + */ + spanLimits.attributeCountLimit = + (_f = (_e = (_d = (_b = (_a = userConfig.spanLimits) === null || _a === void 0 ? void 0 : _a.attributeCountLimit) !== null && _b !== void 0 ? _b : (_c = userConfig.generalLimits) === null || _c === void 0 ? void 0 : _c.attributeCountLimit) !== null && _d !== void 0 ? _d : parsedEnvConfig.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT) !== null && _e !== void 0 ? _e : parsedEnvConfig.OTEL_ATTRIBUTE_COUNT_LIMIT) !== null && _f !== void 0 ? _f : core_1.DEFAULT_ATTRIBUTE_COUNT_LIMIT; + /** + * Reassign span attribute value length limit to use first non null value defined by user or use default value + */ + spanLimits.attributeValueLengthLimit = + (_m = (_l = (_k = (_h = (_g = userConfig.spanLimits) === null || _g === void 0 ? void 0 : _g.attributeValueLengthLimit) !== null && _h !== void 0 ? _h : (_j = userConfig.generalLimits) === null || _j === void 0 ? void 0 : _j.attributeValueLengthLimit) !== null && _k !== void 0 ? _k : parsedEnvConfig.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT) !== null && _l !== void 0 ? _l : parsedEnvConfig.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT) !== null && _m !== void 0 ? _m : core_1.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; + return Object.assign({}, userConfig, { spanLimits }); +} +exports.reconfigureLimits = reconfigureLimits; +//# sourceMappingURL=utility.js.map + +/***/ }), + +/***/ 20155: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const ANY = Symbol('SemVer ANY') +// hoisted class for cyclic dependency +class Comparator { + static get ANY () { + return ANY + } + + constructor (comp, options) { + options = parseOptions(options) + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } + + comp = comp.trim().split(/\s+/).join(' ') + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) + + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } + + debug('comp', this) + } + + parse (comp) { + const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + const m = comp.match(r) + + if (!m) { + throw new TypeError(`Invalid comparator: ${comp}`) + } + + this.operator = m[1] !== undefined ? m[1] : '' + if (this.operator === '=') { + this.operator = '' + } + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } + } + + toString () { + return this.value + } + + test (version) { + debug('Comparator.test', version, this.options.loose) + + if (this.semver === ANY || version === ANY) { + return true + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + return cmp(version, this.operator, this.semver, this.options) + } + + intersects (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (this.operator === '') { + if (this.value === '') { + return true + } + return new Range(comp.value, options).test(this.value) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + return new Range(this.value, options).test(comp.semver) + } + + options = parseOptions(options) + + // Special cases where nothing can possibly be lower + if (options.includePrerelease && + (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) { + return false + } + if (!options.includePrerelease && + (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) { + return false + } + + // Same direction increasing (> or >=) + if (this.operator.startsWith('>') && comp.operator.startsWith('>')) { + return true + } + // Same direction decreasing (< or <=) + if (this.operator.startsWith('<') && comp.operator.startsWith('<')) { + return true + } + // same SemVer and both sides are inclusive (<= or >=) + if ( + (this.semver.version === comp.semver.version) && + this.operator.includes('=') && comp.operator.includes('=')) { + return true + } + // opposite directions less than + if (cmp(this.semver, '<', comp.semver, options) && + this.operator.startsWith('>') && comp.operator.startsWith('<')) { + return true + } + // opposite directions greater than + if (cmp(this.semver, '>', comp.semver, options) && + this.operator.startsWith('<') && comp.operator.startsWith('>')) { + return true + } + return false + } +} + +module.exports = Comparator + +const parseOptions = __nccwpck_require__(84611) +const { safeRe: re, t } = __nccwpck_require__(57529) +const cmp = __nccwpck_require__(58289) +const debug = __nccwpck_require__(91308) +const SemVer = __nccwpck_require__(11776) +const Range = __nccwpck_require__(32009) + + +/***/ }), + +/***/ 32009: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SPACE_CHARACTERS = /\s+/g + +// hoisted class for cyclic dependency +class Range { + constructor (range, options) { + options = parseOptions(options) + + if (range instanceof Range) { + if ( + range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease + ) { + return range + } else { + return new Range(range.raw, options) + } + } + + if (range instanceof Comparator) { + // just put it in the set and return + this.raw = range.value + this.set = [[range]] + this.formatted = undefined + return this + } + + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease + + // First reduce all whitespace as much as possible so we do not have to rely + // on potentially slow regexes like \s*. This is then stored and used for + // future error messages as well. + this.raw = range.trim().replace(SPACE_CHARACTERS, ' ') + + // First, split on || + this.set = this.raw + .split('||') + // map the range to a 2d array of comparators + .map(r => this.parseRange(r.trim())) + // throw out any comparator lists that are empty + // this generally means that it was not a valid range, which is allowed + // in loose mode, but will still throw if the WHOLE range is invalid. + .filter(c => c.length) + + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${this.raw}`) + } + + // if we have any that are not the null set, throw out null sets. + if (this.set.length > 1) { + // keep the first one, in case they're all null sets + const first = this.set[0] + this.set = this.set.filter(c => !isNullSet(c[0])) + if (this.set.length === 0) { + this.set = [first] + } else if (this.set.length > 1) { + // if we have any that are *, then the range is just * + for (const c of this.set) { + if (c.length === 1 && isAny(c[0])) { + this.set = [c] + break + } + } + } + } + + this.formatted = undefined + } + + get range () { + if (this.formatted === undefined) { + this.formatted = '' + for (let i = 0; i < this.set.length; i++) { + if (i > 0) { + this.formatted += '||' + } + const comps = this.set[i] + for (let k = 0; k < comps.length; k++) { + if (k > 0) { + this.formatted += ' ' + } + this.formatted += comps[k].toString().trim() + } + } + } + return this.formatted + } + + format () { + return this.range + } + + toString () { + return this.range + } + + parseRange (range) { + // memoize range parsing for performance. + // this is a very hot path, and fully deterministic. + const memoOpts = + (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | + (this.options.loose && FLAG_LOOSE) + const memoKey = memoOpts + ':' + range + const cached = cache.get(memoKey) + if (cached) { + return cached + } + + const loose = this.options.loose + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) + debug('hyphen replace', range) + + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range) + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[t.TILDETRIM], tildeTrimReplace) + debug('tilde trim', range) + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[t.CARETTRIM], caretTrimReplace) + debug('caret trim', range) + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + let rangeList = range + .split(' ') + .map(comp => parseComparator(comp, this.options)) + .join(' ') + .split(/\s+/) + // >=0.0.0 is equivalent to * + .map(comp => replaceGTE0(comp, this.options)) + + if (loose) { + // in loose mode, throw out any that are not valid comparators + rangeList = rangeList.filter(comp => { + debug('loose invalid filter', comp, this.options) + return !!comp.match(re[t.COMPARATORLOOSE]) + }) + } + debug('range list', rangeList) + + // if any comparators are the null set, then replace with JUST null set + // if more than one comparator, remove any * comparators + // also, don't include the same comparator more than once + const rangeMap = new Map() + const comparators = rangeList.map(comp => new Comparator(comp, this.options)) + for (const comp of comparators) { + if (isNullSet(comp)) { + return [comp] + } + rangeMap.set(comp.value, comp) + } + if (rangeMap.size > 1 && rangeMap.has('')) { + rangeMap.delete('') + } + + const result = [...rangeMap.values()] + cache.set(memoKey, result) + return result + } + + intersects (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + + return this.set.some((thisComparators) => { + return ( + isSatisfiable(thisComparators, options) && + range.set.some((rangeComparators) => { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) + } + + // if ANY of the sets match ALL of its comparators, then pass + test (version) { + if (!version) { + return false + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false + } +} + +module.exports = Range + +const LRU = __nccwpck_require__(88412) +const cache = new LRU() + +const parseOptions = __nccwpck_require__(84611) +const Comparator = __nccwpck_require__(20155) +const debug = __nccwpck_require__(91308) +const SemVer = __nccwpck_require__(11776) +const { + safeRe: re, + t, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace, +} = __nccwpck_require__(57529) +const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = __nccwpck_require__(28487) + +const isNullSet = c => c.value === '<0.0.0-0' +const isAny = c => c.value === '' + +// take a set of comparators and determine whether there +// exists a version which can satisfy it +const isSatisfiable = (comparators, options) => { + let result = true + const remainingComparators = comparators.slice() + let testComparator = remainingComparators.pop() + + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options) + }) + + testComparator = remainingComparators.pop() + } + + return result +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +const parseComparator = (comp, options) => { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp +} + +const isX = id => !id || id.toLowerCase() === 'x' || id === '*' + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 +// ~0.0.1 --> >=0.0.1 <0.1.0-0 +const replaceTildes = (comp, options) => { + return comp + .trim() + .split(/\s+/) + .map((c) => replaceTilde(c, options)) + .join(' ') +} + +const replaceTilde = (comp, options) => { + const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] + return comp.replace(r, (_, M, m, p, pr) => { + debug('tilde', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0` + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0-0 + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` + } else if (pr) { + debug('replaceTilde pr', pr) + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } else { + // ~1.2.3 == >=1.2.3 <1.3.0-0 + ret = `>=${M}.${m}.${p + } <${M}.${+m + 1}.0-0` + } + + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 +// ^1.2.3 --> >=1.2.3 <2.0.0-0 +// ^1.2.0 --> >=1.2.0 <2.0.0-0 +// ^0.0.1 --> >=0.0.1 <0.0.2-0 +// ^0.1.0 --> >=0.1.0 <0.2.0-0 +const replaceCarets = (comp, options) => { + return comp + .trim() + .split(/\s+/) + .map((c) => replaceCaret(c, options)) + .join(' ') +} + +const replaceCaret = (comp, options) => { + debug('caret', comp, options) + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] + const z = options.includePrerelease ? '-0' : '' + return comp.replace(r, (_, M, m, p, pr) => { + debug('caret', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` + } else if (isX(p)) { + if (M === '0') { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` + } else { + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${+M + 1}.0.0-0` + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p + }${z} <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p + }${z} <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p + } <${+M + 1}.0.0-0` + } + } + + debug('caret return', ret) + return ret + }) +} + +const replaceXRanges = (comp, options) => { + debug('replaceXRanges', comp, options) + return comp + .split(/\s+/) + .map((c) => replaceXRange(c, options)) + .join(' ') +} + +const replaceXRange = (comp, options) => { + comp = comp.trim() + const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] + return comp.replace(r, (ret, gtlt, M, m, p, pr) => { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + const xM = isX(M) + const xm = xM || isX(m) + const xp = xm || isX(p) + const anyX = xp + + if (gtlt === '=' && anyX) { + gtlt = '' + } + + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } + + if (gtlt === '<') { + pr = '-0' + } + + ret = `${gtlt + M}.${m}.${p}${pr}` + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` + } else if (xp) { + ret = `>=${M}.${m}.0${pr + } <${M}.${+m + 1}.0-0` + } + + debug('xRange return', ret) + + return ret + }) +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +const replaceStars = (comp, options) => { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp + .trim() + .replace(re[t.STAR], '') +} + +const replaceGTE0 = (comp, options) => { + debug('replaceGTE0', comp, options) + return comp + .trim() + .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') +} + +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 +// TODO build? +const hyphenReplace = incPr => ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr) => { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? '-0' : ''}` + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` + } else if (fpr) { + from = `>=${from}` + } else { + from = `>=${from}${incPr ? '-0' : ''}` + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0` + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0` + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}` + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0` + } else { + to = `<=${to}` + } + + return `${from} ${to}`.trim() +} + +const testSet = (set, version, options) => { + for (let i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } + + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (let i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === Comparator.ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + const allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false + } + + return true +} + + +/***/ }), + +/***/ 11776: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const debug = __nccwpck_require__(91308) +const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(28487) +const { safeRe: re, t } = __nccwpck_require__(57529) + +const parseOptions = __nccwpck_require__(84611) +const { compareIdentifiers } = __nccwpck_require__(28370) +class SemVer { + constructor (version, options) { + options = parseOptions(options) + + if (version instanceof SemVer) { + if (version.loose === !!options.loose && + version.includePrerelease === !!options.includePrerelease) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + // this isn't actually relevant for versions, but keep it so that we + // don't run into trouble passing this.options around. + this.includePrerelease = !!options.includePrerelease + + const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) + + if (!m) { + throw new TypeError(`Invalid Version: ${version}`) + } + + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() + } + + format () { + this.version = `${this.major}.${this.minor}.${this.patch}` + if (this.prerelease.length) { + this.version += `-${this.prerelease.join('.')}` + } + return this.version + } + + toString () { + return this.version + } + + compare (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + if (typeof other === 'string' && other === this.version) { + return 0 + } + other = new SemVer(other, this.options) + } + + if (other.version === this.version) { + return 0 + } + + return this.compareMain(other) || this.comparePre(other) + } + + compareMain (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return ( + compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) + ) + } + + comparePre (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + let i = 0 + do { + const a = this.prerelease[i] + const b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + compareBuild (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + let i = 0 + do { + const a = this.build[i] + const b = other.build[i] + debug('build compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc (release, identifier, identifierBase) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier, identifierBase) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier, identifierBase) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier, identifierBase) + this.inc('pre', identifier, identifierBase) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier, identifierBase) + } + this.inc('pre', identifier, identifierBase) + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if ( + this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0 + ) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case 'pre': { + const base = Number(identifierBase) ? 1 : 0 + + if (!identifier && identifierBase === false) { + throw new Error('invalid increment argument: identifier is empty') + } + + if (this.prerelease.length === 0) { + this.prerelease = [base] + } else { + let i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + if (identifier === this.prerelease.join('.') && identifierBase === false) { + throw new Error('invalid increment argument: identifier already exists') + } + this.prerelease.push(base) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + let prerelease = [identifier, base] + if (identifierBase === false) { + prerelease = [identifier] + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease + } + } else { + this.prerelease = prerelease + } + } + break + } + default: + throw new Error(`invalid increment argument: ${release}`) + } + this.raw = this.format() + if (this.build.length) { + this.raw += `+${this.build.join('.')}` + } + return this + } +} + +module.exports = SemVer + + +/***/ }), + +/***/ 16911: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parse = __nccwpck_require__(42083) +const clean = (version, options) => { + const s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} +module.exports = clean + + +/***/ }), + +/***/ 58289: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const eq = __nccwpck_require__(34618) +const neq = __nccwpck_require__(28728) +const gt = __nccwpck_require__(16565) +const gte = __nccwpck_require__(93358) +const lt = __nccwpck_require__(93586) +const lte = __nccwpck_require__(34113) + +const cmp = (a, op, b, loose) => { + switch (op) { + case '===': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a === b + + case '!==': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError(`Invalid operator: ${op}`) + } +} +module.exports = cmp + + +/***/ }), + +/***/ 35207: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(11776) +const parse = __nccwpck_require__(42083) +const { safeRe: re, t } = __nccwpck_require__(57529) + +const coerce = (version, options) => { + if (version instanceof SemVer) { + return version + } + + if (typeof version === 'number') { + version = String(version) + } + + if (typeof version !== 'string') { + return null + } + + options = options || {} + + let match = null + if (!options.rtl) { + match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]) + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL] + let next + while ((next = coerceRtlRegex.exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next + } + coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length + } + // leave it in a clean state + coerceRtlRegex.lastIndex = -1 + } + + if (match === null) { + return null + } + + const major = match[2] + const minor = match[3] || '0' + const patch = match[4] || '0' + const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '' + const build = options.includePrerelease && match[6] ? `+${match[6]}` : '' + + return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options) +} +module.exports = coerce + + +/***/ }), + +/***/ 28099: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(11776) +const compareBuild = (a, b, loose) => { + const versionA = new SemVer(a, loose) + const versionB = new SemVer(b, loose) + return versionA.compare(versionB) || versionA.compareBuild(versionB) +} +module.exports = compareBuild + + +/***/ }), + +/***/ 56531: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(61020) +const compareLoose = (a, b) => compare(a, b, true) +module.exports = compareLoose + + +/***/ }), + +/***/ 61020: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(11776) +const compare = (a, b, loose) => + new SemVer(a, loose).compare(new SemVer(b, loose)) + +module.exports = compare + + +/***/ }), + +/***/ 52704: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parse = __nccwpck_require__(42083) + +const diff = (version1, version2) => { + const v1 = parse(version1, null, true) + const v2 = parse(version2, null, true) + const comparison = v1.compare(v2) + + if (comparison === 0) { + return null + } + + const v1Higher = comparison > 0 + const highVersion = v1Higher ? v1 : v2 + const lowVersion = v1Higher ? v2 : v1 + const highHasPre = !!highVersion.prerelease.length + const lowHasPre = !!lowVersion.prerelease.length + + if (lowHasPre && !highHasPre) { + // Going from prerelease -> no prerelease requires some special casing + + // If the low version has only a major, then it will always be a major + // Some examples: + // 1.0.0-1 -> 1.0.0 + // 1.0.0-1 -> 1.1.1 + // 1.0.0-1 -> 2.0.0 + if (!lowVersion.patch && !lowVersion.minor) { + return 'major' + } + + // Otherwise it can be determined by checking the high version + + if (highVersion.patch) { + // anything higher than a patch bump would result in the wrong version + return 'patch' + } + + if (highVersion.minor) { + // anything higher than a minor bump would result in the wrong version + return 'minor' + } + + // bumping major/minor/patch all have same result + return 'major' + } + + // add the `pre` prefix if we are going to a prerelease version + const prefix = highHasPre ? 'pre' : '' + + if (v1.major !== v2.major) { + return prefix + 'major' + } + + if (v1.minor !== v2.minor) { + return prefix + 'minor' + } + + if (v1.patch !== v2.patch) { + return prefix + 'patch' + } + + // high and low are preleases + return 'prerelease' +} + +module.exports = diff + + +/***/ }), + +/***/ 34618: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(61020) +const eq = (a, b, loose) => compare(a, b, loose) === 0 +module.exports = eq + + +/***/ }), + +/***/ 16565: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(61020) +const gt = (a, b, loose) => compare(a, b, loose) > 0 +module.exports = gt + + +/***/ }), + +/***/ 93358: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(61020) +const gte = (a, b, loose) => compare(a, b, loose) >= 0 +module.exports = gte + + +/***/ }), + +/***/ 96881: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(11776) + +const inc = (version, release, options, identifier, identifierBase) => { + if (typeof (options) === 'string') { + identifierBase = identifier + identifier = options + options = undefined + } + + try { + return new SemVer( + version instanceof SemVer ? version.version : version, + options + ).inc(release, identifier, identifierBase).version + } catch (er) { + return null + } +} +module.exports = inc + + +/***/ }), + +/***/ 93586: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(61020) +const lt = (a, b, loose) => compare(a, b, loose) < 0 +module.exports = lt + + +/***/ }), + +/***/ 34113: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(61020) +const lte = (a, b, loose) => compare(a, b, loose) <= 0 +module.exports = lte + + +/***/ }), + +/***/ 23501: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(11776) +const major = (a, loose) => new SemVer(a, loose).major +module.exports = major + + +/***/ }), + +/***/ 92013: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(11776) +const minor = (a, loose) => new SemVer(a, loose).minor +module.exports = minor + + +/***/ }), + +/***/ 28728: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(61020) +const neq = (a, b, loose) => compare(a, b, loose) !== 0 +module.exports = neq + + +/***/ }), + +/***/ 42083: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(11776) +const parse = (version, options, throwErrors = false) => { + if (version instanceof SemVer) { + return version + } + try { + return new SemVer(version, options) + } catch (er) { + if (!throwErrors) { + return null + } + throw er + } +} + +module.exports = parse + + +/***/ }), + +/***/ 73539: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(11776) +const patch = (a, loose) => new SemVer(a, loose).patch +module.exports = patch + + +/***/ }), + +/***/ 67881: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parse = __nccwpck_require__(42083) +const prerelease = (version, options) => { + const parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} +module.exports = prerelease + + +/***/ }), + +/***/ 86396: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(61020) +const rcompare = (a, b, loose) => compare(b, a, loose) +module.exports = rcompare + + +/***/ }), + +/***/ 47804: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compareBuild = __nccwpck_require__(28099) +const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) +module.exports = rsort + + +/***/ }), + +/***/ 7980: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(32009) +const satisfies = (version, range, options) => { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} +module.exports = satisfies + + +/***/ }), + +/***/ 91350: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compareBuild = __nccwpck_require__(28099) +const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) +module.exports = sort + + +/***/ }), + +/***/ 6783: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parse = __nccwpck_require__(42083) +const valid = (version, options) => { + const v = parse(version, options) + return v ? v.version : null +} +module.exports = valid + + +/***/ }), + +/***/ 52023: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// just pre-load all the stuff that index.js lazily exports +const internalRe = __nccwpck_require__(57529) +const constants = __nccwpck_require__(28487) +const SemVer = __nccwpck_require__(11776) +const identifiers = __nccwpck_require__(28370) +const parse = __nccwpck_require__(42083) +const valid = __nccwpck_require__(6783) +const clean = __nccwpck_require__(16911) +const inc = __nccwpck_require__(96881) +const diff = __nccwpck_require__(52704) +const major = __nccwpck_require__(23501) +const minor = __nccwpck_require__(92013) +const patch = __nccwpck_require__(73539) +const prerelease = __nccwpck_require__(67881) +const compare = __nccwpck_require__(61020) +const rcompare = __nccwpck_require__(86396) +const compareLoose = __nccwpck_require__(56531) +const compareBuild = __nccwpck_require__(28099) +const sort = __nccwpck_require__(91350) +const rsort = __nccwpck_require__(47804) +const gt = __nccwpck_require__(16565) +const lt = __nccwpck_require__(93586) +const eq = __nccwpck_require__(34618) +const neq = __nccwpck_require__(28728) +const gte = __nccwpck_require__(93358) +const lte = __nccwpck_require__(34113) +const cmp = __nccwpck_require__(58289) +const coerce = __nccwpck_require__(35207) +const Comparator = __nccwpck_require__(20155) +const Range = __nccwpck_require__(32009) +const satisfies = __nccwpck_require__(7980) +const toComparators = __nccwpck_require__(89918) +const maxSatisfying = __nccwpck_require__(79211) +const minSatisfying = __nccwpck_require__(78235) +const minVersion = __nccwpck_require__(53373) +const validRange = __nccwpck_require__(93210) +const outside = __nccwpck_require__(96789) +const gtr = __nccwpck_require__(89685) +const ltr = __nccwpck_require__(72549) +const intersects = __nccwpck_require__(64514) +const simplifyRange = __nccwpck_require__(90590) +const subset = __nccwpck_require__(48462) +module.exports = { + parse, + valid, + clean, + inc, + diff, + major, + minor, + patch, + prerelease, + compare, + rcompare, + compareLoose, + compareBuild, + sort, + rsort, + gt, + lt, + eq, + neq, + gte, + lte, + cmp, + coerce, + Comparator, + Range, + satisfies, + toComparators, + maxSatisfying, + minSatisfying, + minVersion, + validRange, + outside, + gtr, + ltr, + intersects, + simplifyRange, + subset, + SemVer, + re: internalRe.re, + src: internalRe.src, + tokens: internalRe.t, + SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, + RELEASE_TYPES: constants.RELEASE_TYPES, + compareIdentifiers: identifiers.compareIdentifiers, + rcompareIdentifiers: identifiers.rcompareIdentifiers, +} + + +/***/ }), + +/***/ 28487: +/***/ ((module) => { + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +const SEMVER_SPEC_VERSION = '2.0.0' + +const MAX_LENGTH = 256 +const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || +/* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +const MAX_SAFE_COMPONENT_LENGTH = 16 + +// Max safe length for a build identifier. The max length minus 6 characters for +// the shortest version with a build 0.0.0+BUILD. +const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 + +const RELEASE_TYPES = [ + 'major', + 'premajor', + 'minor', + 'preminor', + 'patch', + 'prepatch', + 'prerelease', +] + +module.exports = { + MAX_LENGTH, + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_SAFE_INTEGER, + RELEASE_TYPES, + SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 0b001, + FLAG_LOOSE: 0b010, +} + + +/***/ }), + +/***/ 91308: +/***/ ((module) => { + +const debug = ( + typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG) +) ? (...args) => console.error('SEMVER', ...args) + : () => {} + +module.exports = debug + + +/***/ }), + +/***/ 28370: +/***/ ((module) => { + +const numeric = /^[0-9]+$/ +const compareIdentifiers = (a, b) => { + const anum = numeric.test(a) + const bnum = numeric.test(b) + + if (anum && bnum) { + a = +a + b = +b + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +} + +const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) + +module.exports = { + compareIdentifiers, + rcompareIdentifiers, +} + + +/***/ }), + +/***/ 88412: +/***/ ((module) => { + +class LRUCache { + constructor () { + this.max = 1000 + this.map = new Map() + } + + get (key) { + const value = this.map.get(key) + if (value === undefined) { + return undefined + } else { + // Remove the key from the map and add it to the end + this.map.delete(key) + this.map.set(key, value) + return value + } + } + + delete (key) { + return this.map.delete(key) + } + + set (key, value) { + const deleted = this.delete(key) + + if (!deleted && value !== undefined) { + // If cache is full, delete the least recently used item + if (this.map.size >= this.max) { + const firstKey = this.map.keys().next().value + this.delete(firstKey) + } + + this.map.set(key, value) + } + + return this + } +} + +module.exports = LRUCache + + +/***/ }), + +/***/ 84611: +/***/ ((module) => { + +// parse out just the options we care about +const looseOption = Object.freeze({ loose: true }) +const emptyOpts = Object.freeze({ }) +const parseOptions = options => { + if (!options) { + return emptyOpts + } + + if (typeof options !== 'object') { + return looseOption + } + + return options +} +module.exports = parseOptions + + +/***/ }), + +/***/ 57529: +/***/ ((module, exports, __nccwpck_require__) => { + +const { + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_LENGTH, +} = __nccwpck_require__(28487) +const debug = __nccwpck_require__(91308) +exports = module.exports = {} + +// The actual regexps go on exports.re +const re = exports.re = [] +const safeRe = exports.safeRe = [] +const src = exports.src = [] +const t = exports.t = {} +let R = 0 + +const LETTERDASHNUMBER = '[a-zA-Z0-9-]' + +// Replace some greedy regex tokens to prevent regex dos issues. These regex are +// used internally via the safeRe object since all inputs in this library get +// normalized first to trim and collapse all extra whitespace. The original +// regexes are exported for userland consumption and lower level usage. A +// future breaking change could export the safer regex only with a note that +// all input should have extra whitespace removed. +const safeRegexReplacements = [ + ['\\s', 1], + ['\\d', MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], +] + +const makeSafeRegex = (value) => { + for (const [token, max] of safeRegexReplacements) { + value = value + .split(`${token}*`).join(`${token}{0,${max}}`) + .split(`${token}+`).join(`${token}{1,${max}}`) + } + return value +} + +const createToken = (name, value, isGlobal) => { + const safe = makeSafeRegex(value) + const index = R++ + debug(name, index, value) + t[name] = index + src[index] = value + re[index] = new RegExp(value, isGlobal ? 'g' : undefined) + safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined) +} + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') +createToken('NUMERICIDENTIFIERLOOSE', '\\d+') + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`) + +// ## Main Version +// Three dot-separated numeric identifiers. + +createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})`) + +createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})`) + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] +}|${src[t.NONNUMERICIDENTIFIER]})`) + +createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] +}|${src[t.NONNUMERICIDENTIFIER]})`) + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] +}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) + +createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] +}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`) + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] +}(?:\\.${src[t.BUILDIDENTIFIER]})*))`) + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +createToken('FULLPLAIN', `v?${src[t.MAINVERSION] +}${src[t.PRERELEASE]}?${ + src[t.BUILD]}?`) + +createToken('FULL', `^${src[t.FULLPLAIN]}$`) + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] +}${src[t.PRERELEASELOOSE]}?${ + src[t.BUILD]}?`) + +createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) + +createToken('GTLT', '((?:<|>)?=?)') + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) +createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) + +createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:${src[t.PRERELEASE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:${src[t.PRERELEASELOOSE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) +createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +createToken('COERCEPLAIN', `${'(^|[^\\d])' + + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`) +createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`) +createToken('COERCEFULL', src[t.COERCEPLAIN] + + `(?:${src[t.PRERELEASE]})?` + + `(?:${src[t.BUILD]})?` + + `(?:$|[^\\d])`) +createToken('COERCERTL', src[t.COERCE], true) +createToken('COERCERTLFULL', src[t.COERCEFULL], true) + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +createToken('LONETILDE', '(?:~>?)') + +createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) +exports.tildeTrimReplace = '$1~' + +createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) +createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +createToken('LONECARET', '(?:\\^)') + +createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) +exports.caretTrimReplace = '$1^' + +createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) +createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) +createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] +}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) +exports.comparatorTrimReplace = '$1$2$3' + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAIN]})` + + `\\s*$`) + +createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAINLOOSE]})` + + `\\s*$`) + +// Star ranges basically just allow anything at all. +createToken('STAR', '(<|>)?=?\\s*\\*') +// >=0.0.0 is like a star +createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$') +createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$') + + +/***/ }), + +/***/ 89685: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// Determine if version is greater than all the versions possible in the range. +const outside = __nccwpck_require__(96789) +const gtr = (version, range, options) => outside(version, range, '>', options) +module.exports = gtr + + +/***/ }), + +/***/ 64514: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(32009) +const intersects = (r1, r2, options) => { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2, options) +} +module.exports = intersects + + +/***/ }), + +/***/ 72549: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const outside = __nccwpck_require__(96789) +// Determine if version is less than all the versions possible in the range +const ltr = (version, range, options) => outside(version, range, '<', options) +module.exports = ltr + + +/***/ }), + +/***/ 79211: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(11776) +const Range = __nccwpck_require__(32009) + +const maxSatisfying = (versions, range, options) => { + let max = null + let maxSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max +} +module.exports = maxSatisfying + + +/***/ }), + +/***/ 78235: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(11776) +const Range = __nccwpck_require__(32009) +const minSatisfying = (versions, range, options) => { + let min = null + let minSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min +} +module.exports = minSatisfying + + +/***/ }), + +/***/ 53373: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(11776) +const Range = __nccwpck_require__(32009) +const gt = __nccwpck_require__(16565) + +const minVersion = (range, loose) => { + range = new Range(range, loose) + + let minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } + + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } + + minver = null + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let setMin = null + comparators.forEach((comparator) => { + // Clone to avoid manipulating the comparator's semver object. + const compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!setMin || gt(compver, setMin)) { + setMin = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error(`Unexpected operation: ${comparator.operator}`) + } + }) + if (setMin && (!minver || gt(minver, setMin))) { + minver = setMin + } + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} +module.exports = minVersion + + +/***/ }), + +/***/ 96789: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(11776) +const Comparator = __nccwpck_require__(20155) +const { ANY } = Comparator +const Range = __nccwpck_require__(32009) +const satisfies = __nccwpck_require__(7980) +const gt = __nccwpck_require__(16565) +const lt = __nccwpck_require__(93586) +const lte = __nccwpck_require__(34113) +const gte = __nccwpck_require__(93358) + +const outside = (version, range, hilo, options) => { + version = new SemVer(version, options) + range = new Range(range, options) + + let gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisfies the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let high = null + let low = null + + comparators.forEach((comparator) => { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +module.exports = outside + + +/***/ }), + +/***/ 90590: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// given a set of versions and a range, create a "simplified" range +// that includes the same versions that the original range does +// If the original range is shorter than the simplified one, return that. +const satisfies = __nccwpck_require__(7980) +const compare = __nccwpck_require__(61020) +module.exports = (versions, range, options) => { + const set = [] + let first = null + let prev = null + const v = versions.sort((a, b) => compare(a, b, options)) + for (const version of v) { + const included = satisfies(version, range, options) + if (included) { + prev = version + if (!first) { + first = version + } + } else { + if (prev) { + set.push([first, prev]) + } + prev = null + first = null + } + } + if (first) { + set.push([first, null]) + } + + const ranges = [] + for (const [min, max] of set) { + if (min === max) { + ranges.push(min) + } else if (!max && min === v[0]) { + ranges.push('*') + } else if (!max) { + ranges.push(`>=${min}`) + } else if (min === v[0]) { + ranges.push(`<=${max}`) + } else { + ranges.push(`${min} - ${max}`) + } + } + const simplified = ranges.join(' || ') + const original = typeof range.raw === 'string' ? range.raw : String(range) + return simplified.length < original.length ? simplified : range +} + + +/***/ }), + +/***/ 48462: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(32009) +const Comparator = __nccwpck_require__(20155) +const { ANY } = Comparator +const satisfies = __nccwpck_require__(7980) +const compare = __nccwpck_require__(61020) + +// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: +// - Every simple range `r1, r2, ...` is a null set, OR +// - Every simple range `r1, r2, ...` which is not a null set is a subset of +// some `R1, R2, ...` +// +// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: +// - If c is only the ANY comparator +// - If C is only the ANY comparator, return true +// - Else if in prerelease mode, return false +// - else replace c with `[>=0.0.0]` +// - If C is only the ANY comparator +// - if in prerelease mode, return true +// - else replace C with `[>=0.0.0]` +// - Let EQ be the set of = comparators in c +// - If EQ is more than one, return true (null set) +// - Let GT be the highest > or >= comparator in c +// - Let LT be the lowest < or <= comparator in c +// - If GT and LT, and GT.semver > LT.semver, return true (null set) +// - If any C is a = range, and GT or LT are set, return false +// - If EQ +// - If GT, and EQ does not satisfy GT, return true (null set) +// - If LT, and EQ does not satisfy LT, return true (null set) +// - If EQ satisfies every C, return true +// - Else return false +// - If GT +// - If GT.semver is lower than any > or >= comp in C, return false +// - If GT is >=, and GT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the GT.semver tuple, return false +// - If LT +// - If LT.semver is greater than any < or <= comp in C, return false +// - If LT is <=, and LT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the LT.semver tuple, return false +// - Else return true + +const subset = (sub, dom, options = {}) => { + if (sub === dom) { + return true + } + + sub = new Range(sub, options) + dom = new Range(dom, options) + let sawNonNull = false + + OUTER: for (const simpleSub of sub.set) { + for (const simpleDom of dom.set) { + const isSub = simpleSubset(simpleSub, simpleDom, options) + sawNonNull = sawNonNull || isSub !== null + if (isSub) { + continue OUTER + } + } + // the null set is a subset of everything, but null simple ranges in + // a complex range should be ignored. so if we saw a non-null range, + // then we know this isn't a subset, but if EVERY simple range was null, + // then it is a subset. + if (sawNonNull) { + return false + } + } + return true +} + +const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')] +const minimumVersion = [new Comparator('>=0.0.0')] + +const simpleSubset = (sub, dom, options) => { + if (sub === dom) { + return true + } + + if (sub.length === 1 && sub[0].semver === ANY) { + if (dom.length === 1 && dom[0].semver === ANY) { + return true + } else if (options.includePrerelease) { + sub = minimumVersionWithPreRelease + } else { + sub = minimumVersion + } + } + + if (dom.length === 1 && dom[0].semver === ANY) { + if (options.includePrerelease) { + return true + } else { + dom = minimumVersion + } + } + + const eqSet = new Set() + let gt, lt + for (const c of sub) { + if (c.operator === '>' || c.operator === '>=') { + gt = higherGT(gt, c, options) + } else if (c.operator === '<' || c.operator === '<=') { + lt = lowerLT(lt, c, options) + } else { + eqSet.add(c.semver) + } + } + + if (eqSet.size > 1) { + return null + } + + let gtltComp + if (gt && lt) { + gtltComp = compare(gt.semver, lt.semver, options) + if (gtltComp > 0) { + return null + } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { + return null + } + } + + // will iterate one or zero times + for (const eq of eqSet) { + if (gt && !satisfies(eq, String(gt), options)) { + return null + } + + if (lt && !satisfies(eq, String(lt), options)) { + return null + } + + for (const c of dom) { + if (!satisfies(eq, String(c), options)) { + return false + } + } + + return true + } + + let higher, lower + let hasDomLT, hasDomGT + // if the subset has a prerelease, we need a comparator in the superset + // with the same tuple and a prerelease, or it's not a subset + let needDomLTPre = lt && + !options.includePrerelease && + lt.semver.prerelease.length ? lt.semver : false + let needDomGTPre = gt && + !options.includePrerelease && + gt.semver.prerelease.length ? gt.semver : false + // exception: <1.2.3-0 is the same as <1.2.3 + if (needDomLTPre && needDomLTPre.prerelease.length === 1 && + lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { + needDomLTPre = false + } + + for (const c of dom) { + hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' + hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' + if (gt) { + if (needDomGTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomGTPre.major && + c.semver.minor === needDomGTPre.minor && + c.semver.patch === needDomGTPre.patch) { + needDomGTPre = false + } + } + if (c.operator === '>' || c.operator === '>=') { + higher = higherGT(gt, c, options) + if (higher === c && higher !== gt) { + return false + } + } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) { + return false + } + } + if (lt) { + if (needDomLTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomLTPre.major && + c.semver.minor === needDomLTPre.minor && + c.semver.patch === needDomLTPre.patch) { + needDomLTPre = false + } + } + if (c.operator === '<' || c.operator === '<=') { + lower = lowerLT(lt, c, options) + if (lower === c && lower !== lt) { + return false + } + } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) { + return false + } + } + if (!c.operator && (lt || gt) && gtltComp !== 0) { + return false + } + } + + // if there was a < or >, and nothing in the dom, then must be false + // UNLESS it was limited by another range in the other direction. + // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 + if (gt && hasDomLT && !lt && gtltComp !== 0) { + return false + } + + if (lt && hasDomGT && !gt && gtltComp !== 0) { + return false + } + + // we needed a prerelease range in a specific tuple, but didn't get one + // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, + // because it includes prereleases in the 1.2.3 tuple + if (needDomGTPre || needDomLTPre) { + return false + } + + return true +} + +// >=1.2.3 is lower than >1.2.3 +const higherGT = (a, b, options) => { + if (!a) { + return b + } + const comp = compare(a.semver, b.semver, options) + return comp > 0 ? a + : comp < 0 ? b + : b.operator === '>' && a.operator === '>=' ? b + : a +} + +// <=1.2.3 is higher than <1.2.3 +const lowerLT = (a, b, options) => { + if (!a) { + return b + } + const comp = compare(a.semver, b.semver, options) + return comp < 0 ? a + : comp > 0 ? b + : b.operator === '<' && a.operator === '<=' ? b + : a +} + +module.exports = subset + + +/***/ }), + +/***/ 89918: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(32009) + +// Mostly just for testing and legacy API reasons +const toComparators = (range, options) => + new Range(range, options).set + .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) + +module.exports = toComparators + + +/***/ }), + +/***/ 93210: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(32009) +const validRange = (range, options) => { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} +module.exports = validRange + + +/***/ }), + +/***/ 88563: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const dsn = __nccwpck_require__(32540); + +const SENTRY_API_VERSION = '7'; + +/** Returns the prefix to construct Sentry ingestion API endpoints. */ +function getBaseApiEndpoint(dsn) { + const protocol = dsn.protocol ? `${dsn.protocol}:` : ''; + const port = dsn.port ? `:${dsn.port}` : ''; + return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`; +} + +/** Returns the ingest API endpoint for target. */ +function _getIngestEndpoint(dsn) { + return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`; +} + +/** Returns a URL-encoded string with auth config suitable for a query string. */ +function _encodedAuth(dsn, sdkInfo) { + const params = { + sentry_version: SENTRY_API_VERSION, + }; + + if (dsn.publicKey) { + // We send only the minimum set of required information. See + // https://github.com/getsentry/sentry-javascript/issues/2572. + params.sentry_key = dsn.publicKey; + } + + if (sdkInfo) { + params.sentry_client = `${sdkInfo.name}/${sdkInfo.version}`; + } + + return new URLSearchParams(params).toString(); +} + +/** + * Returns the envelope endpoint URL with auth in the query string. + * + * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests. + */ +function getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnel, sdkInfo) { + return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`; +} + +/** Returns the url to the report dialog endpoint. */ +function getReportDialogEndpoint( + dsnLike, + dialogOptions + +, +) { + const dsn$1 = dsn.makeDsn(dsnLike); + if (!dsn$1) { + return ''; + } + + const endpoint = `${getBaseApiEndpoint(dsn$1)}embed/error-page/`; + + let encodedOptions = `dsn=${dsn.dsnToString(dsn$1)}`; + for (const key in dialogOptions) { + if (key === 'dsn') { + continue; + } + + if (key === 'onClose') { + continue; + } + + if (key === 'user') { + const user = dialogOptions.user; + if (!user) { + continue; + } + if (user.name) { + encodedOptions += `&name=${encodeURIComponent(user.name)}`; + } + if (user.email) { + encodedOptions += `&email=${encodeURIComponent(user.email)}`; + } + } else { + encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] )}`; + } + } + + return `${endpoint}?${encodedOptions}`; +} + +exports.getEnvelopeEndpointWithUrlEncodedAuth = getEnvelopeEndpointWithUrlEncodedAuth; +exports.getReportDialogEndpoint = getReportDialogEndpoint; +//# sourceMappingURL=api.js.map + + +/***/ }), + +/***/ 29878: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const carrier = __nccwpck_require__(38080); +const stackStrategy = __nccwpck_require__(88484); + +/** + * @private Private API with no semver guarantees! + * + * Sets the global async context strategy + */ +function setAsyncContextStrategy(strategy) { + // Get main carrier (global for every environment) + const registry = carrier.getMainCarrier(); + const sentry = carrier.getSentryCarrier(registry); + sentry.acs = strategy; +} + +/** + * Get the current async context strategy. + * If none has been setup, the default will be used. + */ +function getAsyncContextStrategy(carrier$1) { + const sentry = carrier.getSentryCarrier(carrier$1); + + if (sentry.acs) { + return sentry.acs; + } + + // Otherwise, use the default one (stack) + return stackStrategy.getStackAsyncContextStrategy(); +} + +exports.getAsyncContextStrategy = getAsyncContextStrategy; +exports.setAsyncContextStrategy = setAsyncContextStrategy; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 88484: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const defaultScopes = __nccwpck_require__(80496); +const scope = __nccwpck_require__(49417); +const is = __nccwpck_require__(84085); +const carrier = __nccwpck_require__(38080); + +/** + * This is an object that holds a stack of scopes. + */ +class AsyncContextStack { + + constructor(scope$1, isolationScope) { + let assignedScope; + if (!scope$1) { + assignedScope = new scope.Scope(); + } else { + assignedScope = scope$1; + } + + let assignedIsolationScope; + if (!isolationScope) { + assignedIsolationScope = new scope.Scope(); + } else { + assignedIsolationScope = isolationScope; + } + + // scope stack for domains or the process + this._stack = [{ scope: assignedScope }]; + this._isolationScope = assignedIsolationScope; + } + + /** + * Fork a scope for the stack. + */ + withScope(callback) { + const scope = this._pushScope(); + + let maybePromiseResult; + try { + maybePromiseResult = callback(scope); + } catch (e) { + this._popScope(); + throw e; + } + + if (is.isThenable(maybePromiseResult)) { + // @ts-expect-error - isThenable returns the wrong type + return maybePromiseResult.then( + res => { + this._popScope(); + return res; + }, + e => { + this._popScope(); + throw e; + }, + ); + } + + this._popScope(); + return maybePromiseResult; + } + + /** + * Get the client of the stack. + */ + getClient() { + return this.getStackTop().client ; + } + + /** + * Returns the scope of the top stack. + */ + getScope() { + return this.getStackTop().scope; + } + + /** + * Get the isolation scope for the stack. + */ + getIsolationScope() { + return this._isolationScope; + } + + /** + * Returns the topmost scope layer in the order domain > local > process. + */ + getStackTop() { + return this._stack[this._stack.length - 1] ; + } + + /** + * Push a scope to the stack. + */ + _pushScope() { + // We want to clone the content of prev scope + const scope = this.getScope().clone(); + this._stack.push({ + client: this.getClient(), + scope, + }); + return scope; + } + + /** + * Pop a scope from the stack. + */ + _popScope() { + if (this._stack.length <= 1) return false; + return !!this._stack.pop(); + } +} + +/** + * Get the global async context stack. + * This will be removed during the v8 cycle and is only here to make migration easier. + */ +function getAsyncContextStack() { + const registry = carrier.getMainCarrier(); + const sentry = carrier.getSentryCarrier(registry); + + return (sentry.stack = sentry.stack || new AsyncContextStack(defaultScopes.getDefaultCurrentScope(), defaultScopes.getDefaultIsolationScope())); +} + +function withScope(callback) { + return getAsyncContextStack().withScope(callback); +} + +function withSetScope(scope, callback) { + const stack = getAsyncContextStack() ; + return stack.withScope(() => { + stack.getStackTop().scope = scope; + return callback(scope); + }); +} + +function withIsolationScope(callback) { + return getAsyncContextStack().withScope(() => { + return callback(getAsyncContextStack().getIsolationScope()); + }); +} + +/** + * Get the stack-based async context strategy. + */ +function getStackAsyncContextStrategy() { + return { + withIsolationScope, + withScope, + withSetScope, + withSetIsolationScope: (_isolationScope, callback) => { + return withIsolationScope(callback); + }, + getCurrentScope: () => getAsyncContextStack().getScope(), + getIsolationScope: () => getAsyncContextStack().getIsolationScope(), + }; +} + +exports.AsyncContextStack = AsyncContextStack; +exports.getStackAsyncContextStrategy = getStackAsyncContextStrategy; +//# sourceMappingURL=stackStrategy.js.map + + +/***/ }), + +/***/ 95457: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const api = __nccwpck_require__(88563); +const currentScopes = __nccwpck_require__(8131); +const debugBuild = __nccwpck_require__(14488); +const envelope = __nccwpck_require__(58784); +const integration = __nccwpck_require__(67428); +const session = __nccwpck_require__(60233); +const dynamicSamplingContext = __nccwpck_require__(29724); +const clientreport = __nccwpck_require__(27962); +const dsn = __nccwpck_require__(32540); +const envelope$1 = __nccwpck_require__(72635); +const error = __nccwpck_require__(66322); +const is = __nccwpck_require__(84085); +const logger = __nccwpck_require__(38752); +const misc = __nccwpck_require__(3181); +const syncpromise = __nccwpck_require__(15621); +const parseSampleRate = __nccwpck_require__(54078); +const prepareEvent = __nccwpck_require__(22264); +const spanUtils = __nccwpck_require__(47569); + +const ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured."; + +/** + * Base implementation for all JavaScript SDK clients. + * + * Call the constructor with the corresponding options + * specific to the client subclass. To access these options later, use + * {@link Client.getOptions}. + * + * If a Dsn is specified in the options, it will be parsed and stored. Use + * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is + * invalid, the constructor will throw a {@link SentryException}. Note that + * without a valid Dsn, the SDK will not send any events to Sentry. + * + * Before sending an event, it is passed through + * {@link BaseClient._prepareEvent} to add SDK information and scope data + * (breadcrumbs and context). To add more custom information, override this + * method and extend the resulting prepared event. + * + * To issue automatically created events (e.g. via instrumentation), use + * {@link Client.captureEvent}. It will prepare the event and pass it through + * the callback lifecycle. To issue auto-breadcrumbs, use + * {@link Client.addBreadcrumb}. + * + * @example + * class NodeClient extends BaseClient { + * public constructor(options: NodeOptions) { + * super(options); + * } + * + * // ... + * } + */ +class BaseClient { + /** Options passed to the SDK. */ + + /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */ + + /** Array of set up integrations. */ + + /** Number of calls being processed */ + + /** Holds flushable */ + + // eslint-disable-next-line @typescript-eslint/ban-types + + /** + * Initializes this client instance. + * + * @param options Options for the client. + */ + constructor(options) { + this._options = options; + this._integrations = {}; + this._numProcessing = 0; + this._outcomes = {}; + this._hooks = {}; + this._eventProcessors = []; + + if (options.dsn) { + this._dsn = dsn.makeDsn(options.dsn); + } else { + debugBuild.DEBUG_BUILD && logger.logger.warn('No DSN provided, client will not send events.'); + } + + if (this._dsn) { + const url = api.getEnvelopeEndpointWithUrlEncodedAuth( + this._dsn, + options.tunnel, + options._metadata ? options._metadata.sdk : undefined, + ); + this._transport = options.transport({ + tunnel: this._options.tunnel, + recordDroppedEvent: this.recordDroppedEvent.bind(this), + ...options.transportOptions, + url, + }); + } + + // TODO(v9): Remove this deprecation warning + const tracingOptions = ['enableTracing', 'tracesSampleRate', 'tracesSampler'] ; + const undefinedOption = tracingOptions.find(option => option in options && options[option] == undefined); + if (undefinedOption) { + logger.consoleSandbox(() => { + // eslint-disable-next-line no-console + console.warn( + `[Sentry] Deprecation warning: \`${undefinedOption}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`, + ); + }); + } + } + + /** + * @inheritDoc + */ + captureException(exception, hint, scope) { + const eventId = misc.uuid4(); + + // ensure we haven't captured this very object before + if (misc.checkOrSetAlreadyCaught(exception)) { + debugBuild.DEBUG_BUILD && logger.logger.log(ALREADY_SEEN_ERROR); + return eventId; + } + + const hintWithEventId = { + event_id: eventId, + ...hint, + }; + + this._process( + this.eventFromException(exception, hintWithEventId).then(event => + this._captureEvent(event, hintWithEventId, scope), + ), + ); + + return hintWithEventId.event_id; + } + + /** + * @inheritDoc + */ + captureMessage( + message, + level, + hint, + currentScope, + ) { + const hintWithEventId = { + event_id: misc.uuid4(), + ...hint, + }; + + const eventMessage = is.isParameterizedString(message) ? message : String(message); + + const promisedEvent = is.isPrimitive(message) + ? this.eventFromMessage(eventMessage, level, hintWithEventId) + : this.eventFromException(message, hintWithEventId); + + this._process(promisedEvent.then(event => this._captureEvent(event, hintWithEventId, currentScope))); + + return hintWithEventId.event_id; + } + + /** + * @inheritDoc + */ + captureEvent(event, hint, currentScope) { + const eventId = misc.uuid4(); + + // ensure we haven't captured this very object before + if (hint && hint.originalException && misc.checkOrSetAlreadyCaught(hint.originalException)) { + debugBuild.DEBUG_BUILD && logger.logger.log(ALREADY_SEEN_ERROR); + return eventId; + } + + const hintWithEventId = { + event_id: eventId, + ...hint, + }; + + const sdkProcessingMetadata = event.sdkProcessingMetadata || {}; + const capturedSpanScope = sdkProcessingMetadata.capturedSpanScope; + + this._process(this._captureEvent(event, hintWithEventId, capturedSpanScope || currentScope)); + + return hintWithEventId.event_id; + } + + /** + * @inheritDoc + */ + captureSession(session$1) { + if (!(typeof session$1.release === 'string')) { + debugBuild.DEBUG_BUILD && logger.logger.warn('Discarded session because of missing or non-string release'); + } else { + this.sendSession(session$1); + // After sending, we set init false to indicate it's not the first occurrence + session.updateSession(session$1, { init: false }); + } + } + + /** + * @inheritDoc + */ + getDsn() { + return this._dsn; + } + + /** + * @inheritDoc + */ + getOptions() { + return this._options; + } + + /** + * @see SdkMetadata + * + * @return The metadata of the SDK + */ + getSdkMetadata() { + return this._options._metadata; + } + + /** + * @inheritDoc + */ + getTransport() { + return this._transport; + } + + /** + * @inheritDoc + */ + flush(timeout) { + const transport = this._transport; + if (transport) { + this.emit('flush'); + return this._isClientDoneProcessing(timeout).then(clientFinished => { + return transport.flush(timeout).then(transportFlushed => clientFinished && transportFlushed); + }); + } else { + return syncpromise.resolvedSyncPromise(true); + } + } + + /** + * @inheritDoc + */ + close(timeout) { + return this.flush(timeout).then(result => { + this.getOptions().enabled = false; + this.emit('close'); + return result; + }); + } + + /** Get all installed event processors. */ + getEventProcessors() { + return this._eventProcessors; + } + + /** @inheritDoc */ + addEventProcessor(eventProcessor) { + this._eventProcessors.push(eventProcessor); + } + + /** @inheritdoc */ + init() { + if ( + this._isEnabled() || + // Force integrations to be setup even if no DSN was set when we have + // Spotlight enabled. This is particularly important for browser as we + // don't support the `spotlight` option there and rely on the users + // adding the `spotlightBrowserIntegration()` to their integrations which + // wouldn't get initialized with the check below when there's no DSN set. + this._options.integrations.some(({ name }) => name.startsWith('Spotlight')) + ) { + this._setupIntegrations(); + } + } + + /** + * Gets an installed integration by its name. + * + * @returns The installed integration or `undefined` if no integration with that `name` was installed. + */ + getIntegrationByName(integrationName) { + return this._integrations[integrationName] ; + } + + /** + * @inheritDoc + */ + addIntegration(integration$1) { + const isAlreadyInstalled = this._integrations[integration$1.name]; + + // This hook takes care of only installing if not already installed + integration.setupIntegration(this, integration$1, this._integrations); + // Here we need to check manually to make sure to not run this multiple times + if (!isAlreadyInstalled) { + integration.afterSetupIntegrations(this, [integration$1]); + } + } + + /** + * @inheritDoc + */ + sendEvent(event, hint = {}) { + this.emit('beforeSendEvent', event, hint); + + let env = envelope.createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel); + + for (const attachment of hint.attachments || []) { + env = envelope$1.addItemToEnvelope(env, envelope$1.createAttachmentEnvelopeItem(attachment)); + } + + const promise = this.sendEnvelope(env); + if (promise) { + promise.then(sendResponse => this.emit('afterSendEvent', event, sendResponse), null); + } + } + + /** + * @inheritDoc + */ + sendSession(session) { + const env = envelope.createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel); + + // sendEnvelope should not throw + // eslint-disable-next-line @typescript-eslint/no-floating-promises + this.sendEnvelope(env); + } + + /** + * @inheritDoc + */ + recordDroppedEvent(reason, category, eventOrCount) { + if (this._options.sendClientReports) { + // TODO v9: We do not need the `event` passed as third argument anymore, and can possibly remove this overload + // If event is passed as third argument, we assume this is a count of 1 + const count = typeof eventOrCount === 'number' ? eventOrCount : 1; + + // We want to track each category (error, transaction, session, replay_event) separately + // but still keep the distinction between different type of outcomes. + // We could use nested maps, but it's much easier to read and type this way. + // A correct type for map-based implementation if we want to go that route + // would be `Partial>>>` + // With typescript 4.1 we could even use template literal types + const key = `${reason}:${category}`; + debugBuild.DEBUG_BUILD && logger.logger.log(`Recording outcome: "${key}"${count > 1 ? ` (${count} times)` : ''}`); + this._outcomes[key] = (this._outcomes[key] || 0) + count; + } + } + + // Keep on() & emit() signatures in sync with types' client.ts interface + /* eslint-disable @typescript-eslint/unified-signatures */ + + /** @inheritdoc */ + + /** @inheritdoc */ + on(hook, callback) { + const hooks = (this._hooks[hook] = this._hooks[hook] || []); + + // @ts-expect-error We assume the types are correct + hooks.push(callback); + + // This function returns a callback execution handler that, when invoked, + // deregisters a callback. This is crucial for managing instances where callbacks + // need to be unregistered to prevent self-referencing in callback closures, + // ensuring proper garbage collection. + return () => { + // @ts-expect-error We assume the types are correct + const cbIndex = hooks.indexOf(callback); + if (cbIndex > -1) { + hooks.splice(cbIndex, 1); + } + }; + } + + /** @inheritdoc */ + + /** @inheritdoc */ + emit(hook, ...rest) { + const callbacks = this._hooks[hook]; + if (callbacks) { + callbacks.forEach(callback => callback(...rest)); + } + } + + /** + * @inheritdoc + */ + sendEnvelope(envelope) { + this.emit('beforeEnvelope', envelope); + + if (this._isEnabled() && this._transport) { + return this._transport.send(envelope).then(null, reason => { + debugBuild.DEBUG_BUILD && logger.logger.error('Error while sending envelope:', reason); + return reason; + }); + } + + debugBuild.DEBUG_BUILD && logger.logger.error('Transport disabled'); + + return syncpromise.resolvedSyncPromise({}); + } + + /* eslint-enable @typescript-eslint/unified-signatures */ + + /** Setup integrations for this client. */ + _setupIntegrations() { + const { integrations } = this._options; + this._integrations = integration.setupIntegrations(this, integrations); + integration.afterSetupIntegrations(this, integrations); + } + + /** Updates existing session based on the provided event */ + _updateSessionFromEvent(session$1, event) { + let crashed = event.level === 'fatal'; + let errored = false; + const exceptions = event.exception && event.exception.values; + + if (exceptions) { + errored = true; + + for (const ex of exceptions) { + const mechanism = ex.mechanism; + if (mechanism && mechanism.handled === false) { + crashed = true; + break; + } + } + } + + // A session is updated and that session update is sent in only one of the two following scenarios: + // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update + // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update + const sessionNonTerminal = session$1.status === 'ok'; + const shouldUpdateAndSend = (sessionNonTerminal && session$1.errors === 0) || (sessionNonTerminal && crashed); + + if (shouldUpdateAndSend) { + session.updateSession(session$1, { + ...(crashed && { status: 'crashed' }), + errors: session$1.errors || Number(errored || crashed), + }); + this.captureSession(session$1); + } + } + + /** + * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying + * "no" (resolving to `false`) in order to give the client a chance to potentially finish first. + * + * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not + * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to + * `true`. + * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and + * `false` otherwise + */ + _isClientDoneProcessing(timeout) { + return new syncpromise.SyncPromise(resolve => { + let ticked = 0; + const tick = 1; + + const interval = setInterval(() => { + if (this._numProcessing == 0) { + clearInterval(interval); + resolve(true); + } else { + ticked += tick; + if (timeout && ticked >= timeout) { + clearInterval(interval); + resolve(false); + } + } + }, tick); + }); + } + + /** Determines whether this SDK is enabled and a transport is present. */ + _isEnabled() { + return this.getOptions().enabled !== false && this._transport !== undefined; + } + + /** + * Adds common information to events. + * + * The information includes release and environment from `options`, + * breadcrumbs and context (extra, tags and user) from the scope. + * + * Information that is already present in the event is never overwritten. For + * nested objects, such as the context, keys are merged. + * + * @param event The original event. + * @param hint May contain additional information about the original exception. + * @param currentScope A scope containing event metadata. + * @returns A new event with more information. + */ + _prepareEvent( + event, + hint, + currentScope = currentScopes.getCurrentScope(), + isolationScope = currentScopes.getIsolationScope(), + ) { + const options = this.getOptions(); + const integrations = Object.keys(this._integrations); + if (!hint.integrations && integrations.length > 0) { + hint.integrations = integrations; + } + + this.emit('preprocessEvent', event, hint); + + if (!event.type) { + isolationScope.setLastEventId(event.event_id || hint.event_id); + } + + return prepareEvent.prepareEvent(options, event, hint, currentScope, this, isolationScope).then(evt => { + if (evt === null) { + return evt; + } + + evt.contexts = { + trace: currentScopes.getTraceContextFromScope(currentScope), + ...evt.contexts, + }; + + const dynamicSamplingContext$1 = dynamicSamplingContext.getDynamicSamplingContextFromScope(this, currentScope); + + evt.sdkProcessingMetadata = { + dynamicSamplingContext: dynamicSamplingContext$1, + ...evt.sdkProcessingMetadata, + }; + + return evt; + }); + } + + /** + * Processes the event and logs an error in case of rejection + * @param event + * @param hint + * @param scope + */ + _captureEvent(event, hint = {}, scope) { + return this._processEvent(event, hint, scope).then( + finalEvent => { + return finalEvent.event_id; + }, + reason => { + if (debugBuild.DEBUG_BUILD) { + // If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for + // control flow, log just the message (no stack) as a log-level log. + if (reason instanceof error.SentryError && reason.logLevel === 'log') { + logger.logger.log(reason.message); + } else { + logger.logger.warn(reason); + } + } + return undefined; + }, + ); + } + + /** + * Processes an event (either error or message) and sends it to Sentry. + * + * This also adds breadcrumbs and context information to the event. However, + * platform specific meta data (such as the User's IP address) must be added + * by the SDK implementor. + * + * + * @param event The event to send to Sentry. + * @param hint May contain additional information about the original exception. + * @param currentScope A scope containing event metadata. + * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send. + */ + _processEvent(event, hint, currentScope) { + const options = this.getOptions(); + const { sampleRate } = options; + + const isTransaction = isTransactionEvent(event); + const isError = isErrorEvent(event); + const eventType = event.type || 'error'; + const beforeSendLabel = `before send for type \`${eventType}\``; + + // 1.0 === 100% events are sent + // 0.0 === 0% events are sent + // Sampling for transaction happens somewhere else + const parsedSampleRate = typeof sampleRate === 'undefined' ? undefined : parseSampleRate.parseSampleRate(sampleRate); + if (isError && typeof parsedSampleRate === 'number' && Math.random() > parsedSampleRate) { + this.recordDroppedEvent('sample_rate', 'error', event); + return syncpromise.rejectedSyncPromise( + new error.SentryError( + `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`, + 'log', + ), + ); + } + + const dataCategory = eventType === 'replay_event' ? 'replay' : eventType; + + const sdkProcessingMetadata = event.sdkProcessingMetadata || {}; + const capturedSpanIsolationScope = sdkProcessingMetadata.capturedSpanIsolationScope; + + return this._prepareEvent(event, hint, currentScope, capturedSpanIsolationScope) + .then(prepared => { + if (prepared === null) { + this.recordDroppedEvent('event_processor', dataCategory, event); + throw new error.SentryError('An event processor returned `null`, will not send event.', 'log'); + } + + const isInternalException = hint.data && (hint.data ).__sentry__ === true; + if (isInternalException) { + return prepared; + } + + const result = processBeforeSend(this, options, prepared, hint); + return _validateBeforeSendResult(result, beforeSendLabel); + }) + .then(processedEvent => { + if (processedEvent === null) { + this.recordDroppedEvent('before_send', dataCategory, event); + if (isTransaction) { + const spans = event.spans || []; + // the transaction itself counts as one span, plus all the child spans that are added + const spanCount = 1 + spans.length; + this.recordDroppedEvent('before_send', 'span', spanCount); + } + throw new error.SentryError(`${beforeSendLabel} returned \`null\`, will not send event.`, 'log'); + } + + const session = currentScope && currentScope.getSession(); + if (!isTransaction && session) { + this._updateSessionFromEvent(session, processedEvent); + } + + if (isTransaction) { + const spanCountBefore = + (processedEvent.sdkProcessingMetadata && processedEvent.sdkProcessingMetadata.spanCountBeforeProcessing) || + 0; + const spanCountAfter = processedEvent.spans ? processedEvent.spans.length : 0; + + const droppedSpanCount = spanCountBefore - spanCountAfter; + if (droppedSpanCount > 0) { + this.recordDroppedEvent('before_send', 'span', droppedSpanCount); + } + } + + // None of the Sentry built event processor will update transaction name, + // so if the transaction name has been changed by an event processor, we know + // it has to come from custom event processor added by a user + const transactionInfo = processedEvent.transaction_info; + if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) { + const source = 'custom'; + processedEvent.transaction_info = { + ...transactionInfo, + source, + }; + } + + this.sendEvent(processedEvent, hint); + return processedEvent; + }) + .then(null, reason => { + if (reason instanceof error.SentryError) { + throw reason; + } + + this.captureException(reason, { + data: { + __sentry__: true, + }, + originalException: reason, + }); + throw new error.SentryError( + `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${reason}`, + ); + }); + } + + /** + * Occupies the client with processing and event + */ + _process(promise) { + this._numProcessing++; + void promise.then( + value => { + this._numProcessing--; + return value; + }, + reason => { + this._numProcessing--; + return reason; + }, + ); + } + + /** + * Clears outcomes on this client and returns them. + */ + _clearOutcomes() { + const outcomes = this._outcomes; + this._outcomes = {}; + return Object.entries(outcomes).map(([key, quantity]) => { + const [reason, category] = key.split(':') ; + return { + reason, + category, + quantity, + }; + }); + } + + /** + * Sends client reports as an envelope. + */ + _flushOutcomes() { + debugBuild.DEBUG_BUILD && logger.logger.log('Flushing outcomes...'); + + const outcomes = this._clearOutcomes(); + + if (outcomes.length === 0) { + debugBuild.DEBUG_BUILD && logger.logger.log('No outcomes to send'); + return; + } + + // This is really the only place where we want to check for a DSN and only send outcomes then + if (!this._dsn) { + debugBuild.DEBUG_BUILD && logger.logger.log('No dsn provided, will not send outcomes'); + return; + } + + debugBuild.DEBUG_BUILD && logger.logger.log('Sending outcomes:', outcomes); + + const envelope = clientreport.createClientReportEnvelope(outcomes, this._options.tunnel && dsn.dsnToString(this._dsn)); + + // sendEnvelope should not throw + // eslint-disable-next-line @typescript-eslint/no-floating-promises + this.sendEnvelope(envelope); + } + + /** + * @inheritDoc + */ + +} + +/** + * Verifies that return value of configured `beforeSend` or `beforeSendTransaction` is of expected type, and returns the value if so. + */ +function _validateBeforeSendResult( + beforeSendResult, + beforeSendLabel, +) { + const invalidValueError = `${beforeSendLabel} must return \`null\` or a valid event.`; + if (is.isThenable(beforeSendResult)) { + return beforeSendResult.then( + event => { + if (!is.isPlainObject(event) && event !== null) { + throw new error.SentryError(invalidValueError); + } + return event; + }, + e => { + throw new error.SentryError(`${beforeSendLabel} rejected with ${e}`); + }, + ); + } else if (!is.isPlainObject(beforeSendResult) && beforeSendResult !== null) { + throw new error.SentryError(invalidValueError); + } + return beforeSendResult; +} + +/** + * Process the matching `beforeSendXXX` callback. + */ +function processBeforeSend( + client, + options, + event, + hint, +) { + const { beforeSend, beforeSendTransaction, beforeSendSpan } = options; + + if (isErrorEvent(event) && beforeSend) { + return beforeSend(event, hint); + } + + if (isTransactionEvent(event)) { + if (event.spans && beforeSendSpan) { + const processedSpans = []; + for (const span of event.spans) { + const processedSpan = beforeSendSpan(span); + if (processedSpan) { + processedSpans.push(processedSpan); + } else { + spanUtils.showSpanDropWarning(); + client.recordDroppedEvent('before_send', 'span'); + } + } + event.spans = processedSpans; + } + + if (beforeSendTransaction) { + if (event.spans) { + // We store the # of spans before processing in SDK metadata, + // so we can compare it afterwards to determine how many spans were dropped + const spanCountBefore = event.spans.length; + event.sdkProcessingMetadata = { + ...event.sdkProcessingMetadata, + spanCountBeforeProcessing: spanCountBefore, + }; + } + return beforeSendTransaction(event, hint); + } + } + + return event; +} + +function isErrorEvent(event) { + return event.type === undefined; +} + +function isTransactionEvent(event) { + return event.type === 'transaction'; +} + +exports.BaseClient = BaseClient; +//# sourceMappingURL=baseclient.js.map + + +/***/ }), + +/***/ 5608: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const currentScopes = __nccwpck_require__(8131); +const logger = __nccwpck_require__(38752); +const time = __nccwpck_require__(75872); + +/** + * Default maximum number of breadcrumbs added to an event. Can be overwritten + * with {@link Options.maxBreadcrumbs}. + */ +const DEFAULT_BREADCRUMBS = 100; + +/** + * Records a new breadcrumb which will be attached to future events. + * + * Breadcrumbs will be added to subsequent events to provide more context on + * user's actions prior to an error or crash. + */ +function addBreadcrumb(breadcrumb, hint) { + const client = currentScopes.getClient(); + const isolationScope = currentScopes.getIsolationScope(); + + if (!client) return; + + const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } = client.getOptions(); + + if (maxBreadcrumbs <= 0) return; + + const timestamp = time.dateTimestampInSeconds(); + const mergedBreadcrumb = { timestamp, ...breadcrumb }; + const finalBreadcrumb = beforeBreadcrumb + ? (logger.consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) ) + : mergedBreadcrumb; + + if (finalBreadcrumb === null) return; + + if (client.emit) { + client.emit('beforeAddBreadcrumb', finalBreadcrumb, hint); + } + + isolationScope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs); +} + +exports.addBreadcrumb = addBreadcrumb; +//# sourceMappingURL=breadcrumbs.js.map + + +/***/ }), + +/***/ 38080: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const version = __nccwpck_require__(17370); +const worldwide = __nccwpck_require__(10891); + +/** + * An object that contains globally accessible properties and maintains a scope stack. + * @hidden + */ + +/** + * Returns the global shim registry. + * + * FIXME: This function is problematic, because despite always returning a valid Carrier, + * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check + * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there. + **/ +function getMainCarrier() { + // This ensures a Sentry carrier exists + getSentryCarrier(worldwide.GLOBAL_OBJ); + return worldwide.GLOBAL_OBJ; +} + +/** Will either get the existing sentry carrier, or create a new one. */ +function getSentryCarrier(carrier) { + const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {}); + + // For now: First SDK that sets the .version property wins + __SENTRY__.version = __SENTRY__.version || version.SDK_VERSION; + + // Intentionally populating and returning the version of "this" SDK instance + // rather than what's set in .version so that "this" SDK always gets its carrier + return (__SENTRY__[version.SDK_VERSION] = __SENTRY__[version.SDK_VERSION] || {}); +} + +exports.getMainCarrier = getMainCarrier; +exports.getSentryCarrier = getSentryCarrier; +//# sourceMappingURL=carrier.js.map + + +/***/ }), + +/***/ 54413: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const dsn = __nccwpck_require__(32540); +const envelope = __nccwpck_require__(72635); +const object = __nccwpck_require__(16100); + +/** + * Create envelope from check in item. + */ +function createCheckInEnvelope( + checkIn, + dynamicSamplingContext, + metadata, + tunnel, + dsn$1, +) { + const headers = { + sent_at: new Date().toISOString(), + }; + + if (metadata && metadata.sdk) { + headers.sdk = { + name: metadata.sdk.name, + version: metadata.sdk.version, + }; + } + + if (!!tunnel && !!dsn$1) { + headers.dsn = dsn.dsnToString(dsn$1); + } + + if (dynamicSamplingContext) { + headers.trace = object.dropUndefinedKeys(dynamicSamplingContext) ; + } + + const item = createCheckInEnvelopeItem(checkIn); + return envelope.createEnvelope(headers, [item]); +} + +function createCheckInEnvelopeItem(checkIn) { + const checkInHeaders = { + type: 'check_in', + }; + return [checkInHeaders, checkIn]; +} + +exports.createCheckInEnvelope = createCheckInEnvelope; +//# sourceMappingURL=checkin.js.map + + +/***/ }), + +/***/ 5958: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const DEFAULT_ENVIRONMENT = 'production'; + +exports.DEFAULT_ENVIRONMENT = DEFAULT_ENVIRONMENT; +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ 8131: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const index = __nccwpck_require__(29878); +const carrier = __nccwpck_require__(38080); +const scope = __nccwpck_require__(49417); +const object = __nccwpck_require__(16100); +const worldwide = __nccwpck_require__(10891); + +/** + * Get the currently active scope. + */ +function getCurrentScope() { + const carrier$1 = carrier.getMainCarrier(); + const acs = index.getAsyncContextStrategy(carrier$1); + return acs.getCurrentScope(); +} + +/** + * Get the currently active isolation scope. + * The isolation scope is active for the current execution context. + */ +function getIsolationScope() { + const carrier$1 = carrier.getMainCarrier(); + const acs = index.getAsyncContextStrategy(carrier$1); + return acs.getIsolationScope(); +} + +/** + * Get the global scope. + * This scope is applied to _all_ events. + */ +function getGlobalScope() { + return worldwide.getGlobalSingleton('globalScope', () => new scope.Scope()); +} + +/** + * Creates a new scope with and executes the given operation within. + * The scope is automatically removed once the operation + * finishes or throws. + */ + +/** + * Either creates a new active scope, or sets the given scope as active scope in the given callback. + */ +function withScope( + ...rest +) { + const carrier$1 = carrier.getMainCarrier(); + const acs = index.getAsyncContextStrategy(carrier$1); + + // If a scope is defined, we want to make this the active scope instead of the default one + if (rest.length === 2) { + const [scope, callback] = rest; + + if (!scope) { + return acs.withScope(callback); + } + + return acs.withSetScope(scope, callback); + } + + return acs.withScope(rest[0]); +} + +/** + * Attempts to fork the current isolation scope and the current scope based on the current async context strategy. If no + * async context strategy is set, the isolation scope and the current scope will not be forked (this is currently the + * case, for example, in the browser). + * + * Usage of this function in environments without async context strategy is discouraged and may lead to unexpected behaviour. + * + * This function is intended for Sentry SDK and SDK integration development. It is not recommended to be used in "normal" + * applications directly because it comes with pitfalls. Use at your own risk! + */ + +/** + * Either creates a new active isolation scope, or sets the given isolation scope as active scope in the given callback. + */ +function withIsolationScope( + ...rest + +) { + const carrier$1 = carrier.getMainCarrier(); + const acs = index.getAsyncContextStrategy(carrier$1); + + // If a scope is defined, we want to make this the active scope instead of the default one + if (rest.length === 2) { + const [isolationScope, callback] = rest; + + if (!isolationScope) { + return acs.withIsolationScope(callback); + } + + return acs.withSetIsolationScope(isolationScope, callback); + } + + return acs.withIsolationScope(rest[0]); +} + +/** + * Get the currently active client. + */ +function getClient() { + return getCurrentScope().getClient(); +} + +/** + * Get a trace context for the given scope. + */ +function getTraceContextFromScope(scope) { + const propagationContext = scope.getPropagationContext(); + + // TODO(v9): Use generateSpanId() instead of spanId + // eslint-disable-next-line deprecation/deprecation + const { traceId, spanId, parentSpanId } = propagationContext; + + const traceContext = object.dropUndefinedKeys({ + trace_id: traceId, + span_id: spanId, + parent_span_id: parentSpanId, + }); + + return traceContext; +} + +exports.getClient = getClient; +exports.getCurrentScope = getCurrentScope; +exports.getGlobalScope = getGlobalScope; +exports.getIsolationScope = getIsolationScope; +exports.getTraceContextFromScope = getTraceContextFromScope; +exports.withIsolationScope = withIsolationScope; +exports.withScope = withScope; +//# sourceMappingURL=currentScopes.js.map + + +/***/ }), + +/***/ 14488: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/** + * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code. + * + * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking. + */ +const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__); + +exports.DEBUG_BUILD = DEBUG_BUILD; +//# sourceMappingURL=debug-build.js.map + + +/***/ }), + +/***/ 80496: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const scope = __nccwpck_require__(49417); +const worldwide = __nccwpck_require__(10891); + +/** Get the default current scope. */ +function getDefaultCurrentScope() { + return worldwide.getGlobalSingleton('defaultCurrentScope', () => new scope.Scope()); +} + +/** Get the default isolation scope. */ +function getDefaultIsolationScope() { + return worldwide.getGlobalSingleton('defaultIsolationScope', () => new scope.Scope()); +} + +exports.getDefaultCurrentScope = getDefaultCurrentScope; +exports.getDefaultIsolationScope = getDefaultIsolationScope; +//# sourceMappingURL=defaultScopes.js.map + + +/***/ }), + +/***/ 58784: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const dynamicSamplingContext = __nccwpck_require__(29724); +const dsn = __nccwpck_require__(32540); +const envelope = __nccwpck_require__(72635); +__nccwpck_require__(87038); +__nccwpck_require__(38752); +const spanUtils = __nccwpck_require__(47569); + +/** + * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key. + * Merge with existing data if any. + **/ +function enhanceEventWithSdkInfo(event, sdkInfo) { + if (!sdkInfo) { + return event; + } + event.sdk = event.sdk || {}; + event.sdk.name = event.sdk.name || sdkInfo.name; + event.sdk.version = event.sdk.version || sdkInfo.version; + event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])]; + event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])]; + return event; +} + +/** Creates an envelope from a Session */ +function createSessionEnvelope( + session, + dsn$1, + metadata, + tunnel, +) { + const sdkInfo = envelope.getSdkMetadataForEnvelopeHeader(metadata); + const envelopeHeaders = { + sent_at: new Date().toISOString(), + ...(sdkInfo && { sdk: sdkInfo }), + ...(!!tunnel && dsn$1 && { dsn: dsn.dsnToString(dsn$1) }), + }; + + const envelopeItem = + 'aggregates' in session ? [{ type: 'sessions' }, session] : [{ type: 'session' }, session.toJSON()]; + + return envelope.createEnvelope(envelopeHeaders, [envelopeItem]); +} + +/** + * Create an Envelope from an event. + */ +function createEventEnvelope( + event, + dsn, + metadata, + tunnel, +) { + const sdkInfo = envelope.getSdkMetadataForEnvelopeHeader(metadata); + + /* + Note: Due to TS, event.type may be `replay_event`, theoretically. + In practice, we never call `createEventEnvelope` with `replay_event` type, + and we'd have to adjust a looot of types to make this work properly. + We want to avoid casting this around, as that could lead to bugs (e.g. when we add another type) + So the safe choice is to really guard against the replay_event type here. + */ + const eventType = event.type && event.type !== 'replay_event' ? event.type : 'event'; + + enhanceEventWithSdkInfo(event, metadata && metadata.sdk); + + const envelopeHeaders = envelope.createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn); + + // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to + // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may + // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid + // of this `delete`, lest we miss putting it back in the next time the property is in use.) + delete event.sdkProcessingMetadata; + + const eventItem = [{ type: eventType }, event]; + return envelope.createEnvelope(envelopeHeaders, [eventItem]); +} + +/** + * Create envelope from Span item. + * + * Takes an optional client and runs spans through `beforeSendSpan` if available. + */ +function createSpanEnvelope(spans, client) { + function dscHasRequiredProps(dsc) { + return !!dsc.trace_id && !!dsc.public_key; + } + + // For the moment we'll obtain the DSC from the first span in the array + // This might need to be changed if we permit sending multiple spans from + // different segments in one envelope + const dsc = dynamicSamplingContext.getDynamicSamplingContextFromSpan(spans[0]); + + const dsn$1 = client && client.getDsn(); + const tunnel = client && client.getOptions().tunnel; + + const headers = { + sent_at: new Date().toISOString(), + ...(dscHasRequiredProps(dsc) && { trace: dsc }), + ...(!!tunnel && dsn$1 && { dsn: dsn.dsnToString(dsn$1) }), + }; + + const beforeSendSpan = client && client.getOptions().beforeSendSpan; + const convertToSpanJSON = beforeSendSpan + ? (span) => { + const spanJson = beforeSendSpan(spanUtils.spanToJSON(span) ); + if (!spanJson) { + spanUtils.showSpanDropWarning(); + } + return spanJson; + } + : (span) => spanUtils.spanToJSON(span); + + const items = []; + for (const span of spans) { + const spanJson = convertToSpanJSON(span); + if (spanJson) { + items.push(envelope.createSpanEnvelopeItem(spanJson)); + } + } + + return envelope.createEnvelope(headers, items); +} + +exports.createEventEnvelope = createEventEnvelope; +exports.createSessionEnvelope = createSessionEnvelope; +exports.createSpanEnvelope = createSpanEnvelope; +//# sourceMappingURL=envelope.js.map + + +/***/ }), + +/***/ 45796: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const debugBuild = __nccwpck_require__(14488); +const is = __nccwpck_require__(84085); +const logger = __nccwpck_require__(38752); +const syncpromise = __nccwpck_require__(15621); + +/** + * Process an array of event processors, returning the processed event (or `null` if the event was dropped). + */ +function notifyEventProcessors( + processors, + event, + hint, + index = 0, +) { + return new syncpromise.SyncPromise((resolve, reject) => { + const processor = processors[index]; + if (event === null || typeof processor !== 'function') { + resolve(event); + } else { + const result = processor({ ...event }, hint) ; + + debugBuild.DEBUG_BUILD && processor.id && result === null && logger.logger.log(`Event processor "${processor.id}" dropped event`); + + if (is.isThenable(result)) { + void result + .then(final => notifyEventProcessors(processors, final, hint, index + 1).then(resolve)) + .then(null, reject); + } else { + void notifyEventProcessors(processors, result, hint, index + 1) + .then(resolve) + .then(null, reject); + } + } + }); +} + +exports.notifyEventProcessors = notifyEventProcessors; +//# sourceMappingURL=eventProcessors.js.map + + +/***/ }), + +/***/ 10779: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const constants = __nccwpck_require__(5958); +const currentScopes = __nccwpck_require__(8131); +const debugBuild = __nccwpck_require__(14488); +const session = __nccwpck_require__(60233); +const is = __nccwpck_require__(84085); +const logger = __nccwpck_require__(38752); +const misc = __nccwpck_require__(3181); +const time = __nccwpck_require__(75872); +const worldwide = __nccwpck_require__(10891); +const prepareEvent = __nccwpck_require__(22264); + +/** + * Captures an exception event and sends it to Sentry. + * + * @param exception The exception to capture. + * @param hint Optional additional data to attach to the Sentry event. + * @returns the id of the captured Sentry event. + */ +function captureException(exception, hint) { + return currentScopes.getCurrentScope().captureException(exception, prepareEvent.parseEventHintOrCaptureContext(hint)); +} + +/** + * Captures a message event and sends it to Sentry. + * + * @param message The message to send to Sentry. + * @param captureContext Define the level of the message or pass in additional data to attach to the message. + * @returns the id of the captured message. + */ +function captureMessage(message, captureContext) { + // This is necessary to provide explicit scopes upgrade, without changing the original + // arity of the `captureMessage(message, level)` method. + const level = typeof captureContext === 'string' ? captureContext : undefined; + const context = typeof captureContext !== 'string' ? { captureContext } : undefined; + return currentScopes.getCurrentScope().captureMessage(message, level, context); +} + +/** + * Captures a manually created event and sends it to Sentry. + * + * @param event The event to send to Sentry. + * @param hint Optional additional data to attach to the Sentry event. + * @returns the id of the captured event. + */ +function captureEvent(event, hint) { + return currentScopes.getCurrentScope().captureEvent(event, hint); +} + +/** + * Sets context data with the given name. + * @param name of the context + * @param context Any kind of data. This data will be normalized. + */ +function setContext(name, context) { + currentScopes.getIsolationScope().setContext(name, context); +} + +/** + * Set an object that will be merged sent as extra data with the event. + * @param extras Extras object to merge into current context. + */ +function setExtras(extras) { + currentScopes.getIsolationScope().setExtras(extras); +} + +/** + * Set key:value that will be sent as extra data with the event. + * @param key String of extra + * @param extra Any kind of data. This data will be normalized. + */ +function setExtra(key, extra) { + currentScopes.getIsolationScope().setExtra(key, extra); +} + +/** + * Set an object that will be merged sent as tags data with the event. + * @param tags Tags context object to merge into current context. + */ +function setTags(tags) { + currentScopes.getIsolationScope().setTags(tags); +} + +/** + * Set key:value that will be sent as tags data with the event. + * + * Can also be used to unset a tag, by passing `undefined`. + * + * @param key String key of tag + * @param value Value of tag + */ +function setTag(key, value) { + currentScopes.getIsolationScope().setTag(key, value); +} + +/** + * Updates user context information for future events. + * + * @param user User context object to be set in the current context. Pass `null` to unset the user. + */ +function setUser(user) { + currentScopes.getIsolationScope().setUser(user); +} + +/** + * The last error event id of the isolation scope. + * + * Warning: This function really returns the last recorded error event id on the current + * isolation scope. If you call this function after handling a certain error and another error + * is captured in between, the last one is returned instead of the one you might expect. + * Also, ids of events that were never sent to Sentry (for example because + * they were dropped in `beforeSend`) could be returned. + * + * @returns The last event id of the isolation scope. + */ +function lastEventId() { + return currentScopes.getIsolationScope().lastEventId(); +} + +/** + * Create a cron monitor check in and send it to Sentry. + * + * @param checkIn An object that describes a check in. + * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want + * to create a monitor automatically when sending a check in. + */ +function captureCheckIn(checkIn, upsertMonitorConfig) { + const scope = currentScopes.getCurrentScope(); + const client = currentScopes.getClient(); + if (!client) { + debugBuild.DEBUG_BUILD && logger.logger.warn('Cannot capture check-in. No client defined.'); + } else if (!client.captureCheckIn) { + debugBuild.DEBUG_BUILD && logger.logger.warn('Cannot capture check-in. Client does not support sending check-ins.'); + } else { + return client.captureCheckIn(checkIn, upsertMonitorConfig, scope); + } + + return misc.uuid4(); +} + +/** + * Wraps a callback with a cron monitor check in. The check in will be sent to Sentry when the callback finishes. + * + * @param monitorSlug The distinct slug of the monitor. + * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want + * to create a monitor automatically when sending a check in. + */ +function withMonitor( + monitorSlug, + callback, + upsertMonitorConfig, +) { + const checkInId = captureCheckIn({ monitorSlug, status: 'in_progress' }, upsertMonitorConfig); + const now = time.timestampInSeconds(); + + function finishCheckIn(status) { + captureCheckIn({ monitorSlug, status, checkInId, duration: time.timestampInSeconds() - now }); + } + + return currentScopes.withIsolationScope(() => { + let maybePromiseResult; + try { + maybePromiseResult = callback(); + } catch (e) { + finishCheckIn('error'); + throw e; + } + + if (is.isThenable(maybePromiseResult)) { + Promise.resolve(maybePromiseResult).then( + () => { + finishCheckIn('ok'); + }, + e => { + finishCheckIn('error'); + throw e; + }, + ); + } else { + finishCheckIn('ok'); + } + + return maybePromiseResult; + }); +} + +/** + * Call `flush()` on the current client, if there is one. See {@link Client.flush}. + * + * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause + * the client to wait until all events are sent before resolving the promise. + * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it + * doesn't (or if there's no client defined). + */ +async function flush(timeout) { + const client = currentScopes.getClient(); + if (client) { + return client.flush(timeout); + } + debugBuild.DEBUG_BUILD && logger.logger.warn('Cannot flush events. No client defined.'); + return Promise.resolve(false); +} + +/** + * Call `close()` on the current client, if there is one. See {@link Client.close}. + * + * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this + * parameter will cause the client to wait until all events are sent before disabling itself. + * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it + * doesn't (or if there's no client defined). + */ +async function close(timeout) { + const client = currentScopes.getClient(); + if (client) { + return client.close(timeout); + } + debugBuild.DEBUG_BUILD && logger.logger.warn('Cannot flush events and disable SDK. No client defined.'); + return Promise.resolve(false); +} + +/** + * Returns true if Sentry has been properly initialized. + */ +function isInitialized() { + return !!currentScopes.getClient(); +} + +/** If the SDK is initialized & enabled. */ +function isEnabled() { + const client = currentScopes.getClient(); + return !!client && client.getOptions().enabled !== false && !!client.getTransport(); +} + +/** + * Add an event processor. + * This will be added to the current isolation scope, ensuring any event that is processed in the current execution + * context will have the processor applied. + */ +function addEventProcessor(callback) { + currentScopes.getIsolationScope().addEventProcessor(callback); +} + +/** + * Start a session on the current isolation scope. + * + * @param context (optional) additional properties to be applied to the returned session object + * + * @returns the new active session + */ +function startSession(context) { + const client = currentScopes.getClient(); + const isolationScope = currentScopes.getIsolationScope(); + const currentScope = currentScopes.getCurrentScope(); + + const { release, environment = constants.DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {}; + + // Will fetch userAgent if called from browser sdk + const { userAgent } = worldwide.GLOBAL_OBJ.navigator || {}; + + const session$1 = session.makeSession({ + release, + environment, + user: currentScope.getUser() || isolationScope.getUser(), + ...(userAgent && { userAgent }), + ...context, + }); + + // End existing session if there's one + const currentSession = isolationScope.getSession(); + if (currentSession && currentSession.status === 'ok') { + session.updateSession(currentSession, { status: 'exited' }); + } + + endSession(); + + // Afterwards we set the new session on the scope + isolationScope.setSession(session$1); + + // TODO (v8): Remove this and only use the isolation scope(?). + // For v7 though, we can't "soft-break" people using getCurrentHub().getScope().setSession() + currentScope.setSession(session$1); + + return session$1; +} + +/** + * End the session on the current isolation scope. + */ +function endSession() { + const isolationScope = currentScopes.getIsolationScope(); + const currentScope = currentScopes.getCurrentScope(); + + const session$1 = currentScope.getSession() || isolationScope.getSession(); + if (session$1) { + session.closeSession(session$1); + } + _sendSessionUpdate(); + + // the session is over; take it off of the scope + isolationScope.setSession(); + + // TODO (v8): Remove this and only use the isolation scope(?). + // For v7 though, we can't "soft-break" people using getCurrentHub().getScope().setSession() + currentScope.setSession(); +} + +/** + * Sends the current Session on the scope + */ +function _sendSessionUpdate() { + const isolationScope = currentScopes.getIsolationScope(); + const currentScope = currentScopes.getCurrentScope(); + const client = currentScopes.getClient(); + // TODO (v8): Remove currentScope and only use the isolation scope(?). + // For v7 though, we can't "soft-break" people using getCurrentHub().getScope().setSession() + const session = currentScope.getSession() || isolationScope.getSession(); + if (session && client) { + client.captureSession(session); + } +} + +/** + * Sends the current session on the scope to Sentry + * + * @param end If set the session will be marked as exited and removed from the scope. + * Defaults to `false`. + */ +function captureSession(end = false) { + // both send the update and pull the session from the scope + if (end) { + endSession(); + return; + } + + // only send the update + _sendSessionUpdate(); +} + +exports.addEventProcessor = addEventProcessor; +exports.captureCheckIn = captureCheckIn; +exports.captureEvent = captureEvent; +exports.captureException = captureException; +exports.captureMessage = captureMessage; +exports.captureSession = captureSession; +exports.close = close; +exports.endSession = endSession; +exports.flush = flush; +exports.isEnabled = isEnabled; +exports.isInitialized = isInitialized; +exports.lastEventId = lastEventId; +exports.setContext = setContext; +exports.setExtra = setExtra; +exports.setExtras = setExtras; +exports.setTag = setTag; +exports.setTags = setTags; +exports.setUser = setUser; +exports.startSession = startSession; +exports.withMonitor = withMonitor; +//# sourceMappingURL=exports.js.map + + +/***/ }), + +/***/ 66883: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const currentScopes = __nccwpck_require__(8131); +const object = __nccwpck_require__(16100); + +/** + * Send user feedback to Sentry. + */ +function captureFeedback( + params, + hint = {}, + scope = currentScopes.getCurrentScope(), +) { + const { message, name, email, url, source, associatedEventId, tags } = params; + + const feedbackEvent = { + contexts: { + feedback: object.dropUndefinedKeys({ + contact_email: email, + name, + message, + url, + source, + associated_event_id: associatedEventId, + }), + }, + type: 'feedback', + level: 'info', + tags, + }; + + const client = (scope && scope.getClient()) || currentScopes.getClient(); + + if (client) { + client.emit('beforeSendFeedback', feedbackEvent, hint); + } + + const eventId = scope.captureEvent(feedbackEvent, hint); + + return eventId; +} + +exports.captureFeedback = captureFeedback; +//# sourceMappingURL=feedback.js.map + + +/***/ }), + +/***/ 17808: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const semanticAttributes = __nccwpck_require__(36827); +__nccwpck_require__(21834); +const is = __nccwpck_require__(84085); +__nccwpck_require__(87038); +__nccwpck_require__(38752); +__nccwpck_require__(75872); +__nccwpck_require__(15621); +const url = __nccwpck_require__(44673); +const baggage = __nccwpck_require__(86741); +__nccwpck_require__(14488); +const hasTracingEnabled = __nccwpck_require__(79223); +const spanUtils = __nccwpck_require__(47569); +const sentryNonRecordingSpan = __nccwpck_require__(36854); +const spanstatus = __nccwpck_require__(21119); +const trace = __nccwpck_require__(97956); +const traceData = __nccwpck_require__(7522); + +/** + * Create and track fetch request spans for usage in combination with `addFetchInstrumentationHandler`. + * + * @returns Span if a span was created, otherwise void. + */ +function instrumentFetchRequest( + handlerData, + shouldCreateSpan, + shouldAttachHeaders, + spans, + spanOrigin = 'auto.http.browser', +) { + if (!handlerData.fetchData) { + return undefined; + } + + const shouldCreateSpanResult = hasTracingEnabled.hasTracingEnabled() && shouldCreateSpan(handlerData.fetchData.url); + + if (handlerData.endTimestamp && shouldCreateSpanResult) { + const spanId = handlerData.fetchData.__span; + if (!spanId) return; + + const span = spans[spanId]; + if (span) { + endSpan(span, handlerData); + + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete spans[spanId]; + } + return undefined; + } + + const { method, url: url$1 } = handlerData.fetchData; + + const fullUrl = getFullURL(url$1); + const host = fullUrl ? url.parseUrl(fullUrl).host : undefined; + + const hasParent = !!spanUtils.getActiveSpan(); + + const span = + shouldCreateSpanResult && hasParent + ? trace.startInactiveSpan({ + name: `${method} ${url$1}`, + attributes: { + url: url$1, + type: 'fetch', + 'http.method': method, + 'http.url': fullUrl, + 'server.address': host, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client', + }, + }) + : new sentryNonRecordingSpan.SentryNonRecordingSpan(); + + handlerData.fetchData.__span = span.spanContext().spanId; + spans[span.spanContext().spanId] = span; + + if (shouldAttachHeaders(handlerData.fetchData.url)) { + const request = handlerData.args[0]; + + const options = handlerData.args[1] || {}; + + const headers = _addTracingHeadersToFetchRequest( + request, + options, + // If performance is disabled (TWP) or there's no active root span (pageload/navigation/interaction), + // we do not want to use the span as base for the trace headers, + // which means that the headers will be generated from the scope and the sampling decision is deferred + hasTracingEnabled.hasTracingEnabled() && hasParent ? span : undefined, + ); + if (headers) { + // Ensure this is actually set, if no options have been passed previously + handlerData.args[1] = options; + options.headers = headers; + } + } + + return span; +} + +/** + * Adds sentry-trace and baggage headers to the various forms of fetch headers. + */ +function _addTracingHeadersToFetchRequest( + request, + fetchOptionsObj + +, + span, +) { + const traceHeaders = traceData.getTraceData({ span }); + const sentryTrace = traceHeaders['sentry-trace']; + const baggage = traceHeaders.baggage; + + // Nothing to do, when we return undefined here, the original headers will be used + if (!sentryTrace) { + return undefined; + } + + const headers = fetchOptionsObj.headers || (isRequest(request) ? request.headers : undefined); + + if (!headers) { + return { ...traceHeaders }; + } else if (isHeaders(headers)) { + const newHeaders = new Headers(headers); + newHeaders.set('sentry-trace', sentryTrace); + + if (baggage) { + const prevBaggageHeader = newHeaders.get('baggage'); + if (prevBaggageHeader) { + const prevHeaderStrippedFromSentryBaggage = stripBaggageHeaderOfSentryBaggageValues(prevBaggageHeader); + newHeaders.set( + 'baggage', + // If there are non-sentry entries (i.e. if the stripped string is non-empty/truthy) combine the stripped header and sentry baggage header + // otherwise just set the sentry baggage header + prevHeaderStrippedFromSentryBaggage ? `${prevHeaderStrippedFromSentryBaggage},${baggage}` : baggage, + ); + } else { + newHeaders.set('baggage', baggage); + } + } + + return newHeaders; + } else if (Array.isArray(headers)) { + const newHeaders = [ + ...headers + // Remove any existing sentry-trace headers + .filter(header => { + return !(Array.isArray(header) && header[0] === 'sentry-trace'); + }) + // Get rid of previous sentry baggage values in baggage header + .map(header => { + if (Array.isArray(header) && header[0] === 'baggage' && typeof header[1] === 'string') { + const [headerName, headerValue, ...rest] = header; + return [headerName, stripBaggageHeaderOfSentryBaggageValues(headerValue), ...rest]; + } else { + return header; + } + }), + // Attach the new sentry-trace header + ['sentry-trace', sentryTrace], + ]; + + if (baggage) { + // If there are multiple entries with the same key, the browser will merge the values into a single request header. + // Its therefore safe to simply push a "baggage" entry, even though there might already be another baggage header. + newHeaders.push(['baggage', baggage]); + } + + return newHeaders ; + } else { + const existingBaggageHeader = 'baggage' in headers ? headers.baggage : undefined; + let newBaggageHeaders = []; + + if (Array.isArray(existingBaggageHeader)) { + newBaggageHeaders = existingBaggageHeader + .map(headerItem => + typeof headerItem === 'string' ? stripBaggageHeaderOfSentryBaggageValues(headerItem) : headerItem, + ) + .filter(headerItem => headerItem === ''); + } else if (existingBaggageHeader) { + newBaggageHeaders.push(stripBaggageHeaderOfSentryBaggageValues(existingBaggageHeader)); + } + + if (baggage) { + newBaggageHeaders.push(baggage); + } + + return { + ...(headers ), + 'sentry-trace': sentryTrace, + baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined, + }; + } +} + +/** + * Adds sentry-trace and baggage headers to the various forms of fetch headers. + * + * @deprecated This function will not be exported anymore in v9. + */ +function addTracingHeadersToFetchRequest( + request, + _client, + _scope, + fetchOptionsObj + +, + span, +) { + return _addTracingHeadersToFetchRequest(request , fetchOptionsObj, span); +} + +function getFullURL(url) { + try { + const parsed = new URL(url); + return parsed.href; + } catch (e) { + return undefined; + } +} + +function endSpan(span, handlerData) { + if (handlerData.response) { + spanstatus.setHttpStatus(span, handlerData.response.status); + + const contentLength = + handlerData.response && handlerData.response.headers && handlerData.response.headers.get('content-length'); + + if (contentLength) { + const contentLengthNum = parseInt(contentLength); + if (contentLengthNum > 0) { + span.setAttribute('http.response_content_length', contentLengthNum); + } + } + } else if (handlerData.error) { + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: 'internal_error' }); + } + span.end(); +} + +function stripBaggageHeaderOfSentryBaggageValues(baggageHeader) { + return ( + baggageHeader + .split(',') + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + .filter(baggageEntry => !baggageEntry.split('=')[0].startsWith(baggage.SENTRY_BAGGAGE_KEY_PREFIX)) + .join(',') + ); +} + +function isRequest(request) { + return typeof Request !== 'undefined' && is.isInstanceOf(request, Request); +} + +function isHeaders(headers) { + return typeof Headers !== 'undefined' && is.isInstanceOf(headers, Headers); +} + +exports.addTracingHeadersToFetchRequest = addTracingHeadersToFetchRequest; +exports.instrumentFetchRequest = instrumentFetchRequest; +//# sourceMappingURL=fetch.js.map + + +/***/ }), + +/***/ 55103: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const breadcrumbs = __nccwpck_require__(5608); +const currentScopes = __nccwpck_require__(8131); +const exports$1 = __nccwpck_require__(10779); + +/** + * This is for legacy reasons, and returns a proxy object instead of a hub to be used. + * + * @deprecated Use the methods directly from the top level Sentry API (e.g. `Sentry.withScope`) + * For more information see our migration guide for + * [replacing `getCurrentHub` and `Hub`](https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md#deprecate-hub) + * usage + */ +// eslint-disable-next-line deprecation/deprecation +function getCurrentHubShim() { + return { + bindClient(client) { + const scope = currentScopes.getCurrentScope(); + scope.setClient(client); + }, + + withScope: currentScopes.withScope, + getClient: () => currentScopes.getClient() , + getScope: currentScopes.getCurrentScope, + getIsolationScope: currentScopes.getIsolationScope, + captureException: (exception, hint) => { + return currentScopes.getCurrentScope().captureException(exception, hint); + }, + captureMessage: (message, level, hint) => { + return currentScopes.getCurrentScope().captureMessage(message, level, hint); + }, + captureEvent: exports$1.captureEvent, + addBreadcrumb: breadcrumbs.addBreadcrumb, + setUser: exports$1.setUser, + setTags: exports$1.setTags, + setTag: exports$1.setTag, + setExtra: exports$1.setExtra, + setExtras: exports$1.setExtras, + setContext: exports$1.setContext, + + getIntegration(integration) { + const client = currentScopes.getClient(); + return (client && client.getIntegrationByName(integration.id)) || null; + }, + + startSession: exports$1.startSession, + endSession: exports$1.endSession, + captureSession(end) { + // both send the update and pull the session from the scope + if (end) { + return exports$1.endSession(); + } + + // only send the update + _sendSessionUpdate(); + }, + }; +} + +/** + * Returns the default hub instance. + * + * If a hub is already registered in the global carrier but this module + * contains a more recent version, it replaces the registered version. + * Otherwise, the currently registered hub will be returned. + * + * @deprecated Use the respective replacement method directly instead. + */ +// eslint-disable-next-line deprecation/deprecation +const getCurrentHub = getCurrentHubShim; + +/** + * Sends the current Session on the scope + */ +function _sendSessionUpdate() { + const scope = currentScopes.getCurrentScope(); + const client = currentScopes.getClient(); + + const session = scope.getSession(); + if (client && session) { + client.captureSession(session); + } +} + +exports.getCurrentHub = getCurrentHub; +exports.getCurrentHubShim = getCurrentHubShim; +//# sourceMappingURL=getCurrentHubShim.js.map + + +/***/ }), + +/***/ 84466: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const errors = __nccwpck_require__(21834); +const utils = __nccwpck_require__(77989); +const hubextensions = __nccwpck_require__(51019); +const idleSpan = __nccwpck_require__(89709); +const sentrySpan = __nccwpck_require__(53263); +const sentryNonRecordingSpan = __nccwpck_require__(36854); +const spanstatus = __nccwpck_require__(21119); +const trace = __nccwpck_require__(97956); +const dynamicSamplingContext = __nccwpck_require__(29724); +const measurement = __nccwpck_require__(50722); +const sampling = __nccwpck_require__(79478); +const logSpans = __nccwpck_require__(28761); +const semanticAttributes = __nccwpck_require__(36827); +const envelope = __nccwpck_require__(58784); +const exports$1 = __nccwpck_require__(10779); +const currentScopes = __nccwpck_require__(8131); +const defaultScopes = __nccwpck_require__(80496); +const index = __nccwpck_require__(29878); +const carrier = __nccwpck_require__(38080); +const session = __nccwpck_require__(60233); +const sessionflusher = __nccwpck_require__(88971); +const scope = __nccwpck_require__(49417); +const eventProcessors = __nccwpck_require__(45796); +const api = __nccwpck_require__(88563); +const baseclient = __nccwpck_require__(95457); +const serverRuntimeClient = __nccwpck_require__(37238); +const sdk = __nccwpck_require__(6183); +const base = __nccwpck_require__(24899); +const offline = __nccwpck_require__(52419); +const multiplexed = __nccwpck_require__(97281); +const integration = __nccwpck_require__(67428); +const applyScopeDataToEvent = __nccwpck_require__(87359); +const prepareEvent = __nccwpck_require__(22264); +const checkin = __nccwpck_require__(54413); +const hasTracingEnabled = __nccwpck_require__(79223); +const isSentryRequestUrl = __nccwpck_require__(2554); +const handleCallbackErrors = __nccwpck_require__(77864); +const parameterize = __nccwpck_require__(32957); +const spanUtils = __nccwpck_require__(47569); +const parseSampleRate = __nccwpck_require__(54078); +const sdkMetadata = __nccwpck_require__(24054); +const traceData = __nccwpck_require__(7522); +const meta = __nccwpck_require__(34314); +const constants = __nccwpck_require__(5958); +const breadcrumbs = __nccwpck_require__(5608); +const functiontostring = __nccwpck_require__(48318); +const inboundfilters = __nccwpck_require__(81264); +const linkederrors = __nccwpck_require__(90529); +const metadata = __nccwpck_require__(1668); +const requestdata = __nccwpck_require__(71679); +const captureconsole = __nccwpck_require__(25821); +const debug = __nccwpck_require__(39957); +const dedupe = __nccwpck_require__(96514); +const extraerrordata = __nccwpck_require__(88764); +const rewriteframes = __nccwpck_require__(94102); +const sessiontiming = __nccwpck_require__(20871); +const zoderrors = __nccwpck_require__(55472); +const thirdPartyErrorsFilter = __nccwpck_require__(86140); +const exports$2 = __nccwpck_require__(57134); +const profiling = __nccwpck_require__(25750); +const exportsDefault = __nccwpck_require__(19001); +const browserAggregator = __nccwpck_require__(53128); +const metricSummary = __nccwpck_require__(48306); +const fetch = __nccwpck_require__(17808); +const trpc = __nccwpck_require__(18833); +const feedback = __nccwpck_require__(66883); +const getCurrentHubShim = __nccwpck_require__(55103); +const aggregateErrors = __nccwpck_require__(29416); +const array = __nccwpck_require__(28904); +const breadcrumbLogLevel = __nccwpck_require__(56448); +const browser = __nccwpck_require__(24450); +const dsn = __nccwpck_require__(32540); +const error = __nccwpck_require__(66322); +const worldwide = __nccwpck_require__(10891); +const console = __nccwpck_require__(32758); +const fetch$1 = __nccwpck_require__(34670); +const globalError = __nccwpck_require__(97033); +const globalUnhandledRejection = __nccwpck_require__(26156); +const handlers = __nccwpck_require__(44639); +const is = __nccwpck_require__(84085); +const isBrowser = __nccwpck_require__(52200); +const logger = __nccwpck_require__(38752); +const memo = __nccwpck_require__(13414); +const misc = __nccwpck_require__(3181); +const node = __nccwpck_require__(10116); +const normalize = __nccwpck_require__(65543); +const object = __nccwpck_require__(16100); +const path = __nccwpck_require__(94509); +const promisebuffer = __nccwpck_require__(28058); +const requestdata$1 = __nccwpck_require__(4630); +const severity = __nccwpck_require__(25753); +const stacktrace = __nccwpck_require__(85820); +const nodeStackTrace = __nccwpck_require__(70169); +const string = __nccwpck_require__(93529); +const supports = __nccwpck_require__(73872); +const syncpromise = __nccwpck_require__(15621); +const time = __nccwpck_require__(75872); +const tracing = __nccwpck_require__(15977); +const env = __nccwpck_require__(11318); +const envelope$1 = __nccwpck_require__(72635); +const clientreport = __nccwpck_require__(27962); +const ratelimit = __nccwpck_require__(78922); +const baggage = __nccwpck_require__(86741); +const url = __nccwpck_require__(44673); +const cache = __nccwpck_require__(6360); +const eventbuilder = __nccwpck_require__(2781); +const anr = __nccwpck_require__(13231); +const lru = __nccwpck_require__(50981); +const propagationContext = __nccwpck_require__(37264); +const vercelWaitUntil = __nccwpck_require__(77437); +const version = __nccwpck_require__(17370); +const debugIds = __nccwpck_require__(4263); +const escapeStringForRegex = __nccwpck_require__(20677); +const supportsHistory = __nccwpck_require__(86017); +const _asyncNullishCoalesce = __nccwpck_require__(89294); +const _asyncOptionalChain = __nccwpck_require__(82384); +const _asyncOptionalChainDelete = __nccwpck_require__(24613); +const _nullishCoalesce = __nccwpck_require__(68874); +const _optionalChain = __nccwpck_require__(6752); +const _optionalChainDelete = __nccwpck_require__(65631); + + + +exports.registerSpanErrorInstrumentation = errors.registerSpanErrorInstrumentation; +exports.getCapturedScopesOnSpan = utils.getCapturedScopesOnSpan; +exports.setCapturedScopesOnSpan = utils.setCapturedScopesOnSpan; +exports.addTracingExtensions = hubextensions.addTracingExtensions; +exports.TRACING_DEFAULTS = idleSpan.TRACING_DEFAULTS; +exports.startIdleSpan = idleSpan.startIdleSpan; +exports.SentrySpan = sentrySpan.SentrySpan; +exports.SentryNonRecordingSpan = sentryNonRecordingSpan.SentryNonRecordingSpan; +exports.SPAN_STATUS_ERROR = spanstatus.SPAN_STATUS_ERROR; +exports.SPAN_STATUS_OK = spanstatus.SPAN_STATUS_OK; +exports.SPAN_STATUS_UNSET = spanstatus.SPAN_STATUS_UNSET; +exports.getSpanStatusFromHttpCode = spanstatus.getSpanStatusFromHttpCode; +exports.setHttpStatus = spanstatus.setHttpStatus; +exports.continueTrace = trace.continueTrace; +exports.startInactiveSpan = trace.startInactiveSpan; +exports.startNewTrace = trace.startNewTrace; +exports.startSpan = trace.startSpan; +exports.startSpanManual = trace.startSpanManual; +exports.suppressTracing = trace.suppressTracing; +exports.withActiveSpan = trace.withActiveSpan; +exports.getDynamicSamplingContextFromClient = dynamicSamplingContext.getDynamicSamplingContextFromClient; +exports.getDynamicSamplingContextFromScope = dynamicSamplingContext.getDynamicSamplingContextFromScope; +exports.getDynamicSamplingContextFromSpan = dynamicSamplingContext.getDynamicSamplingContextFromSpan; +exports.spanToBaggageHeader = dynamicSamplingContext.spanToBaggageHeader; +exports.setMeasurement = measurement.setMeasurement; +exports.timedEventsToMeasurements = measurement.timedEventsToMeasurements; +exports.sampleSpan = sampling.sampleSpan; +exports.logSpanEnd = logSpans.logSpanEnd; +exports.logSpanStart = logSpans.logSpanStart; +exports.SEMANTIC_ATTRIBUTE_CACHE_HIT = semanticAttributes.SEMANTIC_ATTRIBUTE_CACHE_HIT; +exports.SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE = semanticAttributes.SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE; +exports.SEMANTIC_ATTRIBUTE_CACHE_KEY = semanticAttributes.SEMANTIC_ATTRIBUTE_CACHE_KEY; +exports.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = semanticAttributes.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME; +exports.SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD = semanticAttributes.SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD; +exports.SEMANTIC_ATTRIBUTE_PROFILE_ID = semanticAttributes.SEMANTIC_ATTRIBUTE_PROFILE_ID; +exports.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME; +exports.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON; +exports.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT; +exports.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE; +exports.SEMANTIC_ATTRIBUTE_SENTRY_OP = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP; +exports.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN; +exports.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE; +exports.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE; +exports.SEMANTIC_ATTRIBUTE_URL_FULL = semanticAttributes.SEMANTIC_ATTRIBUTE_URL_FULL; +exports.createEventEnvelope = envelope.createEventEnvelope; +exports.createSessionEnvelope = envelope.createSessionEnvelope; +exports.createSpanEnvelope = envelope.createSpanEnvelope; +exports.addEventProcessor = exports$1.addEventProcessor; +exports.captureCheckIn = exports$1.captureCheckIn; +exports.captureEvent = exports$1.captureEvent; +exports.captureException = exports$1.captureException; +exports.captureMessage = exports$1.captureMessage; +exports.captureSession = exports$1.captureSession; +exports.close = exports$1.close; +exports.endSession = exports$1.endSession; +exports.flush = exports$1.flush; +exports.isEnabled = exports$1.isEnabled; +exports.isInitialized = exports$1.isInitialized; +exports.lastEventId = exports$1.lastEventId; +exports.setContext = exports$1.setContext; +exports.setExtra = exports$1.setExtra; +exports.setExtras = exports$1.setExtras; +exports.setTag = exports$1.setTag; +exports.setTags = exports$1.setTags; +exports.setUser = exports$1.setUser; +exports.startSession = exports$1.startSession; +exports.withMonitor = exports$1.withMonitor; +exports.getClient = currentScopes.getClient; +exports.getCurrentScope = currentScopes.getCurrentScope; +exports.getGlobalScope = currentScopes.getGlobalScope; +exports.getIsolationScope = currentScopes.getIsolationScope; +exports.getTraceContextFromScope = currentScopes.getTraceContextFromScope; +exports.withIsolationScope = currentScopes.withIsolationScope; +exports.withScope = currentScopes.withScope; +exports.getDefaultCurrentScope = defaultScopes.getDefaultCurrentScope; +exports.getDefaultIsolationScope = defaultScopes.getDefaultIsolationScope; +exports.setAsyncContextStrategy = index.setAsyncContextStrategy; +exports.getMainCarrier = carrier.getMainCarrier; +exports.closeSession = session.closeSession; +exports.makeSession = session.makeSession; +exports.updateSession = session.updateSession; +exports.SessionFlusher = sessionflusher.SessionFlusher; +exports.Scope = scope.Scope; +exports.notifyEventProcessors = eventProcessors.notifyEventProcessors; +exports.getEnvelopeEndpointWithUrlEncodedAuth = api.getEnvelopeEndpointWithUrlEncodedAuth; +exports.getReportDialogEndpoint = api.getReportDialogEndpoint; +exports.BaseClient = baseclient.BaseClient; +exports.ServerRuntimeClient = serverRuntimeClient.ServerRuntimeClient; +exports.initAndBind = sdk.initAndBind; +exports.setCurrentClient = sdk.setCurrentClient; +exports.createTransport = base.createTransport; +exports.makeOfflineTransport = offline.makeOfflineTransport; +exports.makeMultiplexedTransport = multiplexed.makeMultiplexedTransport; +exports.addIntegration = integration.addIntegration; +exports.defineIntegration = integration.defineIntegration; +exports.getIntegrationsToSetup = integration.getIntegrationsToSetup; +exports.applyScopeDataToEvent = applyScopeDataToEvent.applyScopeDataToEvent; +exports.mergeScopeData = applyScopeDataToEvent.mergeScopeData; +exports.prepareEvent = prepareEvent.prepareEvent; +exports.createCheckInEnvelope = checkin.createCheckInEnvelope; +exports.hasTracingEnabled = hasTracingEnabled.hasTracingEnabled; +exports.isSentryRequestUrl = isSentryRequestUrl.isSentryRequestUrl; +exports.handleCallbackErrors = handleCallbackErrors.handleCallbackErrors; +exports.parameterize = parameterize.parameterize; +exports.addChildSpanToSpan = spanUtils.addChildSpanToSpan; +exports.getActiveSpan = spanUtils.getActiveSpan; +exports.getRootSpan = spanUtils.getRootSpan; +exports.getSpanDescendants = spanUtils.getSpanDescendants; +exports.getStatusMessage = spanUtils.getStatusMessage; +exports.spanIsSampled = spanUtils.spanIsSampled; +exports.spanTimeInputToSeconds = spanUtils.spanTimeInputToSeconds; +exports.spanToJSON = spanUtils.spanToJSON; +exports.spanToTraceContext = spanUtils.spanToTraceContext; +exports.spanToTraceHeader = spanUtils.spanToTraceHeader; +exports.updateSpanName = spanUtils.updateSpanName; +exports.parseSampleRate = parseSampleRate.parseSampleRate; +exports.applySdkMetadata = sdkMetadata.applySdkMetadata; +exports.getTraceData = traceData.getTraceData; +exports.getTraceMetaTags = meta.getTraceMetaTags; +exports.DEFAULT_ENVIRONMENT = constants.DEFAULT_ENVIRONMENT; +exports.addBreadcrumb = breadcrumbs.addBreadcrumb; +exports.functionToStringIntegration = functiontostring.functionToStringIntegration; +exports.inboundFiltersIntegration = inboundfilters.inboundFiltersIntegration; +exports.linkedErrorsIntegration = linkederrors.linkedErrorsIntegration; +exports.moduleMetadataIntegration = metadata.moduleMetadataIntegration; +exports.requestDataIntegration = requestdata.requestDataIntegration; +exports.captureConsoleIntegration = captureconsole.captureConsoleIntegration; +exports.debugIntegration = debug.debugIntegration; +exports.dedupeIntegration = dedupe.dedupeIntegration; +exports.extraErrorDataIntegration = extraerrordata.extraErrorDataIntegration; +exports.rewriteFramesIntegration = rewriteframes.rewriteFramesIntegration; +exports.sessionTimingIntegration = sessiontiming.sessionTimingIntegration; +exports.zodErrorsIntegration = zoderrors.zodErrorsIntegration; +exports.thirdPartyErrorFilterIntegration = thirdPartyErrorsFilter.thirdPartyErrorFilterIntegration; +exports.metrics = exports$2.metrics; +exports.profiler = profiling.profiler; +exports.metricsDefault = exportsDefault.metricsDefault; +exports.BrowserMetricsAggregator = browserAggregator.BrowserMetricsAggregator; +exports.getMetricSummaryJsonForSpan = metricSummary.getMetricSummaryJsonForSpan; +exports.addTracingHeadersToFetchRequest = fetch.addTracingHeadersToFetchRequest; +exports.instrumentFetchRequest = fetch.instrumentFetchRequest; +exports.trpcMiddleware = trpc.trpcMiddleware; +exports.captureFeedback = feedback.captureFeedback; +exports.getCurrentHub = getCurrentHubShim.getCurrentHub; +exports.getCurrentHubShim = getCurrentHubShim.getCurrentHubShim; +exports.applyAggregateErrorsToEvent = aggregateErrors.applyAggregateErrorsToEvent; +exports.flatten = array.flatten; +exports.getBreadcrumbLogLevelFromHttpStatusCode = breadcrumbLogLevel.getBreadcrumbLogLevelFromHttpStatusCode; +exports.getComponentName = browser.getComponentName; +exports.getDomElement = browser.getDomElement; +exports.getLocationHref = browser.getLocationHref; +exports.htmlTreeAsString = browser.htmlTreeAsString; +exports.dsnFromString = dsn.dsnFromString; +exports.dsnToString = dsn.dsnToString; +exports.makeDsn = dsn.makeDsn; +exports.SentryError = error.SentryError; +exports.GLOBAL_OBJ = worldwide.GLOBAL_OBJ; +exports.getGlobalSingleton = worldwide.getGlobalSingleton; +exports.addConsoleInstrumentationHandler = console.addConsoleInstrumentationHandler; +exports.addFetchEndInstrumentationHandler = fetch$1.addFetchEndInstrumentationHandler; +exports.addFetchInstrumentationHandler = fetch$1.addFetchInstrumentationHandler; +exports.addGlobalErrorInstrumentationHandler = globalError.addGlobalErrorInstrumentationHandler; +exports.addGlobalUnhandledRejectionInstrumentationHandler = globalUnhandledRejection.addGlobalUnhandledRejectionInstrumentationHandler; +exports.addHandler = handlers.addHandler; +exports.maybeInstrument = handlers.maybeInstrument; +exports.resetInstrumentationHandlers = handlers.resetInstrumentationHandlers; +exports.triggerHandlers = handlers.triggerHandlers; +exports.isDOMError = is.isDOMError; +exports.isDOMException = is.isDOMException; +exports.isElement = is.isElement; +exports.isError = is.isError; +exports.isErrorEvent = is.isErrorEvent; +exports.isEvent = is.isEvent; +exports.isInstanceOf = is.isInstanceOf; +exports.isParameterizedString = is.isParameterizedString; +exports.isPlainObject = is.isPlainObject; +exports.isPrimitive = is.isPrimitive; +exports.isRegExp = is.isRegExp; +exports.isString = is.isString; +exports.isSyntheticEvent = is.isSyntheticEvent; +exports.isThenable = is.isThenable; +exports.isVueViewModel = is.isVueViewModel; +exports.isBrowser = isBrowser.isBrowser; +exports.CONSOLE_LEVELS = logger.CONSOLE_LEVELS; +exports.consoleSandbox = logger.consoleSandbox; +exports.logger = logger.logger; +exports.originalConsoleMethods = logger.originalConsoleMethods; +exports.memoBuilder = memo.memoBuilder; +exports.addContextToFrame = misc.addContextToFrame; +exports.addExceptionMechanism = misc.addExceptionMechanism; +exports.addExceptionTypeValue = misc.addExceptionTypeValue; +exports.arrayify = misc.arrayify; +exports.checkOrSetAlreadyCaught = misc.checkOrSetAlreadyCaught; +exports.getEventDescription = misc.getEventDescription; +exports.parseSemver = misc.parseSemver; +exports.uuid4 = misc.uuid4; +exports.dynamicRequire = node.dynamicRequire; +exports.isNodeEnv = node.isNodeEnv; +exports.loadModule = node.loadModule; +exports.normalize = normalize.normalize; +exports.normalizeToSize = normalize.normalizeToSize; +exports.normalizeUrlToBase = normalize.normalizeUrlToBase; +exports.addNonEnumerableProperty = object.addNonEnumerableProperty; +exports.convertToPlainObject = object.convertToPlainObject; +exports.dropUndefinedKeys = object.dropUndefinedKeys; +exports.extractExceptionKeysForMessage = object.extractExceptionKeysForMessage; +exports.fill = object.fill; +exports.getOriginalFunction = object.getOriginalFunction; +exports.markFunctionWrapped = object.markFunctionWrapped; +exports.objectify = object.objectify; +exports.urlEncode = object.urlEncode; +exports.basename = path.basename; +exports.dirname = path.dirname; +exports.isAbsolute = path.isAbsolute; +exports.join = path.join; +exports.normalizePath = path.normalizePath; +exports.relative = path.relative; +exports.resolve = path.resolve; +exports.makePromiseBuffer = promisebuffer.makePromiseBuffer; +exports.DEFAULT_USER_INCLUDES = requestdata$1.DEFAULT_USER_INCLUDES; +exports.addNormalizedRequestDataToEvent = requestdata$1.addNormalizedRequestDataToEvent; +exports.addRequestDataToEvent = requestdata$1.addRequestDataToEvent; +exports.extractPathForTransaction = requestdata$1.extractPathForTransaction; +exports.extractQueryParamsFromUrl = requestdata$1.extractQueryParamsFromUrl; +exports.extractRequestData = requestdata$1.extractRequestData; +exports.headersToDict = requestdata$1.headersToDict; +exports.httpRequestToRequestData = requestdata$1.httpRequestToRequestData; +exports.winterCGHeadersToDict = requestdata$1.winterCGHeadersToDict; +exports.winterCGRequestToRequestData = requestdata$1.winterCGRequestToRequestData; +exports.severityLevelFromString = severity.severityLevelFromString; +exports.validSeverityLevels = severity.validSeverityLevels; +exports.UNKNOWN_FUNCTION = stacktrace.UNKNOWN_FUNCTION; +exports.createStackParser = stacktrace.createStackParser; +exports.getFramesFromEvent = stacktrace.getFramesFromEvent; +exports.getFunctionName = stacktrace.getFunctionName; +exports.stackParserFromStackParserOptions = stacktrace.stackParserFromStackParserOptions; +exports.stripSentryFramesAndReverse = stacktrace.stripSentryFramesAndReverse; +exports.filenameIsInApp = nodeStackTrace.filenameIsInApp; +exports.node = nodeStackTrace.node; +exports.nodeStackLineParser = nodeStackTrace.nodeStackLineParser; +exports.isMatchingPattern = string.isMatchingPattern; +exports.safeJoin = string.safeJoin; +exports.snipLine = string.snipLine; +exports.stringMatchesSomePattern = string.stringMatchesSomePattern; +exports.truncate = string.truncate; +exports.isNativeFunction = supports.isNativeFunction; +exports.supportsDOMError = supports.supportsDOMError; +exports.supportsDOMException = supports.supportsDOMException; +exports.supportsErrorEvent = supports.supportsErrorEvent; +exports.supportsFetch = supports.supportsFetch; +exports.supportsNativeFetch = supports.supportsNativeFetch; +exports.supportsReferrerPolicy = supports.supportsReferrerPolicy; +exports.supportsReportingObserver = supports.supportsReportingObserver; +exports.SyncPromise = syncpromise.SyncPromise; +exports.rejectedSyncPromise = syncpromise.rejectedSyncPromise; +exports.resolvedSyncPromise = syncpromise.resolvedSyncPromise; +Object.defineProperty(exports, "_browserPerformanceTimeOriginMode", ({ + enumerable: true, + get: () => time._browserPerformanceTimeOriginMode +})); +exports.browserPerformanceTimeOrigin = time.browserPerformanceTimeOrigin; +exports.dateTimestampInSeconds = time.dateTimestampInSeconds; +exports.timestampInSeconds = time.timestampInSeconds; +exports.TRACEPARENT_REGEXP = tracing.TRACEPARENT_REGEXP; +exports.extractTraceparentData = tracing.extractTraceparentData; +exports.generateSentryTraceHeader = tracing.generateSentryTraceHeader; +exports.propagationContextFromHeaders = tracing.propagationContextFromHeaders; +exports.getSDKSource = env.getSDKSource; +exports.isBrowserBundle = env.isBrowserBundle; +exports.addItemToEnvelope = envelope$1.addItemToEnvelope; +exports.createAttachmentEnvelopeItem = envelope$1.createAttachmentEnvelopeItem; +exports.createEnvelope = envelope$1.createEnvelope; +exports.createEventEnvelopeHeaders = envelope$1.createEventEnvelopeHeaders; +exports.createSpanEnvelopeItem = envelope$1.createSpanEnvelopeItem; +exports.envelopeContainsItemType = envelope$1.envelopeContainsItemType; +exports.envelopeItemTypeToDataCategory = envelope$1.envelopeItemTypeToDataCategory; +exports.forEachEnvelopeItem = envelope$1.forEachEnvelopeItem; +exports.getSdkMetadataForEnvelopeHeader = envelope$1.getSdkMetadataForEnvelopeHeader; +exports.parseEnvelope = envelope$1.parseEnvelope; +exports.serializeEnvelope = envelope$1.serializeEnvelope; +exports.createClientReportEnvelope = clientreport.createClientReportEnvelope; +exports.DEFAULT_RETRY_AFTER = ratelimit.DEFAULT_RETRY_AFTER; +exports.disabledUntil = ratelimit.disabledUntil; +exports.isRateLimited = ratelimit.isRateLimited; +exports.parseRetryAfterHeader = ratelimit.parseRetryAfterHeader; +exports.updateRateLimits = ratelimit.updateRateLimits; +exports.BAGGAGE_HEADER_NAME = baggage.BAGGAGE_HEADER_NAME; +exports.MAX_BAGGAGE_STRING_LENGTH = baggage.MAX_BAGGAGE_STRING_LENGTH; +exports.SENTRY_BAGGAGE_KEY_PREFIX = baggage.SENTRY_BAGGAGE_KEY_PREFIX; +exports.SENTRY_BAGGAGE_KEY_PREFIX_REGEX = baggage.SENTRY_BAGGAGE_KEY_PREFIX_REGEX; +exports.baggageHeaderToDynamicSamplingContext = baggage.baggageHeaderToDynamicSamplingContext; +exports.dynamicSamplingContextToSentryBaggageHeader = baggage.dynamicSamplingContextToSentryBaggageHeader; +exports.parseBaggageHeader = baggage.parseBaggageHeader; +exports.getNumberOfUrlSegments = url.getNumberOfUrlSegments; +exports.getSanitizedUrlString = url.getSanitizedUrlString; +exports.parseUrl = url.parseUrl; +exports.stripUrlQueryAndFragment = url.stripUrlQueryAndFragment; +exports.makeFifoCache = cache.makeFifoCache; +exports.eventFromMessage = eventbuilder.eventFromMessage; +exports.eventFromUnknownInput = eventbuilder.eventFromUnknownInput; +exports.exceptionFromError = eventbuilder.exceptionFromError; +exports.parseStackFrames = eventbuilder.parseStackFrames; +exports.callFrameToStackFrame = anr.callFrameToStackFrame; +exports.watchdogTimer = anr.watchdogTimer; +exports.LRUMap = lru.LRUMap; +exports.generatePropagationContext = propagationContext.generatePropagationContext; +exports.generateSpanId = propagationContext.generateSpanId; +exports.generateTraceId = propagationContext.generateTraceId; +exports.vercelWaitUntil = vercelWaitUntil.vercelWaitUntil; +exports.SDK_VERSION = version.SDK_VERSION; +exports.getDebugImagesForResources = debugIds.getDebugImagesForResources; +exports.getFilenameToDebugIdMap = debugIds.getFilenameToDebugIdMap; +exports.escapeStringForRegex = escapeStringForRegex.escapeStringForRegex; +exports.supportsHistory = supportsHistory.supportsHistory; +exports._asyncNullishCoalesce = _asyncNullishCoalesce._asyncNullishCoalesce; +exports._asyncOptionalChain = _asyncOptionalChain._asyncOptionalChain; +exports._asyncOptionalChainDelete = _asyncOptionalChainDelete._asyncOptionalChainDelete; +exports._nullishCoalesce = _nullishCoalesce._nullishCoalesce; +exports._optionalChain = _optionalChain._optionalChain; +exports._optionalChainDelete = _optionalChainDelete._optionalChainDelete; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 67428: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const currentScopes = __nccwpck_require__(8131); +const debugBuild = __nccwpck_require__(14488); +const logger = __nccwpck_require__(38752); + +const installedIntegrations = []; + +/** Map of integrations assigned to a client */ + +/** + * Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to + * preserve the order of integrations in the array. + * + * @private + */ +function filterDuplicates(integrations) { + const integrationsByName = {}; + + integrations.forEach((currentInstance) => { + const { name } = currentInstance; + + const existingInstance = integrationsByName[name]; + + // We want integrations later in the array to overwrite earlier ones of the same type, except that we never want a + // default instance to overwrite an existing user instance + if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) { + return; + } + + integrationsByName[name] = currentInstance; + }); + + return Object.values(integrationsByName); +} + +/** Gets integrations to install */ +function getIntegrationsToSetup(options) { + const defaultIntegrations = options.defaultIntegrations || []; + const userIntegrations = options.integrations; + + // We flag default instances, so that later we can tell them apart from any user-created instances of the same class + defaultIntegrations.forEach((integration) => { + integration.isDefaultInstance = true; + }); + + let integrations; + + if (Array.isArray(userIntegrations)) { + integrations = [...defaultIntegrations, ...userIntegrations]; + } else if (typeof userIntegrations === 'function') { + const resolvedUserIntegrations = userIntegrations(defaultIntegrations); + integrations = Array.isArray(resolvedUserIntegrations) ? resolvedUserIntegrations : [resolvedUserIntegrations]; + } else { + integrations = defaultIntegrations; + } + + const finalIntegrations = filterDuplicates(integrations); + + // The `Debug` integration prints copies of the `event` and `hint` which will be passed to `beforeSend` or + // `beforeSendTransaction`. It therefore has to run after all other integrations, so that the changes of all event + // processors will be reflected in the printed values. For lack of a more elegant way to guarantee that, we therefore + // locate it and, assuming it exists, pop it out of its current spot and shove it onto the end of the array. + const debugIndex = finalIntegrations.findIndex(integration => integration.name === 'Debug'); + if (debugIndex > -1) { + const [debugInstance] = finalIntegrations.splice(debugIndex, 1) ; + finalIntegrations.push(debugInstance); + } + + return finalIntegrations; +} + +/** + * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default + * integrations are added unless they were already provided before. + * @param integrations array of integration instances + * @param withDefault should enable default integrations + */ +function setupIntegrations(client, integrations) { + const integrationIndex = {}; + + integrations.forEach(integration => { + // guard against empty provided integrations + if (integration) { + setupIntegration(client, integration, integrationIndex); + } + }); + + return integrationIndex; +} + +/** + * Execute the `afterAllSetup` hooks of the given integrations. + */ +function afterSetupIntegrations(client, integrations) { + for (const integration of integrations) { + // guard against empty provided integrations + if (integration && integration.afterAllSetup) { + integration.afterAllSetup(client); + } + } +} + +/** Setup a single integration. */ +function setupIntegration(client, integration, integrationIndex) { + if (integrationIndex[integration.name]) { + debugBuild.DEBUG_BUILD && logger.logger.log(`Integration skipped because it was already installed: ${integration.name}`); + return; + } + integrationIndex[integration.name] = integration; + + // `setupOnce` is only called the first time + if (installedIntegrations.indexOf(integration.name) === -1 && typeof integration.setupOnce === 'function') { + integration.setupOnce(); + installedIntegrations.push(integration.name); + } + + // `setup` is run for each client + if (integration.setup && typeof integration.setup === 'function') { + integration.setup(client); + } + + if (typeof integration.preprocessEvent === 'function') { + const callback = integration.preprocessEvent.bind(integration) ; + client.on('preprocessEvent', (event, hint) => callback(event, hint, client)); + } + + if (typeof integration.processEvent === 'function') { + const callback = integration.processEvent.bind(integration) ; + + const processor = Object.assign((event, hint) => callback(event, hint, client), { + id: integration.name, + }); + + client.addEventProcessor(processor); + } + + debugBuild.DEBUG_BUILD && logger.logger.log(`Integration installed: ${integration.name}`); +} + +/** Add an integration to the current scope's client. */ +function addIntegration(integration) { + const client = currentScopes.getClient(); + + if (!client) { + debugBuild.DEBUG_BUILD && logger.logger.warn(`Cannot add integration "${integration.name}" because no SDK Client is available.`); + return; + } + + client.addIntegration(integration); +} + +/** + * Define an integration function that can be used to create an integration instance. + * Note that this by design hides the implementation details of the integration, as they are considered internal. + */ +function defineIntegration(fn) { + return fn; +} + +exports.addIntegration = addIntegration; +exports.afterSetupIntegrations = afterSetupIntegrations; +exports.defineIntegration = defineIntegration; +exports.getIntegrationsToSetup = getIntegrationsToSetup; +exports.installedIntegrations = installedIntegrations; +exports.setupIntegration = setupIntegration; +exports.setupIntegrations = setupIntegrations; +//# sourceMappingURL=integration.js.map + + +/***/ }), + +/***/ 25821: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const currentScopes = __nccwpck_require__(8131); +const exports$1 = __nccwpck_require__(10779); +const integration = __nccwpck_require__(67428); +const console = __nccwpck_require__(32758); +const logger = __nccwpck_require__(38752); +const misc = __nccwpck_require__(3181); +const severity = __nccwpck_require__(25753); +const string = __nccwpck_require__(93529); +const worldwide = __nccwpck_require__(10891); + +const INTEGRATION_NAME = 'CaptureConsole'; + +const _captureConsoleIntegration = ((options = {}) => { + const levels = options.levels || logger.CONSOLE_LEVELS; + // TODO(v9): Flip default value to `true` + const handled = !!options.handled; + + return { + name: INTEGRATION_NAME, + setup(client) { + if (!('console' in worldwide.GLOBAL_OBJ)) { + return; + } + + console.addConsoleInstrumentationHandler(({ args, level }) => { + if (currentScopes.getClient() !== client || !levels.includes(level)) { + return; + } + + consoleHandler(args, level, handled); + }); + }, + }; +}) ; + +/** + * Send Console API calls as Sentry Events. + */ +const captureConsoleIntegration = integration.defineIntegration(_captureConsoleIntegration); + +function consoleHandler(args, level, handled) { + const captureContext = { + level: severity.severityLevelFromString(level), + extra: { + arguments: args, + }, + }; + + currentScopes.withScope(scope => { + scope.addEventProcessor(event => { + event.logger = 'console'; + + misc.addExceptionMechanism(event, { + handled, + type: 'console', + }); + + return event; + }); + + if (level === 'assert') { + if (!args[0]) { + const message = `Assertion failed: ${string.safeJoin(args.slice(1), ' ') || 'console.assert'}`; + scope.setExtra('arguments', args.slice(1)); + exports$1.captureMessage(message, captureContext); + } + return; + } + + const error = args.find(arg => arg instanceof Error); + if (error) { + exports$1.captureException(error, captureContext); + return; + } + + const message = string.safeJoin(args, ' '); + exports$1.captureMessage(message, captureContext); + }); +} + +exports.captureConsoleIntegration = captureConsoleIntegration; +//# sourceMappingURL=captureconsole.js.map + + +/***/ }), + +/***/ 39957: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const integration = __nccwpck_require__(67428); +const logger = __nccwpck_require__(38752); + +const INTEGRATION_NAME = 'Debug'; + +const _debugIntegration = ((options = {}) => { + const _options = { + debugger: false, + stringify: false, + ...options, + }; + + return { + name: INTEGRATION_NAME, + setup(client) { + client.on('beforeSendEvent', (event, hint) => { + if (_options.debugger) { + // eslint-disable-next-line no-debugger + debugger; + } + + /* eslint-disable no-console */ + logger.consoleSandbox(() => { + if (_options.stringify) { + console.log(JSON.stringify(event, null, 2)); + if (hint && Object.keys(hint).length) { + console.log(JSON.stringify(hint, null, 2)); + } + } else { + console.log(event); + if (hint && Object.keys(hint).length) { + console.log(hint); + } + } + }); + /* eslint-enable no-console */ + }); + }, + }; +}) ; + +/** + * Integration to debug sent Sentry events. + * This integration should not be used in production. + * + * @deprecated This integration is deprecated and will be removed in the next major version of the SDK. + * To log outgoing events, use [Hook Options](https://docs.sentry.io/platforms/javascript/configuration/options/#hooks) (`beforeSend`, `beforeSendTransaction`, ...). + */ +const debugIntegration = integration.defineIntegration(_debugIntegration); + +exports.debugIntegration = debugIntegration; +//# sourceMappingURL=debug.js.map + + +/***/ }), + +/***/ 96514: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const integration = __nccwpck_require__(67428); +const debugBuild = __nccwpck_require__(14488); +const logger = __nccwpck_require__(38752); +const stacktrace = __nccwpck_require__(85820); + +const INTEGRATION_NAME = 'Dedupe'; + +const _dedupeIntegration = (() => { + let previousEvent; + + return { + name: INTEGRATION_NAME, + processEvent(currentEvent) { + // We want to ignore any non-error type events, e.g. transactions or replays + // These should never be deduped, and also not be compared against as _previousEvent. + if (currentEvent.type) { + return currentEvent; + } + + // Juuust in case something goes wrong + try { + if (_shouldDropEvent(currentEvent, previousEvent)) { + debugBuild.DEBUG_BUILD && logger.logger.warn('Event dropped due to being a duplicate of previously captured event.'); + return null; + } + } catch (_oO) {} // eslint-disable-line no-empty + + return (previousEvent = currentEvent); + }, + }; +}) ; + +/** + * Deduplication filter. + */ +const dedupeIntegration = integration.defineIntegration(_dedupeIntegration); + +/** only exported for tests. */ +function _shouldDropEvent(currentEvent, previousEvent) { + if (!previousEvent) { + return false; + } + + if (_isSameMessageEvent(currentEvent, previousEvent)) { + return true; + } + + if (_isSameExceptionEvent(currentEvent, previousEvent)) { + return true; + } + + return false; +} + +function _isSameMessageEvent(currentEvent, previousEvent) { + const currentMessage = currentEvent.message; + const previousMessage = previousEvent.message; + + // If neither event has a message property, they were both exceptions, so bail out + if (!currentMessage && !previousMessage) { + return false; + } + + // If only one event has a stacktrace, but not the other one, they are not the same + if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) { + return false; + } + + if (currentMessage !== previousMessage) { + return false; + } + + if (!_isSameFingerprint(currentEvent, previousEvent)) { + return false; + } + + if (!_isSameStacktrace(currentEvent, previousEvent)) { + return false; + } + + return true; +} + +function _isSameExceptionEvent(currentEvent, previousEvent) { + const previousException = _getExceptionFromEvent(previousEvent); + const currentException = _getExceptionFromEvent(currentEvent); + + if (!previousException || !currentException) { + return false; + } + + if (previousException.type !== currentException.type || previousException.value !== currentException.value) { + return false; + } + + if (!_isSameFingerprint(currentEvent, previousEvent)) { + return false; + } + + if (!_isSameStacktrace(currentEvent, previousEvent)) { + return false; + } + + return true; +} + +function _isSameStacktrace(currentEvent, previousEvent) { + let currentFrames = stacktrace.getFramesFromEvent(currentEvent); + let previousFrames = stacktrace.getFramesFromEvent(previousEvent); + + // If neither event has a stacktrace, they are assumed to be the same + if (!currentFrames && !previousFrames) { + return true; + } + + // If only one event has a stacktrace, but not the other one, they are not the same + if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) { + return false; + } + + currentFrames = currentFrames ; + previousFrames = previousFrames ; + + // If number of frames differ, they are not the same + if (previousFrames.length !== currentFrames.length) { + return false; + } + + // Otherwise, compare the two + for (let i = 0; i < previousFrames.length; i++) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const frameA = previousFrames[i]; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const frameB = currentFrames[i]; + + if ( + frameA.filename !== frameB.filename || + frameA.lineno !== frameB.lineno || + frameA.colno !== frameB.colno || + frameA.function !== frameB.function + ) { + return false; + } + } + + return true; +} + +function _isSameFingerprint(currentEvent, previousEvent) { + let currentFingerprint = currentEvent.fingerprint; + let previousFingerprint = previousEvent.fingerprint; + + // If neither event has a fingerprint, they are assumed to be the same + if (!currentFingerprint && !previousFingerprint) { + return true; + } + + // If only one event has a fingerprint, but not the other one, they are not the same + if ((currentFingerprint && !previousFingerprint) || (!currentFingerprint && previousFingerprint)) { + return false; + } + + currentFingerprint = currentFingerprint ; + previousFingerprint = previousFingerprint ; + + // Otherwise, compare the two + try { + return !!(currentFingerprint.join('') === previousFingerprint.join('')); + } catch (_oO) { + return false; + } +} + +function _getExceptionFromEvent(event) { + return event.exception && event.exception.values && event.exception.values[0]; +} + +exports._shouldDropEvent = _shouldDropEvent; +exports.dedupeIntegration = dedupeIntegration; +//# sourceMappingURL=dedupe.js.map + + +/***/ }), + +/***/ 88764: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const integration = __nccwpck_require__(67428); +const debugBuild = __nccwpck_require__(14488); +const is = __nccwpck_require__(84085); +const logger = __nccwpck_require__(38752); +const normalize = __nccwpck_require__(65543); +const object = __nccwpck_require__(16100); +const string = __nccwpck_require__(93529); + +const INTEGRATION_NAME = 'ExtraErrorData'; + +/** + * Extract additional data for from original exceptions. + */ +const _extraErrorDataIntegration = ((options = {}) => { + const { depth = 3, captureErrorCause = true } = options; + return { + name: INTEGRATION_NAME, + processEvent(event, hint, client) { + const { maxValueLength = 250 } = client.getOptions(); + return _enhanceEventWithErrorData(event, hint, depth, captureErrorCause, maxValueLength); + }, + }; +}) ; + +const extraErrorDataIntegration = integration.defineIntegration(_extraErrorDataIntegration); + +function _enhanceEventWithErrorData( + event, + hint = {}, + depth, + captureErrorCause, + maxValueLength, +) { + if (!hint.originalException || !is.isError(hint.originalException)) { + return event; + } + const exceptionName = (hint.originalException ).name || hint.originalException.constructor.name; + + const errorData = _extractErrorData(hint.originalException , captureErrorCause, maxValueLength); + + if (errorData) { + const contexts = { + ...event.contexts, + }; + + const normalizedErrorData = normalize.normalize(errorData, depth); + + if (is.isPlainObject(normalizedErrorData)) { + // We mark the error data as "already normalized" here, because we don't want other normalization procedures to + // potentially truncate the data we just already normalized, with a certain depth setting. + object.addNonEnumerableProperty(normalizedErrorData, '__sentry_skip_normalization__', true); + contexts[exceptionName] = normalizedErrorData; + } + + return { + ...event, + contexts, + }; + } + + return event; +} + +/** + * Extract extra information from the Error object + */ +function _extractErrorData( + error, + captureErrorCause, + maxValueLength, +) { + // We are trying to enhance already existing event, so no harm done if it won't succeed + try { + const nativeKeys = [ + 'name', + 'message', + 'stack', + 'line', + 'column', + 'fileName', + 'lineNumber', + 'columnNumber', + 'toJSON', + ]; + + const extraErrorInfo = {}; + + // We want only enumerable properties, thus `getOwnPropertyNames` is redundant here, as we filter keys anyway. + for (const key of Object.keys(error)) { + if (nativeKeys.indexOf(key) !== -1) { + continue; + } + const value = error[key]; + extraErrorInfo[key] = is.isError(value) || typeof value === 'string' ? string.truncate(`${value}`, maxValueLength) : value; + } + + // Error.cause is a standard property that is non enumerable, we therefore need to access it separately. + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause + if (captureErrorCause && error.cause !== undefined) { + extraErrorInfo.cause = is.isError(error.cause) ? error.cause.toString() : error.cause; + } + + // Check if someone attached `toJSON` method to grab even more properties (eg. axios is doing that) + if (typeof error.toJSON === 'function') { + const serializedError = error.toJSON() ; + + for (const key of Object.keys(serializedError)) { + const value = serializedError[key]; + extraErrorInfo[key] = is.isError(value) ? value.toString() : value; + } + } + + return extraErrorInfo; + } catch (oO) { + debugBuild.DEBUG_BUILD && logger.logger.error('Unable to extract extra data from the Error object:', oO); + } + + return null; +} + +exports.extraErrorDataIntegration = extraErrorDataIntegration; +//# sourceMappingURL=extraerrordata.js.map + + +/***/ }), + +/***/ 48318: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const currentScopes = __nccwpck_require__(8131); +const integration = __nccwpck_require__(67428); +const object = __nccwpck_require__(16100); + +let originalFunctionToString; + +const INTEGRATION_NAME = 'FunctionToString'; + +const SETUP_CLIENTS = new WeakMap(); + +const _functionToStringIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + // eslint-disable-next-line @typescript-eslint/unbound-method + originalFunctionToString = Function.prototype.toString; + + // intrinsics (like Function.prototype) might be immutable in some environments + // e.g. Node with --frozen-intrinsics, XS (an embedded JavaScript engine) or SES (a JavaScript proposal) + try { + Function.prototype.toString = function ( ...args) { + const originalFunction = object.getOriginalFunction(this); + const context = + SETUP_CLIENTS.has(currentScopes.getClient() ) && originalFunction !== undefined ? originalFunction : this; + return originalFunctionToString.apply(context, args); + }; + } catch (e) { + // ignore errors here, just don't patch this + } + }, + setup(client) { + SETUP_CLIENTS.set(client, true); + }, + }; +}) ; + +/** + * Patch toString calls to return proper name for wrapped functions. + * + * ```js + * Sentry.init({ + * integrations: [ + * functionToStringIntegration(), + * ], + * }); + * ``` + */ +const functionToStringIntegration = integration.defineIntegration(_functionToStringIntegration); + +exports.functionToStringIntegration = functionToStringIntegration; +//# sourceMappingURL=functiontostring.js.map + + +/***/ }), + +/***/ 81264: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const debugBuild = __nccwpck_require__(14488); +const integration = __nccwpck_require__(67428); +const logger = __nccwpck_require__(38752); +const misc = __nccwpck_require__(3181); +const string = __nccwpck_require__(93529); + +// "Script error." is hard coded into browsers for errors that it can't read. +// this is the result of a script being pulled in from an external domain and CORS. +const DEFAULT_IGNORE_ERRORS = [ + /^Script error\.?$/, + /^Javascript error: Script error\.? on line 0$/, + /^ResizeObserver loop completed with undelivered notifications.$/, // The browser logs this when a ResizeObserver handler takes a bit longer. Usually this is not an actual issue though. It indicates slowness. + /^Cannot redefine property: googletag$/, // This is thrown when google tag manager is used in combination with an ad blocker + "undefined is not an object (evaluating 'a.L')", // Random error that happens but not actionable or noticeable to end-users. + 'can\'t redefine non-configurable property "solana"', // Probably a browser extension or custom browser (Brave) throwing this error + "vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)", // Error thrown by GTM, seemingly not affecting end-users + "Can't find variable: _AutofillCallbackHandler", // Unactionable error in instagram webview https://developers.facebook.com/community/threads/320013549791141/ + /^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/, // unactionable error from CEFSharp, a .NET library that embeds chromium in .NET apps +]; + +/** Options for the InboundFilters integration */ + +const INTEGRATION_NAME = 'InboundFilters'; +const _inboundFiltersIntegration = ((options = {}) => { + return { + name: INTEGRATION_NAME, + processEvent(event, _hint, client) { + const clientOptions = client.getOptions(); + const mergedOptions = _mergeOptions(options, clientOptions); + return _shouldDropEvent(event, mergedOptions) ? null : event; + }, + }; +}) ; + +const inboundFiltersIntegration = integration.defineIntegration(_inboundFiltersIntegration); + +function _mergeOptions( + internalOptions = {}, + clientOptions = {}, +) { + return { + allowUrls: [...(internalOptions.allowUrls || []), ...(clientOptions.allowUrls || [])], + denyUrls: [...(internalOptions.denyUrls || []), ...(clientOptions.denyUrls || [])], + ignoreErrors: [ + ...(internalOptions.ignoreErrors || []), + ...(clientOptions.ignoreErrors || []), + ...(internalOptions.disableErrorDefaults ? [] : DEFAULT_IGNORE_ERRORS), + ], + ignoreTransactions: [...(internalOptions.ignoreTransactions || []), ...(clientOptions.ignoreTransactions || [])], + ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true, + }; +} + +function _shouldDropEvent(event, options) { + if (options.ignoreInternal && _isSentryError(event)) { + debugBuild.DEBUG_BUILD && + logger.logger.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${misc.getEventDescription(event)}`); + return true; + } + if (_isIgnoredError(event, options.ignoreErrors)) { + debugBuild.DEBUG_BUILD && + logger.logger.warn( + `Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${misc.getEventDescription(event)}`, + ); + return true; + } + if (_isUselessError(event)) { + debugBuild.DEBUG_BUILD && + logger.logger.warn( + `Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${misc.getEventDescription( + event, + )}`, + ); + return true; + } + if (_isIgnoredTransaction(event, options.ignoreTransactions)) { + debugBuild.DEBUG_BUILD && + logger.logger.warn( + `Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${misc.getEventDescription(event)}`, + ); + return true; + } + if (_isDeniedUrl(event, options.denyUrls)) { + debugBuild.DEBUG_BUILD && + logger.logger.warn( + `Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${misc.getEventDescription( + event, + )}.\nUrl: ${_getEventFilterUrl(event)}`, + ); + return true; + } + if (!_isAllowedUrl(event, options.allowUrls)) { + debugBuild.DEBUG_BUILD && + logger.logger.warn( + `Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${misc.getEventDescription( + event, + )}.\nUrl: ${_getEventFilterUrl(event)}`, + ); + return true; + } + return false; +} + +function _isIgnoredError(event, ignoreErrors) { + // If event.type, this is not an error + if (event.type || !ignoreErrors || !ignoreErrors.length) { + return false; + } + + return _getPossibleEventMessages(event).some(message => string.stringMatchesSomePattern(message, ignoreErrors)); +} + +function _isIgnoredTransaction(event, ignoreTransactions) { + if (event.type !== 'transaction' || !ignoreTransactions || !ignoreTransactions.length) { + return false; + } + + const name = event.transaction; + return name ? string.stringMatchesSomePattern(name, ignoreTransactions) : false; +} + +function _isDeniedUrl(event, denyUrls) { + // TODO: Use Glob instead? + if (!denyUrls || !denyUrls.length) { + return false; + } + const url = _getEventFilterUrl(event); + return !url ? false : string.stringMatchesSomePattern(url, denyUrls); +} + +function _isAllowedUrl(event, allowUrls) { + // TODO: Use Glob instead? + if (!allowUrls || !allowUrls.length) { + return true; + } + const url = _getEventFilterUrl(event); + return !url ? true : string.stringMatchesSomePattern(url, allowUrls); +} + +function _getPossibleEventMessages(event) { + const possibleMessages = []; + + if (event.message) { + possibleMessages.push(event.message); + } + + let lastException; + try { + // @ts-expect-error Try catching to save bundle size + lastException = event.exception.values[event.exception.values.length - 1]; + } catch (e) { + // try catching to save bundle size checking existence of variables + } + + if (lastException) { + if (lastException.value) { + possibleMessages.push(lastException.value); + if (lastException.type) { + possibleMessages.push(`${lastException.type}: ${lastException.value}`); + } + } + } + + return possibleMessages; +} + +function _isSentryError(event) { + try { + // @ts-expect-error can't be a sentry error if undefined + return event.exception.values[0].type === 'SentryError'; + } catch (e) { + // ignore + } + return false; +} + +function _getLastValidUrl(frames = []) { + for (let i = frames.length - 1; i >= 0; i--) { + const frame = frames[i]; + + if (frame && frame.filename !== '' && frame.filename !== '[native code]') { + return frame.filename || null; + } + } + + return null; +} + +function _getEventFilterUrl(event) { + try { + let frames; + try { + // @ts-expect-error we only care about frames if the whole thing here is defined + frames = event.exception.values[0].stacktrace.frames; + } catch (e) { + // ignore + } + return frames ? _getLastValidUrl(frames) : null; + } catch (oO) { + debugBuild.DEBUG_BUILD && logger.logger.error(`Cannot extract url for event ${misc.getEventDescription(event)}`); + return null; + } +} + +function _isUselessError(event) { + if (event.type) { + // event is not an error + return false; + } + + // We only want to consider events for dropping that actually have recorded exception values. + if (!event.exception || !event.exception.values || event.exception.values.length === 0) { + return false; + } + + return ( + // No top-level message + !event.message && + // There are no exception values that have a stacktrace, a non-generic-Error type or value + !event.exception.values.some(value => value.stacktrace || (value.type && value.type !== 'Error') || value.value) + ); +} + +exports.inboundFiltersIntegration = inboundFiltersIntegration; +//# sourceMappingURL=inboundfilters.js.map + + +/***/ }), + +/***/ 90529: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const integration = __nccwpck_require__(67428); +const aggregateErrors = __nccwpck_require__(29416); +const eventbuilder = __nccwpck_require__(2781); + +const DEFAULT_KEY = 'cause'; +const DEFAULT_LIMIT = 5; + +const INTEGRATION_NAME = 'LinkedErrors'; + +const _linkedErrorsIntegration = ((options = {}) => { + const limit = options.limit || DEFAULT_LIMIT; + const key = options.key || DEFAULT_KEY; + + return { + name: INTEGRATION_NAME, + preprocessEvent(event, hint, client) { + const options = client.getOptions(); + + aggregateErrors.applyAggregateErrorsToEvent( + eventbuilder.exceptionFromError, + options.stackParser, + options.maxValueLength, + key, + limit, + event, + hint, + ); + }, + }; +}) ; + +const linkedErrorsIntegration = integration.defineIntegration(_linkedErrorsIntegration); + +exports.linkedErrorsIntegration = linkedErrorsIntegration; +//# sourceMappingURL=linkederrors.js.map + + +/***/ }), + +/***/ 1668: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const integration = __nccwpck_require__(67428); +const metadata = __nccwpck_require__(44592); +const envelope = __nccwpck_require__(72635); + +/** + * Adds module metadata to stack frames. + * + * Metadata can be injected by the Sentry bundler plugins using the `moduleMetadata` config option. + * + * When this integration is added, the metadata passed to the bundler plugin is added to the stack frames of all events + * under the `module_metadata` property. This can be used to help in tagging or routing of events from different teams + * our sources + */ +const moduleMetadataIntegration = integration.defineIntegration(() => { + return { + name: 'ModuleMetadata', + setup(client) { + // We need to strip metadata from stack frames before sending them to Sentry since these are client side only. + client.on('beforeEnvelope', envelope$1 => { + envelope.forEachEnvelopeItem(envelope$1, (item, type) => { + if (type === 'event') { + const event = Array.isArray(item) ? (item )[1] : undefined; + + if (event) { + metadata.stripMetadataFromStackFrames(event); + item[1] = event; + } + } + }); + }); + + client.on('applyFrameMetadata', event => { + // Only apply stack frame metadata to error events + if (event.type) { + return; + } + + const stackParser = client.getOptions().stackParser; + metadata.addMetadataToStackFrames(stackParser, event); + }); + }, + }; +}); + +exports.moduleMetadataIntegration = moduleMetadataIntegration; +//# sourceMappingURL=metadata.js.map + + +/***/ }), + +/***/ 71679: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const integration = __nccwpck_require__(67428); +const requestdata = __nccwpck_require__(4630); + +const DEFAULT_OPTIONS = { + include: { + cookies: true, + data: true, + headers: true, + ip: false, + query_string: true, + url: true, + user: { + id: true, + username: true, + email: true, + }, + }, + transactionNamingScheme: 'methodPath' , +}; + +const INTEGRATION_NAME = 'RequestData'; + +const _requestDataIntegration = ((options = {}) => { + const _options = { + ...DEFAULT_OPTIONS, + ...options, + include: { + ...DEFAULT_OPTIONS.include, + ...options.include, + user: + options.include && typeof options.include.user === 'boolean' + ? options.include.user + : { + ...DEFAULT_OPTIONS.include.user, + // Unclear why TS still thinks `options.include.user` could be a boolean at this point + ...((options.include || {}).user ), + }, + }, + }; + + return { + name: INTEGRATION_NAME, + processEvent(event) { + // Note: In the long run, most of the logic here should probably move into the request data utility functions. For + // the moment it lives here, though, until https://github.com/getsentry/sentry-javascript/issues/5718 is addressed. + // (TL;DR: Those functions touch many parts of the repo in many different ways, and need to be cleaned up. Once + // that's happened, it will be easier to add this logic in without worrying about unexpected side effects.) + + const { sdkProcessingMetadata = {} } = event; + const { request, normalizedRequest } = sdkProcessingMetadata; + + const addRequestDataOptions = convertReqDataIntegrationOptsToAddReqDataOpts(_options); + + // If this is set, it takes precedence over the plain request object + if (normalizedRequest) { + // Some other data is not available in standard HTTP requests, but can sometimes be augmented by e.g. Express or Next.js + const ipAddress = request ? request.ip || (request.socket && request.socket.remoteAddress) : undefined; + const user = request ? request.user : undefined; + + requestdata.addNormalizedRequestDataToEvent(event, normalizedRequest, { ipAddress, user }, addRequestDataOptions); + return event; + } + + // TODO(v9): Eventually we can remove this fallback branch and only rely on the normalizedRequest above + if (!request) { + return event; + } + + // eslint-disable-next-line deprecation/deprecation + return requestdata.addRequestDataToEvent(event, request, addRequestDataOptions); + }, + }; +}) ; + +/** + * Add data about a request to an event. Primarily for use in Node-based SDKs, but included in `@sentry/core` + * so it can be used in cross-platform SDKs like `@sentry/nextjs`. + */ +const requestDataIntegration = integration.defineIntegration(_requestDataIntegration); + +/** Convert this integration's options to match what `addRequestDataToEvent` expects */ +/** TODO: Can possibly be deleted once https://github.com/getsentry/sentry-javascript/issues/5718 is fixed */ +function convertReqDataIntegrationOptsToAddReqDataOpts( + integrationOptions, +) { + const { + // eslint-disable-next-line deprecation/deprecation + transactionNamingScheme, + include: { ip, user, ...requestOptions }, + } = integrationOptions; + + const requestIncludeKeys = ['method']; + for (const [key, value] of Object.entries(requestOptions)) { + if (value) { + requestIncludeKeys.push(key); + } + } + + let addReqDataUserOpt; + if (user === undefined) { + addReqDataUserOpt = true; + } else if (typeof user === 'boolean') { + addReqDataUserOpt = user; + } else { + const userIncludeKeys = []; + for (const [key, value] of Object.entries(user)) { + if (value) { + userIncludeKeys.push(key); + } + } + addReqDataUserOpt = userIncludeKeys; + } + + return { + include: { + ip, + user: addReqDataUserOpt, + request: requestIncludeKeys.length !== 0 ? requestIncludeKeys : undefined, + transaction: transactionNamingScheme, + }, + }; +} + +exports.requestDataIntegration = requestDataIntegration; +//# sourceMappingURL=requestdata.js.map + + +/***/ }), + +/***/ 94102: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const integration = __nccwpck_require__(67428); +const path = __nccwpck_require__(94509); +const worldwide = __nccwpck_require__(10891); + +const INTEGRATION_NAME = 'RewriteFrames'; + +/** + * Rewrite event frames paths. + */ +const rewriteFramesIntegration = integration.defineIntegration((options = {}) => { + const root = options.root; + const prefix = options.prefix || 'app:///'; + + const isBrowser = 'window' in worldwide.GLOBAL_OBJ && worldwide.GLOBAL_OBJ.window !== undefined; + + const iteratee = options.iteratee || generateIteratee({ isBrowser, root, prefix }); + + /** Process an exception event. */ + function _processExceptionsEvent(event) { + try { + return { + ...event, + exception: { + ...event.exception, + // The check for this is performed inside `process` call itself, safe to skip here + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + values: event.exception.values.map(value => ({ + ...value, + ...(value.stacktrace && { stacktrace: _processStacktrace(value.stacktrace) }), + })), + }, + }; + } catch (_oO) { + return event; + } + } + + /** Process a stack trace. */ + function _processStacktrace(stacktrace) { + return { + ...stacktrace, + frames: stacktrace && stacktrace.frames && stacktrace.frames.map(f => iteratee(f)), + }; + } + + return { + name: INTEGRATION_NAME, + processEvent(originalEvent) { + let processedEvent = originalEvent; + + if (originalEvent.exception && Array.isArray(originalEvent.exception.values)) { + processedEvent = _processExceptionsEvent(processedEvent); + } + + return processedEvent; + }, + }; +}); + +/** + * Exported only for tests. + */ +function generateIteratee({ + isBrowser, + root, + prefix, +} + +) { + return (frame) => { + if (!frame.filename) { + return frame; + } + + // Determine if this is a Windows frame by checking for a Windows-style prefix such as `C:\` + const isWindowsFrame = + /^[a-zA-Z]:\\/.test(frame.filename) || + // or the presence of a backslash without a forward slash (which are not allowed on Windows) + (frame.filename.includes('\\') && !frame.filename.includes('/')); + + // Check if the frame filename begins with `/` + const startsWithSlash = /^\//.test(frame.filename); + + if (isBrowser) { + if (root) { + const oldFilename = frame.filename; + if (oldFilename.indexOf(root) === 0) { + frame.filename = oldFilename.replace(root, prefix); + } + } + } else { + if (isWindowsFrame || startsWithSlash) { + const filename = isWindowsFrame + ? frame.filename + .replace(/^[a-zA-Z]:/, '') // remove Windows-style prefix + .replace(/\\/g, '/') // replace all `\\` instances with `/` + : frame.filename; + const base = root ? path.relative(root, filename) : path.basename(filename); + frame.filename = `${prefix}${base}`; + } + } + + return frame; + }; +} + +exports.generateIteratee = generateIteratee; +exports.rewriteFramesIntegration = rewriteFramesIntegration; +//# sourceMappingURL=rewriteframes.js.map + + +/***/ }), + +/***/ 20871: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const integration = __nccwpck_require__(67428); +const time = __nccwpck_require__(75872); + +const INTEGRATION_NAME = 'SessionTiming'; + +const _sessionTimingIntegration = (() => { + const startTime = time.timestampInSeconds() * 1000; + + return { + name: INTEGRATION_NAME, + processEvent(event) { + const now = time.timestampInSeconds() * 1000; + + return { + ...event, + extra: { + ...event.extra, + ['session:start']: startTime, + ['session:duration']: now - startTime, + ['session:end']: now, + }, + }; + }, + }; +}) ; + +/** + * This function adds duration since the sessionTimingIntegration was initialized + * till the time event was sent. + * + * @deprecated This integration is deprecated and will be removed in the next major version of the SDK. + * To capture session durations alongside events, use [Context](https://docs.sentry.io/platforms/javascript/enriching-events/context/) (`Sentry.setContext()`). + */ +const sessionTimingIntegration = integration.defineIntegration(_sessionTimingIntegration); + +exports.sessionTimingIntegration = sessionTimingIntegration; +//# sourceMappingURL=sessiontiming.js.map + + +/***/ }), + +/***/ 86140: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const integration = __nccwpck_require__(67428); +const metadata = __nccwpck_require__(44592); +const envelope = __nccwpck_require__(72635); +const stacktrace = __nccwpck_require__(85820); + +/** + * This integration allows you to filter out, or tag error events that do not come from user code marked with a bundle key via the Sentry bundler plugins. + */ +const thirdPartyErrorFilterIntegration = integration.defineIntegration((options) => { + return { + name: 'ThirdPartyErrorsFilter', + setup(client) { + // We need to strip metadata from stack frames before sending them to Sentry since these are client side only. + // TODO(lforst): Move this cleanup logic into a more central place in the SDK. + client.on('beforeEnvelope', envelope$1 => { + envelope.forEachEnvelopeItem(envelope$1, (item, type) => { + if (type === 'event') { + const event = Array.isArray(item) ? (item )[1] : undefined; + + if (event) { + metadata.stripMetadataFromStackFrames(event); + item[1] = event; + } + } + }); + }); + + client.on('applyFrameMetadata', event => { + // Only apply stack frame metadata to error events + if (event.type) { + return; + } + + const stackParser = client.getOptions().stackParser; + metadata.addMetadataToStackFrames(stackParser, event); + }); + }, + + processEvent(event) { + const frameKeys = getBundleKeysForAllFramesWithFilenames(event); + + if (frameKeys) { + const arrayMethod = + options.behaviour === 'drop-error-if-contains-third-party-frames' || + options.behaviour === 'apply-tag-if-contains-third-party-frames' + ? 'some' + : 'every'; + + const behaviourApplies = frameKeys[arrayMethod](keys => !keys.some(key => options.filterKeys.includes(key))); + + if (behaviourApplies) { + const shouldDrop = + options.behaviour === 'drop-error-if-contains-third-party-frames' || + options.behaviour === 'drop-error-if-exclusively-contains-third-party-frames'; + if (shouldDrop) { + return null; + } else { + event.tags = { + ...event.tags, + third_party_code: true, + }; + } + } + } + + return event; + }, + }; +}); + +function getBundleKeysForAllFramesWithFilenames(event) { + const frames = stacktrace.getFramesFromEvent(event); + + if (!frames) { + return undefined; + } + + return ( + frames + // Exclude frames without a filename since these are likely native code or built-ins + .filter(frame => !!frame.filename) + .map(frame => { + if (frame.module_metadata) { + return Object.keys(frame.module_metadata) + .filter(key => key.startsWith(BUNDLER_PLUGIN_APP_KEY_PREFIX)) + .map(key => key.slice(BUNDLER_PLUGIN_APP_KEY_PREFIX.length)); + } + return []; + }) + ); +} + +const BUNDLER_PLUGIN_APP_KEY_PREFIX = '_sentryBundlerPluginAppKey:'; + +exports.thirdPartyErrorFilterIntegration = thirdPartyErrorFilterIntegration; +//# sourceMappingURL=third-party-errors-filter.js.map + + +/***/ }), + +/***/ 55472: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const integration = __nccwpck_require__(67428); +const is = __nccwpck_require__(84085); +const string = __nccwpck_require__(93529); + +const DEFAULT_LIMIT = 10; +const INTEGRATION_NAME = 'ZodErrors'; + +/** + * Simplified ZodIssue type definition + */ + +function originalExceptionIsZodError(originalException) { + return ( + is.isError(originalException) && + originalException.name === 'ZodError' && + Array.isArray((originalException ).issues) + ); +} + +/** + * Formats child objects or arrays to a string + * that is preserved when sent to Sentry. + * + * Without this, we end up with something like this in Sentry: + * + * [ + * [Object], + * [Object], + * [Object], + * [Object] + * ] + */ +function flattenIssue(issue) { + return { + ...issue, + path: 'path' in issue && Array.isArray(issue.path) ? issue.path.join('.') : undefined, + keys: 'keys' in issue ? JSON.stringify(issue.keys) : undefined, + unionErrors: 'unionErrors' in issue ? JSON.stringify(issue.unionErrors) : undefined, + }; +} + +/** + * Takes ZodError issue path array and returns a flattened version as a string. + * This makes it easier to display paths within a Sentry error message. + * + * Array indexes are normalized to reduce duplicate entries + * + * @param path ZodError issue path + * @returns flattened path + * + * @example + * flattenIssuePath([0, 'foo', 1, 'bar']) // -> '.foo..bar' + */ +function flattenIssuePath(path) { + return path + .map(p => { + if (typeof p === 'number') { + return ''; + } else { + return p; + } + }) + .join('.'); +} + +/** + * Zod error message is a stringified version of ZodError.issues + * This doesn't display well in the Sentry UI. Replace it with something shorter. + */ +function formatIssueMessage(zodError) { + const errorKeyMap = new Set(); + for (const iss of zodError.issues) { + const issuePath = flattenIssuePath(iss.path); + if (issuePath.length > 0) { + errorKeyMap.add(issuePath); + } + } + + const errorKeys = Array.from(errorKeyMap); + if (errorKeys.length === 0) { + // If there are no keys, then we're likely validating the root + // variable rather than a key within an object. This attempts + // to extract what type it was that failed to validate. + // For example, z.string().parse(123) would return "string" here. + let rootExpectedType = 'variable'; + if (zodError.issues.length > 0) { + const iss = zodError.issues[0]; + if (iss !== undefined && 'expected' in iss && typeof iss.expected === 'string') { + rootExpectedType = iss.expected; + } + } + return `Failed to validate ${rootExpectedType}`; + } + return `Failed to validate keys: ${string.truncate(errorKeys.join(', '), 100)}`; +} + +/** + * Applies ZodError issues to an event extra and replaces the error message + */ +function applyZodErrorsToEvent( + limit, + saveZodIssuesAsAttachment = false, + event, + hint, +) { + if ( + !event.exception || + !event.exception.values || + !hint || + !hint.originalException || + !originalExceptionIsZodError(hint.originalException) || + hint.originalException.issues.length === 0 + ) { + return event; + } + + try { + const issuesToFlatten = saveZodIssuesAsAttachment + ? hint.originalException.issues + : hint.originalException.issues.slice(0, limit); + const flattenedIssues = issuesToFlatten.map(flattenIssue); + + if (saveZodIssuesAsAttachment) { + // Sometimes having the full error details can be helpful. + // Attachments have much higher limits, so we can include the full list of issues. + if (!Array.isArray(hint.attachments)) { + hint.attachments = []; + } + hint.attachments.push({ + filename: 'zod_issues.json', + data: JSON.stringify({ + issues: flattenedIssues, + }), + }); + } + + return { + ...event, + exception: { + ...event.exception, + values: [ + { + ...event.exception.values[0], + value: formatIssueMessage(hint.originalException), + }, + ...event.exception.values.slice(1), + ], + }, + extra: { + ...event.extra, + 'zoderror.issues': flattenedIssues.slice(0, limit), + }, + }; + } catch (e) { + // Hopefully we never throw errors here, but record it + // with the event just in case. + return { + ...event, + extra: { + ...event.extra, + 'zoderrors sentry integration parse error': { + message: 'an exception was thrown while processing ZodError within applyZodErrorsToEvent()', + error: e instanceof Error ? `${e.name}: ${e.message}\n${e.stack}` : 'unknown', + }, + }, + }; + } +} + +const _zodErrorsIntegration = ((options = {}) => { + const limit = typeof options.limit === 'undefined' ? DEFAULT_LIMIT : options.limit; + + return { + name: INTEGRATION_NAME, + processEvent(originalEvent, hint) { + const processedEvent = applyZodErrorsToEvent(limit, options.saveZodIssuesAsAttachment, originalEvent, hint); + return processedEvent; + }, + }; +}) ; + +/** + * Sentry integration to process Zod errors, making them easier to work with in Sentry. + */ +const zodErrorsIntegration = integration.defineIntegration(_zodErrorsIntegration); + +exports.applyZodErrorsToEvent = applyZodErrorsToEvent; +exports.flattenIssue = flattenIssue; +exports.flattenIssuePath = flattenIssuePath; +exports.formatIssueMessage = formatIssueMessage; +exports.zodErrorsIntegration = zodErrorsIntegration; +//# sourceMappingURL=zoderrors.js.map + + +/***/ }), + +/***/ 44592: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const worldwide = __nccwpck_require__(10891); + +/** Keys are source filename/url, values are metadata objects. */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const filenameMetadataMap = new Map(); +/** Set of stack strings that have already been parsed. */ +const parsedStacks = new Set(); + +function ensureMetadataStacksAreParsed(parser) { + if (!worldwide.GLOBAL_OBJ._sentryModuleMetadata) { + return; + } + + for (const stack of Object.keys(worldwide.GLOBAL_OBJ._sentryModuleMetadata)) { + const metadata = worldwide.GLOBAL_OBJ._sentryModuleMetadata[stack]; + + if (parsedStacks.has(stack)) { + continue; + } + + // Ensure this stack doesn't get parsed again + parsedStacks.add(stack); + + const frames = parser(stack); + + // Go through the frames starting from the top of the stack and find the first one with a filename + for (const frame of frames.reverse()) { + if (frame.filename) { + // Save the metadata for this filename + filenameMetadataMap.set(frame.filename, metadata); + break; + } + } + } +} + +/** + * Retrieve metadata for a specific JavaScript file URL. + * + * Metadata is injected by the Sentry bundler plugins using the `_experiments.moduleMetadata` config option. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function getMetadataForUrl(parser, filename) { + ensureMetadataStacksAreParsed(parser); + return filenameMetadataMap.get(filename); +} + +/** + * Adds metadata to stack frames. + * + * Metadata is injected by the Sentry bundler plugins using the `_experiments.moduleMetadata` config option. + */ +function addMetadataToStackFrames(parser, event) { + try { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + event.exception.values.forEach(exception => { + if (!exception.stacktrace) { + return; + } + + for (const frame of exception.stacktrace.frames || []) { + if (!frame.filename || frame.module_metadata) { + continue; + } + + const metadata = getMetadataForUrl(parser, frame.filename); + + if (metadata) { + frame.module_metadata = metadata; + } + } + }); + } catch (_) { + // To save bundle size we're just try catching here instead of checking for the existence of all the different objects. + } +} + +/** + * Strips metadata from stack frames. + */ +function stripMetadataFromStackFrames(event) { + try { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + event.exception.values.forEach(exception => { + if (!exception.stacktrace) { + return; + } + + for (const frame of exception.stacktrace.frames || []) { + delete frame.module_metadata; + } + }); + } catch (_) { + // To save bundle size we're just try catching here instead of checking for the existence of all the different objects. + } +} + +exports.addMetadataToStackFrames = addMetadataToStackFrames; +exports.getMetadataForUrl = getMetadataForUrl; +exports.stripMetadataFromStackFrames = stripMetadataFromStackFrames; +//# sourceMappingURL=metadata.js.map + + +/***/ }), + +/***/ 33325: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const time = __nccwpck_require__(75872); +const spanUtils = __nccwpck_require__(47569); +const constants = __nccwpck_require__(12510); +const envelope = __nccwpck_require__(61993); +const instance = __nccwpck_require__(23260); +const utils = __nccwpck_require__(72475); + +/** + * A metrics aggregator that aggregates metrics in memory and flushes them periodically. + */ +class MetricsAggregator { + // TODO(@anonrig): Use FinalizationRegistry to have a proper way of flushing the buckets + // when the aggregator is garbage collected. + // Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry + + // Different metrics have different weights. We use this to limit the number of metrics + // that we store in memory. + + // We adjust the type here to add the `unref()` part, as setInterval can technically return a number or a NodeJS.Timer + + // SDKs are required to shift the flush interval by random() * rollup_in_seconds. + // That shift is determined once per startup to create jittering. + + // An SDK is required to perform force flushing ahead of scheduled time if the memory + // pressure is too high. There is no rule for this other than that SDKs should be tracking + // abstract aggregation complexity (eg: a counter only carries a single float, whereas a + // distribution is a float per emission). + // + // Force flush is used on either shutdown, flush() or when we exceed the max weight. + + constructor( _client) {this._client = _client; + this._buckets = new Map(); + this._bucketsTotalWeight = 0; + + this._interval = setInterval(() => this._flush(), constants.DEFAULT_FLUSH_INTERVAL); + if (this._interval.unref) { + this._interval.unref(); + } + + this._flushShift = Math.floor((Math.random() * constants.DEFAULT_FLUSH_INTERVAL) / 1000); + this._forceFlush = false; + } + + /** + * @inheritDoc + */ + add( + metricType, + unsanitizedName, + value, + unsanitizedUnit = 'none', + unsanitizedTags = {}, + maybeFloatTimestamp = time.timestampInSeconds(), + ) { + const timestamp = Math.floor(maybeFloatTimestamp); + const name = utils.sanitizeMetricKey(unsanitizedName); + const tags = utils.sanitizeTags(unsanitizedTags); + const unit = utils.sanitizeUnit(unsanitizedUnit ); + + const bucketKey = utils.getBucketKey(metricType, name, unit, tags); + + let bucketItem = this._buckets.get(bucketKey); + // If this is a set metric, we need to calculate the delta from the previous weight. + const previousWeight = bucketItem && metricType === constants.SET_METRIC_TYPE ? bucketItem.metric.weight : 0; + + if (bucketItem) { + bucketItem.metric.add(value); + // TODO(abhi): Do we need this check? + if (bucketItem.timestamp < timestamp) { + bucketItem.timestamp = timestamp; + } + } else { + bucketItem = { + // @ts-expect-error we don't need to narrow down the type of value here, saves bundle size. + metric: new instance.METRIC_MAP[metricType](value), + timestamp, + metricType, + name, + unit, + tags, + }; + this._buckets.set(bucketKey, bucketItem); + } + + // If value is a string, it's a set metric so calculate the delta from the previous weight. + const val = typeof value === 'string' ? bucketItem.metric.weight - previousWeight : value; + spanUtils.updateMetricSummaryOnActiveSpan(metricType, name, val, unit, unsanitizedTags, bucketKey); + + // We need to keep track of the total weight of the buckets so that we can + // flush them when we exceed the max weight. + this._bucketsTotalWeight += bucketItem.metric.weight; + + if (this._bucketsTotalWeight >= constants.MAX_WEIGHT) { + this.flush(); + } + } + + /** + * Flushes the current metrics to the transport via the transport. + */ + flush() { + this._forceFlush = true; + this._flush(); + } + + /** + * Shuts down metrics aggregator and clears all metrics. + */ + close() { + this._forceFlush = true; + clearInterval(this._interval); + this._flush(); + } + + /** + * Flushes the buckets according to the internal state of the aggregator. + * If it is a force flush, which happens on shutdown, it will flush all buckets. + * Otherwise, it will only flush buckets that are older than the flush interval, + * and according to the flush shift. + * + * This function mutates `_forceFlush` and `_bucketsTotalWeight` properties. + */ + _flush() { + // TODO(@anonrig): Add Atomics for locking to avoid having force flush and regular flush + // running at the same time. + // Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics + + // This path eliminates the need for checking for timestamps since we're forcing a flush. + // Remember to reset the flag, or it will always flush all metrics. + if (this._forceFlush) { + this._forceFlush = false; + this._bucketsTotalWeight = 0; + this._captureMetrics(this._buckets); + this._buckets.clear(); + return; + } + const cutoffSeconds = Math.floor(time.timestampInSeconds()) - constants.DEFAULT_FLUSH_INTERVAL / 1000 - this._flushShift; + // TODO(@anonrig): Optimization opportunity. + // Convert this map to an array and store key in the bucketItem. + const flushedBuckets = new Map(); + for (const [key, bucket] of this._buckets) { + if (bucket.timestamp <= cutoffSeconds) { + flushedBuckets.set(key, bucket); + this._bucketsTotalWeight -= bucket.metric.weight; + } + } + + for (const [key] of flushedBuckets) { + this._buckets.delete(key); + } + + this._captureMetrics(flushedBuckets); + } + + /** + * Only captures a subset of the buckets passed to this function. + * @param flushedBuckets + */ + _captureMetrics(flushedBuckets) { + if (flushedBuckets.size > 0) { + // TODO(@anonrig): Optimization opportunity. + // This copy operation can be avoided if we store the key in the bucketItem. + const buckets = Array.from(flushedBuckets).map(([, bucketItem]) => bucketItem); + envelope.captureAggregateMetrics(this._client, buckets); + } + } +} + +exports.MetricsAggregator = MetricsAggregator; +//# sourceMappingURL=aggregator.js.map + + +/***/ }), + +/***/ 53128: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const time = __nccwpck_require__(75872); +const spanUtils = __nccwpck_require__(47569); +const constants = __nccwpck_require__(12510); +const envelope = __nccwpck_require__(61993); +const instance = __nccwpck_require__(23260); +const utils = __nccwpck_require__(72475); + +/** + * A simple metrics aggregator that aggregates metrics in memory and flushes them periodically. + * Default flush interval is 5 seconds. + * + * @experimental This API is experimental and might change in the future. + */ +class BrowserMetricsAggregator { + // TODO(@anonrig): Use FinalizationRegistry to have a proper way of flushing the buckets + // when the aggregator is garbage collected. + // Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry + + constructor( _client) {this._client = _client; + this._buckets = new Map(); + this._interval = setInterval(() => this.flush(), constants.DEFAULT_BROWSER_FLUSH_INTERVAL); + } + + /** + * @inheritDoc + */ + add( + metricType, + unsanitizedName, + value, + unsanitizedUnit = 'none', + unsanitizedTags = {}, + maybeFloatTimestamp = time.timestampInSeconds(), + ) { + const timestamp = Math.floor(maybeFloatTimestamp); + const name = utils.sanitizeMetricKey(unsanitizedName); + const tags = utils.sanitizeTags(unsanitizedTags); + const unit = utils.sanitizeUnit(unsanitizedUnit ); + + const bucketKey = utils.getBucketKey(metricType, name, unit, tags); + + let bucketItem = this._buckets.get(bucketKey); + // If this is a set metric, we need to calculate the delta from the previous weight. + const previousWeight = bucketItem && metricType === constants.SET_METRIC_TYPE ? bucketItem.metric.weight : 0; + + if (bucketItem) { + bucketItem.metric.add(value); + // TODO(abhi): Do we need this check? + if (bucketItem.timestamp < timestamp) { + bucketItem.timestamp = timestamp; + } + } else { + bucketItem = { + // @ts-expect-error we don't need to narrow down the type of value here, saves bundle size. + metric: new instance.METRIC_MAP[metricType](value), + timestamp, + metricType, + name, + unit, + tags, + }; + this._buckets.set(bucketKey, bucketItem); + } + + // If value is a string, it's a set metric so calculate the delta from the previous weight. + const val = typeof value === 'string' ? bucketItem.metric.weight - previousWeight : value; + spanUtils.updateMetricSummaryOnActiveSpan(metricType, name, val, unit, unsanitizedTags, bucketKey); + } + + /** + * @inheritDoc + */ + flush() { + // short circuit if buckets are empty. + if (this._buckets.size === 0) { + return; + } + + const metricBuckets = Array.from(this._buckets.values()); + envelope.captureAggregateMetrics(this._client, metricBuckets); + + this._buckets.clear(); + } + + /** + * @inheritDoc + */ + close() { + clearInterval(this._interval); + this.flush(); + } +} + +exports.BrowserMetricsAggregator = BrowserMetricsAggregator; +//# sourceMappingURL=browser-aggregator.js.map + + +/***/ }), + +/***/ 12510: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const COUNTER_METRIC_TYPE = 'c' ; +const GAUGE_METRIC_TYPE = 'g' ; +const SET_METRIC_TYPE = 's' ; +const DISTRIBUTION_METRIC_TYPE = 'd' ; + +/** + * This does not match spec in https://develop.sentry.dev/sdk/metrics + * but was chosen to optimize for the most common case in browser environments. + */ +const DEFAULT_BROWSER_FLUSH_INTERVAL = 5000; + +/** + * SDKs are required to bucket into 10 second intervals (rollup in seconds) + * which is the current lower bound of metric accuracy. + */ +const DEFAULT_FLUSH_INTERVAL = 10000; + +/** + * The maximum number of metrics that should be stored in memory. + */ +const MAX_WEIGHT = 10000; + +exports.COUNTER_METRIC_TYPE = COUNTER_METRIC_TYPE; +exports.DEFAULT_BROWSER_FLUSH_INTERVAL = DEFAULT_BROWSER_FLUSH_INTERVAL; +exports.DEFAULT_FLUSH_INTERVAL = DEFAULT_FLUSH_INTERVAL; +exports.DISTRIBUTION_METRIC_TYPE = DISTRIBUTION_METRIC_TYPE; +exports.GAUGE_METRIC_TYPE = GAUGE_METRIC_TYPE; +exports.MAX_WEIGHT = MAX_WEIGHT; +exports.SET_METRIC_TYPE = SET_METRIC_TYPE; +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ 61993: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const dsn = __nccwpck_require__(32540); +const envelope = __nccwpck_require__(72635); +const logger = __nccwpck_require__(38752); +const utils = __nccwpck_require__(72475); + +/** + * Captures aggregated metrics to the supplied client. + */ +function captureAggregateMetrics(client, metricBucketItems) { + logger.logger.log(`Flushing aggregated metrics, number of metrics: ${metricBucketItems.length}`); + const dsn = client.getDsn(); + const metadata = client.getSdkMetadata(); + const tunnel = client.getOptions().tunnel; + + const metricsEnvelope = createMetricEnvelope(metricBucketItems, dsn, metadata, tunnel); + + // sendEnvelope should not throw + // eslint-disable-next-line @typescript-eslint/no-floating-promises + client.sendEnvelope(metricsEnvelope); +} + +/** + * Create envelope from a metric aggregate. + */ +function createMetricEnvelope( + metricBucketItems, + dsn$1, + metadata, + tunnel, +) { + const headers = { + sent_at: new Date().toISOString(), + }; + + if (metadata && metadata.sdk) { + headers.sdk = { + name: metadata.sdk.name, + version: metadata.sdk.version, + }; + } + + if (!!tunnel && dsn$1) { + headers.dsn = dsn.dsnToString(dsn$1); + } + + const item = createMetricEnvelopeItem(metricBucketItems); + return envelope.createEnvelope(headers, [item]); +} + +function createMetricEnvelopeItem(metricBucketItems) { + const payload = utils.serializeMetricBuckets(metricBucketItems); + const metricHeaders = { + type: 'statsd', + length: payload.length, + }; + return [metricHeaders, payload]; +} + +exports.captureAggregateMetrics = captureAggregateMetrics; +exports.createMetricEnvelope = createMetricEnvelope; +//# sourceMappingURL=envelope.js.map + + +/***/ }), + +/***/ 19001: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const aggregator = __nccwpck_require__(33325); +const exports$1 = __nccwpck_require__(57134); + +/** + * Adds a value to a counter metric + * + * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. + */ +function increment(name, value = 1, data) { + // eslint-disable-next-line deprecation/deprecation + exports$1.metrics.increment(aggregator.MetricsAggregator, name, value, data); +} + +/** + * Adds a value to a distribution metric + * + * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. + */ +function distribution(name, value, data) { + // eslint-disable-next-line deprecation/deprecation + exports$1.metrics.distribution(aggregator.MetricsAggregator, name, value, data); +} + +/** + * Adds a value to a set metric. Value must be a string or integer. + * + * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. + */ +function set(name, value, data) { + // eslint-disable-next-line deprecation/deprecation + exports$1.metrics.set(aggregator.MetricsAggregator, name, value, data); +} + +/** + * Adds a value to a gauge metric + * + * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. + */ +function gauge(name, value, data) { + // eslint-disable-next-line deprecation/deprecation + exports$1.metrics.gauge(aggregator.MetricsAggregator, name, value, data); +} + +/** + * Adds a timing metric. + * The metric is added as a distribution metric. + * + * You can either directly capture a numeric `value`, or wrap a callback function in `timing`. + * In the latter case, the duration of the callback execution will be captured as a span & a metric. + * + * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. + */ + +function timing( + name, + value, + unit = 'second', + data, +) { + // eslint-disable-next-line deprecation/deprecation + return exports$1.metrics.timing(aggregator.MetricsAggregator, name, value, unit, data); +} + +/** + * Returns the metrics aggregator for a given client. + */ +function getMetricsAggregatorForClient(client) { + // eslint-disable-next-line deprecation/deprecation + return exports$1.metrics.getMetricsAggregatorForClient(client, aggregator.MetricsAggregator); +} + +/** + * The metrics API is used to capture custom metrics in Sentry. + * + * @deprecated The Sentry metrics beta has ended. This export will be removed in a future release. + */ +const metricsDefault + + = { + increment, + distribution, + set, + gauge, + timing, + /** + * @ignore This is for internal use only. + */ + getMetricsAggregatorForClient, +}; + +exports.metricsDefault = metricsDefault; +//# sourceMappingURL=exports-default.js.map + + +/***/ }), + +/***/ 57134: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const currentScopes = __nccwpck_require__(8131); +const debugBuild = __nccwpck_require__(14488); +__nccwpck_require__(21834); +const worldwide = __nccwpck_require__(10891); +__nccwpck_require__(87038); +const logger = __nccwpck_require__(38752); +const time = __nccwpck_require__(75872); +const spanUtils = __nccwpck_require__(47569); +const trace = __nccwpck_require__(97956); +const handleCallbackErrors = __nccwpck_require__(77864); +const constants = __nccwpck_require__(12510); + +/** + * Gets the metrics aggregator for a given client. + * @param client The client for which to get the metrics aggregator. + * @param Aggregator Optional metrics aggregator class to use to create an aggregator if one does not exist. + */ +function getMetricsAggregatorForClient( + client, + Aggregator, +) { + const globalMetricsAggregators = worldwide.getGlobalSingleton( + 'globalMetricsAggregators', + () => new WeakMap(), + ); + + const aggregator = globalMetricsAggregators.get(client); + if (aggregator) { + return aggregator; + } + + const newAggregator = new Aggregator(client); + client.on('flush', () => newAggregator.flush()); + client.on('close', () => newAggregator.close()); + globalMetricsAggregators.set(client, newAggregator); + + return newAggregator; +} + +function addToMetricsAggregator( + Aggregator, + metricType, + name, + value, + data = {}, +) { + const client = data.client || currentScopes.getClient(); + + if (!client) { + return; + } + + const span = spanUtils.getActiveSpan(); + const rootSpan = span ? spanUtils.getRootSpan(span) : undefined; + const transactionName = rootSpan && spanUtils.spanToJSON(rootSpan).description; + + const { unit, tags, timestamp } = data; + const { release, environment } = client.getOptions(); + const metricTags = {}; + if (release) { + metricTags.release = release; + } + if (environment) { + metricTags.environment = environment; + } + if (transactionName) { + metricTags.transaction = transactionName; + } + + debugBuild.DEBUG_BUILD && logger.logger.log(`Adding value of ${value} to ${metricType} metric ${name}`); + + const aggregator = getMetricsAggregatorForClient(client, Aggregator); + aggregator.add(metricType, name, value, unit, { ...metricTags, ...tags }, timestamp); +} + +/** + * Adds a value to a counter metric + * + * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. + */ +function increment(aggregator, name, value = 1, data) { + addToMetricsAggregator(aggregator, constants.COUNTER_METRIC_TYPE, name, ensureNumber(value), data); +} + +/** + * Adds a value to a distribution metric + * + * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. + */ +function distribution(aggregator, name, value, data) { + addToMetricsAggregator(aggregator, constants.DISTRIBUTION_METRIC_TYPE, name, ensureNumber(value), data); +} + +/** + * Adds a timing metric. + * The metric is added as a distribution metric. + * + * You can either directly capture a numeric `value`, or wrap a callback function in `timing`. + * In the latter case, the duration of the callback execution will be captured as a span & a metric. + * + * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. + */ +function timing( + aggregator, + name, + value, + unit = 'second', + data, +) { + // callback form + if (typeof value === 'function') { + const startTime = time.timestampInSeconds(); + + return trace.startSpanManual( + { + op: 'metrics.timing', + name, + startTime, + onlyIfParent: true, + }, + span => { + return handleCallbackErrors.handleCallbackErrors( + () => value(), + () => { + // no special error handling necessary + }, + () => { + const endTime = time.timestampInSeconds(); + const timeDiff = endTime - startTime; + // eslint-disable-next-line deprecation/deprecation + distribution(aggregator, name, timeDiff, { ...data, unit: 'second' }); + span.end(endTime); + }, + ); + }, + ); + } + + // value form + // eslint-disable-next-line deprecation/deprecation + distribution(aggregator, name, value, { ...data, unit }); +} + +/** + * Adds a value to a set metric. Value must be a string or integer. + * + * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. + */ +function set(aggregator, name, value, data) { + addToMetricsAggregator(aggregator, constants.SET_METRIC_TYPE, name, value, data); +} + +/** + * Adds a value to a gauge metric + * + * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. + */ +function gauge(aggregator, name, value, data) { + addToMetricsAggregator(aggregator, constants.GAUGE_METRIC_TYPE, name, ensureNumber(value), data); +} + +/** + * The metrics API is used to capture custom metrics in Sentry. + * + * @deprecated The Sentry metrics beta has ended. This export will be removed in a future release. + */ +const metrics = { + increment, + distribution, + set, + gauge, + timing, + /** + * @ignore This is for internal use only. + */ + getMetricsAggregatorForClient, +}; + +// Although this is typed to be a number, we try to handle strings as well here +function ensureNumber(number) { + return typeof number === 'string' ? parseInt(number) : number; +} + +exports.metrics = metrics; +//# sourceMappingURL=exports.js.map + + +/***/ }), + +/***/ 23260: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const constants = __nccwpck_require__(12510); +const utils = __nccwpck_require__(72475); + +/** + * A metric instance representing a counter. + */ +class CounterMetric { + constructor( _value) {this._value = _value;} + + /** @inheritDoc */ + get weight() { + return 1; + } + + /** @inheritdoc */ + add(value) { + this._value += value; + } + + /** @inheritdoc */ + toString() { + return `${this._value}`; + } +} + +/** + * A metric instance representing a gauge. + */ +class GaugeMetric { + + constructor(value) { + this._last = value; + this._min = value; + this._max = value; + this._sum = value; + this._count = 1; + } + + /** @inheritDoc */ + get weight() { + return 5; + } + + /** @inheritdoc */ + add(value) { + this._last = value; + if (value < this._min) { + this._min = value; + } + if (value > this._max) { + this._max = value; + } + this._sum += value; + this._count++; + } + + /** @inheritdoc */ + toString() { + return `${this._last}:${this._min}:${this._max}:${this._sum}:${this._count}`; + } +} + +/** + * A metric instance representing a distribution. + */ +class DistributionMetric { + + constructor(first) { + this._value = [first]; + } + + /** @inheritDoc */ + get weight() { + return this._value.length; + } + + /** @inheritdoc */ + add(value) { + this._value.push(value); + } + + /** @inheritdoc */ + toString() { + return this._value.join(':'); + } +} + +/** + * A metric instance representing a set. + */ +class SetMetric { + + constructor( first) {this.first = first; + this._value = new Set([first]); + } + + /** @inheritDoc */ + get weight() { + return this._value.size; + } + + /** @inheritdoc */ + add(value) { + this._value.add(value); + } + + /** @inheritdoc */ + toString() { + return Array.from(this._value) + .map(val => (typeof val === 'string' ? utils.simpleHash(val) : val)) + .join(':'); + } +} + +const METRIC_MAP = { + [constants.COUNTER_METRIC_TYPE]: CounterMetric, + [constants.GAUGE_METRIC_TYPE]: GaugeMetric, + [constants.DISTRIBUTION_METRIC_TYPE]: DistributionMetric, + [constants.SET_METRIC_TYPE]: SetMetric, +}; + +exports.CounterMetric = CounterMetric; +exports.DistributionMetric = DistributionMetric; +exports.GaugeMetric = GaugeMetric; +exports.METRIC_MAP = METRIC_MAP; +exports.SetMetric = SetMetric; +//# sourceMappingURL=instance.js.map + + +/***/ }), + +/***/ 48306: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const object = __nccwpck_require__(16100); + +/** + * key: bucketKey + * value: [exportKey, MetricSummary] + */ + +const METRICS_SPAN_FIELD = '_sentryMetrics'; + +/** + * Fetches the metric summary if it exists for the passed span + */ +function getMetricSummaryJsonForSpan(span) { + const storage = (span )[METRICS_SPAN_FIELD]; + + if (!storage) { + return undefined; + } + const output = {}; + + for (const [, [exportKey, summary]] of storage) { + const arr = output[exportKey] || (output[exportKey] = []); + arr.push(object.dropUndefinedKeys(summary)); + } + + return output; +} + +/** + * Updates the metric summary on a span. + */ +function updateMetricSummaryOnSpan( + span, + metricType, + sanitizedName, + value, + unit, + tags, + bucketKey, +) { + const existingStorage = (span )[METRICS_SPAN_FIELD]; + const storage = + existingStorage || + ((span )[METRICS_SPAN_FIELD] = new Map()); + + const exportKey = `${metricType}:${sanitizedName}@${unit}`; + const bucketItem = storage.get(bucketKey); + + if (bucketItem) { + const [, summary] = bucketItem; + storage.set(bucketKey, [ + exportKey, + { + min: Math.min(summary.min, value), + max: Math.max(summary.max, value), + count: (summary.count += 1), + sum: (summary.sum += value), + tags: summary.tags, + }, + ]); + } else { + storage.set(bucketKey, [ + exportKey, + { + min: value, + max: value, + count: 1, + sum: value, + tags, + }, + ]); + } +} + +exports.getMetricSummaryJsonForSpan = getMetricSummaryJsonForSpan; +exports.updateMetricSummaryOnSpan = updateMetricSummaryOnSpan; +//# sourceMappingURL=metric-summary.js.map + + +/***/ }), + +/***/ 72475: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const object = __nccwpck_require__(16100); + +/** + * Generate bucket key from metric properties. + */ +function getBucketKey( + metricType, + name, + unit, + tags, +) { + const stringifiedTags = Object.entries(object.dropUndefinedKeys(tags)).sort((a, b) => a[0].localeCompare(b[0])); + return `${metricType}${name}${unit}${stringifiedTags}`; +} + +/* eslint-disable no-bitwise */ +/** + * Simple hash function for strings. + */ +function simpleHash(s) { + let rv = 0; + for (let i = 0; i < s.length; i++) { + const c = s.charCodeAt(i); + rv = (rv << 5) - rv + c; + rv &= rv; + } + return rv >>> 0; +} +/* eslint-enable no-bitwise */ + +/** + * Serialize metrics buckets into a string based on statsd format. + * + * Example of format: + * metric.name@second:1:1.2|d|#a:value,b:anothervalue|T12345677 + * Segments: + * name: metric.name + * unit: second + * value: [1, 1.2] + * type of metric: d (distribution) + * tags: { a: value, b: anothervalue } + * timestamp: 12345677 + */ +function serializeMetricBuckets(metricBucketItems) { + let out = ''; + for (const item of metricBucketItems) { + const tagEntries = Object.entries(item.tags); + const maybeTags = tagEntries.length > 0 ? `|#${tagEntries.map(([key, value]) => `${key}:${value}`).join(',')}` : ''; + out += `${item.name}@${item.unit}:${item.metric}|${item.metricType}${maybeTags}|T${item.timestamp}\n`; + } + return out; +} + +/** + * Sanitizes units + * + * These Regex's are straight from the normalisation docs: + * https://develop.sentry.dev/sdk/metrics/#normalization + */ +function sanitizeUnit(unit) { + return unit.replace(/[^\w]+/gi, '_'); +} + +/** + * Sanitizes metric keys + * + * These Regex's are straight from the normalisation docs: + * https://develop.sentry.dev/sdk/metrics/#normalization + */ +function sanitizeMetricKey(key) { + return key.replace(/[^\w\-.]+/gi, '_'); +} + +/** + * Sanitizes metric keys + * + * These Regex's are straight from the normalisation docs: + * https://develop.sentry.dev/sdk/metrics/#normalization + */ +function sanitizeTagKey(key) { + return key.replace(/[^\w\-./]+/gi, ''); +} + +/** + * These Regex's are straight from the normalisation docs: + * https://develop.sentry.dev/sdk/metrics/#normalization + */ +const tagValueReplacements = [ + ['\n', '\\n'], + ['\r', '\\r'], + ['\t', '\\t'], + ['\\', '\\\\'], + ['|', '\\u{7c}'], + [',', '\\u{2c}'], +]; + +function getCharOrReplacement(input) { + for (const [search, replacement] of tagValueReplacements) { + if (input === search) { + return replacement; + } + } + + return input; +} + +function sanitizeTagValue(value) { + return [...value].reduce((acc, char) => acc + getCharOrReplacement(char), ''); +} + +/** + * Sanitizes tags. + */ +function sanitizeTags(unsanitizedTags) { + const tags = {}; + for (const key in unsanitizedTags) { + if (Object.prototype.hasOwnProperty.call(unsanitizedTags, key)) { + const sanitizedKey = sanitizeTagKey(key); + tags[sanitizedKey] = sanitizeTagValue(String(unsanitizedTags[key])); + } + } + return tags; +} + +exports.getBucketKey = getBucketKey; +exports.sanitizeMetricKey = sanitizeMetricKey; +exports.sanitizeTags = sanitizeTags; +exports.sanitizeUnit = sanitizeUnit; +exports.serializeMetricBuckets = serializeMetricBuckets; +exports.simpleHash = simpleHash; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 25750: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const currentScopes = __nccwpck_require__(8131); +const debugBuild = __nccwpck_require__(14488); +const logger = __nccwpck_require__(38752); + +function isProfilingIntegrationWithProfiler( + integration, +) { + return ( + !!integration && + typeof integration['_profiler'] !== 'undefined' && + typeof integration['_profiler']['start'] === 'function' && + typeof integration['_profiler']['stop'] === 'function' + ); +} +/** + * Starts the Sentry continuous profiler. + * This mode is exclusive with the transaction profiler and will only work if the profilesSampleRate is set to a falsy value. + * In continuous profiling mode, the profiler will keep reporting profile chunks to Sentry until it is stopped, which allows for continuous profiling of the application. + */ +function startProfiler() { + const client = currentScopes.getClient(); + if (!client) { + debugBuild.DEBUG_BUILD && logger.logger.warn('No Sentry client available, profiling is not started'); + return; + } + + const integration = client.getIntegrationByName('ProfilingIntegration'); + + if (!integration) { + debugBuild.DEBUG_BUILD && logger.logger.warn('ProfilingIntegration is not available'); + return; + } + + if (!isProfilingIntegrationWithProfiler(integration)) { + debugBuild.DEBUG_BUILD && logger.logger.warn('Profiler is not available on profiling integration.'); + return; + } + + integration._profiler.start(); +} + +/** + * Stops the Sentry continuous profiler. + * Calls to stop will stop the profiler and flush the currently collected profile data to Sentry. + */ +function stopProfiler() { + const client = currentScopes.getClient(); + if (!client) { + debugBuild.DEBUG_BUILD && logger.logger.warn('No Sentry client available, profiling is not started'); + return; + } + + const integration = client.getIntegrationByName('ProfilingIntegration'); + if (!integration) { + debugBuild.DEBUG_BUILD && logger.logger.warn('ProfilingIntegration is not available'); + return; + } + + if (!isProfilingIntegrationWithProfiler(integration)) { + debugBuild.DEBUG_BUILD && logger.logger.warn('Profiler is not available on profiling integration.'); + return; + } + + integration._profiler.stop(); +} + +const profiler = { + startProfiler, + stopProfiler, +}; + +exports.profiler = profiler; +//# sourceMappingURL=profiling.js.map + + +/***/ }), + +/***/ 49417: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const session = __nccwpck_require__(60233); +const is = __nccwpck_require__(84085); +const logger = __nccwpck_require__(38752); +const misc = __nccwpck_require__(3181); +const propagationContext = __nccwpck_require__(37264); +const time = __nccwpck_require__(75872); +const merge = __nccwpck_require__(32003); +const spanOnScope = __nccwpck_require__(14379); + +/** + * Default value for maximum number of breadcrumbs added to an event. + */ +const DEFAULT_MAX_BREADCRUMBS = 100; + +/** + * Holds additional event information. + */ +class ScopeClass { + /** Flag if notifying is happening. */ + + /** Callback for client to receive scope changes. */ + + /** Callback list that will be called during event processing. */ + + /** Array of breadcrumbs. */ + + /** User */ + + /** Tags */ + + /** Extra */ + + /** Contexts */ + + /** Attachments */ + + /** Propagation Context for distributed tracing */ + + /** + * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get + * sent to Sentry + */ + + /** Fingerprint */ + + /** Severity */ + + /** + * Transaction Name + * + * IMPORTANT: The transaction name on the scope has nothing to do with root spans/transaction objects. + * It's purpose is to assign a transaction to the scope that's added to non-transaction events. + */ + + /** Session */ + + /** Request Mode Session Status */ + // eslint-disable-next-line deprecation/deprecation + + /** The client on this scope */ + + /** Contains the last event id of a captured event. */ + + // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method. + + constructor() { + this._notifyingListeners = false; + this._scopeListeners = []; + this._eventProcessors = []; + this._breadcrumbs = []; + this._attachments = []; + this._user = {}; + this._tags = {}; + this._extra = {}; + this._contexts = {}; + this._sdkProcessingMetadata = {}; + this._propagationContext = { + traceId: propagationContext.generateTraceId(), + spanId: propagationContext.generateSpanId(), + }; + } + + /** + * @inheritDoc + */ + clone() { + const newScope = new ScopeClass(); + newScope._breadcrumbs = [...this._breadcrumbs]; + newScope._tags = { ...this._tags }; + newScope._extra = { ...this._extra }; + newScope._contexts = { ...this._contexts }; + if (this._contexts.flags) { + // We need to copy the `values` array so insertions on a cloned scope + // won't affect the original array. + newScope._contexts.flags = { + values: [...this._contexts.flags.values], + }; + } + + newScope._user = this._user; + newScope._level = this._level; + newScope._session = this._session; + newScope._transactionName = this._transactionName; + newScope._fingerprint = this._fingerprint; + newScope._eventProcessors = [...this._eventProcessors]; + newScope._requestSession = this._requestSession; + newScope._attachments = [...this._attachments]; + newScope._sdkProcessingMetadata = { ...this._sdkProcessingMetadata }; + newScope._propagationContext = { ...this._propagationContext }; + newScope._client = this._client; + newScope._lastEventId = this._lastEventId; + + spanOnScope._setSpanForScope(newScope, spanOnScope._getSpanForScope(this)); + + return newScope; + } + + /** + * @inheritDoc + */ + setClient(client) { + this._client = client; + } + + /** + * @inheritDoc + */ + setLastEventId(lastEventId) { + this._lastEventId = lastEventId; + } + + /** + * @inheritDoc + */ + getClient() { + return this._client ; + } + + /** + * @inheritDoc + */ + lastEventId() { + return this._lastEventId; + } + + /** + * @inheritDoc + */ + addScopeListener(callback) { + this._scopeListeners.push(callback); + } + + /** + * @inheritDoc + */ + addEventProcessor(callback) { + this._eventProcessors.push(callback); + return this; + } + + /** + * @inheritDoc + */ + setUser(user) { + // If null is passed we want to unset everything, but still define keys, + // so that later down in the pipeline any existing values are cleared. + this._user = user || { + email: undefined, + id: undefined, + ip_address: undefined, + username: undefined, + }; + + if (this._session) { + session.updateSession(this._session, { user }); + } + + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + getUser() { + return this._user; + } + + /** + * @inheritDoc + */ + // eslint-disable-next-line deprecation/deprecation + getRequestSession() { + return this._requestSession; + } + + /** + * @inheritDoc + */ + // eslint-disable-next-line deprecation/deprecation + setRequestSession(requestSession) { + this._requestSession = requestSession; + return this; + } + + /** + * @inheritDoc + */ + setTags(tags) { + this._tags = { + ...this._tags, + ...tags, + }; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setTag(key, value) { + this._tags = { ...this._tags, [key]: value }; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setExtras(extras) { + this._extra = { + ...this._extra, + ...extras, + }; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setExtra(key, extra) { + this._extra = { ...this._extra, [key]: extra }; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setFingerprint(fingerprint) { + this._fingerprint = fingerprint; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setLevel(level) { + this._level = level; + this._notifyScopeListeners(); + return this; + } + + /** + * Sets the transaction name on the scope so that the name of e.g. taken server route or + * the page location is attached to future events. + * + * IMPORTANT: Calling this function does NOT change the name of the currently active + * root span. If you want to change the name of the active root span, use + * `Sentry.updateSpanName(rootSpan, 'new name')` instead. + * + * By default, the SDK updates the scope's transaction name automatically on sensible + * occasions, such as a page navigation or when handling a new request on the server. + */ + setTransactionName(name) { + this._transactionName = name; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setContext(key, context) { + if (context === null) { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete this._contexts[key]; + } else { + this._contexts[key] = context; + } + + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setSession(session) { + if (!session) { + delete this._session; + } else { + this._session = session; + } + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + getSession() { + return this._session; + } + + /** + * @inheritDoc + */ + update(captureContext) { + if (!captureContext) { + return this; + } + + const scopeToMerge = typeof captureContext === 'function' ? captureContext(this) : captureContext; + + const [scopeInstance, requestSession] = + scopeToMerge instanceof Scope + ? // eslint-disable-next-line deprecation/deprecation + [scopeToMerge.getScopeData(), scopeToMerge.getRequestSession()] + : is.isPlainObject(scopeToMerge) + ? [captureContext , (captureContext ).requestSession] + : []; + + const { tags, extra, user, contexts, level, fingerprint = [], propagationContext } = scopeInstance || {}; + + this._tags = { ...this._tags, ...tags }; + this._extra = { ...this._extra, ...extra }; + this._contexts = { ...this._contexts, ...contexts }; + + if (user && Object.keys(user).length) { + this._user = user; + } + + if (level) { + this._level = level; + } + + if (fingerprint.length) { + this._fingerprint = fingerprint; + } + + if (propagationContext) { + this._propagationContext = propagationContext; + } + + if (requestSession) { + this._requestSession = requestSession; + } + + return this; + } + + /** + * @inheritDoc + */ + clear() { + // client is not cleared here on purpose! + this._breadcrumbs = []; + this._tags = {}; + this._extra = {}; + this._user = {}; + this._contexts = {}; + this._level = undefined; + this._transactionName = undefined; + this._fingerprint = undefined; + this._requestSession = undefined; + this._session = undefined; + spanOnScope._setSpanForScope(this, undefined); + this._attachments = []; + this.setPropagationContext({ traceId: propagationContext.generateTraceId() }); + + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + addBreadcrumb(breadcrumb, maxBreadcrumbs) { + const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS; + + // No data has been changed, so don't notify scope listeners + if (maxCrumbs <= 0) { + return this; + } + + const mergedBreadcrumb = { + timestamp: time.dateTimestampInSeconds(), + ...breadcrumb, + }; + + this._breadcrumbs.push(mergedBreadcrumb); + if (this._breadcrumbs.length > maxCrumbs) { + this._breadcrumbs = this._breadcrumbs.slice(-maxCrumbs); + if (this._client) { + this._client.recordDroppedEvent('buffer_overflow', 'log_item'); + } + } + + this._notifyScopeListeners(); + + return this; + } + + /** + * @inheritDoc + */ + getLastBreadcrumb() { + return this._breadcrumbs[this._breadcrumbs.length - 1]; + } + + /** + * @inheritDoc + */ + clearBreadcrumbs() { + this._breadcrumbs = []; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + addAttachment(attachment) { + this._attachments.push(attachment); + return this; + } + + /** + * @inheritDoc + */ + clearAttachments() { + this._attachments = []; + return this; + } + + /** @inheritDoc */ + getScopeData() { + return { + breadcrumbs: this._breadcrumbs, + attachments: this._attachments, + contexts: this._contexts, + tags: this._tags, + extra: this._extra, + user: this._user, + level: this._level, + fingerprint: this._fingerprint || [], + eventProcessors: this._eventProcessors, + propagationContext: this._propagationContext, + sdkProcessingMetadata: this._sdkProcessingMetadata, + transactionName: this._transactionName, + span: spanOnScope._getSpanForScope(this), + }; + } + + /** + * @inheritDoc + */ + setSDKProcessingMetadata(newData) { + this._sdkProcessingMetadata = merge.merge(this._sdkProcessingMetadata, newData, 2); + return this; + } + + /** + * @inheritDoc + */ + setPropagationContext( + context, + ) { + this._propagationContext = { + // eslint-disable-next-line deprecation/deprecation + spanId: propagationContext.generateSpanId(), + ...context, + }; + return this; + } + + /** + * @inheritDoc + */ + getPropagationContext() { + return this._propagationContext; + } + + /** + * @inheritDoc + */ + captureException(exception, hint) { + const eventId = hint && hint.event_id ? hint.event_id : misc.uuid4(); + + if (!this._client) { + logger.logger.warn('No client configured on scope - will not capture exception!'); + return eventId; + } + + const syntheticException = new Error('Sentry syntheticException'); + + this._client.captureException( + exception, + { + originalException: exception, + syntheticException, + ...hint, + event_id: eventId, + }, + this, + ); + + return eventId; + } + + /** + * @inheritDoc + */ + captureMessage(message, level, hint) { + const eventId = hint && hint.event_id ? hint.event_id : misc.uuid4(); + + if (!this._client) { + logger.logger.warn('No client configured on scope - will not capture message!'); + return eventId; + } + + const syntheticException = new Error(message); + + this._client.captureMessage( + message, + level, + { + originalException: message, + syntheticException, + ...hint, + event_id: eventId, + }, + this, + ); + + return eventId; + } + + /** + * @inheritDoc + */ + captureEvent(event, hint) { + const eventId = hint && hint.event_id ? hint.event_id : misc.uuid4(); + + if (!this._client) { + logger.logger.warn('No client configured on scope - will not capture event!'); + return eventId; + } + + this._client.captureEvent(event, { ...hint, event_id: eventId }, this); + + return eventId; + } + + /** + * This will be called on every set call. + */ + _notifyScopeListeners() { + // We need this check for this._notifyingListeners to be able to work on scope during updates + // If this check is not here we'll produce endless recursion when something is done with the scope + // during the callback. + if (!this._notifyingListeners) { + this._notifyingListeners = true; + this._scopeListeners.forEach(callback => { + callback(this); + }); + this._notifyingListeners = false; + } + } +} + +/** + * Holds additional event information. + */ +const Scope = ScopeClass; + +/** + * Holds additional event information. + */ + +exports.Scope = Scope; +//# sourceMappingURL=scope.js.map + + +/***/ }), + +/***/ 6183: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const currentScopes = __nccwpck_require__(8131); +const debugBuild = __nccwpck_require__(14488); +const logger = __nccwpck_require__(38752); + +/** A class object that can instantiate Client objects. */ + +/** + * Internal function to create a new SDK client instance. The client is + * installed and then bound to the current scope. + * + * @param clientClass The client class to instantiate. + * @param options Options to pass to the client. + */ +function initAndBind( + clientClass, + options, +) { + if (options.debug === true) { + if (debugBuild.DEBUG_BUILD) { + logger.logger.enable(); + } else { + // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped + logger.consoleSandbox(() => { + // eslint-disable-next-line no-console + console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.'); + }); + } + } + const scope = currentScopes.getCurrentScope(); + scope.update(options.initialScope); + + const client = new clientClass(options); + setCurrentClient(client); + client.init(); + return client; +} + +/** + * Make the given client the current client. + */ +function setCurrentClient(client) { + currentScopes.getCurrentScope().setClient(client); +} + +exports.initAndBind = initAndBind; +exports.setCurrentClient = setCurrentClient; +//# sourceMappingURL=sdk.js.map + + +/***/ }), + +/***/ 36827: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/** + * Use this attribute to represent the source of a span. + * Should be one of: custom, url, route, view, component, task, unknown + * + */ +const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = 'sentry.source'; + +/** + * Use this attribute to represent the sample rate used for a span. + */ +const SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = 'sentry.sample_rate'; + +/** + * Use this attribute to represent the operation of a span. + */ +const SEMANTIC_ATTRIBUTE_SENTRY_OP = 'sentry.op'; + +/** + * Use this attribute to represent the origin of a span. + */ +const SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = 'sentry.origin'; + +/** The reason why an idle span finished. */ +const SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = 'sentry.idle_span_finish_reason'; + +/** The unit of a measurement, which may be stored as a TimedEvent. */ +const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = 'sentry.measurement_unit'; + +/** The value of a measurement, which may be stored as a TimedEvent. */ +const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = 'sentry.measurement_value'; + +/** + * A custom span name set by users guaranteed to be taken over any automatically + * inferred name. This attribute is removed before the span is sent. + * + * @internal only meant for internal SDK usage + * @hidden + */ +const SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME = 'sentry.custom_span_name'; + +/** + * The id of the profile that this span occurred in. + */ +const SEMANTIC_ATTRIBUTE_PROFILE_ID = 'sentry.profile_id'; + +const SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = 'sentry.exclusive_time'; + +const SEMANTIC_ATTRIBUTE_CACHE_HIT = 'cache.hit'; + +const SEMANTIC_ATTRIBUTE_CACHE_KEY = 'cache.key'; + +const SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE = 'cache.item_size'; + +/** TODO: Remove these once we update to latest semantic conventions */ +const SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD = 'http.request.method'; +const SEMANTIC_ATTRIBUTE_URL_FULL = 'url.full'; + +exports.SEMANTIC_ATTRIBUTE_CACHE_HIT = SEMANTIC_ATTRIBUTE_CACHE_HIT; +exports.SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE = SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE; +exports.SEMANTIC_ATTRIBUTE_CACHE_KEY = SEMANTIC_ATTRIBUTE_CACHE_KEY; +exports.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME; +exports.SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD = SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD; +exports.SEMANTIC_ATTRIBUTE_PROFILE_ID = SEMANTIC_ATTRIBUTE_PROFILE_ID; +exports.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME = SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME; +exports.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON; +exports.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT; +exports.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE; +exports.SEMANTIC_ATTRIBUTE_SENTRY_OP = SEMANTIC_ATTRIBUTE_SENTRY_OP; +exports.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN; +exports.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE; +exports.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = SEMANTIC_ATTRIBUTE_SENTRY_SOURCE; +exports.SEMANTIC_ATTRIBUTE_URL_FULL = SEMANTIC_ATTRIBUTE_URL_FULL; +//# sourceMappingURL=semanticAttributes.js.map + + +/***/ }), + +/***/ 37238: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const baseclient = __nccwpck_require__(95457); +const checkin = __nccwpck_require__(54413); +const currentScopes = __nccwpck_require__(8131); +const debugBuild = __nccwpck_require__(14488); +const sessionflusher = __nccwpck_require__(88971); +const errors = __nccwpck_require__(21834); +__nccwpck_require__(87038); +const logger = __nccwpck_require__(38752); +__nccwpck_require__(75872); +const spanOnScope = __nccwpck_require__(14379); +const spanUtils = __nccwpck_require__(47569); +const misc = __nccwpck_require__(3181); +const syncpromise = __nccwpck_require__(15621); +const eventbuilder = __nccwpck_require__(2781); +const dynamicSamplingContext = __nccwpck_require__(29724); + +/** + * The Sentry Server Runtime Client SDK. + */ +class ServerRuntimeClient + + extends baseclient.BaseClient { + // eslint-disable-next-line deprecation/deprecation + + /** + * Creates a new Edge SDK instance. + * @param options Configuration options for this SDK. + */ + constructor(options) { + // Server clients always support tracing + errors.registerSpanErrorInstrumentation(); + + super(options); + } + + /** + * @inheritDoc + */ + eventFromException(exception, hint) { + const event = eventbuilder.eventFromUnknownInput(this, this._options.stackParser, exception, hint); + event.level = 'error'; + + return syncpromise.resolvedSyncPromise(event); + } + + /** + * @inheritDoc + */ + eventFromMessage( + message, + level = 'info', + hint, + ) { + return syncpromise.resolvedSyncPromise( + eventbuilder.eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace), + ); + } + + /** + * @inheritDoc + */ + captureException(exception, hint, scope) { + // Check if `_sessionFlusher` exists because it is initialized (defined) only when the `autoSessionTracking` is enabled. + // The expectation is that session aggregates are only sent when `autoSessionTracking` is enabled. + // TODO(v9): Our goal in the future is to not have the `autoSessionTracking` option and instead rely on integrations doing the creation and sending of sessions. We will not have a central kill-switch for sessions. + // TODO(v9): This should move into the httpIntegration. + // eslint-disable-next-line deprecation/deprecation + if (this._options.autoSessionTracking && this._sessionFlusher) { + // eslint-disable-next-line deprecation/deprecation + const requestSession = currentScopes.getIsolationScope().getRequestSession(); + + // Necessary checks to ensure this is code block is executed only within a request + // Should override the status only if `requestSession.status` is `Ok`, which is its initial stage + if (requestSession && requestSession.status === 'ok') { + requestSession.status = 'errored'; + } + } + + return super.captureException(exception, hint, scope); + } + + /** + * @inheritDoc + */ + captureEvent(event, hint, scope) { + // Check if `_sessionFlusher` exists because it is initialized only when the `autoSessionTracking` is enabled. + // The expectation is that session aggregates are only sent when `autoSessionTracking` is enabled. + // TODO(v9): Our goal in the future is to not have the `autoSessionTracking` option and instead rely on integrations doing the creation and sending of sessions. We will not have a central kill-switch for sessions. + // TODO(v9): This should move into the httpIntegration. + // eslint-disable-next-line deprecation/deprecation + if (this._options.autoSessionTracking && this._sessionFlusher) { + const eventType = event.type || 'exception'; + const isException = + eventType === 'exception' && event.exception && event.exception.values && event.exception.values.length > 0; + + // If the event is of type Exception, then a request session should be captured + if (isException) { + // eslint-disable-next-line deprecation/deprecation + const requestSession = currentScopes.getIsolationScope().getRequestSession(); + + // Ensure that this is happening within the bounds of a request, and make sure not to override + // Session Status if Errored / Crashed + if (requestSession && requestSession.status === 'ok') { + requestSession.status = 'errored'; + } + } + } + + return super.captureEvent(event, hint, scope); + } + + /** + * + * @inheritdoc + */ + close(timeout) { + if (this._sessionFlusher) { + this._sessionFlusher.close(); + } + return super.close(timeout); + } + + /** + * Initializes an instance of SessionFlusher on the client which will aggregate and periodically flush session data. + * + * NOTICE: This method will implicitly create an interval that is periodically called. + * To clean up this resources, call `.close()` when you no longer intend to use the client. + * Not doing so will result in a memory leak. + */ + initSessionFlusher() { + const { release, environment } = this._options; + if (!release) { + debugBuild.DEBUG_BUILD && logger.logger.warn('Cannot initialize an instance of SessionFlusher if no release is provided!'); + } else { + // eslint-disable-next-line deprecation/deprecation + this._sessionFlusher = new sessionflusher.SessionFlusher(this, { + release, + environment, + }); + } + } + + /** + * Create a cron monitor check in and send it to Sentry. + * + * @param checkIn An object that describes a check in. + * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want + * to create a monitor automatically when sending a check in. + */ + captureCheckIn(checkIn, monitorConfig, scope) { + const id = 'checkInId' in checkIn && checkIn.checkInId ? checkIn.checkInId : misc.uuid4(); + if (!this._isEnabled()) { + debugBuild.DEBUG_BUILD && logger.logger.warn('SDK not enabled, will not capture checkin.'); + return id; + } + + const options = this.getOptions(); + const { release, environment, tunnel } = options; + + const serializedCheckIn = { + check_in_id: id, + monitor_slug: checkIn.monitorSlug, + status: checkIn.status, + release, + environment, + }; + + if ('duration' in checkIn) { + serializedCheckIn.duration = checkIn.duration; + } + + if (monitorConfig) { + serializedCheckIn.monitor_config = { + schedule: monitorConfig.schedule, + checkin_margin: monitorConfig.checkinMargin, + max_runtime: monitorConfig.maxRuntime, + timezone: monitorConfig.timezone, + failure_issue_threshold: monitorConfig.failureIssueThreshold, + recovery_threshold: monitorConfig.recoveryThreshold, + }; + } + + const [dynamicSamplingContext, traceContext] = this._getTraceInfoFromScope(scope); + if (traceContext) { + serializedCheckIn.contexts = { + trace: traceContext, + }; + } + + const envelope = checkin.createCheckInEnvelope( + serializedCheckIn, + dynamicSamplingContext, + this.getSdkMetadata(), + tunnel, + this.getDsn(), + ); + + debugBuild.DEBUG_BUILD && logger.logger.info('Sending checkin:', checkIn.monitorSlug, checkIn.status); + + // sendEnvelope should not throw + // eslint-disable-next-line @typescript-eslint/no-floating-promises + this.sendEnvelope(envelope); + + return id; + } + + /** + * Method responsible for capturing/ending a request session by calling `incrementSessionStatusCount` to increment + * appropriate session aggregates bucket + * + * @deprecated This method should not be used or extended. It's functionality will move into the `httpIntegration` and not be part of any public API. + */ + _captureRequestSession() { + if (!this._sessionFlusher) { + debugBuild.DEBUG_BUILD && logger.logger.warn('Discarded request mode session because autoSessionTracking option was disabled'); + } else { + this._sessionFlusher.incrementSessionStatusCount(); + } + } + + /** + * @inheritDoc + */ + _prepareEvent( + event, + hint, + scope, + isolationScope, + ) { + if (this._options.platform) { + event.platform = event.platform || this._options.platform; + } + + if (this._options.runtime) { + event.contexts = { + ...event.contexts, + runtime: (event.contexts || {}).runtime || this._options.runtime, + }; + } + + if (this._options.serverName) { + event.server_name = event.server_name || this._options.serverName; + } + + return super._prepareEvent(event, hint, scope, isolationScope); + } + + /** Extract trace information from scope */ + _getTraceInfoFromScope( + scope, + ) { + if (!scope) { + return [undefined, undefined]; + } + + const span = spanOnScope._getSpanForScope(scope); + + const traceContext = span ? spanUtils.spanToTraceContext(span) : currentScopes.getTraceContextFromScope(scope); + const dynamicSamplingContext$1 = span + ? dynamicSamplingContext.getDynamicSamplingContextFromSpan(span) + : dynamicSamplingContext.getDynamicSamplingContextFromScope(this, scope); + return [dynamicSamplingContext$1, traceContext]; + } +} + +exports.ServerRuntimeClient = ServerRuntimeClient; +//# sourceMappingURL=server-runtime-client.js.map + + +/***/ }), + +/***/ 60233: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +__nccwpck_require__(87038); +__nccwpck_require__(38752); +const object = __nccwpck_require__(16100); +const time = __nccwpck_require__(75872); +const misc = __nccwpck_require__(3181); +__nccwpck_require__(15621); + +/** + * Creates a new `Session` object by setting certain default parameters. If optional @param context + * is passed, the passed properties are applied to the session object. + * + * @param context (optional) additional properties to be applied to the returned session object + * + * @returns a new `Session` object + */ +function makeSession(context) { + // Both timestamp and started are in seconds since the UNIX epoch. + const startingTime = time.timestampInSeconds(); + + const session = { + sid: misc.uuid4(), + init: true, + timestamp: startingTime, + started: startingTime, + duration: 0, + status: 'ok', + errors: 0, + ignoreDuration: false, + toJSON: () => sessionToJSON(session), + }; + + if (context) { + updateSession(session, context); + } + + return session; +} + +/** + * Updates a session object with the properties passed in the context. + * + * Note that this function mutates the passed object and returns void. + * (Had to do this instead of returning a new and updated session because closing and sending a session + * makes an update to the session after it was passed to the sending logic. + * @see BaseClient.captureSession ) + * + * @param session the `Session` to update + * @param context the `SessionContext` holding the properties that should be updated in @param session + */ +// eslint-disable-next-line complexity +function updateSession(session, context = {}) { + if (context.user) { + if (!session.ipAddress && context.user.ip_address) { + session.ipAddress = context.user.ip_address; + } + + if (!session.did && !context.did) { + session.did = context.user.id || context.user.email || context.user.username; + } + } + + session.timestamp = context.timestamp || time.timestampInSeconds(); + + if (context.abnormal_mechanism) { + session.abnormal_mechanism = context.abnormal_mechanism; + } + + if (context.ignoreDuration) { + session.ignoreDuration = context.ignoreDuration; + } + if (context.sid) { + // Good enough uuid validation. — Kamil + session.sid = context.sid.length === 32 ? context.sid : misc.uuid4(); + } + if (context.init !== undefined) { + session.init = context.init; + } + if (!session.did && context.did) { + session.did = `${context.did}`; + } + if (typeof context.started === 'number') { + session.started = context.started; + } + if (session.ignoreDuration) { + session.duration = undefined; + } else if (typeof context.duration === 'number') { + session.duration = context.duration; + } else { + const duration = session.timestamp - session.started; + session.duration = duration >= 0 ? duration : 0; + } + if (context.release) { + session.release = context.release; + } + if (context.environment) { + session.environment = context.environment; + } + if (!session.ipAddress && context.ipAddress) { + session.ipAddress = context.ipAddress; + } + if (!session.userAgent && context.userAgent) { + session.userAgent = context.userAgent; + } + if (typeof context.errors === 'number') { + session.errors = context.errors; + } + if (context.status) { + session.status = context.status; + } +} + +/** + * Closes a session by setting its status and updating the session object with it. + * Internally calls `updateSession` to update the passed session object. + * + * Note that this function mutates the passed session (@see updateSession for explanation). + * + * @param session the `Session` object to be closed + * @param status the `SessionStatus` with which the session was closed. If you don't pass a status, + * this function will keep the previously set status, unless it was `'ok'` in which case + * it is changed to `'exited'`. + */ +function closeSession(session, status) { + let context = {}; + if (status) { + context = { status }; + } else if (session.status === 'ok') { + context = { status: 'exited' }; + } + + updateSession(session, context); +} + +/** + * Serializes a passed session object to a JSON object with a slightly different structure. + * This is necessary because the Sentry backend requires a slightly different schema of a session + * than the one the JS SDKs use internally. + * + * @param session the session to be converted + * + * @returns a JSON object of the passed session + */ +function sessionToJSON(session) { + return object.dropUndefinedKeys({ + sid: `${session.sid}`, + init: session.init, + // Make sure that sec is converted to ms for date constructor + started: new Date(session.started * 1000).toISOString(), + timestamp: new Date(session.timestamp * 1000).toISOString(), + status: session.status, + errors: session.errors, + did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined, + duration: session.duration, + abnormal_mechanism: session.abnormal_mechanism, + attrs: { + release: session.release, + environment: session.environment, + ip_address: session.ipAddress, + user_agent: session.userAgent, + }, + }); +} + +exports.closeSession = closeSession; +exports.makeSession = makeSession; +exports.updateSession = updateSession; +//# sourceMappingURL=session.js.map + + +/***/ }), + +/***/ 88971: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const currentScopes = __nccwpck_require__(8131); +const object = __nccwpck_require__(16100); + +/** + * @deprecated `SessionFlusher` is deprecated and will be removed in the next major version of the SDK. + */ +// TODO(v9): The goal for the SessionFlusher is to become a stupidly simple mechanism to aggregate "Sessions" (actually "RequestSessions"). It should probably live directly inside the Http integration/instrumentation. +// eslint-disable-next-line deprecation/deprecation +class SessionFlusher { + + // We adjust the type here to add the `unref()` part, as setInterval can technically return a number or a NodeJS.Timer + + constructor(client, attrs) { + this._client = client; + this.flushTimeout = 60; + this._pendingAggregates = new Map(); + this._isEnabled = true; + + // Call to setInterval, so that flush is called every 60 seconds. + this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1000); + if (this._intervalId.unref) { + this._intervalId.unref(); + } + this._sessionAttrs = attrs; + } + + /** Checks if `pendingAggregates` has entries, and if it does flushes them by calling `sendSession` */ + flush() { + const sessionAggregates = this.getSessionAggregates(); + if (sessionAggregates.aggregates.length === 0) { + return; + } + this._pendingAggregates = new Map(); + this._client.sendSession(sessionAggregates); + } + + /** Massages the entries in `pendingAggregates` and returns aggregated sessions */ + getSessionAggregates() { + const aggregates = Array.from(this._pendingAggregates.values()); + + const sessionAggregates = { + attrs: this._sessionAttrs, + aggregates, + }; + return object.dropUndefinedKeys(sessionAggregates); + } + + /** JSDoc */ + close() { + clearInterval(this._intervalId); + this._isEnabled = false; + this.flush(); + } + + /** + * Wrapper function for _incrementSessionStatusCount that checks if the instance of SessionFlusher is enabled then + * fetches the session status of the request from `Scope.getRequestSession().status` on the scope and passes them to + * `_incrementSessionStatusCount` along with the start date + */ + incrementSessionStatusCount() { + if (!this._isEnabled) { + return; + } + const isolationScope = currentScopes.getIsolationScope(); + // eslint-disable-next-line deprecation/deprecation + const requestSession = isolationScope.getRequestSession(); + + if (requestSession && requestSession.status) { + this._incrementSessionStatusCount(requestSession.status, new Date()); + // This is not entirely necessarily but is added as a safe guard to indicate the bounds of a request and so in + // case captureRequestSession is called more than once to prevent double count + // eslint-disable-next-line deprecation/deprecation + isolationScope.setRequestSession(undefined); + /* eslint-enable @typescript-eslint/no-unsafe-member-access */ + } + } + + /** + * Increments status bucket in pendingAggregates buffer (internal state) corresponding to status of + * the session received + */ + // eslint-disable-next-line deprecation/deprecation + _incrementSessionStatusCount(status, date) { + // Truncate minutes and seconds on Session Started attribute to have one minute bucket keys + const sessionStartedTrunc = new Date(date).setSeconds(0, 0); + + // corresponds to aggregated sessions in one specific minute bucket + // for example, {"started":"2021-03-16T08:00:00.000Z","exited":4, "errored": 1} + let aggregationCounts = this._pendingAggregates.get(sessionStartedTrunc); + if (!aggregationCounts) { + aggregationCounts = { started: new Date(sessionStartedTrunc).toISOString() }; + this._pendingAggregates.set(sessionStartedTrunc, aggregationCounts); + } + + switch (status) { + case 'errored': + aggregationCounts.errored = (aggregationCounts.errored || 0) + 1; + return aggregationCounts.errored; + case 'ok': + aggregationCounts.exited = (aggregationCounts.exited || 0) + 1; + return aggregationCounts.exited; + default: + aggregationCounts.crashed = (aggregationCounts.crashed || 0) + 1; + return aggregationCounts.crashed; + } + } +} + +exports.SessionFlusher = SessionFlusher; +//# sourceMappingURL=sessionflusher.js.map + + +/***/ }), + +/***/ 29724: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const constants = __nccwpck_require__(5958); +const currentScopes = __nccwpck_require__(8131); +const semanticAttributes = __nccwpck_require__(36827); +const baggage = __nccwpck_require__(86741); +const object = __nccwpck_require__(16100); +const hasTracingEnabled = __nccwpck_require__(79223); +const spanUtils = __nccwpck_require__(47569); + +/** + * If you change this value, also update the terser plugin config to + * avoid minification of the object property! + */ +const FROZEN_DSC_FIELD = '_frozenDsc'; + +/** + * Freeze the given DSC on the given span. + */ +function freezeDscOnSpan(span, dsc) { + const spanWithMaybeDsc = span ; + object.addNonEnumerableProperty(spanWithMaybeDsc, FROZEN_DSC_FIELD, dsc); +} + +/** + * Creates a dynamic sampling context from a client. + * + * Dispatches the `createDsc` lifecycle hook as a side effect. + */ +function getDynamicSamplingContextFromClient(trace_id, client) { + const options = client.getOptions(); + + const { publicKey: public_key } = client.getDsn() || {}; + + const dsc = object.dropUndefinedKeys({ + environment: options.environment || constants.DEFAULT_ENVIRONMENT, + release: options.release, + public_key, + trace_id, + }) ; + + client.emit('createDsc', dsc); + + return dsc; +} + +/** + * Get the dynamic sampling context for the currently active scopes. + */ +function getDynamicSamplingContextFromScope(client, scope) { + const propagationContext = scope.getPropagationContext(); + return propagationContext.dsc || getDynamicSamplingContextFromClient(propagationContext.traceId, client); +} + +/** + * Creates a dynamic sampling context from a span (and client and scope) + * + * @param span the span from which a few values like the root span name and sample rate are extracted. + * + * @returns a dynamic sampling context + */ +function getDynamicSamplingContextFromSpan(span) { + const client = currentScopes.getClient(); + if (!client) { + return {}; + } + + const rootSpan = spanUtils.getRootSpan(span); + + // For core implementation, we freeze the DSC onto the span as a non-enumerable property + const frozenDsc = (rootSpan )[FROZEN_DSC_FIELD]; + if (frozenDsc) { + return frozenDsc; + } + + // For OpenTelemetry, we freeze the DSC on the trace state + const traceState = rootSpan.spanContext().traceState; + const traceStateDsc = traceState && traceState.get('sentry.dsc'); + + // If the span has a DSC, we want it to take precedence + const dscOnTraceState = traceStateDsc && baggage.baggageHeaderToDynamicSamplingContext(traceStateDsc); + + if (dscOnTraceState) { + return dscOnTraceState; + } + + // Else, we generate it from the span + const dsc = getDynamicSamplingContextFromClient(span.spanContext().traceId, client); + const jsonSpan = spanUtils.spanToJSON(rootSpan); + const attributes = jsonSpan.data || {}; + const maybeSampleRate = attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]; + + if (maybeSampleRate != null) { + dsc.sample_rate = `${maybeSampleRate}`; + } + + // We don't want to have a transaction name in the DSC if the source is "url" because URLs might contain PII + const source = attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; + + // after JSON conversion, txn.name becomes jsonSpan.description + const name = jsonSpan.description; + if (source !== 'url' && name) { + dsc.transaction = name; + } + + // How can we even land here with hasTracingEnabled() returning false? + // Otel creates a Non-recording span in Tracing Without Performance mode when handling incoming requests + // So we end up with an active span that is not sampled (neither positively nor negatively) + if (hasTracingEnabled.hasTracingEnabled()) { + dsc.sampled = String(spanUtils.spanIsSampled(rootSpan)); + } + + client.emit('createDsc', dsc, rootSpan); + + return dsc; +} + +/** + * Convert a Span to a baggage header. + */ +function spanToBaggageHeader(span) { + const dsc = getDynamicSamplingContextFromSpan(span); + return baggage.dynamicSamplingContextToSentryBaggageHeader(dsc); +} + +exports.freezeDscOnSpan = freezeDscOnSpan; +exports.getDynamicSamplingContextFromClient = getDynamicSamplingContextFromClient; +exports.getDynamicSamplingContextFromScope = getDynamicSamplingContextFromScope; +exports.getDynamicSamplingContextFromSpan = getDynamicSamplingContextFromSpan; +exports.spanToBaggageHeader = spanToBaggageHeader; +//# sourceMappingURL=dynamicSamplingContext.js.map + + +/***/ }), + +/***/ 21834: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const debugBuild = __nccwpck_require__(14488); +const globalError = __nccwpck_require__(97033); +const globalUnhandledRejection = __nccwpck_require__(26156); +const logger = __nccwpck_require__(38752); +const spanUtils = __nccwpck_require__(47569); +const spanstatus = __nccwpck_require__(21119); + +let errorsInstrumented = false; + +/** + * Ensure that global errors automatically set the active span status. + */ +function registerSpanErrorInstrumentation() { + if (errorsInstrumented) { + return; + } + + errorsInstrumented = true; + globalError.addGlobalErrorInstrumentationHandler(errorCallback); + globalUnhandledRejection.addGlobalUnhandledRejectionInstrumentationHandler(errorCallback); +} + +/** + * If an error or unhandled promise occurs, we mark the active root span as failed + */ +function errorCallback() { + const activeSpan = spanUtils.getActiveSpan(); + const rootSpan = activeSpan && spanUtils.getRootSpan(activeSpan); + if (rootSpan) { + const message = 'internal_error'; + debugBuild.DEBUG_BUILD && logger.logger.log(`[Tracing] Root span: ${message} -> Global error occurred`); + rootSpan.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message }); + } +} + +// The function name will be lost when bundling but we need to be able to identify this listener later to maintain the +// node.js default exit behaviour +errorCallback.tag = 'sentry_tracingErrorCallback'; + +exports.registerSpanErrorInstrumentation = registerSpanErrorInstrumentation; +//# sourceMappingURL=errors.js.map + + +/***/ }), + +/***/ 51019: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const errors = __nccwpck_require__(21834); + +/** + * @deprecated Use `registerSpanErrorInstrumentation()` instead. In v9, this function will be removed. Note that you don't need to call this in Node-based SDKs or when using `browserTracingIntegration`. + */ +function addTracingExtensions() { + errors.registerSpanErrorInstrumentation(); +} + +exports.addTracingExtensions = addTracingExtensions; +//# sourceMappingURL=hubextensions.js.map + + +/***/ }), + +/***/ 89709: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const currentScopes = __nccwpck_require__(8131); +const debugBuild = __nccwpck_require__(14488); +const semanticAttributes = __nccwpck_require__(36827); +const logger = __nccwpck_require__(38752); +const time = __nccwpck_require__(75872); +const hasTracingEnabled = __nccwpck_require__(79223); +const spanOnScope = __nccwpck_require__(14379); +const spanUtils = __nccwpck_require__(47569); +const sentryNonRecordingSpan = __nccwpck_require__(36854); +const spanstatus = __nccwpck_require__(21119); +const trace = __nccwpck_require__(97956); + +const TRACING_DEFAULTS = { + idleTimeout: 1000, + finalTimeout: 30000, + childSpanTimeout: 15000, +}; + +const FINISH_REASON_HEARTBEAT_FAILED = 'heartbeatFailed'; +const FINISH_REASON_IDLE_TIMEOUT = 'idleTimeout'; +const FINISH_REASON_FINAL_TIMEOUT = 'finalTimeout'; +const FINISH_REASON_EXTERNAL_FINISH = 'externalFinish'; + +/** + * An idle span is a span that automatically finishes. It does this by tracking child spans as activities. + * An idle span is always the active span. + */ +function startIdleSpan(startSpanOptions, options = {}) { + // Activities store a list of active spans + const activities = new Map(); + + // We should not use heartbeat if we finished a span + let _finished = false; + + // Timer that tracks idleTimeout + let _idleTimeoutID; + + // The reason why the span was finished + let _finishReason = FINISH_REASON_EXTERNAL_FINISH; + + let _autoFinishAllowed = !options.disableAutoFinish; + + const _cleanupHooks = []; + + const { + idleTimeout = TRACING_DEFAULTS.idleTimeout, + finalTimeout = TRACING_DEFAULTS.finalTimeout, + childSpanTimeout = TRACING_DEFAULTS.childSpanTimeout, + beforeSpanEnd, + } = options; + + const client = currentScopes.getClient(); + + if (!client || !hasTracingEnabled.hasTracingEnabled()) { + return new sentryNonRecordingSpan.SentryNonRecordingSpan(); + } + + const scope = currentScopes.getCurrentScope(); + const previousActiveSpan = spanUtils.getActiveSpan(); + const span = _startIdleSpan(startSpanOptions); + + // We patch span.end to ensure we can run some things before the span is ended + // eslint-disable-next-line @typescript-eslint/unbound-method + span.end = new Proxy(span.end, { + apply(target, thisArg, args) { + if (beforeSpanEnd) { + beforeSpanEnd(span); + } + + // Just ensuring that this keeps working, even if we ever have more arguments here + const [definedEndTimestamp, ...rest] = args; + const timestamp = definedEndTimestamp || time.timestampInSeconds(); + const spanEndTimestamp = spanUtils.spanTimeInputToSeconds(timestamp); + + // Ensure we end with the last span timestamp, if possible + const spans = spanUtils.getSpanDescendants(span).filter(child => child !== span); + + // If we have no spans, we just end, nothing else to do here + if (!spans.length) { + onIdleSpanEnded(spanEndTimestamp); + return Reflect.apply(target, thisArg, [spanEndTimestamp, ...rest]); + } + + const childEndTimestamps = spans + .map(span => spanUtils.spanToJSON(span).timestamp) + .filter(timestamp => !!timestamp) ; + const latestSpanEndTimestamp = childEndTimestamps.length ? Math.max(...childEndTimestamps) : undefined; + + // In reality this should always exist here, but type-wise it may be undefined... + const spanStartTimestamp = spanUtils.spanToJSON(span).start_timestamp; + + // The final endTimestamp should: + // * Never be before the span start timestamp + // * Be the latestSpanEndTimestamp, if there is one, and it is smaller than the passed span end timestamp + // * Otherwise be the passed end timestamp + // Final timestamp can never be after finalTimeout + const endTimestamp = Math.min( + spanStartTimestamp ? spanStartTimestamp + finalTimeout / 1000 : Infinity, + Math.max(spanStartTimestamp || -Infinity, Math.min(spanEndTimestamp, latestSpanEndTimestamp || Infinity)), + ); + + onIdleSpanEnded(endTimestamp); + return Reflect.apply(target, thisArg, [endTimestamp, ...rest]); + }, + }); + + /** + * Cancels the existing idle timeout, if there is one. + */ + function _cancelIdleTimeout() { + if (_idleTimeoutID) { + clearTimeout(_idleTimeoutID); + _idleTimeoutID = undefined; + } + } + + /** + * Restarts idle timeout, if there is no running idle timeout it will start one. + */ + function _restartIdleTimeout(endTimestamp) { + _cancelIdleTimeout(); + _idleTimeoutID = setTimeout(() => { + if (!_finished && activities.size === 0 && _autoFinishAllowed) { + _finishReason = FINISH_REASON_IDLE_TIMEOUT; + span.end(endTimestamp); + } + }, idleTimeout); + } + + /** + * Restarts child span timeout, if there is none running it will start one. + */ + function _restartChildSpanTimeout(endTimestamp) { + _idleTimeoutID = setTimeout(() => { + if (!_finished && _autoFinishAllowed) { + _finishReason = FINISH_REASON_HEARTBEAT_FAILED; + span.end(endTimestamp); + } + }, childSpanTimeout); + } + + /** + * Start tracking a specific activity. + * @param spanId The span id that represents the activity + */ + function _pushActivity(spanId) { + _cancelIdleTimeout(); + activities.set(spanId, true); + + const endTimestamp = time.timestampInSeconds(); + // We need to add the timeout here to have the real endtimestamp of the idle span + // Remember timestampInSeconds is in seconds, timeout is in ms + _restartChildSpanTimeout(endTimestamp + childSpanTimeout / 1000); + } + + /** + * Remove an activity from usage + * @param spanId The span id that represents the activity + */ + function _popActivity(spanId) { + if (activities.has(spanId)) { + activities.delete(spanId); + } + + if (activities.size === 0) { + const endTimestamp = time.timestampInSeconds(); + // We need to add the timeout here to have the real endtimestamp of the idle span + // Remember timestampInSeconds is in seconds, timeout is in ms + _restartIdleTimeout(endTimestamp + idleTimeout / 1000); + } + } + + function onIdleSpanEnded(endTimestamp) { + _finished = true; + activities.clear(); + + _cleanupHooks.forEach(cleanup => cleanup()); + + spanOnScope._setSpanForScope(scope, previousActiveSpan); + + const spanJSON = spanUtils.spanToJSON(span); + + const { start_timestamp: startTimestamp } = spanJSON; + // This should never happen, but to make TS happy... + if (!startTimestamp) { + return; + } + + const attributes = spanJSON.data || {}; + if (!attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON]) { + span.setAttribute(semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, _finishReason); + } + + logger.logger.log(`[Tracing] Idle span "${spanJSON.op}" finished`); + + const childSpans = spanUtils.getSpanDescendants(span).filter(child => child !== span); + + let discardedSpans = 0; + childSpans.forEach(childSpan => { + // We cancel all pending spans with status "cancelled" to indicate the idle span was finished early + if (childSpan.isRecording()) { + childSpan.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: 'cancelled' }); + childSpan.end(endTimestamp); + debugBuild.DEBUG_BUILD && + logger.logger.log('[Tracing] Cancelling span since span ended early', JSON.stringify(childSpan, undefined, 2)); + } + + const childSpanJSON = spanUtils.spanToJSON(childSpan); + const { timestamp: childEndTimestamp = 0, start_timestamp: childStartTimestamp = 0 } = childSpanJSON; + + const spanStartedBeforeIdleSpanEnd = childStartTimestamp <= endTimestamp; + + // Add a delta with idle timeout so that we prevent false positives + const timeoutWithMarginOfError = (finalTimeout + idleTimeout) / 1000; + const spanEndedBeforeFinalTimeout = childEndTimestamp - childStartTimestamp <= timeoutWithMarginOfError; + + if (debugBuild.DEBUG_BUILD) { + const stringifiedSpan = JSON.stringify(childSpan, undefined, 2); + if (!spanStartedBeforeIdleSpanEnd) { + logger.logger.log('[Tracing] Discarding span since it happened after idle span was finished', stringifiedSpan); + } else if (!spanEndedBeforeFinalTimeout) { + logger.logger.log('[Tracing] Discarding span since it finished after idle span final timeout', stringifiedSpan); + } + } + + if (!spanEndedBeforeFinalTimeout || !spanStartedBeforeIdleSpanEnd) { + spanUtils.removeChildSpanFromSpan(span, childSpan); + discardedSpans++; + } + }); + + if (discardedSpans > 0) { + span.setAttribute('sentry.idle_span_discarded_spans', discardedSpans); + } + } + + _cleanupHooks.push( + client.on('spanStart', startedSpan => { + // If we already finished the idle span, + // or if this is the idle span itself being started, + // or if the started span has already been closed, + // we don't care about it for activity + if (_finished || startedSpan === span || !!spanUtils.spanToJSON(startedSpan).timestamp) { + return; + } + + const allSpans = spanUtils.getSpanDescendants(span); + + // If the span that was just started is a child of the idle span, we should track it + if (allSpans.includes(startedSpan)) { + _pushActivity(startedSpan.spanContext().spanId); + } + }), + ); + + _cleanupHooks.push( + client.on('spanEnd', endedSpan => { + if (_finished) { + return; + } + + _popActivity(endedSpan.spanContext().spanId); + }), + ); + + _cleanupHooks.push( + client.on('idleSpanEnableAutoFinish', spanToAllowAutoFinish => { + if (spanToAllowAutoFinish === span) { + _autoFinishAllowed = true; + _restartIdleTimeout(); + + if (activities.size) { + _restartChildSpanTimeout(); + } + } + }), + ); + + // We only start the initial idle timeout if we are not delaying the auto finish + if (!options.disableAutoFinish) { + _restartIdleTimeout(); + } + + setTimeout(() => { + if (!_finished) { + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: 'deadline_exceeded' }); + _finishReason = FINISH_REASON_FINAL_TIMEOUT; + span.end(); + } + }, finalTimeout); + + return span; +} + +function _startIdleSpan(options) { + const span = trace.startInactiveSpan(options); + + spanOnScope._setSpanForScope(currentScopes.getCurrentScope(), span); + + debugBuild.DEBUG_BUILD && logger.logger.log('[Tracing] Started span is an idle span'); + + return span; +} + +exports.TRACING_DEFAULTS = TRACING_DEFAULTS; +exports.startIdleSpan = startIdleSpan; +//# sourceMappingURL=idleSpan.js.map + + +/***/ }), + +/***/ 28761: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const debugBuild = __nccwpck_require__(14488); +const logger = __nccwpck_require__(38752); +const spanUtils = __nccwpck_require__(47569); + +/** + * Print a log message for a started span. + */ +function logSpanStart(span) { + if (!debugBuild.DEBUG_BUILD) return; + + const { description = '< unknown name >', op = '< unknown op >', parent_span_id: parentSpanId } = spanUtils.spanToJSON(span); + const { spanId } = span.spanContext(); + + const sampled = spanUtils.spanIsSampled(span); + const rootSpan = spanUtils.getRootSpan(span); + const isRootSpan = rootSpan === span; + + const header = `[Tracing] Starting ${sampled ? 'sampled' : 'unsampled'} ${isRootSpan ? 'root ' : ''}span`; + + const infoParts = [`op: ${op}`, `name: ${description}`, `ID: ${spanId}`]; + + if (parentSpanId) { + infoParts.push(`parent ID: ${parentSpanId}`); + } + + if (!isRootSpan) { + const { op, description } = spanUtils.spanToJSON(rootSpan); + infoParts.push(`root ID: ${rootSpan.spanContext().spanId}`); + if (op) { + infoParts.push(`root op: ${op}`); + } + if (description) { + infoParts.push(`root description: ${description}`); + } + } + + logger.logger.log(`${header} + ${infoParts.join('\n ')}`); +} + +/** + * Print a log message for an ended span. + */ +function logSpanEnd(span) { + if (!debugBuild.DEBUG_BUILD) return; + + const { description = '< unknown name >', op = '< unknown op >' } = spanUtils.spanToJSON(span); + const { spanId } = span.spanContext(); + const rootSpan = spanUtils.getRootSpan(span); + const isRootSpan = rootSpan === span; + + const msg = `[Tracing] Finishing "${op}" ${isRootSpan ? 'root ' : ''}span "${description}" with ID ${spanId}`; + logger.logger.log(msg); +} + +exports.logSpanEnd = logSpanEnd; +exports.logSpanStart = logSpanStart; +//# sourceMappingURL=logSpans.js.map + + +/***/ }), + +/***/ 50722: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const debugBuild = __nccwpck_require__(14488); +const semanticAttributes = __nccwpck_require__(36827); +const logger = __nccwpck_require__(38752); +const spanUtils = __nccwpck_require__(47569); + +/** + * Adds a measurement to the active transaction on the current global scope. You can optionally pass in a different span + * as the 4th parameter. + */ +function setMeasurement(name, value, unit, activeSpan = spanUtils.getActiveSpan()) { + const rootSpan = activeSpan && spanUtils.getRootSpan(activeSpan); + + if (rootSpan) { + debugBuild.DEBUG_BUILD && logger.logger.log(`[Measurement] Setting measurement on root span: ${name} = ${value} ${unit}`); + rootSpan.addEvent(name, { + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: value, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: unit , + }); + } +} + +/** + * Convert timed events to measurements. + */ +function timedEventsToMeasurements(events) { + if (!events || events.length === 0) { + return undefined; + } + + const measurements = {}; + events.forEach(event => { + const attributes = event.attributes || {}; + const unit = attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT] ; + const value = attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE] ; + + if (typeof unit === 'string' && typeof value === 'number') { + measurements[event.name] = { value, unit }; + } + }); + + return measurements; +} + +exports.setMeasurement = setMeasurement; +exports.timedEventsToMeasurements = timedEventsToMeasurements; +//# sourceMappingURL=measurement.js.map + + +/***/ }), + +/***/ 79478: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const currentScopes = __nccwpck_require__(8131); +const debugBuild = __nccwpck_require__(14488); +const logger = __nccwpck_require__(38752); +const hasTracingEnabled = __nccwpck_require__(79223); +const parseSampleRate = __nccwpck_require__(54078); + +/** + * Makes a sampling decision for the given options. + * + * Called every time a root span is created. Only root spans which emerge with a `sampled` value of `true` will be + * sent to Sentry. + */ +function sampleSpan( + options, + samplingContext, +) { + // nothing to do if tracing is not enabled + if (!hasTracingEnabled.hasTracingEnabled(options)) { + return [false]; + } + + // Casting this from unknown, as the type of `sdkProcessingMetadata` is only changed in v9 and `normalizedRequest` is set in SentryHttpInstrumentation + const normalizedRequest = currentScopes.getIsolationScope().getScopeData().sdkProcessingMetadata + .normalizedRequest ; + + const enhancedSamplingContext = { + ...samplingContext, + normalizedRequest: samplingContext.normalizedRequest || normalizedRequest, + }; + + // we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` nor `enableTracing` were defined, so one of these should + // work; prefer the hook if so + let sampleRate; + if (typeof options.tracesSampler === 'function') { + sampleRate = options.tracesSampler(enhancedSamplingContext); + } else if (enhancedSamplingContext.parentSampled !== undefined) { + sampleRate = enhancedSamplingContext.parentSampled; + } else if (typeof options.tracesSampleRate !== 'undefined') { + sampleRate = options.tracesSampleRate; + } else { + // When `enableTracing === true`, we use a sample rate of 100% + sampleRate = 1; + } + + // Since this is coming from the user (or from a function provided by the user), who knows what we might get. + // (The only valid values are booleans or numbers between 0 and 1.) + const parsedSampleRate = parseSampleRate.parseSampleRate(sampleRate); + + if (parsedSampleRate === undefined) { + debugBuild.DEBUG_BUILD && logger.logger.warn('[Tracing] Discarding transaction because of invalid sample rate.'); + return [false]; + } + + // if the function returned 0 (or false), or if `tracesSampleRate` is 0, it's a sign the transaction should be dropped + if (!parsedSampleRate) { + debugBuild.DEBUG_BUILD && + logger.logger.log( + `[Tracing] Discarding transaction because ${ + typeof options.tracesSampler === 'function' + ? 'tracesSampler returned 0 or false' + : 'a negative sampling decision was inherited or tracesSampleRate is set to 0' + }`, + ); + return [false, parsedSampleRate]; + } + + // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is + // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false. + const shouldSample = Math.random() < parsedSampleRate; + + // if we're not going to keep it, we're done + if (!shouldSample) { + debugBuild.DEBUG_BUILD && + logger.logger.log( + `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number( + sampleRate, + )})`, + ); + return [false, parsedSampleRate]; + } + + return [true, parsedSampleRate]; +} + +exports.sampleSpan = sampleSpan; +//# sourceMappingURL=sampling.js.map + + +/***/ }), + +/***/ 36854: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const propagationContext = __nccwpck_require__(37264); +const spanUtils = __nccwpck_require__(47569); + +/** + * A Sentry Span that is non-recording, meaning it will not be sent to Sentry. + */ +class SentryNonRecordingSpan { + + constructor(spanContext = {}) { + this._traceId = spanContext.traceId || propagationContext.generateTraceId(); + this._spanId = spanContext.spanId || propagationContext.generateSpanId(); + } + + /** @inheritdoc */ + spanContext() { + return { + spanId: this._spanId, + traceId: this._traceId, + traceFlags: spanUtils.TRACE_FLAG_NONE, + }; + } + + /** @inheritdoc */ + // eslint-disable-next-line @typescript-eslint/no-empty-function + end(_timestamp) {} + + /** @inheritdoc */ + setAttribute(_key, _value) { + return this; + } + + /** @inheritdoc */ + setAttributes(_values) { + return this; + } + + /** @inheritdoc */ + setStatus(_status) { + return this; + } + + /** @inheritdoc */ + updateName(_name) { + return this; + } + + /** @inheritdoc */ + isRecording() { + return false; + } + + /** @inheritdoc */ + addEvent( + _name, + _attributesOrStartTime, + _startTime, + ) { + return this; + } + + /** + * This should generally not be used, + * but we need it for being compliant with the OTEL Span interface. + * + * @hidden + * @internal + */ + addLink(_link) { + return this; + } + + /** + * This should generally not be used, + * but we need it for being compliant with the OTEL Span interface. + * + * @hidden + * @internal + */ + addLinks(_links) { + return this; + } + + /** + * This should generally not be used, + * but we need it for being compliant with the OTEL Span interface. + * + * @hidden + * @internal + */ + recordException(_exception, _time) { + // noop + } +} + +exports.SentryNonRecordingSpan = SentryNonRecordingSpan; +//# sourceMappingURL=sentryNonRecordingSpan.js.map + + +/***/ }), + +/***/ 53263: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const currentScopes = __nccwpck_require__(8131); +const debugBuild = __nccwpck_require__(14488); +const envelope = __nccwpck_require__(58784); +const metricSummary = __nccwpck_require__(48306); +const semanticAttributes = __nccwpck_require__(36827); +const logger = __nccwpck_require__(38752); +const object = __nccwpck_require__(16100); +const propagationContext = __nccwpck_require__(37264); +const time = __nccwpck_require__(75872); +const spanUtils = __nccwpck_require__(47569); +const dynamicSamplingContext = __nccwpck_require__(29724); +const logSpans = __nccwpck_require__(28761); +const measurement = __nccwpck_require__(50722); +const utils = __nccwpck_require__(77989); + +const MAX_SPAN_COUNT = 1000; + +/** + * Span contains all data about a span + */ +class SentrySpan { + + /** Epoch timestamp in seconds when the span started. */ + + /** Epoch timestamp in seconds when the span ended. */ + + /** Internal keeper of the status */ + + /** The timed events added to this span. */ + + /** if true, treat span as a standalone span (not part of a transaction) */ + + /** + * You should never call the constructor manually, always use `Sentry.startSpan()` + * or other span methods. + * @internal + * @hideconstructor + * @hidden + */ + constructor(spanContext = {}) { + this._traceId = spanContext.traceId || propagationContext.generateTraceId(); + this._spanId = spanContext.spanId || propagationContext.generateSpanId(); + this._startTime = spanContext.startTimestamp || time.timestampInSeconds(); + + this._attributes = {}; + this.setAttributes({ + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'manual', + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: spanContext.op, + ...spanContext.attributes, + }); + + this._name = spanContext.name; + + if (spanContext.parentSpanId) { + this._parentSpanId = spanContext.parentSpanId; + } + // We want to include booleans as well here + if ('sampled' in spanContext) { + this._sampled = spanContext.sampled; + } + if (spanContext.endTimestamp) { + this._endTime = spanContext.endTimestamp; + } + + this._events = []; + + this._isStandaloneSpan = spanContext.isStandalone; + + // If the span is already ended, ensure we finalize the span immediately + if (this._endTime) { + this._onSpanEnded(); + } + } + + /** + * This should generally not be used, + * but it is needed for being compliant with the OTEL Span interface. + * + * @hidden + * @internal + */ + addLink(_link) { + return this; + } + + /** + * This should generally not be used, + * but it is needed for being compliant with the OTEL Span interface. + * + * @hidden + * @internal + */ + addLinks(_links) { + return this; + } + + /** + * This should generally not be used, + * but it is needed for being compliant with the OTEL Span interface. + * + * @hidden + * @internal + */ + recordException(_exception, _time) { + // noop + } + + /** @inheritdoc */ + spanContext() { + const { _spanId: spanId, _traceId: traceId, _sampled: sampled } = this; + return { + spanId, + traceId, + traceFlags: sampled ? spanUtils.TRACE_FLAG_SAMPLED : spanUtils.TRACE_FLAG_NONE, + }; + } + + /** @inheritdoc */ + setAttribute(key, value) { + if (value === undefined) { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete this._attributes[key]; + } else { + this._attributes[key] = value; + } + + return this; + } + + /** @inheritdoc */ + setAttributes(attributes) { + Object.keys(attributes).forEach(key => this.setAttribute(key, attributes[key])); + return this; + } + + /** + * This should generally not be used, + * but we need it for browser tracing where we want to adjust the start time afterwards. + * USE THIS WITH CAUTION! + * + * @hidden + * @internal + */ + updateStartTime(timeInput) { + this._startTime = spanUtils.spanTimeInputToSeconds(timeInput); + } + + /** + * @inheritDoc + */ + setStatus(value) { + this._status = value; + return this; + } + + /** + * @inheritDoc + */ + updateName(name) { + this._name = name; + this.setAttribute(semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'custom'); + return this; + } + + /** @inheritdoc */ + end(endTimestamp) { + // If already ended, skip + if (this._endTime) { + return; + } + + this._endTime = spanUtils.spanTimeInputToSeconds(endTimestamp); + logSpans.logSpanEnd(this); + + this._onSpanEnded(); + } + + /** + * Get JSON representation of this span. + * + * @hidden + * @internal This method is purely for internal purposes and should not be used outside + * of SDK code. If you need to get a JSON representation of a span, + * use `spanToJSON(span)` instead. + */ + getSpanJSON() { + return object.dropUndefinedKeys({ + data: this._attributes, + description: this._name, + op: this._attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP], + parent_span_id: this._parentSpanId, + span_id: this._spanId, + start_timestamp: this._startTime, + status: spanUtils.getStatusMessage(this._status), + timestamp: this._endTime, + trace_id: this._traceId, + origin: this._attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] , + _metrics_summary: metricSummary.getMetricSummaryJsonForSpan(this), + profile_id: this._attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_PROFILE_ID] , + exclusive_time: this._attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME] , + measurements: measurement.timedEventsToMeasurements(this._events), + is_segment: (this._isStandaloneSpan && spanUtils.getRootSpan(this) === this) || undefined, + segment_id: this._isStandaloneSpan ? spanUtils.getRootSpan(this).spanContext().spanId : undefined, + }); + } + + /** @inheritdoc */ + isRecording() { + return !this._endTime && !!this._sampled; + } + + /** + * @inheritdoc + */ + addEvent( + name, + attributesOrStartTime, + startTime, + ) { + debugBuild.DEBUG_BUILD && logger.logger.log('[Tracing] Adding an event to span:', name); + + const time$1 = isSpanTimeInput(attributesOrStartTime) ? attributesOrStartTime : startTime || time.timestampInSeconds(); + const attributes = isSpanTimeInput(attributesOrStartTime) ? {} : attributesOrStartTime || {}; + + const event = { + name, + time: spanUtils.spanTimeInputToSeconds(time$1), + attributes, + }; + + this._events.push(event); + + return this; + } + + /** + * This method should generally not be used, + * but for now we need a way to publicly check if the `_isStandaloneSpan` flag is set. + * USE THIS WITH CAUTION! + * @internal + * @hidden + * @experimental + */ + isStandaloneSpan() { + return !!this._isStandaloneSpan; + } + + /** Emit `spanEnd` when the span is ended. */ + _onSpanEnded() { + const client = currentScopes.getClient(); + if (client) { + client.emit('spanEnd', this); + } + + // A segment span is basically the root span of a local span tree. + // So for now, this is either what we previously refer to as the root span, + // or a standalone span. + const isSegmentSpan = this._isStandaloneSpan || this === spanUtils.getRootSpan(this); + + if (!isSegmentSpan) { + return; + } + + // if this is a standalone span, we send it immediately + if (this._isStandaloneSpan) { + if (this._sampled) { + sendSpanEnvelope(envelope.createSpanEnvelope([this], client)); + } else { + debugBuild.DEBUG_BUILD && + logger.logger.log('[Tracing] Discarding standalone span because its trace was not chosen to be sampled.'); + if (client) { + client.recordDroppedEvent('sample_rate', 'span'); + } + } + return; + } + + const transactionEvent = this._convertSpanToTransaction(); + if (transactionEvent) { + const scope = utils.getCapturedScopesOnSpan(this).scope || currentScopes.getCurrentScope(); + scope.captureEvent(transactionEvent); + } + } + + /** + * Finish the transaction & prepare the event to send to Sentry. + */ + _convertSpanToTransaction() { + // We can only convert finished spans + if (!isFullFinishedSpan(spanUtils.spanToJSON(this))) { + return undefined; + } + + if (!this._name) { + debugBuild.DEBUG_BUILD && logger.logger.warn('Transaction has no name, falling back to ``.'); + this._name = ''; + } + + const { scope: capturedSpanScope, isolationScope: capturedSpanIsolationScope } = utils.getCapturedScopesOnSpan(this); + const scope = capturedSpanScope || currentScopes.getCurrentScope(); + const client = scope.getClient() || currentScopes.getClient(); + + if (this._sampled !== true) { + // At this point if `sampled !== true` we want to discard the transaction. + debugBuild.DEBUG_BUILD && logger.logger.log('[Tracing] Discarding transaction because its trace was not chosen to be sampled.'); + + if (client) { + client.recordDroppedEvent('sample_rate', 'transaction'); + } + + return undefined; + } + + // The transaction span itself as well as any potential standalone spans should be filtered out + const finishedSpans = spanUtils.getSpanDescendants(this).filter(span => span !== this && !isStandaloneSpan(span)); + + const spans = finishedSpans.map(span => spanUtils.spanToJSON(span)).filter(isFullFinishedSpan); + + const source = this._attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] ; + + // remove internal root span attributes we don't need to send. + /* eslint-disable @typescript-eslint/no-dynamic-delete */ + delete this._attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; + spans.forEach(span => { + span.data && delete span.data[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; + }); + // eslint-enabled-next-line @typescript-eslint/no-dynamic-delete + + const transaction = { + contexts: { + trace: spanUtils.spanToTransactionTraceContext(this), + }, + spans: + // spans.sort() mutates the array, but `spans` is already a copy so we can safely do this here + // we do not use spans anymore after this point + spans.length > MAX_SPAN_COUNT + ? spans.sort((a, b) => a.start_timestamp - b.start_timestamp).slice(0, MAX_SPAN_COUNT) + : spans, + start_timestamp: this._startTime, + timestamp: this._endTime, + transaction: this._name, + type: 'transaction', + sdkProcessingMetadata: { + capturedSpanScope, + capturedSpanIsolationScope, + ...object.dropUndefinedKeys({ + dynamicSamplingContext: dynamicSamplingContext.getDynamicSamplingContextFromSpan(this), + }), + }, + _metrics_summary: metricSummary.getMetricSummaryJsonForSpan(this), + ...(source && { + transaction_info: { + source, + }, + }), + }; + + const measurements = measurement.timedEventsToMeasurements(this._events); + const hasMeasurements = measurements && Object.keys(measurements).length; + + if (hasMeasurements) { + debugBuild.DEBUG_BUILD && + logger.logger.log( + '[Measurements] Adding measurements to transaction event', + JSON.stringify(measurements, undefined, 2), + ); + transaction.measurements = measurements; + } + + return transaction; + } +} + +function isSpanTimeInput(value) { + return (value && typeof value === 'number') || value instanceof Date || Array.isArray(value); +} + +// We want to filter out any incomplete SpanJSON objects +function isFullFinishedSpan(input) { + return !!input.start_timestamp && !!input.timestamp && !!input.span_id && !!input.trace_id; +} + +/** `SentrySpan`s can be sent as a standalone span rather than belonging to a transaction */ +function isStandaloneSpan(span) { + return span instanceof SentrySpan && span.isStandaloneSpan(); +} + +/** + * Sends a `SpanEnvelope`. + * + * Note: If the envelope's spans are dropped, e.g. via `beforeSendSpan`, + * the envelope will not be sent either. + */ +function sendSpanEnvelope(envelope) { + const client = currentScopes.getClient(); + if (!client) { + return; + } + + const spanItems = envelope[1]; + if (!spanItems || spanItems.length === 0) { + client.recordDroppedEvent('before_send', 'span'); + return; + } + + // sendEnvelope should not throw + // eslint-disable-next-line @typescript-eslint/no-floating-promises + client.sendEnvelope(envelope); +} + +exports.SentrySpan = SentrySpan; +//# sourceMappingURL=sentrySpan.js.map + + +/***/ }), + +/***/ 21119: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const SPAN_STATUS_UNSET = 0; +const SPAN_STATUS_OK = 1; +const SPAN_STATUS_ERROR = 2; + +/** + * Converts a HTTP status code into a sentry status with a message. + * + * @param httpStatus The HTTP response status code. + * @returns The span status or unknown_error. + */ +// https://develop.sentry.dev/sdk/event-payloads/span/ +function getSpanStatusFromHttpCode(httpStatus) { + if (httpStatus < 400 && httpStatus >= 100) { + return { code: SPAN_STATUS_OK }; + } + + if (httpStatus >= 400 && httpStatus < 500) { + switch (httpStatus) { + case 401: + return { code: SPAN_STATUS_ERROR, message: 'unauthenticated' }; + case 403: + return { code: SPAN_STATUS_ERROR, message: 'permission_denied' }; + case 404: + return { code: SPAN_STATUS_ERROR, message: 'not_found' }; + case 409: + return { code: SPAN_STATUS_ERROR, message: 'already_exists' }; + case 413: + return { code: SPAN_STATUS_ERROR, message: 'failed_precondition' }; + case 429: + return { code: SPAN_STATUS_ERROR, message: 'resource_exhausted' }; + case 499: + return { code: SPAN_STATUS_ERROR, message: 'cancelled' }; + default: + return { code: SPAN_STATUS_ERROR, message: 'invalid_argument' }; + } + } + + if (httpStatus >= 500 && httpStatus < 600) { + switch (httpStatus) { + case 501: + return { code: SPAN_STATUS_ERROR, message: 'unimplemented' }; + case 503: + return { code: SPAN_STATUS_ERROR, message: 'unavailable' }; + case 504: + return { code: SPAN_STATUS_ERROR, message: 'deadline_exceeded' }; + default: + return { code: SPAN_STATUS_ERROR, message: 'internal_error' }; + } + } + + return { code: SPAN_STATUS_ERROR, message: 'unknown_error' }; +} + +/** + * Sets the Http status attributes on the current span based on the http code. + * Additionally, the span's status is updated, depending on the http code. + */ +function setHttpStatus(span, httpStatus) { + span.setAttribute('http.response.status_code', httpStatus); + + const spanStatus = getSpanStatusFromHttpCode(httpStatus); + if (spanStatus.message !== 'unknown_error') { + span.setStatus(spanStatus); + } +} + +exports.SPAN_STATUS_ERROR = SPAN_STATUS_ERROR; +exports.SPAN_STATUS_OK = SPAN_STATUS_OK; +exports.SPAN_STATUS_UNSET = SPAN_STATUS_UNSET; +exports.getSpanStatusFromHttpCode = getSpanStatusFromHttpCode; +exports.setHttpStatus = setHttpStatus; +//# sourceMappingURL=spanstatus.js.map + + +/***/ }), + +/***/ 97956: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const carrier = __nccwpck_require__(38080); +const currentScopes = __nccwpck_require__(8131); +const index = __nccwpck_require__(29878); +const debugBuild = __nccwpck_require__(14488); +const semanticAttributes = __nccwpck_require__(36827); +const logger = __nccwpck_require__(38752); +const propagationContext = __nccwpck_require__(37264); +const tracing = __nccwpck_require__(15977); +const handleCallbackErrors = __nccwpck_require__(77864); +const hasTracingEnabled = __nccwpck_require__(79223); +const spanOnScope = __nccwpck_require__(14379); +const spanUtils = __nccwpck_require__(47569); +const dynamicSamplingContext = __nccwpck_require__(29724); +const logSpans = __nccwpck_require__(28761); +const sampling = __nccwpck_require__(79478); +const sentryNonRecordingSpan = __nccwpck_require__(36854); +const sentrySpan = __nccwpck_require__(53263); +const spanstatus = __nccwpck_require__(21119); +const utils = __nccwpck_require__(77989); + +const SUPPRESS_TRACING_KEY = '__SENTRY_SUPPRESS_TRACING__'; + +/** + * Wraps a function with a transaction/span and finishes the span after the function is done. + * The created span is the active span and will be used as parent by other spans created inside the function + * and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active. + * + * If you want to create a span that is not set as active, use {@link startInactiveSpan}. + * + * You'll always get a span passed to the callback, + * it may just be a non-recording span if the span is not sampled or if tracing is disabled. + */ +function startSpan(options, callback) { + const acs = getAcs(); + if (acs.startSpan) { + return acs.startSpan(options, callback); + } + + const spanArguments = parseSentrySpanArguments(options); + const { forceTransaction, parentSpan: customParentSpan } = options; + + return currentScopes.withScope(options.scope, () => { + // If `options.parentSpan` is defined, we want to wrap the callback in `withActiveSpan` + const wrapper = getActiveSpanWrapper(customParentSpan); + + return wrapper(() => { + const scope = currentScopes.getCurrentScope(); + const parentSpan = getParentSpan(scope); + + const shouldSkipSpan = options.onlyIfParent && !parentSpan; + const activeSpan = shouldSkipSpan + ? new sentryNonRecordingSpan.SentryNonRecordingSpan() + : createChildOrRootSpan({ + parentSpan, + spanArguments, + forceTransaction, + scope, + }); + + spanOnScope._setSpanForScope(scope, activeSpan); + + return handleCallbackErrors.handleCallbackErrors( + () => callback(activeSpan), + () => { + // Only update the span status if it hasn't been changed yet, and the span is not yet finished + const { status } = spanUtils.spanToJSON(activeSpan); + if (activeSpan.isRecording() && (!status || status === 'ok')) { + activeSpan.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: 'internal_error' }); + } + }, + () => activeSpan.end(), + ); + }); + }); +} + +/** + * Similar to `Sentry.startSpan`. Wraps a function with a transaction/span, but does not finish the span + * after the function is done automatically. You'll have to call `span.end()` manually. + * + * The created span is the active span and will be used as parent by other spans created inside the function + * and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active. + * + * You'll always get a span passed to the callback, + * it may just be a non-recording span if the span is not sampled or if tracing is disabled. + */ +function startSpanManual(options, callback) { + const acs = getAcs(); + if (acs.startSpanManual) { + return acs.startSpanManual(options, callback); + } + + const spanArguments = parseSentrySpanArguments(options); + const { forceTransaction, parentSpan: customParentSpan } = options; + + return currentScopes.withScope(options.scope, () => { + // If `options.parentSpan` is defined, we want to wrap the callback in `withActiveSpan` + const wrapper = getActiveSpanWrapper(customParentSpan); + + return wrapper(() => { + const scope = currentScopes.getCurrentScope(); + const parentSpan = getParentSpan(scope); + + const shouldSkipSpan = options.onlyIfParent && !parentSpan; + const activeSpan = shouldSkipSpan + ? new sentryNonRecordingSpan.SentryNonRecordingSpan() + : createChildOrRootSpan({ + parentSpan, + spanArguments, + forceTransaction, + scope, + }); + + spanOnScope._setSpanForScope(scope, activeSpan); + + function finishAndSetSpan() { + activeSpan.end(); + } + + return handleCallbackErrors.handleCallbackErrors( + () => callback(activeSpan, finishAndSetSpan), + () => { + // Only update the span status if it hasn't been changed yet, and the span is not yet finished + const { status } = spanUtils.spanToJSON(activeSpan); + if (activeSpan.isRecording() && (!status || status === 'ok')) { + activeSpan.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: 'internal_error' }); + } + }, + ); + }); + }); +} + +/** + * Creates a span. This span is not set as active, so will not get automatic instrumentation spans + * as children or be able to be accessed via `Sentry.getActiveSpan()`. + * + * If you want to create a span that is set as active, use {@link startSpan}. + * + * This function will always return a span, + * it may just be a non-recording span if the span is not sampled or if tracing is disabled. + */ +function startInactiveSpan(options) { + const acs = getAcs(); + if (acs.startInactiveSpan) { + return acs.startInactiveSpan(options); + } + + const spanArguments = parseSentrySpanArguments(options); + const { forceTransaction, parentSpan: customParentSpan } = options; + + // If `options.scope` is defined, we use this as as a wrapper, + // If `options.parentSpan` is defined, we want to wrap the callback in `withActiveSpan` + const wrapper = options.scope + ? (callback) => currentScopes.withScope(options.scope, callback) + : customParentSpan !== undefined + ? (callback) => withActiveSpan(customParentSpan, callback) + : (callback) => callback(); + + return wrapper(() => { + const scope = currentScopes.getCurrentScope(); + const parentSpan = getParentSpan(scope); + + const shouldSkipSpan = options.onlyIfParent && !parentSpan; + + if (shouldSkipSpan) { + return new sentryNonRecordingSpan.SentryNonRecordingSpan(); + } + + return createChildOrRootSpan({ + parentSpan, + spanArguments, + forceTransaction, + scope, + }); + }); +} + +/** + * Continue a trace from `sentry-trace` and `baggage` values. + * These values can be obtained from incoming request headers, or in the browser from `` + * and `` HTML tags. + * + * Spans started with `startSpan`, `startSpanManual` and `startInactiveSpan`, within the callback will automatically + * be attached to the incoming trace. + */ +const continueTrace = ( + options + +, + callback, +) => { + const carrier$1 = carrier.getMainCarrier(); + const acs = index.getAsyncContextStrategy(carrier$1); + if (acs.continueTrace) { + return acs.continueTrace(options, callback); + } + + const { sentryTrace, baggage } = options; + + return currentScopes.withScope(scope => { + const propagationContext = tracing.propagationContextFromHeaders(sentryTrace, baggage); + scope.setPropagationContext(propagationContext); + return callback(); + }); +}; + +/** + * Forks the current scope and sets the provided span as active span in the context of the provided callback. Can be + * passed `null` to start an entirely new span tree. + * + * @param span Spans started in the context of the provided callback will be children of this span. If `null` is passed, + * spans started within the callback will not be attached to a parent span. + * @param callback Execution context in which the provided span will be active. Is passed the newly forked scope. + * @returns the value returned from the provided callback function. + */ +function withActiveSpan(span, callback) { + const acs = getAcs(); + if (acs.withActiveSpan) { + return acs.withActiveSpan(span, callback); + } + + return currentScopes.withScope(scope => { + spanOnScope._setSpanForScope(scope, span || undefined); + return callback(scope); + }); +} + +/** Suppress tracing in the given callback, ensuring no spans are generated inside of it. */ +function suppressTracing(callback) { + const acs = getAcs(); + + if (acs.suppressTracing) { + return acs.suppressTracing(callback); + } + + return currentScopes.withScope(scope => { + scope.setSDKProcessingMetadata({ [SUPPRESS_TRACING_KEY]: true }); + return callback(); + }); +} + +/** + * Starts a new trace for the duration of the provided callback. Spans started within the + * callback will be part of the new trace instead of a potentially previously started trace. + * + * Important: Only use this function if you want to override the default trace lifetime and + * propagation mechanism of the SDK for the duration and scope of the provided callback. + * The newly created trace will also be the root of a new distributed trace, for example if + * you make http requests within the callback. + * This function might be useful if the operation you want to instrument should not be part + * of a potentially ongoing trace. + * + * Default behavior: + * - Server-side: A new trace is started for each incoming request. + * - Browser: A new trace is started for each page our route. Navigating to a new route + * or page will automatically create a new trace. + */ +function startNewTrace(callback) { + return currentScopes.withScope(scope => { + scope.setPropagationContext({ traceId: propagationContext.generateTraceId() }); + debugBuild.DEBUG_BUILD && logger.logger.info(`Starting a new trace with id ${scope.getPropagationContext().traceId}`); + return withActiveSpan(null, callback); + }); +} + +function createChildOrRootSpan({ + parentSpan, + spanArguments, + forceTransaction, + scope, +} + +) { + if (!hasTracingEnabled.hasTracingEnabled()) { + return new sentryNonRecordingSpan.SentryNonRecordingSpan(); + } + + const isolationScope = currentScopes.getIsolationScope(); + + let span; + if (parentSpan && !forceTransaction) { + span = _startChildSpan(parentSpan, scope, spanArguments); + spanUtils.addChildSpanToSpan(parentSpan, span); + } else if (parentSpan) { + // If we forced a transaction but have a parent span, make sure to continue from the parent span, not the scope + const dsc = dynamicSamplingContext.getDynamicSamplingContextFromSpan(parentSpan); + const { traceId, spanId: parentSpanId } = parentSpan.spanContext(); + const parentSampled = spanUtils.spanIsSampled(parentSpan); + + span = _startRootSpan( + { + traceId, + parentSpanId, + ...spanArguments, + }, + scope, + parentSampled, + ); + + dynamicSamplingContext.freezeDscOnSpan(span, dsc); + } else { + const { + traceId, + dsc, + parentSpanId, + sampled: parentSampled, + } = { + ...isolationScope.getPropagationContext(), + ...scope.getPropagationContext(), + }; + + span = _startRootSpan( + { + traceId, + parentSpanId, + ...spanArguments, + }, + scope, + parentSampled, + ); + + if (dsc) { + dynamicSamplingContext.freezeDscOnSpan(span, dsc); + } + } + + logSpans.logSpanStart(span); + + utils.setCapturedScopesOnSpan(span, scope, isolationScope); + + return span; +} + +/** + * This converts StartSpanOptions to SentrySpanArguments. + * For the most part (for now) we accept the same options, + * but some of them need to be transformed. + */ +function parseSentrySpanArguments(options) { + const exp = options.experimental || {}; + const initialCtx = { + isStandalone: exp.standalone, + ...options, + }; + + if (options.startTime) { + const ctx = { ...initialCtx }; + ctx.startTimestamp = spanUtils.spanTimeInputToSeconds(options.startTime); + delete ctx.startTime; + return ctx; + } + + return initialCtx; +} + +function getAcs() { + const carrier$1 = carrier.getMainCarrier(); + return index.getAsyncContextStrategy(carrier$1); +} + +function _startRootSpan(spanArguments, scope, parentSampled) { + const client = currentScopes.getClient(); + const options = (client && client.getOptions()) || {}; + + const { name = '', attributes } = spanArguments; + const [sampled, sampleRate] = scope.getScopeData().sdkProcessingMetadata[SUPPRESS_TRACING_KEY] + ? [false] + : sampling.sampleSpan(options, { + name, + parentSampled, + attributes, + transactionContext: { + name, + parentSampled, + }, + }); + + const rootSpan = new sentrySpan.SentrySpan({ + ...spanArguments, + attributes: { + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'custom', + ...spanArguments.attributes, + }, + sampled, + }); + if (sampleRate !== undefined) { + rootSpan.setAttribute(semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, sampleRate); + } + + if (client) { + client.emit('spanStart', rootSpan); + } + + return rootSpan; +} + +/** + * Creates a new `Span` while setting the current `Span.id` as `parentSpanId`. + * This inherits the sampling decision from the parent span. + */ +function _startChildSpan(parentSpan, scope, spanArguments) { + const { spanId, traceId } = parentSpan.spanContext(); + const sampled = scope.getScopeData().sdkProcessingMetadata[SUPPRESS_TRACING_KEY] ? false : spanUtils.spanIsSampled(parentSpan); + + const childSpan = sampled + ? new sentrySpan.SentrySpan({ + ...spanArguments, + parentSpanId: spanId, + traceId, + sampled, + }) + : new sentryNonRecordingSpan.SentryNonRecordingSpan({ traceId }); + + spanUtils.addChildSpanToSpan(parentSpan, childSpan); + + const client = currentScopes.getClient(); + if (client) { + client.emit('spanStart', childSpan); + // If it has an endTimestamp, it's already ended + if (spanArguments.endTimestamp) { + client.emit('spanEnd', childSpan); + } + } + + return childSpan; +} + +function getParentSpan(scope) { + const span = spanOnScope._getSpanForScope(scope) ; + + if (!span) { + return undefined; + } + + const client = currentScopes.getClient(); + const options = client ? client.getOptions() : {}; + if (options.parentSpanIsAlwaysRootSpan) { + return spanUtils.getRootSpan(span) ; + } + + return span; +} + +function getActiveSpanWrapper(parentSpan) { + return parentSpan !== undefined + ? (callback) => { + return withActiveSpan(parentSpan, callback); + } + : (callback) => callback(); +} + +exports.continueTrace = continueTrace; +exports.startInactiveSpan = startInactiveSpan; +exports.startNewTrace = startNewTrace; +exports.startSpan = startSpan; +exports.startSpanManual = startSpanManual; +exports.suppressTracing = suppressTracing; +exports.withActiveSpan = withActiveSpan; +//# sourceMappingURL=trace.js.map + + +/***/ }), + +/***/ 77989: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const object = __nccwpck_require__(16100); + +const SCOPE_ON_START_SPAN_FIELD = '_sentryScope'; +const ISOLATION_SCOPE_ON_START_SPAN_FIELD = '_sentryIsolationScope'; + +/** Store the scope & isolation scope for a span, which can the be used when it is finished. */ +function setCapturedScopesOnSpan(span, scope, isolationScope) { + if (span) { + object.addNonEnumerableProperty(span, ISOLATION_SCOPE_ON_START_SPAN_FIELD, isolationScope); + object.addNonEnumerableProperty(span, SCOPE_ON_START_SPAN_FIELD, scope); + } +} + +/** + * Grabs the scope and isolation scope off a span that were active when the span was started. + */ +function getCapturedScopesOnSpan(span) { + return { + scope: (span )[SCOPE_ON_START_SPAN_FIELD], + isolationScope: (span )[ISOLATION_SCOPE_ON_START_SPAN_FIELD], + }; +} + +exports.getCapturedScopesOnSpan = getCapturedScopesOnSpan; +exports.setCapturedScopesOnSpan = setCapturedScopesOnSpan; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 24899: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const debugBuild = __nccwpck_require__(14488); +const envelope = __nccwpck_require__(72635); +const error = __nccwpck_require__(66322); +const logger = __nccwpck_require__(38752); +const promisebuffer = __nccwpck_require__(28058); +const ratelimit = __nccwpck_require__(78922); +const syncpromise = __nccwpck_require__(15621); + +const DEFAULT_TRANSPORT_BUFFER_SIZE = 64; + +/** + * Creates an instance of a Sentry `Transport` + * + * @param options + * @param makeRequest + */ +function createTransport( + options, + makeRequest, + buffer = promisebuffer.makePromiseBuffer( + options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE, + ), +) { + let rateLimits = {}; + const flush = (timeout) => buffer.drain(timeout); + + function send(envelope$1) { + const filteredEnvelopeItems = []; + + // Drop rate limited items from envelope + envelope.forEachEnvelopeItem(envelope$1, (item, type) => { + const dataCategory = envelope.envelopeItemTypeToDataCategory(type); + if (ratelimit.isRateLimited(rateLimits, dataCategory)) { + const event = getEventForEnvelopeItem(item, type); + options.recordDroppedEvent('ratelimit_backoff', dataCategory, event); + } else { + filteredEnvelopeItems.push(item); + } + }); + + // Skip sending if envelope is empty after filtering out rate limited events + if (filteredEnvelopeItems.length === 0) { + return syncpromise.resolvedSyncPromise({}); + } + + const filteredEnvelope = envelope.createEnvelope(envelope$1[0], filteredEnvelopeItems ); + + // Creates client report for each item in an envelope + const recordEnvelopeLoss = (reason) => { + envelope.forEachEnvelopeItem(filteredEnvelope, (item, type) => { + const event = getEventForEnvelopeItem(item, type); + options.recordDroppedEvent(reason, envelope.envelopeItemTypeToDataCategory(type), event); + }); + }; + + const requestTask = () => + makeRequest({ body: envelope.serializeEnvelope(filteredEnvelope) }).then( + response => { + // We don't want to throw on NOK responses, but we want to at least log them + if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode >= 300)) { + debugBuild.DEBUG_BUILD && logger.logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`); + } + + rateLimits = ratelimit.updateRateLimits(rateLimits, response); + return response; + }, + error => { + recordEnvelopeLoss('network_error'); + throw error; + }, + ); + + return buffer.add(requestTask).then( + result => result, + error$1 => { + if (error$1 instanceof error.SentryError) { + debugBuild.DEBUG_BUILD && logger.logger.error('Skipped sending event because buffer is full.'); + recordEnvelopeLoss('queue_overflow'); + return syncpromise.resolvedSyncPromise({}); + } else { + throw error$1; + } + }, + ); + } + + return { + send, + flush, + }; +} + +function getEventForEnvelopeItem(item, type) { + if (type !== 'event' && type !== 'transaction') { + return undefined; + } + + return Array.isArray(item) ? (item )[1] : undefined; +} + +exports.DEFAULT_TRANSPORT_BUFFER_SIZE = DEFAULT_TRANSPORT_BUFFER_SIZE; +exports.createTransport = createTransport; +//# sourceMappingURL=base.js.map + + +/***/ }), + +/***/ 97281: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const api = __nccwpck_require__(88563); +const dsn = __nccwpck_require__(32540); +const envelope = __nccwpck_require__(72635); + +/** + * Gets an event from an envelope. + * + * This is only exported for use in the tests + */ +function eventFromEnvelope(env, types) { + let event; + + envelope.forEachEnvelopeItem(env, (item, type) => { + if (types.includes(type)) { + event = Array.isArray(item) ? (item )[1] : undefined; + } + // bail out if we found an event + return !!event; + }); + + return event; +} + +/** + * Creates a transport that overrides the release on all events. + */ +function makeOverrideReleaseTransport( + createTransport, + release, +) { + return options => { + const transport = createTransport(options); + + return { + ...transport, + send: async (envelope) => { + const event = eventFromEnvelope(envelope, ['event', 'transaction', 'profile', 'replay_event']); + + if (event) { + event.release = release; + } + return transport.send(envelope); + }, + }; + }; +} + +/** Overrides the DSN in the envelope header */ +function overrideDsn(envelope$1, dsn) { + return envelope.createEnvelope( + dsn + ? { + ...envelope$1[0], + dsn, + } + : envelope$1[0], + envelope$1[1], + ); +} + +/** + * Creates a transport that can send events to different DSNs depending on the envelope contents. + */ +function makeMultiplexedTransport( + createTransport, + matcher, +) { + return options => { + const fallbackTransport = createTransport(options); + const otherTransports = new Map(); + + function getTransport(dsn$1, release) { + // We create a transport for every unique dsn/release combination as there may be code from multiple releases in + // use at the same time + const key = release ? `${dsn$1}:${release}` : dsn$1; + + let transport = otherTransports.get(key); + + if (!transport) { + const validatedDsn = dsn.dsnFromString(dsn$1); + if (!validatedDsn) { + return undefined; + } + const url = api.getEnvelopeEndpointWithUrlEncodedAuth(validatedDsn, options.tunnel); + + transport = release + ? makeOverrideReleaseTransport(createTransport, release)({ ...options, url }) + : createTransport({ ...options, url }); + + otherTransports.set(key, transport); + } + + return [dsn$1, transport]; + } + + async function send(envelope) { + function getEvent(types) { + const eventTypes = types && types.length ? types : ['event']; + return eventFromEnvelope(envelope, eventTypes); + } + + const transports = matcher({ envelope, getEvent }) + .map(result => { + if (typeof result === 'string') { + return getTransport(result, undefined); + } else { + return getTransport(result.dsn, result.release); + } + }) + .filter((t) => !!t); + + // If we have no transports to send to, use the fallback transport + // Don't override the DSN in the header for the fallback transport. '' is falsy + const transportsWithFallback = transports.length ? transports : [['', fallbackTransport]]; + + const results = (await Promise.all( + transportsWithFallback.map(([dsn, transport]) => transport.send(overrideDsn(envelope, dsn))), + )) ; + + return results[0]; + } + + async function flush(timeout) { + const allTransports = [...otherTransports.values(), fallbackTransport]; + const results = await Promise.all(allTransports.map(transport => transport.flush(timeout))); + return results.every(r => r); + } + + return { + send, + flush, + }; + }; +} + +exports.eventFromEnvelope = eventFromEnvelope; +exports.makeMultiplexedTransport = makeMultiplexedTransport; +//# sourceMappingURL=multiplexed.js.map + + +/***/ }), + +/***/ 52419: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const debugBuild = __nccwpck_require__(14488); +const envelope = __nccwpck_require__(72635); +const logger = __nccwpck_require__(38752); +const ratelimit = __nccwpck_require__(78922); + +const MIN_DELAY = 100; // 100 ms +const START_DELAY = 5000; // 5 seconds +const MAX_DELAY = 3.6e6; // 1 hour + +/** + * Wraps a transport and stores and retries events when they fail to send. + * + * @param createTransport The transport to wrap. + */ +function makeOfflineTransport( + createTransport, +) { + function log(...args) { + debugBuild.DEBUG_BUILD && logger.logger.info('[Offline]:', ...args); + } + + return options => { + const transport = createTransport(options); + + if (!options.createStore) { + throw new Error('No `createStore` function was provided'); + } + + const store = options.createStore(options); + + let retryDelay = START_DELAY; + let flushTimer; + + function shouldQueue(env, error, retryDelay) { + // We want to drop client reports because they can be generated when we retry sending events while offline. + if (envelope.envelopeContainsItemType(env, ['client_report'])) { + return false; + } + + if (options.shouldStore) { + return options.shouldStore(env, error, retryDelay); + } + + return true; + } + + function flushIn(delay) { + if (flushTimer) { + clearTimeout(flushTimer ); + } + + flushTimer = setTimeout(async () => { + flushTimer = undefined; + + const found = await store.shift(); + if (found) { + log('Attempting to send previously queued event'); + + // We should to update the sent_at timestamp to the current time. + found[0].sent_at = new Date().toISOString(); + + void send(found, true).catch(e => { + log('Failed to retry sending', e); + }); + } + }, delay) ; + + // We need to unref the timer in node.js, otherwise the node process never exit. + if (typeof flushTimer !== 'number' && flushTimer.unref) { + flushTimer.unref(); + } + } + + function flushWithBackOff() { + if (flushTimer) { + return; + } + + flushIn(retryDelay); + + retryDelay = Math.min(retryDelay * 2, MAX_DELAY); + } + + async function send(envelope$1, isRetry = false) { + // We queue all replay envelopes to avoid multiple replay envelopes being sent at the same time. If one fails, we + // need to retry them in order. + if (!isRetry && envelope.envelopeContainsItemType(envelope$1, ['replay_event', 'replay_recording'])) { + await store.push(envelope$1); + flushIn(MIN_DELAY); + return {}; + } + + try { + const result = await transport.send(envelope$1); + + let delay = MIN_DELAY; + + if (result) { + // If there's a retry-after header, use that as the next delay. + if (result.headers && result.headers['retry-after']) { + delay = ratelimit.parseRetryAfterHeader(result.headers['retry-after']); + } else if (result.headers && result.headers['x-sentry-rate-limits']) { + delay = 60000; // 60 seconds + } // If we have a server error, return now so we don't flush the queue. + else if ((result.statusCode || 0) >= 400) { + return result; + } + } + + flushIn(delay); + retryDelay = START_DELAY; + return result; + } catch (e) { + if (await shouldQueue(envelope$1, e , retryDelay)) { + // If this envelope was a retry, we want to add it to the front of the queue so it's retried again first. + if (isRetry) { + await store.unshift(envelope$1); + } else { + await store.push(envelope$1); + } + flushWithBackOff(); + log('Error sending. Event queued.', e ); + return {}; + } else { + throw e; + } + } + } + + if (options.flushAtStartup) { + flushWithBackOff(); + } + + return { + send, + flush: timeout => { + // If there's no timeout, we should attempt to flush the offline queue. + if (timeout === undefined) { + retryDelay = START_DELAY; + flushIn(MIN_DELAY); + } + + return transport.flush(timeout); + }, + }; + }; +} + +exports.MIN_DELAY = MIN_DELAY; +exports.START_DELAY = START_DELAY; +exports.makeOfflineTransport = makeOfflineTransport; +//# sourceMappingURL=offline.js.map + + +/***/ }), + +/***/ 18833: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const currentScopes = __nccwpck_require__(8131); +const exports$1 = __nccwpck_require__(10779); +const semanticAttributes = __nccwpck_require__(36827); +__nccwpck_require__(21834); +__nccwpck_require__(87038); +__nccwpck_require__(38752); +__nccwpck_require__(14488); +__nccwpck_require__(75872); +const normalize = __nccwpck_require__(65543); +__nccwpck_require__(15621); +const trace = __nccwpck_require__(97956); + +const trpcCaptureContext = { mechanism: { handled: false, data: { function: 'trpcMiddleware' } } }; + +function captureIfError(nextResult) { + // TODO: Set span status based on what TRPCError was encountered + if ( + typeof nextResult === 'object' && + nextResult !== null && + 'ok' in nextResult && + !nextResult.ok && + 'error' in nextResult + ) { + exports$1.captureException(nextResult.error, trpcCaptureContext); + } +} + +/** + * Sentry tRPC middleware that captures errors and creates spans for tRPC procedures. + */ +function trpcMiddleware(options = {}) { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + return async function (opts) { + const { path, type, next, rawInput, getRawInput } = opts; + + const client = currentScopes.getClient(); + const clientOptions = client && client.getOptions(); + + const trpcContext = { + procedure_path: path, + procedure_type: type, + }; + + if (options.attachRpcInput !== undefined ? options.attachRpcInput : clientOptions && clientOptions.sendDefaultPii) { + if (rawInput !== undefined) { + trpcContext.input = normalize.normalize(rawInput); + } + + if (getRawInput !== undefined && typeof getRawInput === 'function') { + try { + const rawRes = await getRawInput(); + + trpcContext.input = normalize.normalize(rawRes); + } catch (err) { + // noop + } + } + } + + return currentScopes.withScope(scope => { + scope.setContext('trpc', trpcContext); + return trace.startSpanManual( + { + name: `trpc/${path}`, + op: 'rpc.server', + attributes: { + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route', + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.rpc.trpc', + }, + }, + async span => { + try { + const nextResult = await next(); + captureIfError(nextResult); + span.end(); + return nextResult; + } catch (e) { + exports$1.captureException(e, trpcCaptureContext); + span.end(); + throw e; + } + }, + ) ; + }); + }; +} + +exports.trpcMiddleware = trpcMiddleware; +//# sourceMappingURL=trpc.js.map + + +/***/ }), + +/***/ 29416: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const is = __nccwpck_require__(84085); +const string = __nccwpck_require__(93529); + +/** + * Creates exceptions inside `event.exception.values` for errors that are nested on properties based on the `key` parameter. + */ +function applyAggregateErrorsToEvent( + exceptionFromErrorImplementation, + parser, + maxValueLimit = 250, + key, + limit, + event, + hint, +) { + if (!event.exception || !event.exception.values || !hint || !is.isInstanceOf(hint.originalException, Error)) { + return; + } + + // Generally speaking the last item in `event.exception.values` is the exception originating from the original Error + const originalException = + event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : undefined; + + // We only create exception grouping if there is an exception in the event. + if (originalException) { + event.exception.values = truncateAggregateExceptions( + aggregateExceptionsFromError( + exceptionFromErrorImplementation, + parser, + limit, + hint.originalException , + key, + event.exception.values, + originalException, + 0, + ), + maxValueLimit, + ); + } +} + +function aggregateExceptionsFromError( + exceptionFromErrorImplementation, + parser, + limit, + error, + key, + prevExceptions, + exception, + exceptionId, +) { + if (prevExceptions.length >= limit + 1) { + return prevExceptions; + } + + let newExceptions = [...prevExceptions]; + + // Recursively call this function in order to walk down a chain of errors + if (is.isInstanceOf(error[key], Error)) { + applyExceptionGroupFieldsForParentException(exception, exceptionId); + const newException = exceptionFromErrorImplementation(parser, error[key]); + const newExceptionId = newExceptions.length; + applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId); + newExceptions = aggregateExceptionsFromError( + exceptionFromErrorImplementation, + parser, + limit, + error[key], + key, + [newException, ...newExceptions], + newException, + newExceptionId, + ); + } + + // This will create exception grouping for AggregateErrors + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError + if (Array.isArray(error.errors)) { + error.errors.forEach((childError, i) => { + if (is.isInstanceOf(childError, Error)) { + applyExceptionGroupFieldsForParentException(exception, exceptionId); + const newException = exceptionFromErrorImplementation(parser, childError); + const newExceptionId = newExceptions.length; + applyExceptionGroupFieldsForChildException(newException, `errors[${i}]`, newExceptionId, exceptionId); + newExceptions = aggregateExceptionsFromError( + exceptionFromErrorImplementation, + parser, + limit, + childError, + key, + [newException, ...newExceptions], + newException, + newExceptionId, + ); + } + }); + } + + return newExceptions; +} + +function applyExceptionGroupFieldsForParentException(exception, exceptionId) { + // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default. + exception.mechanism = exception.mechanism || { type: 'generic', handled: true }; + + exception.mechanism = { + ...exception.mechanism, + ...(exception.type === 'AggregateError' && { is_exception_group: true }), + exception_id: exceptionId, + }; +} + +function applyExceptionGroupFieldsForChildException( + exception, + source, + exceptionId, + parentId, +) { + // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default. + exception.mechanism = exception.mechanism || { type: 'generic', handled: true }; + + exception.mechanism = { + ...exception.mechanism, + type: 'chained', + source, + exception_id: exceptionId, + parent_id: parentId, + }; +} + +/** + * Truncate the message (exception.value) of all exceptions in the event. + * Because this event processor is ran after `applyClientOptions`, + * we need to truncate the message of the added exceptions here. + */ +function truncateAggregateExceptions(exceptions, maxValueLength) { + return exceptions.map(exception => { + if (exception.value) { + exception.value = string.truncate(exception.value, maxValueLength); + } + return exception; + }); +} + +exports.applyAggregateErrorsToEvent = applyAggregateErrorsToEvent; +//# sourceMappingURL=aggregate-errors.js.map + + +/***/ }), + +/***/ 13231: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const nodeStackTrace = __nccwpck_require__(70169); +const object = __nccwpck_require__(16100); +const stacktrace = __nccwpck_require__(85820); + +/** + * A node.js watchdog timer + * @param pollInterval The interval that we expect to get polled at + * @param anrThreshold The threshold for when we consider ANR + * @param callback The callback to call for ANR + * @returns An object with `poll` and `enabled` functions {@link WatchdogReturn} + */ +function watchdogTimer( + createTimer, + pollInterval, + anrThreshold, + callback, +) { + const timer = createTimer(); + let triggered = false; + let enabled = true; + + setInterval(() => { + const diffMs = timer.getTimeMs(); + + if (triggered === false && diffMs > pollInterval + anrThreshold) { + triggered = true; + if (enabled) { + callback(); + } + } + + if (diffMs < pollInterval + anrThreshold) { + triggered = false; + } + }, 20); + + return { + poll: () => { + timer.reset(); + }, + enabled: (state) => { + enabled = state; + }, + }; +} + +// types copied from inspector.d.ts + +/** + * Converts Debugger.CallFrame to Sentry StackFrame + */ +function callFrameToStackFrame( + frame, + url, + getModuleFromFilename, +) { + const filename = url ? url.replace(/^file:\/\//, '') : undefined; + + // CallFrame row/col are 0 based, whereas StackFrame are 1 based + const colno = frame.location.columnNumber ? frame.location.columnNumber + 1 : undefined; + const lineno = frame.location.lineNumber ? frame.location.lineNumber + 1 : undefined; + + return object.dropUndefinedKeys({ + filename, + module: getModuleFromFilename(filename), + function: frame.functionName || stacktrace.UNKNOWN_FUNCTION, + colno, + lineno, + in_app: filename ? nodeStackTrace.filenameIsInApp(filename) : undefined, + }); +} + +exports.callFrameToStackFrame = callFrameToStackFrame; +exports.watchdogTimer = watchdogTimer; +//# sourceMappingURL=anr.js.map + + +/***/ }), + +/***/ 28904: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/** Flattens a multi-dimensional array + * + * @deprecated This function is deprecated and will be removed in the next major version. + */ +function flatten(input) { + const result = []; + + const flattenHelper = (input) => { + input.forEach((el) => { + if (Array.isArray(el)) { + flattenHelper(el ); + } else { + result.push(el ); + } + }); + }; + + flattenHelper(input); + return result; +} + +exports.flatten = flatten; +//# sourceMappingURL=array.js.map + + +/***/ }), + +/***/ 86741: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const debugBuild = __nccwpck_require__(87038); +const is = __nccwpck_require__(84085); +const logger = __nccwpck_require__(38752); + +/** + * @deprecated Use a `"baggage"` string directly + */ +const BAGGAGE_HEADER_NAME = 'baggage'; + +const SENTRY_BAGGAGE_KEY_PREFIX = 'sentry-'; + +const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/; + +/** + * Max length of a serialized baggage string + * + * https://www.w3.org/TR/baggage/#limits + */ +const MAX_BAGGAGE_STRING_LENGTH = 8192; + +/** + * Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the "sentry-" prefixed values + * from it. + * + * @param baggageHeader A very bread definition of a baggage header as it might appear in various frameworks. + * @returns The Dynamic Sampling Context that was found on `baggageHeader`, if there was any, `undefined` otherwise. + */ +function baggageHeaderToDynamicSamplingContext( + // Very liberal definition of what any incoming header might look like + baggageHeader, +) { + const baggageObject = parseBaggageHeader(baggageHeader); + + if (!baggageObject) { + return undefined; + } + + // Read all "sentry-" prefixed values out of the baggage object and put it onto a dynamic sampling context object. + const dynamicSamplingContext = Object.entries(baggageObject).reduce((acc, [key, value]) => { + if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) { + const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length); + acc[nonPrefixedKey] = value; + } + return acc; + }, {}); + + // Only return a dynamic sampling context object if there are keys in it. + // A keyless object means there were no sentry values on the header, which means that there is no DSC. + if (Object.keys(dynamicSamplingContext).length > 0) { + return dynamicSamplingContext ; + } else { + return undefined; + } +} + +/** + * Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with "sentry-". + * + * @param dynamicSamplingContext The Dynamic Sampling Context to turn into a header. For convenience and compatibility + * with the `getDynamicSamplingContext` method on the Transaction class ,this argument can also be `undefined`. If it is + * `undefined` the function will return `undefined`. + * @returns a baggage header, created from `dynamicSamplingContext`, or `undefined` either if `dynamicSamplingContext` + * was `undefined`, or if `dynamicSamplingContext` didn't contain any values. + */ +function dynamicSamplingContextToSentryBaggageHeader( + // this also takes undefined for convenience and bundle size in other places + dynamicSamplingContext, +) { + if (!dynamicSamplingContext) { + return undefined; + } + + // Prefix all DSC keys with "sentry-" and put them into a new object + const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce( + (acc, [dscKey, dscValue]) => { + if (dscValue) { + acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue; + } + return acc; + }, + {}, + ); + + return objectToBaggageHeader(sentryPrefixedDSC); +} + +/** + * Take a baggage header and parse it into an object. + */ +function parseBaggageHeader( + baggageHeader, +) { + if (!baggageHeader || (!is.isString(baggageHeader) && !Array.isArray(baggageHeader))) { + return undefined; + } + + if (Array.isArray(baggageHeader)) { + // Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it + return baggageHeader.reduce((acc, curr) => { + const currBaggageObject = baggageHeaderToObject(curr); + Object.entries(currBaggageObject).forEach(([key, value]) => { + acc[key] = value; + }); + return acc; + }, {}); + } + + return baggageHeaderToObject(baggageHeader); +} + +/** + * Will parse a baggage header, which is a simple key-value map, into a flat object. + * + * @param baggageHeader The baggage header to parse. + * @returns a flat object containing all the key-value pairs from `baggageHeader`. + */ +function baggageHeaderToObject(baggageHeader) { + return baggageHeader + .split(',') + .map(baggageEntry => baggageEntry.split('=').map(keyOrValue => decodeURIComponent(keyOrValue.trim()))) + .reduce((acc, [key, value]) => { + if (key && value) { + acc[key] = value; + } + return acc; + }, {}); +} + +/** + * Turns a flat object (key-value pairs) into a baggage header, which is also just key-value pairs. + * + * @param object The object to turn into a baggage header. + * @returns a baggage header string, or `undefined` if the object didn't have any values, since an empty baggage header + * is not spec compliant. + */ +function objectToBaggageHeader(object) { + if (Object.keys(object).length === 0) { + // An empty baggage header is not spec compliant: We return undefined. + return undefined; + } + + return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => { + const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`; + const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`; + if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) { + debugBuild.DEBUG_BUILD && + logger.logger.warn( + `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`, + ); + return baggageHeader; + } else { + return newBaggageHeader; + } + }, ''); +} + +exports.BAGGAGE_HEADER_NAME = BAGGAGE_HEADER_NAME; +exports.MAX_BAGGAGE_STRING_LENGTH = MAX_BAGGAGE_STRING_LENGTH; +exports.SENTRY_BAGGAGE_KEY_PREFIX = SENTRY_BAGGAGE_KEY_PREFIX; +exports.SENTRY_BAGGAGE_KEY_PREFIX_REGEX = SENTRY_BAGGAGE_KEY_PREFIX_REGEX; +exports.baggageHeaderToDynamicSamplingContext = baggageHeaderToDynamicSamplingContext; +exports.dynamicSamplingContextToSentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader; +exports.parseBaggageHeader = parseBaggageHeader; +//# sourceMappingURL=baggage.js.map + + +/***/ }), + +/***/ 56448: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/** + * Determine a breadcrumb's log level (only `warning` or `error`) based on an HTTP status code. + */ +function getBreadcrumbLogLevelFromHttpStatusCode(statusCode) { + // NOTE: undefined defaults to 'info' in Sentry + if (statusCode === undefined) { + return undefined; + } else if (statusCode >= 400 && statusCode < 500) { + return 'warning'; + } else if (statusCode >= 500) { + return 'error'; + } else { + return undefined; + } +} + +exports.getBreadcrumbLogLevelFromHttpStatusCode = getBreadcrumbLogLevelFromHttpStatusCode; +//# sourceMappingURL=breadcrumb-log-level.js.map + + +/***/ }), + +/***/ 24450: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const is = __nccwpck_require__(84085); +const worldwide = __nccwpck_require__(10891); + +const WINDOW = worldwide.GLOBAL_OBJ ; + +const DEFAULT_MAX_STRING_LENGTH = 80; + +/** + * Given a child DOM element, returns a query-selector statement describing that + * and its ancestors + * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz] + * @returns generated DOM path + */ +function htmlTreeAsString( + elem, + options = {}, +) { + if (!elem) { + return ''; + } + + // try/catch both: + // - accessing event.target (see getsentry/raven-js#838, #768) + // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly + // - can throw an exception in some circumstances. + try { + let currentElem = elem ; + const MAX_TRAVERSE_HEIGHT = 5; + const out = []; + let height = 0; + let len = 0; + const separator = ' > '; + const sepLength = separator.length; + let nextStr; + const keyAttrs = Array.isArray(options) ? options : options.keyAttrs; + const maxStringLength = (!Array.isArray(options) && options.maxStringLength) || DEFAULT_MAX_STRING_LENGTH; + + while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) { + nextStr = _htmlElementAsString(currentElem, keyAttrs); + // bail out if + // - nextStr is the 'html' element + // - the length of the string that would be created exceeds maxStringLength + // (ignore this limit if we are on the first iteration) + if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength)) { + break; + } + + out.push(nextStr); + + len += nextStr.length; + currentElem = currentElem.parentNode; + } + + return out.reverse().join(separator); + } catch (_oO) { + return ''; + } +} + +/** + * Returns a simple, query-selector representation of a DOM element + * e.g. [HTMLElement] => input#foo.btn[name=baz] + * @returns generated DOM path + */ +function _htmlElementAsString(el, keyAttrs) { + const elem = el + +; + + const out = []; + + if (!elem || !elem.tagName) { + return ''; + } + + // @ts-expect-error WINDOW has HTMLElement + if (WINDOW.HTMLElement) { + // If using the component name annotation plugin, this value may be available on the DOM node + if (elem instanceof HTMLElement && elem.dataset) { + if (elem.dataset['sentryComponent']) { + return elem.dataset['sentryComponent']; + } + if (elem.dataset['sentryElement']) { + return elem.dataset['sentryElement']; + } + } + } + + out.push(elem.tagName.toLowerCase()); + + // Pairs of attribute keys defined in `serializeAttribute` and their values on element. + const keyAttrPairs = + keyAttrs && keyAttrs.length + ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)]) + : null; + + if (keyAttrPairs && keyAttrPairs.length) { + keyAttrPairs.forEach(keyAttrPair => { + out.push(`[${keyAttrPair[0]}="${keyAttrPair[1]}"]`); + }); + } else { + if (elem.id) { + out.push(`#${elem.id}`); + } + + const className = elem.className; + if (className && is.isString(className)) { + const classes = className.split(/\s+/); + for (const c of classes) { + out.push(`.${c}`); + } + } + } + const allowedAttrs = ['aria-label', 'type', 'name', 'title', 'alt']; + for (const k of allowedAttrs) { + const attr = elem.getAttribute(k); + if (attr) { + out.push(`[${k}="${attr}"]`); + } + } + + return out.join(''); +} + +/** + * A safe form of location.href + */ +function getLocationHref() { + try { + return WINDOW.document.location.href; + } catch (oO) { + return ''; + } +} + +/** + * Gets a DOM element by using document.querySelector. + * + * This wrapper will first check for the existence of the function before + * actually calling it so that we don't have to take care of this check, + * every time we want to access the DOM. + * + * Reason: DOM/querySelector is not available in all environments. + * + * We have to cast to any because utils can be consumed by a variety of environments, + * and we don't want to break TS users. If you know what element will be selected by + * `document.querySelector`, specify it as part of the generic call. For example, + * `const element = getDomElement('selector');` + * + * @param selector the selector string passed on to document.querySelector + * + * @deprecated This method is deprecated and will be removed in the next major version. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function getDomElement(selector) { + if (WINDOW.document && WINDOW.document.querySelector) { + return WINDOW.document.querySelector(selector) ; + } + return null; +} + +/** + * Given a DOM element, traverses up the tree until it finds the first ancestor node + * that has the `data-sentry-component` or `data-sentry-element` attribute with `data-sentry-component` taking + * precedence. This attribute is added at build-time by projects that have the component name annotation plugin installed. + * + * @returns a string representation of the component for the provided DOM element, or `null` if not found + */ +function getComponentName(elem) { + // @ts-expect-error WINDOW has HTMLElement + if (!WINDOW.HTMLElement) { + return null; + } + + let currentElem = elem ; + const MAX_TRAVERSE_HEIGHT = 5; + for (let i = 0; i < MAX_TRAVERSE_HEIGHT; i++) { + if (!currentElem) { + return null; + } + + if (currentElem instanceof HTMLElement) { + if (currentElem.dataset['sentryComponent']) { + return currentElem.dataset['sentryComponent']; + } + if (currentElem.dataset['sentryElement']) { + return currentElem.dataset['sentryElement']; + } + } + + currentElem = currentElem.parentNode; + } + + return null; +} + +exports.getComponentName = getComponentName; +exports.getDomElement = getDomElement; +exports.getLocationHref = getLocationHref; +exports.htmlTreeAsString = htmlTreeAsString; +//# sourceMappingURL=browser.js.map + + +/***/ }), + +/***/ 89294: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const _nullishCoalesce = __nccwpck_require__(68874); + +// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f +// +// The MIT License (MIT) +// +// Copyright (c) 2012-2018 various contributors (see AUTHORS) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + + +/** + * Polyfill for the nullish coalescing operator (`??`), when used in situations where at least one of the values is the + * result of an async operation. + * + * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the + * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior. + * + * Adapted from Sucrase (https://github.com/alangpierce/sucrase) + * + * @param lhs The value of the expression to the left of the `??` + * @param rhsFn A function returning the value of the expression to the right of the `??` + * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value + */ +async function _asyncNullishCoalesce(lhs, rhsFn) { + return _nullishCoalesce._nullishCoalesce(lhs, rhsFn); +} + +// Sucrase version: +// async function _asyncNullishCoalesce(lhs, rhsFn) { +// if (lhs != null) { +// return lhs; +// } else { +// return await rhsFn(); +// } +// } + +exports._asyncNullishCoalesce = _asyncNullishCoalesce; +//# sourceMappingURL=_asyncNullishCoalesce.js.map + + +/***/ }), + +/***/ 82384: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/** + * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values, + * descriptors, and functions, for situations in which at least one part of the expression is async. + * + * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See + * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15 + * + * @param ops Array result of expression conversion + * @returns The value of the expression + */ +async function _asyncOptionalChain(ops) { + let lastAccessLHS = undefined; + let value = ops[0]; + let i = 1; + while (i < ops.length) { + const op = ops[i] ; + const fn = ops[i + 1] ; + i += 2; + // by checking for loose equality to `null`, we catch both `null` and `undefined` + if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { + // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it + return; + } + if (op === 'access' || op === 'optionalAccess') { + lastAccessLHS = value; + value = await fn(value); + } else if (op === 'call' || op === 'optionalCall') { + value = await fn((...args) => (value ).call(lastAccessLHS, ...args)); + lastAccessLHS = undefined; + } + } + return value; +} + +// Sucrase version: +// async function _asyncOptionalChain(ops) { +// let lastAccessLHS = undefined; +// let value = ops[0]; +// let i = 1; +// while (i < ops.length) { +// const op = ops[i]; +// const fn = ops[i + 1]; +// i += 2; +// if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { +// return undefined; +// } +// if (op === 'access' || op === 'optionalAccess') { +// lastAccessLHS = value; +// value = await fn(value); +// } else if (op === 'call' || op === 'optionalCall') { +// value = await fn((...args) => value.call(lastAccessLHS, ...args)); +// lastAccessLHS = undefined; +// } +// } +// return value; +// } + +exports._asyncOptionalChain = _asyncOptionalChain; +//# sourceMappingURL=_asyncOptionalChain.js.map + + +/***/ }), + +/***/ 24613: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const _asyncOptionalChain = __nccwpck_require__(82384); + +// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f +// +// The MIT License (MIT) +// +// Copyright (c) 2012-2018 various contributors (see AUTHORS) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + + +/** + * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values, + * descriptors, and functions, in cases where the value of the expression is to be deleted. + * + * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See + * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15 + * + * @param ops Array result of expression conversion + * @returns The return value of the `delete` operator: `true`, unless the deletion target is an own, non-configurable + * property (one which can't be deleted or turned into an accessor, and whose enumerability can't be changed), in which + * case `false`. + */ +async function _asyncOptionalChainDelete(ops) { + const result = (await _asyncOptionalChain._asyncOptionalChain(ops)) ; + // If `result` is `null`, it means we didn't get to the end of the chain and so nothing was deleted (in which case, + // return `true` since that's what `delete` does when it no-ops). If it's non-null, we know the delete happened, in + // which case we return whatever the `delete` returned, which will be a boolean. + return result == null ? true : (result ); +} + +// Sucrase version: +// async function asyncOptionalChainDelete(ops) { +// const result = await ASYNC_OPTIONAL_CHAIN_NAME(ops); +// return result == null ? true : result; +// } + +exports._asyncOptionalChainDelete = _asyncOptionalChainDelete; +//# sourceMappingURL=_asyncOptionalChainDelete.js.map + + +/***/ }), + +/***/ 68874: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f +// +// The MIT License (MIT) +// +// Copyright (c) 2012-2018 various contributors (see AUTHORS) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +/** + * Polyfill for the nullish coalescing operator (`??`). + * + * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the + * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior. + * + * Adapted from Sucrase (https://github.com/alangpierce/sucrase) + * + * @param lhs The value of the expression to the left of the `??` + * @param rhsFn A function returning the value of the expression to the right of the `??` + * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value + */ +function _nullishCoalesce(lhs, rhsFn) { + // by checking for loose equality to `null`, we catch both `null` and `undefined` + return lhs != null ? lhs : rhsFn(); +} + +// Sucrase version: +// function _nullishCoalesce(lhs, rhsFn) { +// if (lhs != null) { +// return lhs; +// } else { +// return rhsFn(); +// } +// } + +exports._nullishCoalesce = _nullishCoalesce; +//# sourceMappingURL=_nullishCoalesce.js.map + + +/***/ }), + +/***/ 6752: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/** + * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values, + * descriptors, and functions. + * + * Adapted from Sucrase (https://github.com/alangpierce/sucrase) + * See https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15 + * + * @param ops Array result of expression conversion + * @returns The value of the expression + */ +function _optionalChain(ops) { + let lastAccessLHS = undefined; + let value = ops[0]; + let i = 1; + while (i < ops.length) { + const op = ops[i] ; + const fn = ops[i + 1] ; + i += 2; + // by checking for loose equality to `null`, we catch both `null` and `undefined` + if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { + // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it + return; + } + if (op === 'access' || op === 'optionalAccess') { + lastAccessLHS = value; + value = fn(value); + } else if (op === 'call' || op === 'optionalCall') { + value = fn((...args) => (value ).call(lastAccessLHS, ...args)); + lastAccessLHS = undefined; + } + } + return value; +} + +// Sucrase version +// function _optionalChain(ops) { +// let lastAccessLHS = undefined; +// let value = ops[0]; +// let i = 1; +// while (i < ops.length) { +// const op = ops[i]; +// const fn = ops[i + 1]; +// i += 2; +// if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { +// return undefined; +// } +// if (op === 'access' || op === 'optionalAccess') { +// lastAccessLHS = value; +// value = fn(value); +// } else if (op === 'call' || op === 'optionalCall') { +// value = fn((...args) => value.call(lastAccessLHS, ...args)); +// lastAccessLHS = undefined; +// } +// } +// return value; +// } + +exports._optionalChain = _optionalChain; +//# sourceMappingURL=_optionalChain.js.map + + +/***/ }), + +/***/ 65631: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const _optionalChain = __nccwpck_require__(6752); + +// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f +// +// The MIT License (MIT) +// +// Copyright (c) 2012-2018 various contributors (see AUTHORS) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + + +/** + * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values, + * descriptors, and functions, in cases where the value of the expression is to be deleted. + * + * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See + * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15 + * + * @param ops Array result of expression conversion + * @returns The return value of the `delete` operator: `true`, unless the deletion target is an own, non-configurable + * property (one which can't be deleted or turned into an accessor, and whose enumerability can't be changed), in which + * case `false`. + */ +function _optionalChainDelete(ops) { + const result = _optionalChain._optionalChain(ops) ; + // If `result` is `null`, it means we didn't get to the end of the chain and so nothing was deleted (in which case, + // return `true` since that's what `delete` does when it no-ops). If it's non-null, we know the delete happened, in + // which case we return whatever the `delete` returned, which will be a boolean. + return result == null ? true : result; +} + +// Sucrase version: +// function _optionalChainDelete(ops) { +// const result = _optionalChain(ops); +// // by checking for loose equality to `null`, we catch both `null` and `undefined` +// return result == null ? true : result; +// } + +exports._optionalChainDelete = _optionalChainDelete; +//# sourceMappingURL=_optionalChainDelete.js.map + + +/***/ }), + +/***/ 6360: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/** + * Creates a cache that evicts keys in fifo order + * @param size {Number} + * + * @deprecated This function is deprecated and will be removed in the next major version. + */ +function makeFifoCache( + size, +) + + { + // Maintain a fifo queue of keys, we cannot rely on Object.keys as the browser may not support it. + let evictionOrder = []; + let cache = {}; + + return { + add(key, value) { + while (evictionOrder.length >= size) { + // shift is O(n) but this is small size and only happens if we are + // exceeding the cache size so it should be fine. + const evictCandidate = evictionOrder.shift(); + + if (evictCandidate !== undefined) { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete cache[evictCandidate]; + } + } + + // in case we have a collision, delete the old key. + if (cache[key]) { + this.delete(key); + } + + evictionOrder.push(key); + cache[key] = value; + }, + clear() { + cache = {}; + evictionOrder = []; + }, + get(key) { + return cache[key]; + }, + size() { + return evictionOrder.length; + }, + // Delete cache key and return true if it existed, false otherwise. + delete(key) { + if (!cache[key]) { + return false; + } + + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete cache[key]; + + for (let i = 0; i < evictionOrder.length; i++) { + if (evictionOrder[i] === key) { + evictionOrder.splice(i, 1); + break; + } + } + + return true; + }, + }; +} + +exports.makeFifoCache = makeFifoCache; +//# sourceMappingURL=cache.js.map + + +/***/ }), + +/***/ 27962: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const envelope = __nccwpck_require__(72635); +const time = __nccwpck_require__(75872); + +/** + * Creates client report envelope + * @param discarded_events An array of discard events + * @param dsn A DSN that can be set on the header. Optional. + */ +function createClientReportEnvelope( + discarded_events, + dsn, + timestamp, +) { + const clientReportItem = [ + { type: 'client_report' }, + { + timestamp: timestamp || time.dateTimestampInSeconds(), + discarded_events, + }, + ]; + return envelope.createEnvelope(dsn ? { dsn } : {}, [clientReportItem]); +} + +exports.createClientReportEnvelope = createClientReportEnvelope; +//# sourceMappingURL=clientreport.js.map + + +/***/ }), + +/***/ 49298: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/** + * This code was originally copied from the 'cookie` module at v0.5.0 and was simplified for our use case. + * https://github.com/jshttp/cookie/blob/a0c84147aab6266bdb3996cf4062e93907c0b0fc/index.js + * It had the following license: + * + * (The MIT License) + * + * Copyright (c) 2012-2014 Roman Shtylman + * Copyright (c) 2015 Douglas Christopher Wilson + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * 'Software'), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * Parses a cookie string + */ +function parseCookie(str) { + const obj = {}; + let index = 0; + + while (index < str.length) { + const eqIdx = str.indexOf('=', index); + + // no more cookie pairs + if (eqIdx === -1) { + break; + } + + let endIdx = str.indexOf(';', index); + + if (endIdx === -1) { + endIdx = str.length; + } else if (endIdx < eqIdx) { + // backtrack on prior semicolon + index = str.lastIndexOf(';', eqIdx - 1) + 1; + continue; + } + + const key = str.slice(index, eqIdx).trim(); + + // only assign once + if (undefined === obj[key]) { + let val = str.slice(eqIdx + 1, endIdx).trim(); + + // quoted values + if (val.charCodeAt(0) === 0x22) { + val = val.slice(1, -1); + } + + try { + obj[key] = val.indexOf('%') !== -1 ? decodeURIComponent(val) : val; + } catch (e) { + obj[key] = val; + } + } + + index = endIdx + 1; + } + + return obj; +} + +exports.parseCookie = parseCookie; +//# sourceMappingURL=cookie.js.map + + +/***/ }), + +/***/ 87038: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/** + * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code. + * + * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking. + */ +const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__); + +exports.DEBUG_BUILD = DEBUG_BUILD; +//# sourceMappingURL=debug-build.js.map + + +/***/ }), + +/***/ 4263: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const worldwide = __nccwpck_require__(10891); + +let parsedStackResults; +let lastKeysCount; +let cachedFilenameDebugIds; + +/** + * Returns a map of filenames to debug identifiers. + */ +function getFilenameToDebugIdMap(stackParser) { + const debugIdMap = worldwide.GLOBAL_OBJ._sentryDebugIds; + if (!debugIdMap) { + return {}; + } + + const debugIdKeys = Object.keys(debugIdMap); + + // If the count of registered globals hasn't changed since the last call, we + // can just return the cached result. + if (cachedFilenameDebugIds && debugIdKeys.length === lastKeysCount) { + return cachedFilenameDebugIds; + } + + lastKeysCount = debugIdKeys.length; + + // Build a map of filename -> debug_id. + cachedFilenameDebugIds = debugIdKeys.reduce((acc, stackKey) => { + if (!parsedStackResults) { + parsedStackResults = {}; + } + + const result = parsedStackResults[stackKey]; + + if (result) { + acc[result[0]] = result[1]; + } else { + const parsedStack = stackParser(stackKey); + + for (let i = parsedStack.length - 1; i >= 0; i--) { + const stackFrame = parsedStack[i]; + const filename = stackFrame && stackFrame.filename; + const debugId = debugIdMap[stackKey]; + + if (filename && debugId) { + acc[filename] = debugId; + parsedStackResults[stackKey] = [filename, debugId]; + break; + } + } + } + + return acc; + }, {}); + + return cachedFilenameDebugIds; +} + +/** + * Returns a list of debug images for the given resources. + */ +function getDebugImagesForResources( + stackParser, + resource_paths, +) { + const filenameDebugIdMap = getFilenameToDebugIdMap(stackParser); + + if (!filenameDebugIdMap) { + return []; + } + + const images = []; + for (const path of resource_paths) { + if (path && filenameDebugIdMap[path]) { + images.push({ + type: 'sourcemap', + code_file: path, + debug_id: filenameDebugIdMap[path] , + }); + } + } + + return images; +} + +exports.getDebugImagesForResources = getDebugImagesForResources; +exports.getFilenameToDebugIdMap = getFilenameToDebugIdMap; +//# sourceMappingURL=debug-ids.js.map + + +/***/ }), + +/***/ 32540: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const debugBuild = __nccwpck_require__(87038); +const logger = __nccwpck_require__(38752); + +/** Regular expression used to parse a Dsn. */ +const DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/; + +function isValidProtocol(protocol) { + return protocol === 'http' || protocol === 'https'; +} + +/** + * Renders the string representation of this Dsn. + * + * By default, this will render the public representation without the password + * component. To get the deprecated private representation, set `withPassword` + * to true. + * + * @param withPassword When set to true, the password will be included. + */ +function dsnToString(dsn, withPassword = false) { + const { host, path, pass, port, projectId, protocol, publicKey } = dsn; + return ( + `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` + + `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}` + ); +} + +/** + * Parses a Dsn from a given string. + * + * @param str A Dsn as string + * @returns Dsn as DsnComponents or undefined if @param str is not a valid DSN string + */ +function dsnFromString(str) { + const match = DSN_REGEX.exec(str); + + if (!match) { + // This should be logged to the console + logger.consoleSandbox(() => { + // eslint-disable-next-line no-console + console.error(`Invalid Sentry Dsn: ${str}`); + }); + return undefined; + } + + const [protocol, publicKey, pass = '', host = '', port = '', lastPath = ''] = match.slice(1); + let path = ''; + let projectId = lastPath; + + const split = projectId.split('/'); + if (split.length > 1) { + path = split.slice(0, -1).join('/'); + projectId = split.pop() ; + } + + if (projectId) { + const projectMatch = projectId.match(/^\d+/); + if (projectMatch) { + projectId = projectMatch[0]; + } + } + + return dsnFromComponents({ host, pass, path, projectId, port, protocol: protocol , publicKey }); +} + +function dsnFromComponents(components) { + return { + protocol: components.protocol, + publicKey: components.publicKey || '', + pass: components.pass || '', + host: components.host, + port: components.port || '', + path: components.path || '', + projectId: components.projectId, + }; +} + +function validateDsn(dsn) { + if (!debugBuild.DEBUG_BUILD) { + return true; + } + + const { port, projectId, protocol } = dsn; + + const requiredComponents = ['protocol', 'publicKey', 'host', 'projectId']; + const hasMissingRequiredComponent = requiredComponents.find(component => { + if (!dsn[component]) { + logger.logger.error(`Invalid Sentry Dsn: ${component} missing`); + return true; + } + return false; + }); + + if (hasMissingRequiredComponent) { + return false; + } + + if (!projectId.match(/^\d+$/)) { + logger.logger.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`); + return false; + } + + if (!isValidProtocol(protocol)) { + logger.logger.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`); + return false; + } + + if (port && isNaN(parseInt(port, 10))) { + logger.logger.error(`Invalid Sentry Dsn: Invalid port ${port}`); + return false; + } + + return true; +} + +/** + * Creates a valid Sentry Dsn object, identifying a Sentry instance and project. + * @returns a valid DsnComponents object or `undefined` if @param from is an invalid DSN source + */ +function makeDsn(from) { + const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from); + if (!components || !validateDsn(components)) { + return undefined; + } + return components; +} + +exports.dsnFromString = dsnFromString; +exports.dsnToString = dsnToString; +exports.makeDsn = makeDsn; +//# sourceMappingURL=dsn.js.map + + +/***/ }), + +/***/ 11318: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/* + * This module exists for optimizations in the build process through rollup and terser. We define some global + * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these + * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will + * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to + * `logger` and preventing node-related code from appearing in browser bundles. + * + * Attention: + * This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by + * users. These flags should live in their respective packages, as we identified user tooling (specifically webpack) + * having issues tree-shaking these constants across package boundaries. + * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want + * users to be able to shake away expressions that it guards. + */ + +/** + * Figures out if we're building a browser bundle. + * + * @returns true if this is a browser bundle build. + */ +function isBrowserBundle() { + return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__; +} + +/** + * Get source of SDK. + */ +function getSDKSource() { + // This comment is used to identify this line in the CDN bundle build step and replace this with "return 'cdn';" + /* __SENTRY_SDK_SOURCE__ */ return 'npm'; +} + +exports.getSDKSource = getSDKSource; +exports.isBrowserBundle = isBrowserBundle; +//# sourceMappingURL=env.js.map + + +/***/ }), + +/***/ 72635: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const dsn = __nccwpck_require__(32540); +const normalize = __nccwpck_require__(65543); +const object = __nccwpck_require__(16100); +const worldwide = __nccwpck_require__(10891); + +/** + * Creates an envelope. + * Make sure to always explicitly provide the generic to this function + * so that the envelope types resolve correctly. + */ +function createEnvelope(headers, items = []) { + return [headers, items] ; +} + +/** + * Add an item to an envelope. + * Make sure to always explicitly provide the generic to this function + * so that the envelope types resolve correctly. + */ +function addItemToEnvelope(envelope, newItem) { + const [headers, items] = envelope; + return [headers, [...items, newItem]] ; +} + +/** + * Convenience function to loop through the items and item types of an envelope. + * (This function was mostly created because working with envelope types is painful at the moment) + * + * If the callback returns true, the rest of the items will be skipped. + */ +function forEachEnvelopeItem( + envelope, + callback, +) { + const envelopeItems = envelope[1]; + + for (const envelopeItem of envelopeItems) { + const envelopeItemType = envelopeItem[0].type; + const result = callback(envelopeItem, envelopeItemType); + + if (result) { + return true; + } + } + + return false; +} + +/** + * Returns true if the envelope contains any of the given envelope item types + */ +function envelopeContainsItemType(envelope, types) { + return forEachEnvelopeItem(envelope, (_, type) => types.includes(type)); +} + +/** + * Encode a string to UTF8 array. + */ +function encodeUTF8(input) { + return worldwide.GLOBAL_OBJ.__SENTRY__ && worldwide.GLOBAL_OBJ.__SENTRY__.encodePolyfill + ? worldwide.GLOBAL_OBJ.__SENTRY__.encodePolyfill(input) + : new TextEncoder().encode(input); +} + +/** + * Decode a UTF8 array to string. + */ +function decodeUTF8(input) { + return worldwide.GLOBAL_OBJ.__SENTRY__ && worldwide.GLOBAL_OBJ.__SENTRY__.decodePolyfill + ? worldwide.GLOBAL_OBJ.__SENTRY__.decodePolyfill(input) + : new TextDecoder().decode(input); +} + +/** + * Serializes an envelope. + */ +function serializeEnvelope(envelope) { + const [envHeaders, items] = envelope; + + // Initially we construct our envelope as a string and only convert to binary chunks if we encounter binary data + let parts = JSON.stringify(envHeaders); + + function append(next) { + if (typeof parts === 'string') { + parts = typeof next === 'string' ? parts + next : [encodeUTF8(parts), next]; + } else { + parts.push(typeof next === 'string' ? encodeUTF8(next) : next); + } + } + + for (const item of items) { + const [itemHeaders, payload] = item; + + append(`\n${JSON.stringify(itemHeaders)}\n`); + + if (typeof payload === 'string' || payload instanceof Uint8Array) { + append(payload); + } else { + let stringifiedPayload; + try { + stringifiedPayload = JSON.stringify(payload); + } catch (e) { + // In case, despite all our efforts to keep `payload` circular-dependency-free, `JSON.stringify()` still + // fails, we try again after normalizing it again with infinite normalization depth. This of course has a + // performance impact but in this case a performance hit is better than throwing. + stringifiedPayload = JSON.stringify(normalize.normalize(payload)); + } + append(stringifiedPayload); + } + } + + return typeof parts === 'string' ? parts : concatBuffers(parts); +} + +function concatBuffers(buffers) { + const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0); + + const merged = new Uint8Array(totalLength); + let offset = 0; + for (const buffer of buffers) { + merged.set(buffer, offset); + offset += buffer.length; + } + + return merged; +} + +/** + * Parses an envelope + */ +function parseEnvelope(env) { + let buffer = typeof env === 'string' ? encodeUTF8(env) : env; + + function readBinary(length) { + const bin = buffer.subarray(0, length); + // Replace the buffer with the remaining data excluding trailing newline + buffer = buffer.subarray(length + 1); + return bin; + } + + function readJson() { + let i = buffer.indexOf(0xa); + // If we couldn't find a newline, we must have found the end of the buffer + if (i < 0) { + i = buffer.length; + } + + return JSON.parse(decodeUTF8(readBinary(i))) ; + } + + const envelopeHeader = readJson(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const items = []; + + while (buffer.length) { + const itemHeader = readJson(); + const binaryLength = typeof itemHeader.length === 'number' ? itemHeader.length : undefined; + + items.push([itemHeader, binaryLength ? readBinary(binaryLength) : readJson()]); + } + + return [envelopeHeader, items]; +} + +/** + * Creates envelope item for a single span + */ +function createSpanEnvelopeItem(spanJson) { + const spanHeaders = { + type: 'span', + }; + + return [spanHeaders, spanJson]; +} + +/** + * Creates attachment envelope items + */ +function createAttachmentEnvelopeItem(attachment) { + const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data) : attachment.data; + + return [ + object.dropUndefinedKeys({ + type: 'attachment', + length: buffer.length, + filename: attachment.filename, + content_type: attachment.contentType, + attachment_type: attachment.attachmentType, + }), + buffer, + ]; +} + +const ITEM_TYPE_TO_DATA_CATEGORY_MAP = { + session: 'session', + sessions: 'session', + attachment: 'attachment', + transaction: 'transaction', + event: 'error', + client_report: 'internal', + user_report: 'default', + profile: 'profile', + profile_chunk: 'profile', + replay_event: 'replay', + replay_recording: 'replay', + check_in: 'monitor', + feedback: 'feedback', + span: 'span', + statsd: 'metric_bucket', + raw_security: 'security', +}; + +/** + * Maps the type of an envelope item to a data category. + */ +function envelopeItemTypeToDataCategory(type) { + return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type]; +} + +/** Extracts the minimal SDK info from the metadata or an events */ +function getSdkMetadataForEnvelopeHeader(metadataOrEvent) { + if (!metadataOrEvent || !metadataOrEvent.sdk) { + return; + } + const { name, version } = metadataOrEvent.sdk; + return { name, version }; +} + +/** + * Creates event envelope headers, based on event, sdk info and tunnel + * Note: This function was extracted from the core package to make it available in Replay + */ +function createEventEnvelopeHeaders( + event, + sdkInfo, + tunnel, + dsn$1, +) { + const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext; + return { + event_id: event.event_id , + sent_at: new Date().toISOString(), + ...(sdkInfo && { sdk: sdkInfo }), + ...(!!tunnel && dsn$1 && { dsn: dsn.dsnToString(dsn$1) }), + ...(dynamicSamplingContext && { + trace: object.dropUndefinedKeys({ ...dynamicSamplingContext }), + }), + }; +} + +exports.addItemToEnvelope = addItemToEnvelope; +exports.createAttachmentEnvelopeItem = createAttachmentEnvelopeItem; +exports.createEnvelope = createEnvelope; +exports.createEventEnvelopeHeaders = createEventEnvelopeHeaders; +exports.createSpanEnvelopeItem = createSpanEnvelopeItem; +exports.envelopeContainsItemType = envelopeContainsItemType; +exports.envelopeItemTypeToDataCategory = envelopeItemTypeToDataCategory; +exports.forEachEnvelopeItem = forEachEnvelopeItem; +exports.getSdkMetadataForEnvelopeHeader = getSdkMetadataForEnvelopeHeader; +exports.parseEnvelope = parseEnvelope; +exports.serializeEnvelope = serializeEnvelope; +//# sourceMappingURL=envelope.js.map + + +/***/ }), + +/***/ 66322: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/** An error emitted by Sentry SDKs and related utilities. */ +class SentryError extends Error { + + constructor( + message, + logLevel = 'warn', + ) { + super(message);this.message = message; + this.logLevel = logLevel; + } +} + +exports.SentryError = SentryError; +//# sourceMappingURL=error.js.map + + +/***/ }), + +/***/ 2781: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const is = __nccwpck_require__(84085); +const misc = __nccwpck_require__(3181); +const normalize = __nccwpck_require__(65543); +const object = __nccwpck_require__(16100); + +/** + * Extracts stack frames from the error.stack string + */ +function parseStackFrames(stackParser, error) { + return stackParser(error.stack || '', 1); +} + +/** + * Extracts stack frames from the error and builds a Sentry Exception + */ +function exceptionFromError(stackParser, error) { + const exception = { + type: error.name || error.constructor.name, + value: error.message, + }; + + const frames = parseStackFrames(stackParser, error); + if (frames.length) { + exception.stacktrace = { frames }; + } + + return exception; +} + +/** If a plain object has a property that is an `Error`, return this error. */ +function getErrorPropertyFromObject(obj) { + for (const prop in obj) { + if (Object.prototype.hasOwnProperty.call(obj, prop)) { + const value = obj[prop]; + if (value instanceof Error) { + return value; + } + } + } + + return undefined; +} + +function getMessageForObject(exception) { + if ('name' in exception && typeof exception.name === 'string') { + let message = `'${exception.name}' captured as exception`; + + if ('message' in exception && typeof exception.message === 'string') { + message += ` with message '${exception.message}'`; + } + + return message; + } else if ('message' in exception && typeof exception.message === 'string') { + return exception.message; + } + + const keys = object.extractExceptionKeysForMessage(exception); + + // Some ErrorEvent instances do not have an `error` property, which is why they are not handled before + // We still want to try to get a decent message for these cases + if (is.isErrorEvent(exception)) { + return `Event \`ErrorEvent\` captured as exception with message \`${exception.message}\``; + } + + const className = getObjectClassName(exception); + + return `${ + className && className !== 'Object' ? `'${className}'` : 'Object' + } captured as exception with keys: ${keys}`; +} + +function getObjectClassName(obj) { + try { + const prototype = Object.getPrototypeOf(obj); + return prototype ? prototype.constructor.name : undefined; + } catch (e) { + // ignore errors here + } +} + +function getException( + client, + mechanism, + exception, + hint, +) { + if (is.isError(exception)) { + return [exception, undefined]; + } + + // Mutate this! + mechanism.synthetic = true; + + if (is.isPlainObject(exception)) { + const normalizeDepth = client && client.getOptions().normalizeDepth; + const extras = { ['__serialized__']: normalize.normalizeToSize(exception , normalizeDepth) }; + + const errorFromProp = getErrorPropertyFromObject(exception); + if (errorFromProp) { + return [errorFromProp, extras]; + } + + const message = getMessageForObject(exception); + const ex = (hint && hint.syntheticException) || new Error(message); + ex.message = message; + + return [ex, extras]; + } + + // This handles when someone does: `throw "something awesome";` + // We use synthesized Error here so we can extract a (rough) stack trace. + const ex = (hint && hint.syntheticException) || new Error(exception ); + ex.message = `${exception}`; + + return [ex, undefined]; +} + +/** + * Builds and Event from a Exception + * @hidden + */ +function eventFromUnknownInput( + client, + stackParser, + exception, + hint, +) { + const providedMechanism = + hint && hint.data && (hint.data ).mechanism; + const mechanism = providedMechanism || { + handled: true, + type: 'generic', + }; + + const [ex, extras] = getException(client, mechanism, exception, hint); + + const event = { + exception: { + values: [exceptionFromError(stackParser, ex)], + }, + }; + + if (extras) { + event.extra = extras; + } + + misc.addExceptionTypeValue(event, undefined, undefined); + misc.addExceptionMechanism(event, mechanism); + + return { + ...event, + event_id: hint && hint.event_id, + }; +} + +/** + * Builds and Event from a Message + * @hidden + */ +function eventFromMessage( + stackParser, + message, + level = 'info', + hint, + attachStacktrace, +) { + const event = { + event_id: hint && hint.event_id, + level, + }; + + if (attachStacktrace && hint && hint.syntheticException) { + const frames = parseStackFrames(stackParser, hint.syntheticException); + if (frames.length) { + event.exception = { + values: [ + { + value: message, + stacktrace: { frames }, + }, + ], + }; + misc.addExceptionMechanism(event, { synthetic: true }); + } + } + + if (is.isParameterizedString(message)) { + const { __sentry_template_string__, __sentry_template_values__ } = message; + + event.logentry = { + message: __sentry_template_string__, + params: __sentry_template_values__, + }; + return event; + } + + event.message = message; + return event; +} + +exports.eventFromMessage = eventFromMessage; +exports.eventFromUnknownInput = eventFromUnknownInput; +exports.exceptionFromError = exceptionFromError; +exports.parseStackFrames = parseStackFrames; +//# sourceMappingURL=eventbuilder.js.map + + +/***/ }), + +/***/ 32758: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const logger = __nccwpck_require__(38752); +const object = __nccwpck_require__(16100); +const worldwide = __nccwpck_require__(10891); +const handlers = __nccwpck_require__(44639); + +/** + * Add an instrumentation handler for when a console.xxx method is called. + * + * Use at your own risk, this might break without changelog notice, only used internally. + * @hidden + */ +function addConsoleInstrumentationHandler(handler) { + const type = 'console'; + handlers.addHandler(type, handler); + handlers.maybeInstrument(type, instrumentConsole); +} + +function instrumentConsole() { + if (!('console' in worldwide.GLOBAL_OBJ)) { + return; + } + + logger.CONSOLE_LEVELS.forEach(function (level) { + if (!(level in worldwide.GLOBAL_OBJ.console)) { + return; + } + + object.fill(worldwide.GLOBAL_OBJ.console, level, function (originalConsoleMethod) { + logger.originalConsoleMethods[level] = originalConsoleMethod; + + return function (...args) { + const handlerData = { args, level }; + handlers.triggerHandlers('console', handlerData); + + const log = logger.originalConsoleMethods[level]; + log && log.apply(worldwide.GLOBAL_OBJ.console, args); + }; + }); + }); +} + +exports.addConsoleInstrumentationHandler = addConsoleInstrumentationHandler; +//# sourceMappingURL=console.js.map + + +/***/ }), + +/***/ 34670: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const is = __nccwpck_require__(84085); +const object = __nccwpck_require__(16100); +const supports = __nccwpck_require__(73872); +const time = __nccwpck_require__(75872); +const worldwide = __nccwpck_require__(10891); +const handlers = __nccwpck_require__(44639); + +/** + * Add an instrumentation handler for when a fetch request happens. + * The handler function is called once when the request starts and once when it ends, + * which can be identified by checking if it has an `endTimestamp`. + * + * Use at your own risk, this might break without changelog notice, only used internally. + * @hidden + */ +function addFetchInstrumentationHandler( + handler, + skipNativeFetchCheck, +) { + const type = 'fetch'; + handlers.addHandler(type, handler); + handlers.maybeInstrument(type, () => instrumentFetch(undefined, skipNativeFetchCheck)); +} + +/** + * Add an instrumentation handler for long-lived fetch requests, like consuming server-sent events (SSE) via fetch. + * The handler will resolve the request body and emit the actual `endTimestamp`, so that the + * span can be updated accordingly. + * + * Only used internally + * @hidden + */ +function addFetchEndInstrumentationHandler(handler) { + const type = 'fetch-body-resolved'; + handlers.addHandler(type, handler); + handlers.maybeInstrument(type, () => instrumentFetch(streamHandler)); +} + +function instrumentFetch(onFetchResolved, skipNativeFetchCheck = false) { + if (skipNativeFetchCheck && !supports.supportsNativeFetch()) { + return; + } + + object.fill(worldwide.GLOBAL_OBJ, 'fetch', function (originalFetch) { + return function (...args) { + // We capture the error right here and not in the Promise error callback because Safari (and probably other + // browsers too) will wipe the stack trace up to this point, only leaving us with this file which is useless. + + // NOTE: If you are a Sentry user, and you are seeing this stack frame, + // it means the error, that was caused by your fetch call did not + // have a stack trace, so the SDK backfilled the stack trace so + // you can see which fetch call failed. + const virtualError = new Error(); + + const { method, url } = parseFetchArgs(args); + const handlerData = { + args, + fetchData: { + method, + url, + }, + startTimestamp: time.timestampInSeconds() * 1000, + // // Adding the error to be able to fingerprint the failed fetch event in HttpClient instrumentation + virtualError, + }; + + // if there is no callback, fetch is instrumented directly + if (!onFetchResolved) { + handlers.triggerHandlers('fetch', { + ...handlerData, + }); + } + + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return originalFetch.apply(worldwide.GLOBAL_OBJ, args).then( + async (response) => { + if (onFetchResolved) { + onFetchResolved(response); + } else { + handlers.triggerHandlers('fetch', { + ...handlerData, + endTimestamp: time.timestampInSeconds() * 1000, + response, + }); + } + + return response; + }, + (error) => { + handlers.triggerHandlers('fetch', { + ...handlerData, + endTimestamp: time.timestampInSeconds() * 1000, + error, + }); + + if (is.isError(error) && error.stack === undefined) { + // NOTE: If you are a Sentry user, and you are seeing this stack frame, + // it means the error, that was caused by your fetch call did not + // have a stack trace, so the SDK backfilled the stack trace so + // you can see which fetch call failed. + error.stack = virtualError.stack; + object.addNonEnumerableProperty(error, 'framesToPop', 1); + } + + // NOTE: If you are a Sentry user, and you are seeing this stack frame, + // it means the sentry.javascript SDK caught an error invoking your application code. + // This is expected behavior and NOT indicative of a bug with sentry.javascript. + throw error; + }, + ); + }; + }); +} + +async function resolveResponse(res, onFinishedResolving) { + if (res && res.body) { + const body = res.body; + const responseReader = body.getReader(); + + // Define a maximum duration after which we just cancel + const maxFetchDurationTimeout = setTimeout( + () => { + body.cancel().then(null, () => { + // noop + }); + }, + 90 * 1000, // 90s + ); + + let readingActive = true; + while (readingActive) { + let chunkTimeout; + try { + // abort reading if read op takes more than 5s + chunkTimeout = setTimeout(() => { + body.cancel().then(null, () => { + // noop on error + }); + }, 5000); + + // This .read() call will reject/throw when we abort due to timeouts through `body.cancel()` + const { done } = await responseReader.read(); + + clearTimeout(chunkTimeout); + + if (done) { + onFinishedResolving(); + readingActive = false; + } + } catch (error) { + readingActive = false; + } finally { + clearTimeout(chunkTimeout); + } + } + + clearTimeout(maxFetchDurationTimeout); + + responseReader.releaseLock(); + body.cancel().then(null, () => { + // noop on error + }); + } +} + +function streamHandler(response) { + // clone response for awaiting stream + let clonedResponseForResolving; + try { + clonedResponseForResolving = response.clone(); + } catch (e) { + return; + } + + // eslint-disable-next-line @typescript-eslint/no-floating-promises + resolveResponse(clonedResponseForResolving, () => { + handlers.triggerHandlers('fetch-body-resolved', { + endTimestamp: time.timestampInSeconds() * 1000, + response, + }); + }); +} + +function hasProp(obj, prop) { + return !!obj && typeof obj === 'object' && !!(obj )[prop]; +} + +function getUrlFromResource(resource) { + if (typeof resource === 'string') { + return resource; + } + + if (!resource) { + return ''; + } + + if (hasProp(resource, 'url')) { + return resource.url; + } + + if (resource.toString) { + return resource.toString(); + } + + return ''; +} + +/** + * Parses the fetch arguments to find the used Http method and the url of the request. + * Exported for tests only. + */ +function parseFetchArgs(fetchArgs) { + if (fetchArgs.length === 0) { + return { method: 'GET', url: '' }; + } + + if (fetchArgs.length === 2) { + const [url, options] = fetchArgs ; + + return { + url: getUrlFromResource(url), + method: hasProp(options, 'method') ? String(options.method).toUpperCase() : 'GET', + }; + } + + const arg = fetchArgs[0]; + return { + url: getUrlFromResource(arg ), + method: hasProp(arg, 'method') ? String(arg.method).toUpperCase() : 'GET', + }; +} + +exports.addFetchEndInstrumentationHandler = addFetchEndInstrumentationHandler; +exports.addFetchInstrumentationHandler = addFetchInstrumentationHandler; +exports.parseFetchArgs = parseFetchArgs; +//# sourceMappingURL=fetch.js.map + + +/***/ }), + +/***/ 97033: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const worldwide = __nccwpck_require__(10891); +const handlers = __nccwpck_require__(44639); + +let _oldOnErrorHandler = null; + +/** + * Add an instrumentation handler for when an error is captured by the global error handler. + * + * Use at your own risk, this might break without changelog notice, only used internally. + * @hidden + */ +function addGlobalErrorInstrumentationHandler(handler) { + const type = 'error'; + handlers.addHandler(type, handler); + handlers.maybeInstrument(type, instrumentError); +} + +function instrumentError() { + _oldOnErrorHandler = worldwide.GLOBAL_OBJ.onerror; + + // Note: The reason we are doing window.onerror instead of window.addEventListener('error') + // is that we are using this handler in the Loader Script, to handle buffered errors consistently + worldwide.GLOBAL_OBJ.onerror = function ( + msg, + url, + line, + column, + error, + ) { + const handlerData = { + column, + error, + line, + msg, + url, + }; + handlers.triggerHandlers('error', handlerData); + + if (_oldOnErrorHandler) { + // eslint-disable-next-line prefer-rest-params + return _oldOnErrorHandler.apply(this, arguments); + } + + return false; + }; + + worldwide.GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__ = true; +} + +exports.addGlobalErrorInstrumentationHandler = addGlobalErrorInstrumentationHandler; +//# sourceMappingURL=globalError.js.map + + +/***/ }), + +/***/ 26156: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const worldwide = __nccwpck_require__(10891); +const handlers = __nccwpck_require__(44639); + +let _oldOnUnhandledRejectionHandler = null; + +/** + * Add an instrumentation handler for when an unhandled promise rejection is captured. + * + * Use at your own risk, this might break without changelog notice, only used internally. + * @hidden + */ +function addGlobalUnhandledRejectionInstrumentationHandler( + handler, +) { + const type = 'unhandledrejection'; + handlers.addHandler(type, handler); + handlers.maybeInstrument(type, instrumentUnhandledRejection); +} + +function instrumentUnhandledRejection() { + _oldOnUnhandledRejectionHandler = worldwide.GLOBAL_OBJ.onunhandledrejection; + + // Note: The reason we are doing window.onunhandledrejection instead of window.addEventListener('unhandledrejection') + // is that we are using this handler in the Loader Script, to handle buffered rejections consistently + worldwide.GLOBAL_OBJ.onunhandledrejection = function (e) { + const handlerData = e; + handlers.triggerHandlers('unhandledrejection', handlerData); + + if (_oldOnUnhandledRejectionHandler) { + // eslint-disable-next-line prefer-rest-params + return _oldOnUnhandledRejectionHandler.apply(this, arguments); + } + + return true; + }; + + worldwide.GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true; +} + +exports.addGlobalUnhandledRejectionInstrumentationHandler = addGlobalUnhandledRejectionInstrumentationHandler; +//# sourceMappingURL=globalUnhandledRejection.js.map + + +/***/ }), + +/***/ 44639: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const debugBuild = __nccwpck_require__(87038); +const logger = __nccwpck_require__(38752); +const stacktrace = __nccwpck_require__(85820); + +// We keep the handlers globally +const handlers = {}; +const instrumented = {}; + +/** Add a handler function. */ +function addHandler(type, handler) { + handlers[type] = handlers[type] || []; + (handlers[type] ).push(handler); +} + +/** + * Reset all instrumentation handlers. + * This can be used by tests to ensure we have a clean slate of instrumentation handlers. + */ +function resetInstrumentationHandlers() { + Object.keys(handlers).forEach(key => { + handlers[key ] = undefined; + }); +} + +/** Maybe run an instrumentation function, unless it was already called. */ +function maybeInstrument(type, instrumentFn) { + if (!instrumented[type]) { + instrumented[type] = true; + try { + instrumentFn(); + } catch (e) { + debugBuild.DEBUG_BUILD && logger.logger.error(`Error while instrumenting ${type}`, e); + } + } +} + +/** Trigger handlers for a given instrumentation type. */ +function triggerHandlers(type, data) { + const typeHandlers = type && handlers[type]; + if (!typeHandlers) { + return; + } + + for (const handler of typeHandlers) { + try { + handler(data); + } catch (e) { + debugBuild.DEBUG_BUILD && + logger.logger.error( + `Error while triggering instrumentation handler.\nType: ${type}\nName: ${stacktrace.getFunctionName(handler)}\nError:`, + e, + ); + } + } +} + +exports.addHandler = addHandler; +exports.maybeInstrument = maybeInstrument; +exports.resetInstrumentationHandlers = resetInstrumentationHandlers; +exports.triggerHandlers = triggerHandlers; +//# sourceMappingURL=handlers.js.map + + +/***/ }), + +/***/ 84085: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +// eslint-disable-next-line @typescript-eslint/unbound-method +const objectToString = Object.prototype.toString; + +/** + * Checks whether given value's type is one of a few Error or Error-like + * {@link isError}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isError(wat) { + switch (objectToString.call(wat)) { + case '[object Error]': + case '[object Exception]': + case '[object DOMException]': + case '[object WebAssembly.Exception]': + return true; + default: + return isInstanceOf(wat, Error); + } +} +/** + * Checks whether given value is an instance of the given built-in class. + * + * @param wat The value to be checked + * @param className + * @returns A boolean representing the result. + */ +function isBuiltin(wat, className) { + return objectToString.call(wat) === `[object ${className}]`; +} + +/** + * Checks whether given value's type is ErrorEvent + * {@link isErrorEvent}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isErrorEvent(wat) { + return isBuiltin(wat, 'ErrorEvent'); +} + +/** + * Checks whether given value's type is DOMError + * {@link isDOMError}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isDOMError(wat) { + return isBuiltin(wat, 'DOMError'); +} + +/** + * Checks whether given value's type is DOMException + * {@link isDOMException}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isDOMException(wat) { + return isBuiltin(wat, 'DOMException'); +} + +/** + * Checks whether given value's type is a string + * {@link isString}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isString(wat) { + return isBuiltin(wat, 'String'); +} + +/** + * Checks whether given string is parameterized + * {@link isParameterizedString}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isParameterizedString(wat) { + return ( + typeof wat === 'object' && + wat !== null && + '__sentry_template_string__' in wat && + '__sentry_template_values__' in wat + ); +} + +/** + * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol) + * {@link isPrimitive}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isPrimitive(wat) { + return wat === null || isParameterizedString(wat) || (typeof wat !== 'object' && typeof wat !== 'function'); +} + +/** + * Checks whether given value's type is an object literal, or a class instance. + * {@link isPlainObject}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isPlainObject(wat) { + return isBuiltin(wat, 'Object'); +} + +/** + * Checks whether given value's type is an Event instance + * {@link isEvent}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isEvent(wat) { + return typeof Event !== 'undefined' && isInstanceOf(wat, Event); +} + +/** + * Checks whether given value's type is an Element instance + * {@link isElement}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isElement(wat) { + return typeof Element !== 'undefined' && isInstanceOf(wat, Element); +} + +/** + * Checks whether given value's type is an regexp + * {@link isRegExp}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isRegExp(wat) { + return isBuiltin(wat, 'RegExp'); +} + +/** + * Checks whether given value has a then function. + * @param wat A value to be checked. + */ +function isThenable(wat) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return Boolean(wat && wat.then && typeof wat.then === 'function'); +} + +/** + * Checks whether given value's type is a SyntheticEvent + * {@link isSyntheticEvent}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isSyntheticEvent(wat) { + return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat; +} + +/** + * Checks whether given value's type is an instance of provided constructor. + * {@link isInstanceOf}. + * + * @param wat A value to be checked. + * @param base A constructor to be used in a check. + * @returns A boolean representing the result. + */ +function isInstanceOf(wat, base) { + try { + return wat instanceof base; + } catch (_e) { + return false; + } +} + +/** + * Checks whether given value's type is a Vue ViewModel. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isVueViewModel(wat) { + // Not using Object.prototype.toString because in Vue 3 it would read the instance's Symbol(Symbol.toStringTag) property. + return !!(typeof wat === 'object' && wat !== null && ((wat ).__isVue || (wat )._isVue)); +} + +exports.isDOMError = isDOMError; +exports.isDOMException = isDOMException; +exports.isElement = isElement; +exports.isError = isError; +exports.isErrorEvent = isErrorEvent; +exports.isEvent = isEvent; +exports.isInstanceOf = isInstanceOf; +exports.isParameterizedString = isParameterizedString; +exports.isPlainObject = isPlainObject; +exports.isPrimitive = isPrimitive; +exports.isRegExp = isRegExp; +exports.isString = isString; +exports.isSyntheticEvent = isSyntheticEvent; +exports.isThenable = isThenable; +exports.isVueViewModel = isVueViewModel; +//# sourceMappingURL=is.js.map + + +/***/ }), + +/***/ 52200: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const node = __nccwpck_require__(10116); +const worldwide = __nccwpck_require__(10891); + +/** + * Returns true if we are in the browser. + */ +function isBrowser() { + // eslint-disable-next-line no-restricted-globals + return typeof window !== 'undefined' && (!node.isNodeEnv() || isElectronNodeRenderer()); +} + +// Electron renderers with nodeIntegration enabled are detected as Node.js so we specifically test for them +function isElectronNodeRenderer() { + const process = (worldwide.GLOBAL_OBJ ).process; + return !!process && process.type === 'renderer'; +} + +exports.isBrowser = isBrowser; +//# sourceMappingURL=isBrowser.js.map + + +/***/ }), + +/***/ 38752: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const debugBuild = __nccwpck_require__(87038); +const worldwide = __nccwpck_require__(10891); + +/** Prefix for logging strings */ +const PREFIX = 'Sentry Logger '; + +const CONSOLE_LEVELS = [ + 'debug', + 'info', + 'warn', + 'error', + 'log', + 'assert', + 'trace', +] ; + +/** This may be mutated by the console instrumentation. */ +const originalConsoleMethods + + = {}; + +/** JSDoc */ + +/** + * Temporarily disable sentry console instrumentations. + * + * @param callback The function to run against the original `console` messages + * @returns The results of the callback + */ +function consoleSandbox(callback) { + if (!('console' in worldwide.GLOBAL_OBJ)) { + return callback(); + } + + const console = worldwide.GLOBAL_OBJ.console ; + const wrappedFuncs = {}; + + const wrappedLevels = Object.keys(originalConsoleMethods) ; + + // Restore all wrapped console methods + wrappedLevels.forEach(level => { + const originalConsoleMethod = originalConsoleMethods[level] ; + wrappedFuncs[level] = console[level] ; + console[level] = originalConsoleMethod; + }); + + try { + return callback(); + } finally { + // Revert restoration to wrapped state + wrappedLevels.forEach(level => { + console[level] = wrappedFuncs[level] ; + }); + } +} + +function makeLogger() { + let enabled = false; + const logger = { + enable: () => { + enabled = true; + }, + disable: () => { + enabled = false; + }, + isEnabled: () => enabled, + }; + + if (debugBuild.DEBUG_BUILD) { + CONSOLE_LEVELS.forEach(name => { + logger[name] = (...args) => { + if (enabled) { + consoleSandbox(() => { + worldwide.GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args); + }); + } + }; + }); + } else { + CONSOLE_LEVELS.forEach(name => { + logger[name] = () => undefined; + }); + } + + return logger ; +} + +/** + * This is a logger singleton which either logs things or no-ops if logging is not enabled. + * The logger is a singleton on the carrier, to ensure that a consistent logger is used throughout the SDK. + */ +const logger = worldwide.getGlobalSingleton('logger', makeLogger); + +exports.CONSOLE_LEVELS = CONSOLE_LEVELS; +exports.consoleSandbox = consoleSandbox; +exports.logger = logger; +exports.originalConsoleMethods = originalConsoleMethods; +//# sourceMappingURL=logger.js.map + + +/***/ }), + +/***/ 50981: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/** A simple Least Recently Used map */ +class LRUMap { + + constructor( _maxSize) {this._maxSize = _maxSize; + this._cache = new Map(); + } + + /** Get the current size of the cache */ + get size() { + return this._cache.size; + } + + /** Get an entry or undefined if it was not in the cache. Re-inserts to update the recently used order */ + get(key) { + const value = this._cache.get(key); + if (value === undefined) { + return undefined; + } + // Remove and re-insert to update the order + this._cache.delete(key); + this._cache.set(key, value); + return value; + } + + /** Insert an entry and evict an older entry if we've reached maxSize */ + set(key, value) { + if (this._cache.size >= this._maxSize) { + // keys() returns an iterator in insertion order so keys().next() gives us the oldest key + this._cache.delete(this._cache.keys().next().value); + } + this._cache.set(key, value); + } + + /** Remove an entry and return the entry if it was in the cache */ + remove(key) { + const value = this._cache.get(key); + if (value) { + this._cache.delete(key); + } + return value; + } + + /** Clear all entries */ + clear() { + this._cache.clear(); + } + + /** Get all the keys */ + keys() { + return Array.from(this._cache.keys()); + } + + /** Get all the values */ + values() { + const values = []; + this._cache.forEach(value => values.push(value)); + return values; + } +} + +exports.LRUMap = LRUMap; +//# sourceMappingURL=lru.js.map + + +/***/ }), + +/***/ 13414: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* eslint-disable @typescript-eslint/no-explicit-any */ + +/** + * Helper to decycle json objects + * + * @deprecated This function is deprecated and will be removed in the next major version. + */ +// TODO(v9): Move this function into normalize() directly +function memoBuilder() { + const hasWeakSet = typeof WeakSet === 'function'; + const inner = hasWeakSet ? new WeakSet() : []; + function memoize(obj) { + if (hasWeakSet) { + if (inner.has(obj)) { + return true; + } + inner.add(obj); + return false; + } + // eslint-disable-next-line @typescript-eslint/prefer-for-of + for (let i = 0; i < inner.length; i++) { + const value = inner[i]; + if (value === obj) { + return true; + } + } + inner.push(obj); + return false; + } + + function unmemoize(obj) { + if (hasWeakSet) { + inner.delete(obj); + } else { + for (let i = 0; i < inner.length; i++) { + if (inner[i] === obj) { + inner.splice(i, 1); + break; + } + } + } + } + return [memoize, unmemoize]; +} + +exports.memoBuilder = memoBuilder; +//# sourceMappingURL=memo.js.map + + +/***/ }), + +/***/ 3181: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const object = __nccwpck_require__(16100); +const string = __nccwpck_require__(93529); +const worldwide = __nccwpck_require__(10891); + +/** + * UUID4 generator + * + * @returns string Generated UUID4. + */ +function uuid4() { + const gbl = worldwide.GLOBAL_OBJ ; + const crypto = gbl.crypto || gbl.msCrypto; + + let getRandomByte = () => Math.random() * 16; + try { + if (crypto && crypto.randomUUID) { + return crypto.randomUUID().replace(/-/g, ''); + } + if (crypto && crypto.getRandomValues) { + getRandomByte = () => { + // crypto.getRandomValues might return undefined instead of the typed array + // in old Chromium versions (e.g. 23.0.1235.0 (151422)) + // However, `typedArray` is still filled in-place. + // @see https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues#typedarray + const typedArray = new Uint8Array(1); + crypto.getRandomValues(typedArray); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return typedArray[0]; + }; + } + } catch (_) { + // some runtimes can crash invoking crypto + // https://github.com/getsentry/sentry-javascript/issues/8935 + } + + // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523 + // Concatenating the following numbers as strings results in '10000000100040008000100000000000' + return (([1e7] ) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, c => + // eslint-disable-next-line no-bitwise + ((c ) ^ ((getRandomByte() & 15) >> ((c ) / 4))).toString(16), + ); +} + +function getFirstException(event) { + return event.exception && event.exception.values ? event.exception.values[0] : undefined; +} + +/** + * Extracts either message or type+value from an event that can be used for user-facing logs + * @returns event's description + */ +function getEventDescription(event) { + const { message, event_id: eventId } = event; + if (message) { + return message; + } + + const firstException = getFirstException(event); + if (firstException) { + if (firstException.type && firstException.value) { + return `${firstException.type}: ${firstException.value}`; + } + return firstException.type || firstException.value || eventId || ''; + } + return eventId || ''; +} + +/** + * Adds exception values, type and value to an synthetic Exception. + * @param event The event to modify. + * @param value Value of the exception. + * @param type Type of the exception. + * @hidden + */ +function addExceptionTypeValue(event, value, type) { + const exception = (event.exception = event.exception || {}); + const values = (exception.values = exception.values || []); + const firstException = (values[0] = values[0] || {}); + if (!firstException.value) { + firstException.value = value || ''; + } + if (!firstException.type) { + firstException.type = type || 'Error'; + } +} + +/** + * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed. + * + * @param event The event to modify. + * @param newMechanism Mechanism data to add to the event. + * @hidden + */ +function addExceptionMechanism(event, newMechanism) { + const firstException = getFirstException(event); + if (!firstException) { + return; + } + + const defaultMechanism = { type: 'generic', handled: true }; + const currentMechanism = firstException.mechanism; + firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism }; + + if (newMechanism && 'data' in newMechanism) { + const mergedData = { ...(currentMechanism && currentMechanism.data), ...newMechanism.data }; + firstException.mechanism.data = mergedData; + } +} + +// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string +const SEMVER_REGEXP = + /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/; + +/** + * Represents Semantic Versioning object + */ + +function _parseInt(input) { + return parseInt(input || '', 10); +} + +/** + * Parses input into a SemVer interface + * @param input string representation of a semver version + */ +function parseSemver(input) { + const match = input.match(SEMVER_REGEXP) || []; + const major = _parseInt(match[1]); + const minor = _parseInt(match[2]); + const patch = _parseInt(match[3]); + return { + buildmetadata: match[5], + major: isNaN(major) ? undefined : major, + minor: isNaN(minor) ? undefined : minor, + patch: isNaN(patch) ? undefined : patch, + prerelease: match[4], + }; +} + +/** + * This function adds context (pre/post/line) lines to the provided frame + * + * @param lines string[] containing all lines + * @param frame StackFrame that will be mutated + * @param linesOfContext number of context lines we want to add pre/post + */ +function addContextToFrame(lines, frame, linesOfContext = 5) { + // When there is no line number in the frame, attaching context is nonsensical and will even break grouping + if (frame.lineno === undefined) { + return; + } + + const maxLines = lines.length; + const sourceLine = Math.max(Math.min(maxLines - 1, frame.lineno - 1), 0); + + frame.pre_context = lines + .slice(Math.max(0, sourceLine - linesOfContext), sourceLine) + .map((line) => string.snipLine(line, 0)); + + // We guard here to ensure this is not larger than the existing number of lines + const lineIndex = Math.min(maxLines - 1, sourceLine); + + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + frame.context_line = string.snipLine(lines[lineIndex], frame.colno || 0); + + frame.post_context = lines + .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext) + .map((line) => string.snipLine(line, 0)); +} + +/** + * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object + * in question), and marks it captured if not. + * + * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and + * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so + * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because + * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not + * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This + * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we + * see it. + * + * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on + * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent + * object wrapper forms so that this check will always work. However, because we need to flag the exact object which + * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification + * must be done before the exception captured. + * + * @param A thrown exception to check or flag as having been seen + * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen) + */ +function checkOrSetAlreadyCaught(exception) { + if (isAlreadyCaptured(exception)) { + return true; + } + + try { + // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the + // `ExtraErrorData` integration + object.addNonEnumerableProperty(exception , '__sentry_captured__', true); + } catch (err) { + // `exception` is a primitive, so we can't mark it seen + } + + return false; +} + +function isAlreadyCaptured(exception) { + try { + return (exception ).__sentry_captured__; + } catch (e) {} // eslint-disable-line no-empty +} + +/** + * Checks whether the given input is already an array, and if it isn't, wraps it in one. + * + * @param maybeArray Input to turn into an array, if necessary + * @returns The input, if already an array, or an array with the input as the only element, if not + * + * @deprecated This function has been deprecated and will not be replaced. + */ +function arrayify(maybeArray) { + return Array.isArray(maybeArray) ? maybeArray : [maybeArray]; +} + +exports.addContextToFrame = addContextToFrame; +exports.addExceptionMechanism = addExceptionMechanism; +exports.addExceptionTypeValue = addExceptionTypeValue; +exports.arrayify = arrayify; +exports.checkOrSetAlreadyCaught = checkOrSetAlreadyCaught; +exports.getEventDescription = getEventDescription; +exports.parseSemver = parseSemver; +exports.uuid4 = uuid4; +//# sourceMappingURL=misc.js.map + + +/***/ }), + +/***/ 70169: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const stacktrace = __nccwpck_require__(85820); + +/** + * Does this filename look like it's part of the app code? + */ +function filenameIsInApp(filename, isNative = false) { + const isInternal = + isNative || + (filename && + // It's not internal if it's an absolute linux path + !filename.startsWith('/') && + // It's not internal if it's an absolute windows path + !filename.match(/^[A-Z]:/) && + // It's not internal if the path is starting with a dot + !filename.startsWith('.') && + // It's not internal if the frame has a protocol. In node, this is usually the case if the file got pre-processed with a bundler like webpack + !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//)); // Schema from: https://stackoverflow.com/a/3641782 + + // in_app is all that's not an internal Node function or a module within node_modules + // note that isNative appears to return true even for node core libraries + // see https://github.com/getsentry/raven-node/issues/176 + + return !isInternal && filename !== undefined && !filename.includes('node_modules/'); +} + +/** Node Stack line parser */ +function node(getModule) { + const FILENAME_MATCH = /^\s*[-]{4,}$/; + const FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/; + + // eslint-disable-next-line complexity + return (line) => { + const lineMatch = line.match(FULL_MATCH); + + if (lineMatch) { + let object; + let method; + let functionName; + let typeName; + let methodName; + + if (lineMatch[1]) { + functionName = lineMatch[1]; + + let methodStart = functionName.lastIndexOf('.'); + if (functionName[methodStart - 1] === '.') { + methodStart--; + } + + if (methodStart > 0) { + object = functionName.slice(0, methodStart); + method = functionName.slice(methodStart + 1); + const objectEnd = object.indexOf('.Module'); + if (objectEnd > 0) { + functionName = functionName.slice(objectEnd + 1); + object = object.slice(0, objectEnd); + } + } + typeName = undefined; + } + + if (method) { + typeName = object; + methodName = method; + } + + if (method === '') { + methodName = undefined; + functionName = undefined; + } + + if (functionName === undefined) { + methodName = methodName || stacktrace.UNKNOWN_FUNCTION; + functionName = typeName ? `${typeName}.${methodName}` : methodName; + } + + let filename = lineMatch[2] && lineMatch[2].startsWith('file://') ? lineMatch[2].slice(7) : lineMatch[2]; + const isNative = lineMatch[5] === 'native'; + + // If it's a Windows path, trim the leading slash so that `/C:/foo` becomes `C:/foo` + if (filename && filename.match(/\/[A-Z]:/)) { + filename = filename.slice(1); + } + + if (!filename && lineMatch[5] && !isNative) { + filename = lineMatch[5]; + } + + return { + filename: filename ? decodeURI(filename) : undefined, + module: getModule ? getModule(filename) : undefined, + function: functionName, + lineno: _parseIntOrUndefined(lineMatch[3]), + colno: _parseIntOrUndefined(lineMatch[4]), + in_app: filenameIsInApp(filename || '', isNative), + }; + } + + if (line.match(FILENAME_MATCH)) { + return { + filename: line, + }; + } + + return undefined; + }; +} + +/** + * Node.js stack line parser + * + * This is in @sentry/core so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`. + * This allows it to be used without referencing or importing any node specific code which causes bundlers to complain + */ +function nodeStackLineParser(getModule) { + return [90, node(getModule)]; +} + +function _parseIntOrUndefined(input) { + return parseInt(input || '', 10) || undefined; +} + +exports.filenameIsInApp = filenameIsInApp; +exports.node = node; +exports.nodeStackLineParser = nodeStackLineParser; +//# sourceMappingURL=node-stack-trace.js.map + + +/***/ }), + +/***/ 10116: +/***/ ((module, exports, __nccwpck_require__) => { + +/* module decorator */ module = __nccwpck_require__.nmd(module); +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const env = __nccwpck_require__(11318); + +/** + * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something, + * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere. + */ + + +/** + * Checks whether we're in the Node.js or Browser environment + * + * @returns Answer to given question + */ +function isNodeEnv() { + // explicitly check for browser bundles as those can be optimized statically + // by terser/rollup. + return ( + !env.isBrowserBundle() && + Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]' + ); +} + +/** + * Requires a module which is protected against bundler minification. + * + * @param request The module path to resolve + * @deprecated This function will be removed in the next major version. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function dynamicRequire(mod, request) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return mod.require(request); +} + +/** + * Helper for dynamically loading module that should work with linked dependencies. + * The problem is that we _should_ be using `require(require.resolve(moduleName, { paths: [cwd()] }))` + * However it's _not possible_ to do that with Webpack, as it has to know all the dependencies during + * build time. `require.resolve` is also not available in any other way, so we cannot create, + * a fake helper like we do with `dynamicRequire`. + * + * We always prefer to use local package, thus the value is not returned early from each `try/catch` block. + * That is to mimic the behavior of `require.resolve` exactly. + * + * @param moduleName module name to require + * @param existingModule module to use for requiring + * @returns possibly required module + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function loadModule(moduleName, existingModule = module) { + let mod; + + try { + // eslint-disable-next-line deprecation/deprecation + mod = dynamicRequire(existingModule, moduleName); + } catch (e) { + // no-empty + } + + if (!mod) { + try { + // eslint-disable-next-line deprecation/deprecation + const { cwd } = dynamicRequire(existingModule, 'process'); + // eslint-disable-next-line deprecation/deprecation + mod = dynamicRequire(existingModule, `${cwd()}/node_modules/${moduleName}`) ; + } catch (e) { + // no-empty + } + } + + return mod; +} + +exports.dynamicRequire = dynamicRequire; +exports.isNodeEnv = isNodeEnv; +exports.loadModule = loadModule; +//# sourceMappingURL=node.js.map + + +/***/ }), + +/***/ 65543: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const is = __nccwpck_require__(84085); +const memo = __nccwpck_require__(13414); +const object = __nccwpck_require__(16100); +const stacktrace = __nccwpck_require__(85820); + +/** + * Recursively normalizes the given object. + * + * - Creates a copy to prevent original input mutation + * - Skips non-enumerable properties + * - When stringifying, calls `toJSON` if implemented + * - Removes circular references + * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format + * - Translates known global objects/classes to a string representations + * - Takes care of `Error` object serialization + * - Optionally limits depth of final output + * - Optionally limits number of properties/elements included in any single object/array + * + * @param input The object to be normalized. + * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.) + * @param maxProperties The max number of elements or properties to be included in any single array or + * object in the normalized output. + * @returns A normalized version of the object, or `"**non-serializable**"` if any errors are thrown during normalization. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function normalize(input, depth = 100, maxProperties = +Infinity) { + try { + // since we're at the outermost level, we don't provide a key + return visit('', input, depth, maxProperties); + } catch (err) { + return { ERROR: `**non-serializable** (${err})` }; + } +} + +/** JSDoc */ +function normalizeToSize( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + object, + // Default Node.js REPL depth + depth = 3, + // 100kB, as 200kB is max payload size, so half sounds reasonable + maxSize = 100 * 1024, +) { + const normalized = normalize(object, depth); + + if (jsonSize(normalized) > maxSize) { + return normalizeToSize(object, depth - 1, maxSize); + } + + return normalized ; +} + +/** + * Visits a node to perform normalization on it + * + * @param key The key corresponding to the given node + * @param value The node to be visited + * @param depth Optional number indicating the maximum recursion depth + * @param maxProperties Optional maximum number of properties/elements included in any single object/array + * @param memo Optional Memo class handling decycling + */ +function visit( + key, + value, + depth = +Infinity, + maxProperties = +Infinity, + // eslint-disable-next-line deprecation/deprecation + memo$1 = memo.memoBuilder(), +) { + const [memoize, unmemoize] = memo$1; + + // Get the simple cases out of the way first + if ( + value == null || // this matches null and undefined -> eqeq not eqeqeq + ['boolean', 'string'].includes(typeof value) || + (typeof value === 'number' && Number.isFinite(value)) + ) { + return value ; + } + + const stringified = stringifyValue(key, value); + + // Anything we could potentially dig into more (objects or arrays) will have come back as `"[object XXXX]"`. + // Everything else will have already been serialized, so if we don't see that pattern, we're done. + if (!stringified.startsWith('[object ')) { + return stringified; + } + + // From here on, we can assert that `value` is either an object or an array. + + // Do not normalize objects that we know have already been normalized. As a general rule, the + // "__sentry_skip_normalization__" property should only be used sparingly and only should only be set on objects that + // have already been normalized. + if ((value )['__sentry_skip_normalization__']) { + return value ; + } + + // We can set `__sentry_override_normalization_depth__` on an object to ensure that from there + // We keep a certain amount of depth. + // This should be used sparingly, e.g. we use it for the redux integration to ensure we get a certain amount of state. + const remainingDepth = + typeof (value )['__sentry_override_normalization_depth__'] === 'number' + ? ((value )['__sentry_override_normalization_depth__'] ) + : depth; + + // We're also done if we've reached the max depth + if (remainingDepth === 0) { + // At this point we know `serialized` is a string of the form `"[object XXXX]"`. Clean it up so it's just `"[XXXX]"`. + return stringified.replace('object ', ''); + } + + // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now. + if (memoize(value)) { + return '[Circular ~]'; + } + + // If the value has a `toJSON` method, we call it to extract more information + const valueWithToJSON = value ; + if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') { + try { + const jsonValue = valueWithToJSON.toJSON(); + // We need to normalize the return value of `.toJSON()` in case it has circular references + return visit('', jsonValue, remainingDepth - 1, maxProperties, memo$1); + } catch (err) { + // pass (The built-in `toJSON` failed, but we can still try to do it ourselves) + } + } + + // At this point we know we either have an object or an array, we haven't seen it before, and we're going to recurse + // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each + // property/entry, and keep track of the number of items we add to it. + const normalized = (Array.isArray(value) ? [] : {}) ; + let numAdded = 0; + + // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant + // properties are non-enumerable and otherwise would get missed. + const visitable = object.convertToPlainObject(value ); + + for (const visitKey in visitable) { + // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration. + if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) { + continue; + } + + if (numAdded >= maxProperties) { + normalized[visitKey] = '[MaxProperties ~]'; + break; + } + + // Recursively visit all the child nodes + const visitValue = visitable[visitKey]; + normalized[visitKey] = visit(visitKey, visitValue, remainingDepth - 1, maxProperties, memo$1); + + numAdded++; + } + + // Once we've visited all the branches, remove the parent from memo storage + unmemoize(value); + + // Return accumulated values + return normalized; +} + +/* eslint-disable complexity */ +/** + * Stringify the given value. Handles various known special values and types. + * + * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn + * the number 1231 into "[Object Number]", nor on `null`, as it will throw. + * + * @param value The value to stringify + * @returns A stringified representation of the given value + */ +function stringifyValue( + key, + // this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for + // our internal use, it'll do + value, +) { + try { + if (key === 'domain' && value && typeof value === 'object' && (value )._events) { + return '[Domain]'; + } + + if (key === 'domainEmitter') { + return '[DomainEmitter]'; + } + + // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first + // which won't throw if they are not present. + + if (typeof global !== 'undefined' && value === global) { + return '[Global]'; + } + + // eslint-disable-next-line no-restricted-globals + if (typeof window !== 'undefined' && value === window) { + return '[Window]'; + } + + // eslint-disable-next-line no-restricted-globals + if (typeof document !== 'undefined' && value === document) { + return '[Document]'; + } + + if (is.isVueViewModel(value)) { + return '[VueViewModel]'; + } + + // React's SyntheticEvent thingy + if (is.isSyntheticEvent(value)) { + return '[SyntheticEvent]'; + } + + if (typeof value === 'number' && !Number.isFinite(value)) { + return `[${value}]`; + } + + if (typeof value === 'function') { + return `[Function: ${stacktrace.getFunctionName(value)}]`; + } + + if (typeof value === 'symbol') { + return `[${String(value)}]`; + } + + // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion + if (typeof value === 'bigint') { + return `[BigInt: ${String(value)}]`; + } + + // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting + // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as + // `"[object Object]"`. If we instead look at the constructor's name (which is the same as the name of the class), + // we can make sure that only plain objects come out that way. + const objName = getConstructorName(value); + + // Handle HTML Elements + if (/^HTML(\w*)Element$/.test(objName)) { + return `[HTMLElement: ${objName}]`; + } + + return `[object ${objName}]`; + } catch (err) { + return `**non-serializable** (${err})`; + } +} +/* eslint-enable complexity */ + +function getConstructorName(value) { + const prototype = Object.getPrototypeOf(value); + + return prototype ? prototype.constructor.name : 'null prototype'; +} + +/** Calculates bytes size of input string */ +function utf8Length(value) { + // eslint-disable-next-line no-bitwise + return ~-encodeURI(value).split(/%..|./).length; +} + +/** Calculates bytes size of input object */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function jsonSize(value) { + return utf8Length(JSON.stringify(value)); +} + +/** + * Normalizes URLs in exceptions and stacktraces to a base path so Sentry can fingerprint + * across platforms and working directory. + * + * @param url The URL to be normalized. + * @param basePath The application base path. + * @returns The normalized URL. + */ +function normalizeUrlToBase(url, basePath) { + const escapedBase = basePath + // Backslash to forward + .replace(/\\/g, '/') + // Escape RegExp special characters + .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&'); + + let newUrl = url; + try { + newUrl = decodeURI(url); + } catch (_Oo) { + // Sometime this breaks + } + return ( + newUrl + .replace(/\\/g, '/') + .replace(/webpack:\/?/g, '') // Remove intermediate base path + // eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor + .replace(new RegExp(`(file://)?/*${escapedBase}/*`, 'ig'), 'app:///') + ); +} + +exports.normalize = normalize; +exports.normalizeToSize = normalizeToSize; +exports.normalizeUrlToBase = normalizeUrlToBase; +//# sourceMappingURL=normalize.js.map + + +/***/ }), + +/***/ 16100: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const browser = __nccwpck_require__(24450); +const debugBuild = __nccwpck_require__(87038); +const is = __nccwpck_require__(84085); +const logger = __nccwpck_require__(38752); +const string = __nccwpck_require__(93529); + +/** + * Replace a method in an object with a wrapped version of itself. + * + * @param source An object that contains a method to be wrapped. + * @param name The name of the method to be wrapped. + * @param replacementFactory A higher-order function that takes the original version of the given method and returns a + * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to + * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, )` or `origMethod.apply(this, [])` (rather than being called directly), again to preserve `this`. + * @returns void + */ +function fill(source, name, replacementFactory) { + if (!(name in source)) { + return; + } + + const original = source[name] ; + const wrapped = replacementFactory(original) ; + + // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work + // otherwise it'll throw "TypeError: Object.defineProperties called on non-object" + if (typeof wrapped === 'function') { + markFunctionWrapped(wrapped, original); + } + + try { + source[name] = wrapped; + } catch (e) { + debugBuild.DEBUG_BUILD && logger.logger.log(`Failed to replace method "${name}" in object`, source); + } +} + +/** + * Defines a non-enumerable property on the given object. + * + * @param obj The object on which to set the property + * @param name The name of the property to be set + * @param value The value to which to set the property + */ +function addNonEnumerableProperty(obj, name, value) { + try { + Object.defineProperty(obj, name, { + // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it + value: value, + writable: true, + configurable: true, + }); + } catch (o_O) { + debugBuild.DEBUG_BUILD && logger.logger.log(`Failed to add non-enumerable property "${name}" to object`, obj); + } +} + +/** + * Remembers the original function on the wrapped function and + * patches up the prototype. + * + * @param wrapped the wrapper function + * @param original the original function that gets wrapped + */ +function markFunctionWrapped(wrapped, original) { + try { + const proto = original.prototype || {}; + wrapped.prototype = original.prototype = proto; + addNonEnumerableProperty(wrapped, '__sentry_original__', original); + } catch (o_O) {} // eslint-disable-line no-empty +} + +/** + * This extracts the original function if available. See + * `markFunctionWrapped` for more information. + * + * @param func the function to unwrap + * @returns the unwrapped version of the function if available. + */ +// eslint-disable-next-line @typescript-eslint/ban-types +function getOriginalFunction(func) { + return func.__sentry_original__; +} + +/** + * Encodes given object into url-friendly format + * + * @param object An object that contains serializable values + * @returns string Encoded + * + * @deprecated This function is deprecated and will be removed in the next major version of the SDK. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function urlEncode(object) { + return Object.entries(object) + .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`) + .join('&'); +} + +/** + * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their + * non-enumerable properties attached. + * + * @param value Initial source that we have to transform in order for it to be usable by the serializer + * @returns An Event or Error turned into an object - or the value argument itself, when value is neither an Event nor + * an Error. + */ +function convertToPlainObject(value) + + { + if (is.isError(value)) { + return { + message: value.message, + name: value.name, + stack: value.stack, + ...getOwnProperties(value), + }; + } else if (is.isEvent(value)) { + const newObj + + = { + type: value.type, + target: serializeEventTarget(value.target), + currentTarget: serializeEventTarget(value.currentTarget), + ...getOwnProperties(value), + }; + + if (typeof CustomEvent !== 'undefined' && is.isInstanceOf(value, CustomEvent)) { + newObj.detail = value.detail; + } + + return newObj; + } else { + return value; + } +} + +/** Creates a string representation of the target of an `Event` object */ +function serializeEventTarget(target) { + try { + return is.isElement(target) ? browser.htmlTreeAsString(target) : Object.prototype.toString.call(target); + } catch (_oO) { + return ''; + } +} + +/** Filters out all but an object's own properties */ +function getOwnProperties(obj) { + if (typeof obj === 'object' && obj !== null) { + const extractedProps = {}; + for (const property in obj) { + if (Object.prototype.hasOwnProperty.call(obj, property)) { + extractedProps[property] = (obj )[property]; + } + } + return extractedProps; + } else { + return {}; + } +} + +/** + * Given any captured exception, extract its keys and create a sorted + * and truncated list that will be used inside the event message. + * eg. `Non-error exception captured with keys: foo, bar, baz` + */ +function extractExceptionKeysForMessage(exception, maxLength = 40) { + const keys = Object.keys(convertToPlainObject(exception)); + keys.sort(); + + const firstKey = keys[0]; + + if (!firstKey) { + return '[object has no keys]'; + } + + if (firstKey.length >= maxLength) { + return string.truncate(firstKey, maxLength); + } + + for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) { + const serialized = keys.slice(0, includedKeys).join(', '); + if (serialized.length > maxLength) { + continue; + } + if (includedKeys === keys.length) { + return serialized; + } + return string.truncate(serialized, maxLength); + } + + return ''; +} + +/** + * Given any object, return a new object having removed all fields whose value was `undefined`. + * Works recursively on objects and arrays. + * + * Attention: This function keeps circular references in the returned object. + */ +function dropUndefinedKeys(inputValue) { + // This map keeps track of what already visited nodes map to. + // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular + // references as the input object. + const memoizationMap = new Map(); + + // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API + return _dropUndefinedKeys(inputValue, memoizationMap); +} + +function _dropUndefinedKeys(inputValue, memoizationMap) { + if (isPojo(inputValue)) { + // If this node has already been visited due to a circular reference, return the object it was mapped to in the new object + const memoVal = memoizationMap.get(inputValue); + if (memoVal !== undefined) { + return memoVal ; + } + + const returnValue = {}; + // Store the mapping of this value in case we visit it again, in case of circular data + memoizationMap.set(inputValue, returnValue); + + for (const key of Object.getOwnPropertyNames(inputValue)) { + if (typeof inputValue[key] !== 'undefined') { + returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap); + } + } + + return returnValue ; + } + + if (Array.isArray(inputValue)) { + // If this node has already been visited due to a circular reference, return the array it was mapped to in the new object + const memoVal = memoizationMap.get(inputValue); + if (memoVal !== undefined) { + return memoVal ; + } + + const returnValue = []; + // Store the mapping of this value in case we visit it again, in case of circular data + memoizationMap.set(inputValue, returnValue); + + inputValue.forEach((item) => { + returnValue.push(_dropUndefinedKeys(item, memoizationMap)); + }); + + return returnValue ; + } + + return inputValue; +} + +function isPojo(input) { + if (!is.isPlainObject(input)) { + return false; + } + + try { + const name = (Object.getPrototypeOf(input) ).constructor.name; + return !name || name === 'Object'; + } catch (e2) { + return true; + } +} + +/** + * Ensure that something is an object. + * + * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper + * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives. + * + * @param wat The subject of the objectification + * @returns A version of `wat` which can safely be used with `Object` class methods + */ +function objectify(wat) { + let objectified; + switch (true) { + // this will catch both undefined and null + case wat == undefined: + objectified = new String(wat); + break; + + // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason + // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as + // an object in order to wrap it. + case typeof wat === 'symbol' || typeof wat === 'bigint': + objectified = Object(wat); + break; + + // this will catch the remaining primitives: `String`, `Number`, and `Boolean` + case is.isPrimitive(wat): + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + objectified = new (wat ).constructor(wat); + break; + + // by process of elimination, at this point we know that `wat` must already be an object + default: + objectified = wat; + break; + } + return objectified; +} + +exports.addNonEnumerableProperty = addNonEnumerableProperty; +exports.convertToPlainObject = convertToPlainObject; +exports.dropUndefinedKeys = dropUndefinedKeys; +exports.extractExceptionKeysForMessage = extractExceptionKeysForMessage; +exports.fill = fill; +exports.getOriginalFunction = getOriginalFunction; +exports.markFunctionWrapped = markFunctionWrapped; +exports.objectify = objectify; +exports.urlEncode = urlEncode; +//# sourceMappingURL=object.js.map + + +/***/ }), + +/***/ 94509: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript +// https://github.com/calvinmetcalf/rollup-plugin-node-builtins/blob/63ab8aacd013767445ca299e468d9a60a95328d7/src/es6/path.js +// +// Copyright Joyent, Inc.and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +/** JSDoc */ +function normalizeArray(parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + let up = 0; + for (let i = parts.length - 1; i >= 0; i--) { + const last = parts[i]; + if (last === '.') { + parts.splice(i, 1); + } else if (last === '..') { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (allowAboveRoot) { + for (; up--; up) { + parts.unshift('..'); + } + } + + return parts; +} + +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +const splitPathRe = /^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/; +/** JSDoc */ +function splitPath(filename) { + // Truncate files names greater than 1024 characters to avoid regex dos + // https://github.com/getsentry/sentry-javascript/pull/8737#discussion_r1285719172 + const truncated = filename.length > 1024 ? `${filename.slice(-1024)}` : filename; + const parts = splitPathRe.exec(truncated); + return parts ? parts.slice(1) : []; +} + +// path.resolve([from ...], to) +// posix version +/** JSDoc */ +function resolve(...args) { + let resolvedPath = ''; + let resolvedAbsolute = false; + + for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) { + const path = i >= 0 ? args[i] : '/'; + + // Skip empty entries + if (!path) { + continue; + } + + resolvedPath = `${path}/${resolvedPath}`; + resolvedAbsolute = path.charAt(0) === '/'; + } + + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + + // Normalize the path + resolvedPath = normalizeArray( + resolvedPath.split('/').filter(p => !!p), + !resolvedAbsolute, + ).join('/'); + + return (resolvedAbsolute ? '/' : '') + resolvedPath || '.'; +} + +/** JSDoc */ +function trim(arr) { + let start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') { + break; + } + } + + let end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') { + break; + } + } + + if (start > end) { + return []; + } + return arr.slice(start, end - start + 1); +} + +// path.relative(from, to) +// posix version +/** JSDoc */ +function relative(from, to) { + /* eslint-disable no-param-reassign */ + from = resolve(from).slice(1); + to = resolve(to).slice(1); + /* eslint-enable no-param-reassign */ + + const fromParts = trim(from.split('/')); + const toParts = trim(to.split('/')); + + const length = Math.min(fromParts.length, toParts.length); + let samePartsLength = length; + for (let i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + + let outputParts = []; + for (let i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + + return outputParts.join('/'); +} + +// path.normalize(path) +// posix version +/** JSDoc */ +function normalizePath(path) { + const isPathAbsolute = isAbsolute(path); + const trailingSlash = path.slice(-1) === '/'; + + // Normalize the path + let normalizedPath = normalizeArray( + path.split('/').filter(p => !!p), + !isPathAbsolute, + ).join('/'); + + if (!normalizedPath && !isPathAbsolute) { + normalizedPath = '.'; + } + if (normalizedPath && trailingSlash) { + normalizedPath += '/'; + } + + return (isPathAbsolute ? '/' : '') + normalizedPath; +} + +// posix version +/** JSDoc */ +function isAbsolute(path) { + return path.charAt(0) === '/'; +} + +// posix version +/** JSDoc */ +function join(...args) { + return normalizePath(args.join('/')); +} + +/** JSDoc */ +function dirname(path) { + const result = splitPath(path); + const root = result[0] || ''; + let dir = result[1]; + + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.slice(0, dir.length - 1); + } + + return root + dir; +} + +/** JSDoc */ +function basename(path, ext) { + let f = splitPath(path)[2] || ''; + if (ext && f.slice(ext.length * -1) === ext) { + f = f.slice(0, f.length - ext.length); + } + return f; +} + +exports.basename = basename; +exports.dirname = dirname; +exports.isAbsolute = isAbsolute; +exports.join = join; +exports.normalizePath = normalizePath; +exports.relative = relative; +exports.resolve = resolve; +//# sourceMappingURL=path.js.map + + +/***/ }), + +/***/ 28058: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const error = __nccwpck_require__(66322); +const syncpromise = __nccwpck_require__(15621); + +/** + * Creates an new PromiseBuffer object with the specified limit + * @param limit max number of promises that can be stored in the buffer + */ +function makePromiseBuffer(limit) { + const buffer = []; + + function isReady() { + return limit === undefined || buffer.length < limit; + } + + /** + * Remove a promise from the queue. + * + * @param task Can be any PromiseLike + * @returns Removed promise. + */ + function remove(task) { + return buffer.splice(buffer.indexOf(task), 1)[0] || Promise.resolve(undefined); + } + + /** + * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment. + * + * @param taskProducer A function producing any PromiseLike; In previous versions this used to be `task: + * PromiseLike`, but under that model, Promises were instantly created on the call-site and their executor + * functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By + * requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer + * limit check. + * @returns The original promise. + */ + function add(taskProducer) { + if (!isReady()) { + return syncpromise.rejectedSyncPromise(new error.SentryError('Not adding Promise because buffer limit was reached.')); + } + + // start the task and add its promise to the queue + const task = taskProducer(); + if (buffer.indexOf(task) === -1) { + buffer.push(task); + } + void task + .then(() => remove(task)) + // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike` + // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't + // have promises, so TS has to polyfill when down-compiling.) + .then(null, () => + remove(task).then(null, () => { + // We have to add another catch here because `remove()` starts a new promise chain. + }), + ); + return task; + } + + /** + * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first. + * + * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or + * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to + * `true`. + * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and + * `false` otherwise + */ + function drain(timeout) { + return new syncpromise.SyncPromise((resolve, reject) => { + let counter = buffer.length; + + if (!counter) { + return resolve(true); + } + + // wait for `timeout` ms and then resolve to `false` (if not cancelled first) + const capturedSetTimeout = setTimeout(() => { + if (timeout && timeout > 0) { + resolve(false); + } + }, timeout); + + // if all promises resolve in time, cancel the timer and resolve to `true` + buffer.forEach(item => { + void syncpromise.resolvedSyncPromise(item).then(() => { + if (!--counter) { + clearTimeout(capturedSetTimeout); + resolve(true); + } + }, reject); + }); + }); + } + + return { + $: buffer, + add, + drain, + }; +} + +exports.makePromiseBuffer = makePromiseBuffer; +//# sourceMappingURL=promisebuffer.js.map + + +/***/ }), + +/***/ 37264: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const misc = __nccwpck_require__(3181); + +/** + * Returns a new minimal propagation context. + * + * @deprecated Use `generateTraceId` and `generateSpanId` instead. + */ +function generatePropagationContext() { + return { + traceId: generateTraceId(), + spanId: generateSpanId(), + }; +} + +/** + * Generate a random, valid trace ID. + */ +function generateTraceId() { + return misc.uuid4(); +} + +/** + * Generate a random, valid span ID. + */ +function generateSpanId() { + return misc.uuid4().substring(16); +} + +exports.generatePropagationContext = generatePropagationContext; +exports.generateSpanId = generateSpanId; +exports.generateTraceId = generateTraceId; +//# sourceMappingURL=propagationContext.js.map + + +/***/ }), + +/***/ 78922: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +// Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend + +const DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds + +/** + * Extracts Retry-After value from the request header or returns default value + * @param header string representation of 'Retry-After' header + * @param now current unix timestamp + * + */ +function parseRetryAfterHeader(header, now = Date.now()) { + const headerDelay = parseInt(`${header}`, 10); + if (!isNaN(headerDelay)) { + return headerDelay * 1000; + } + + const headerDate = Date.parse(`${header}`); + if (!isNaN(headerDate)) { + return headerDate - now; + } + + return DEFAULT_RETRY_AFTER; +} + +/** + * Gets the time that the given category is disabled until for rate limiting. + * In case no category-specific limit is set but a general rate limit across all categories is active, + * that time is returned. + * + * @return the time in ms that the category is disabled until or 0 if there's no active rate limit. + */ +function disabledUntil(limits, dataCategory) { + return limits[dataCategory] || limits.all || 0; +} + +/** + * Checks if a category is rate limited + */ +function isRateLimited(limits, dataCategory, now = Date.now()) { + return disabledUntil(limits, dataCategory) > now; +} + +/** + * Update ratelimits from incoming headers. + * + * @return the updated RateLimits object. + */ +function updateRateLimits( + limits, + { statusCode, headers }, + now = Date.now(), +) { + const updatedRateLimits = { + ...limits, + }; + + // "The name is case-insensitive." + // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get + const rateLimitHeader = headers && headers['x-sentry-rate-limits']; + const retryAfterHeader = headers && headers['retry-after']; + + if (rateLimitHeader) { + /** + * rate limit headers are of the form + *

,
,.. + * where each
is of the form + * : : : : + * where + * is a delay in seconds + * is the event type(s) (error, transaction, etc) being rate limited and is of the form + * ;;... + * is what's being limited (org, project, or key) - ignored by SDK + * is an arbitrary string like "org_quota" - ignored by SDK + * Semicolon-separated list of metric namespace identifiers. Defines which namespace(s) will be affected. + * Only present if rate limit applies to the metric_bucket data category. + */ + for (const limit of rateLimitHeader.trim().split(',')) { + const [retryAfter, categories, , , namespaces] = limit.split(':', 5) ; + const headerDelay = parseInt(retryAfter, 10); + const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default + if (!categories) { + updatedRateLimits.all = now + delay; + } else { + for (const category of categories.split(';')) { + if (category === 'metric_bucket') { + // namespaces will be present when category === 'metric_bucket' + if (!namespaces || namespaces.split(';').includes('custom')) { + updatedRateLimits[category] = now + delay; + } + } else { + updatedRateLimits[category] = now + delay; + } + } + } + } + } else if (retryAfterHeader) { + updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now); + } else if (statusCode === 429) { + updatedRateLimits.all = now + 60 * 1000; + } + + return updatedRateLimits; +} + +exports.DEFAULT_RETRY_AFTER = DEFAULT_RETRY_AFTER; +exports.disabledUntil = disabledUntil; +exports.isRateLimited = isRateLimited; +exports.parseRetryAfterHeader = parseRetryAfterHeader; +exports.updateRateLimits = updateRateLimits; +//# sourceMappingURL=ratelimit.js.map + + +/***/ }), + +/***/ 4630: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const cookie = __nccwpck_require__(49298); +const debugBuild = __nccwpck_require__(87038); +const is = __nccwpck_require__(84085); +const logger = __nccwpck_require__(38752); +const normalize = __nccwpck_require__(65543); +const object = __nccwpck_require__(16100); +const string = __nccwpck_require__(93529); +const url = __nccwpck_require__(44673); +const getIpAddress = __nccwpck_require__(51395); + +const DEFAULT_INCLUDES = { + ip: false, + request: true, + user: true, +}; +const DEFAULT_REQUEST_INCLUDES = ['cookies', 'data', 'headers', 'method', 'query_string', 'url']; +const DEFAULT_USER_INCLUDES = ['id', 'username', 'email']; + +/** + * Options deciding what parts of the request to use when enhancing an event + */ + +/** + * Extracts a complete and parameterized path from the request object and uses it to construct transaction name. + * If the parameterized transaction name cannot be extracted, we fall back to the raw URL. + * + * Additionally, this function determines and returns the transaction name source + * + * eg. GET /mountpoint/user/:id + * + * @param req A request object + * @param options What to include in the transaction name (method, path, or a custom route name to be + * used instead of the request's route) + * + * @returns A tuple of the fully constructed transaction name [0] and its source [1] (can be either 'route' or 'url') + * @deprecated This method will be removed in v9. It is not in use anymore. + */ +function extractPathForTransaction( + req, + options = {}, +) { + const method = req.method && req.method.toUpperCase(); + + let path = ''; + let source = 'url'; + + // Check to see if there's a parameterized route we can use (as there is in Express) + if (options.customRoute || req.route) { + path = options.customRoute || `${req.baseUrl || ''}${req.route && req.route.path}`; + source = 'route'; + } + + // Otherwise, just take the original URL + else if (req.originalUrl || req.url) { + path = url.stripUrlQueryAndFragment(req.originalUrl || req.url || ''); + } + + let name = ''; + if (options.method && method) { + name += method; + } + if (options.method && options.path) { + name += ' '; + } + if (options.path && path) { + name += path; + } + + return [name, source]; +} + +function extractUserData( + user + +, + keys, +) { + const extractedUser = {}; + const attributes = Array.isArray(keys) ? keys : DEFAULT_USER_INCLUDES; + + attributes.forEach(key => { + if (user && key in user) { + extractedUser[key] = user[key]; + } + }); + + return extractedUser; +} + +/** + * Normalize data from the request object, accounting for framework differences. + * + * @param req The request object from which to extract data + * @param options.include An optional array of keys to include in the normalized data. Defaults to + * DEFAULT_REQUEST_INCLUDES if not provided. + * @param options.deps Injected, platform-specific dependencies + * @returns An object containing normalized request data + * + * @deprecated Instead manually normalize the request data into a format that fits `addNormalizedRequestDataToEvent`. + */ +function extractRequestData( + req, + options + + = {}, +) { + const { include = DEFAULT_REQUEST_INCLUDES } = options; + const requestData = {}; + + // headers: + // node, express, koa, nextjs: req.headers + const headers = (req.headers || {}) + +; + // method: + // node, express, koa, nextjs: req.method + const method = req.method; + // host: + // express: req.hostname in > 4 and req.host in < 4 + // koa: req.host + // node, nextjs: req.headers.host + // Express 4 mistakenly strips off port number from req.host / req.hostname so we can't rely on them + // See: https://github.com/expressjs/express/issues/3047#issuecomment-236653223 + // Also: https://github.com/getsentry/sentry-javascript/issues/1917 + const host = headers.host || req.hostname || req.host || ''; + // protocol: + // node, nextjs: + // express, koa: req.protocol + const protocol = req.protocol === 'https' || (req.socket && req.socket.encrypted) ? 'https' : 'http'; + // url (including path and query string): + // node, express: req.originalUrl + // koa, nextjs: req.url + const originalUrl = req.originalUrl || req.url || ''; + // absolute url + const absoluteUrl = originalUrl.startsWith(protocol) ? originalUrl : `${protocol}://${host}${originalUrl}`; + include.forEach(key => { + switch (key) { + case 'headers': { + requestData.headers = headers; + + // Remove the Cookie header in case cookie data should not be included in the event + if (!include.includes('cookies')) { + delete (requestData.headers ).cookie; + } + + // Remove IP headers in case IP data should not be included in the event + if (!include.includes('ip')) { + getIpAddress.ipHeaderNames.forEach(ipHeaderName => { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete (requestData.headers )[ipHeaderName]; + }); + } + + break; + } + case 'method': { + requestData.method = method; + break; + } + case 'url': { + requestData.url = absoluteUrl; + break; + } + case 'cookies': { + // cookies: + // node, express, koa: req.headers.cookie + // vercel, sails.js, express (w/ cookie middleware), nextjs: req.cookies + requestData.cookies = + // TODO (v8 / #5257): We're only sending the empty object for backwards compatibility, so the last bit can + // come off in v8 + req.cookies || (headers.cookie && cookie.parseCookie(headers.cookie)) || {}; + break; + } + case 'query_string': { + // query string: + // node: req.url (raw) + // express, koa, nextjs: req.query + requestData.query_string = extractQueryParams(req); + break; + } + case 'data': { + if (method === 'GET' || method === 'HEAD') { + break; + } + // NOTE: As of v8, request is (unless a user sets this manually) ALWAYS a http request + // Which does not have a body by default + // However, in our http instrumentation, we patch the request to capture the body and store it on the + // request as `.body` anyhow + // In v9, we may update requestData to only work with plain http requests + // body data: + // express, koa, nextjs: req.body + // + // when using node by itself, you have to read the incoming stream(see + // https://nodejs.dev/learn/get-http-request-body-data-using-nodejs); if a user is doing that, we can't know + // where they're going to store the final result, so they'll have to capture this data themselves + const body = req.body; + if (body !== undefined) { + const stringBody = is.isString(body) + ? body + : is.isPlainObject(body) + ? JSON.stringify(normalize.normalize(body)) + : string.truncate(`${body}`, 1024); + if (stringBody) { + requestData.data = stringBody; + } + } + break; + } + default: { + if ({}.hasOwnProperty.call(req, key)) { + requestData[key] = (req )[key]; + } + } + } + }); + + return requestData; +} + +/** + * Add already normalized request data to an event. + * This mutates the passed in event. + */ +function addNormalizedRequestDataToEvent( + event, + req, + // This is non-standard data that is not part of the regular HTTP request + additionalData, + options, +) { + const include = { + ...DEFAULT_INCLUDES, + ...(options && options.include), + }; + + if (include.request) { + const includeRequest = Array.isArray(include.request) ? [...include.request] : [...DEFAULT_REQUEST_INCLUDES]; + if (include.ip) { + includeRequest.push('ip'); + } + + const extractedRequestData = extractNormalizedRequestData(req, { include: includeRequest }); + + event.request = { + ...event.request, + ...extractedRequestData, + }; + } + + if (include.user) { + const extractedUser = + additionalData.user && is.isPlainObject(additionalData.user) + ? extractUserData(additionalData.user, include.user) + : {}; + + if (Object.keys(extractedUser).length) { + event.user = { + ...extractedUser, + ...event.user, + }; + } + } + + if (include.ip) { + const ip = (req.headers && getIpAddress.getClientIPAddress(req.headers)) || additionalData.ipAddress; + if (ip) { + event.user = { + ...event.user, + ip_address: ip, + }; + } + } +} + +/** + * Add data from the given request to the given event + * + * @param event The event to which the request data will be added + * @param req Request object + * @param options.include Flags to control what data is included + * @param options.deps Injected platform-specific dependencies + * @returns The mutated `Event` object + * + * @deprecated Use `addNormalizedRequestDataToEvent` instead. + */ +function addRequestDataToEvent( + event, + req, + options, +) { + const include = { + ...DEFAULT_INCLUDES, + ...(options && options.include), + }; + + if (include.request) { + const includeRequest = Array.isArray(include.request) ? [...include.request] : [...DEFAULT_REQUEST_INCLUDES]; + if (include.ip) { + includeRequest.push('ip'); + } + + // eslint-disable-next-line deprecation/deprecation + const extractedRequestData = extractRequestData(req, { include: includeRequest }); + + event.request = { + ...event.request, + ...extractedRequestData, + }; + } + + if (include.user) { + const extractedUser = req.user && is.isPlainObject(req.user) ? extractUserData(req.user, include.user) : {}; + + if (Object.keys(extractedUser).length) { + event.user = { + ...event.user, + ...extractedUser, + }; + } + } + + // client ip: + // node, nextjs: req.socket.remoteAddress + // express, koa: req.ip + // It may also be sent by proxies as specified in X-Forwarded-For or similar headers + if (include.ip) { + const ip = (req.headers && getIpAddress.getClientIPAddress(req.headers)) || req.ip || (req.socket && req.socket.remoteAddress); + if (ip) { + event.user = { + ...event.user, + ip_address: ip, + }; + } + } + + return event; +} + +function extractQueryParams(req) { + // url (including path and query string): + // node, express: req.originalUrl + // koa, nextjs: req.url + let originalUrl = req.originalUrl || req.url || ''; + + if (!originalUrl) { + return; + } + + // The `URL` constructor can't handle internal URLs of the form `/some/path/here`, so stick a dummy protocol and + // hostname on the beginning. Since the point here is just to grab the query string, it doesn't matter what we use. + if (originalUrl.startsWith('/')) { + originalUrl = `http://dogs.are.great${originalUrl}`; + } + + try { + const queryParams = req.query || new URL(originalUrl).search.slice(1); + return queryParams.length ? queryParams : undefined; + } catch (e2) { + return undefined; + } +} + +/** + * Transforms a `Headers` object that implements the `Web Fetch API` (https://developer.mozilla.org/en-US/docs/Web/API/Headers) into a simple key-value dict. + * The header keys will be lower case: e.g. A "Content-Type" header will be stored as "content-type". + */ +// TODO(v8): Make this function return undefined when the extraction fails. +function winterCGHeadersToDict(winterCGHeaders) { + const headers = {}; + try { + winterCGHeaders.forEach((value, key) => { + if (typeof value === 'string') { + // We check that value is a string even though it might be redundant to make sure prototype pollution is not possible. + headers[key] = value; + } + }); + } catch (e) { + debugBuild.DEBUG_BUILD && + logger.logger.warn('Sentry failed extracting headers from a request object. If you see this, please file an issue.'); + } + + return headers; +} + +/** + * Convert common request headers to a simple dictionary. + */ +function headersToDict(reqHeaders) { + const headers = Object.create(null); + + try { + Object.entries(reqHeaders).forEach(([key, value]) => { + if (typeof value === 'string') { + headers[key] = value; + } + }); + } catch (e) { + debugBuild.DEBUG_BUILD && + logger.logger.warn('Sentry failed extracting headers from a request object. If you see this, please file an issue.'); + } + + return headers; +} + +/** + * Converts a `Request` object that implements the `Web Fetch API` (https://developer.mozilla.org/en-US/docs/Web/API/Headers) into the format that the `RequestData` integration understands. + */ +function winterCGRequestToRequestData(req) { + const headers = winterCGHeadersToDict(req.headers); + + return { + method: req.method, + url: req.url, + query_string: extractQueryParamsFromUrl(req.url), + headers, + // TODO: Can we extract body data from the request? + }; +} + +/** + * Convert a HTTP request object to RequestEventData to be passed as normalizedRequest. + * Instead of allowing `PolymorphicRequest` to be passed, + * we want to be more specific and generally require a http.IncomingMessage-like object. + */ +function httpRequestToRequestData(request + +) { + const headers = request.headers || {}; + const host = headers.host || ''; + const protocol = request.socket && (request.socket ).encrypted ? 'https' : 'http'; + const originalUrl = request.url || ''; + const absoluteUrl = originalUrl.startsWith(protocol) ? originalUrl : `${protocol}://${host}${originalUrl}`; + + // This is non-standard, but may be sometimes set + // It may be overwritten later by our own body handling + const data = (request ).body || undefined; + + // This is non-standard, but may be set on e.g. Next.js or Express requests + const cookies = (request ).cookies; + + return object.dropUndefinedKeys({ + url: absoluteUrl, + method: request.method, + query_string: extractQueryParamsFromUrl(originalUrl), + headers: headersToDict(headers), + cookies, + data, + }); +} + +/** Extract the query params from an URL. */ +function extractQueryParamsFromUrl(url) { + // url is path and query string + if (!url) { + return; + } + + try { + // The `URL` constructor can't handle internal URLs of the form `/some/path/here`, so stick a dummy protocol and + // hostname as the base. Since the point here is just to grab the query string, it doesn't matter what we use. + const queryParams = new URL(url, 'http://dogs.are.great').search.slice(1); + return queryParams.length ? queryParams : undefined; + } catch (e3) { + return undefined; + } +} + +function extractNormalizedRequestData( + normalizedRequest, + { include }, +) { + const includeKeys = include ? (Array.isArray(include) ? include : DEFAULT_REQUEST_INCLUDES) : []; + + const requestData = {}; + const headers = { ...normalizedRequest.headers }; + + if (includeKeys.includes('headers')) { + requestData.headers = headers; + + // Remove the Cookie header in case cookie data should not be included in the event + if (!include.includes('cookies')) { + delete (headers ).cookie; + } + + // Remove IP headers in case IP data should not be included in the event + if (!include.includes('ip')) { + getIpAddress.ipHeaderNames.forEach(ipHeaderName => { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete (headers )[ipHeaderName]; + }); + } + } + + if (includeKeys.includes('method')) { + requestData.method = normalizedRequest.method; + } + + if (includeKeys.includes('url')) { + requestData.url = normalizedRequest.url; + } + + if (includeKeys.includes('cookies')) { + const cookies = normalizedRequest.cookies || (headers && headers.cookie ? cookie.parseCookie(headers.cookie) : undefined); + requestData.cookies = cookies || {}; + } + + if (includeKeys.includes('query_string')) { + requestData.query_string = normalizedRequest.query_string; + } + + if (includeKeys.includes('data')) { + requestData.data = normalizedRequest.data; + } + + return requestData; +} + +exports.DEFAULT_USER_INCLUDES = DEFAULT_USER_INCLUDES; +exports.addNormalizedRequestDataToEvent = addNormalizedRequestDataToEvent; +exports.addRequestDataToEvent = addRequestDataToEvent; +exports.extractPathForTransaction = extractPathForTransaction; +exports.extractQueryParamsFromUrl = extractQueryParamsFromUrl; +exports.extractRequestData = extractRequestData; +exports.headersToDict = headersToDict; +exports.httpRequestToRequestData = httpRequestToRequestData; +exports.winterCGHeadersToDict = winterCGHeadersToDict; +exports.winterCGRequestToRequestData = winterCGRequestToRequestData; +//# sourceMappingURL=requestdata.js.map + + +/***/ }), + +/***/ 25753: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/** + * @deprecated This variable has been deprecated and will be removed in the next major version. + */ +const validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug']; + +/** + * Converts a string-based level into a `SeverityLevel`, normalizing it along the way. + * + * @param level String representation of desired `SeverityLevel`. + * @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level. + */ +function severityLevelFromString(level) { + return ( + level === 'warn' ? 'warning' : ['fatal', 'error', 'warning', 'log', 'info', 'debug'].includes(level) ? level : 'log' + ) ; +} + +exports.severityLevelFromString = severityLevelFromString; +exports.validSeverityLevels = validSeverityLevels; +//# sourceMappingURL=severity.js.map + + +/***/ }), + +/***/ 85820: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const STACKTRACE_FRAME_LIMIT = 50; +const UNKNOWN_FUNCTION = '?'; +// Used to sanitize webpack (error: *) wrapped stack errors +const WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/; +const STRIP_FRAME_REGEXP = /captureMessage|captureException/; + +/** + * Creates a stack parser with the supplied line parsers + * + * StackFrames are returned in the correct order for Sentry Exception + * frames and with Sentry SDK internal frames removed from the top and bottom + * + */ +function createStackParser(...parsers) { + const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map(p => p[1]); + + return (stack, skipFirstLines = 0, framesToPop = 0) => { + const frames = []; + const lines = stack.split('\n'); + + for (let i = skipFirstLines; i < lines.length; i++) { + const line = lines[i] ; + // Ignore lines over 1kb as they are unlikely to be stack frames. + // Many of the regular expressions use backtracking which results in run time that increases exponentially with + // input size. Huge strings can result in hangs/Denial of Service: + // https://github.com/getsentry/sentry-javascript/issues/2286 + if (line.length > 1024) { + continue; + } + + // https://github.com/getsentry/sentry-javascript/issues/5459 + // Remove webpack (error: *) wrappers + const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, '$1') : line; + + // https://github.com/getsentry/sentry-javascript/issues/7813 + // Skip Error: lines + if (cleanedLine.match(/\S*Error: /)) { + continue; + } + + for (const parser of sortedParsers) { + const frame = parser(cleanedLine); + + if (frame) { + frames.push(frame); + break; + } + } + + if (frames.length >= STACKTRACE_FRAME_LIMIT + framesToPop) { + break; + } + } + + return stripSentryFramesAndReverse(frames.slice(framesToPop)); + }; +} + +/** + * Gets a stack parser implementation from Options.stackParser + * @see Options + * + * If options contains an array of line parsers, it is converted into a parser + */ +function stackParserFromStackParserOptions(stackParser) { + if (Array.isArray(stackParser)) { + return createStackParser(...stackParser); + } + return stackParser; +} + +/** + * Removes Sentry frames from the top and bottom of the stack if present and enforces a limit of max number of frames. + * Assumes stack input is ordered from top to bottom and returns the reverse representation so call site of the + * function that caused the crash is the last frame in the array. + * @hidden + */ +function stripSentryFramesAndReverse(stack) { + if (!stack.length) { + return []; + } + + const localStack = Array.from(stack); + + // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call) + if (/sentryWrapped/.test(getLastStackFrame(localStack).function || '')) { + localStack.pop(); + } + + // Reversing in the middle of the procedure allows us to just pop the values off the stack + localStack.reverse(); + + // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call) + if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || '')) { + localStack.pop(); + + // When using synthetic events, we will have a 2 levels deep stack, as `new Error('Sentry syntheticException')` + // is produced within the hub itself, making it: + // + // Sentry.captureException() + // getCurrentHub().captureException() + // + // instead of just the top `Sentry` call itself. + // This forces us to possibly strip an additional frame in the exact same was as above. + if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || '')) { + localStack.pop(); + } + } + + return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map(frame => ({ + ...frame, + filename: frame.filename || getLastStackFrame(localStack).filename, + function: frame.function || UNKNOWN_FUNCTION, + })); +} + +function getLastStackFrame(arr) { + return arr[arr.length - 1] || {}; +} + +const defaultFunctionName = ''; + +/** + * Safely extract function name from itself + */ +function getFunctionName(fn) { + try { + if (!fn || typeof fn !== 'function') { + return defaultFunctionName; + } + return fn.name || defaultFunctionName; + } catch (e) { + // Just accessing custom props in some Selenium environments + // can cause a "Permission denied" exception (see raven-js#495). + return defaultFunctionName; + } +} + +/** + * Get's stack frames from an event without needing to check for undefined properties. + */ +function getFramesFromEvent(event) { + const exception = event.exception; + + if (exception) { + const frames = []; + try { + // @ts-expect-error Object could be undefined + exception.values.forEach(value => { + // @ts-expect-error Value could be undefined + if (value.stacktrace.frames) { + // @ts-expect-error Value could be undefined + frames.push(...value.stacktrace.frames); + } + }); + return frames; + } catch (_oO) { + return undefined; + } + } + return undefined; +} + +exports.UNKNOWN_FUNCTION = UNKNOWN_FUNCTION; +exports.createStackParser = createStackParser; +exports.getFramesFromEvent = getFramesFromEvent; +exports.getFunctionName = getFunctionName; +exports.stackParserFromStackParserOptions = stackParserFromStackParserOptions; +exports.stripSentryFramesAndReverse = stripSentryFramesAndReverse; +//# sourceMappingURL=stacktrace.js.map + + +/***/ }), + +/***/ 93529: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const is = __nccwpck_require__(84085); + +/** + * Truncates given string to the maximum characters count + * + * @param str An object that contains serializable values + * @param max Maximum number of characters in truncated string (0 = unlimited) + * @returns string Encoded + */ +function truncate(str, max = 0) { + if (typeof str !== 'string' || max === 0) { + return str; + } + return str.length <= max ? str : `${str.slice(0, max)}...`; +} + +/** + * This is basically just `trim_line` from + * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67 + * + * @param str An object that contains serializable values + * @param max Maximum number of characters in truncated string + * @returns string Encoded + */ +function snipLine(line, colno) { + let newLine = line; + const lineLength = newLine.length; + if (lineLength <= 150) { + return newLine; + } + if (colno > lineLength) { + // eslint-disable-next-line no-param-reassign + colno = lineLength; + } + + let start = Math.max(colno - 60, 0); + if (start < 5) { + start = 0; + } + + let end = Math.min(start + 140, lineLength); + if (end > lineLength - 5) { + end = lineLength; + } + if (end === lineLength) { + start = Math.max(end - 140, 0); + } + + newLine = newLine.slice(start, end); + if (start > 0) { + newLine = `'{snip} ${newLine}`; + } + if (end < lineLength) { + newLine += ' {snip}'; + } + + return newLine; +} + +/** + * Join values in array + * @param input array of values to be joined together + * @param delimiter string to be placed in-between values + * @returns Joined values + */ +function safeJoin(input, delimiter) { + if (!Array.isArray(input)) { + return ''; + } + + const output = []; + // eslint-disable-next-line @typescript-eslint/prefer-for-of + for (let i = 0; i < input.length; i++) { + const value = input[i]; + try { + // This is a hack to fix a Vue3-specific bug that causes an infinite loop of + // console warnings. This happens when a Vue template is rendered with + // an undeclared variable, which we try to stringify, ultimately causing + // Vue to issue another warning which repeats indefinitely. + // see: https://github.com/getsentry/sentry-javascript/pull/8981 + if (is.isVueViewModel(value)) { + output.push('[VueViewModel]'); + } else { + output.push(String(value)); + } + } catch (e) { + output.push('[value cannot be serialized]'); + } + } + + return output.join(delimiter); +} + +/** + * Checks if the given value matches a regex or string + * + * @param value The string to test + * @param pattern Either a regex or a string against which `value` will be matched + * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match + * `pattern` if it contains `pattern`. Only applies to string-type patterns. + */ +function isMatchingPattern( + value, + pattern, + requireExactStringMatch = false, +) { + if (!is.isString(value)) { + return false; + } + + if (is.isRegExp(pattern)) { + return pattern.test(value); + } + if (is.isString(pattern)) { + return requireExactStringMatch ? value === pattern : value.includes(pattern); + } + + return false; +} + +/** + * Test the given string against an array of strings and regexes. By default, string matching is done on a + * substring-inclusion basis rather than a strict equality basis + * + * @param testString The string to test + * @param patterns The patterns against which to test the string + * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to + * count. If false, `testString` will match a string pattern if it contains that pattern. + * @returns + */ +function stringMatchesSomePattern( + testString, + patterns = [], + requireExactStringMatch = false, +) { + return patterns.some(pattern => isMatchingPattern(testString, pattern, requireExactStringMatch)); +} + +exports.isMatchingPattern = isMatchingPattern; +exports.safeJoin = safeJoin; +exports.snipLine = snipLine; +exports.stringMatchesSomePattern = stringMatchesSomePattern; +exports.truncate = truncate; +//# sourceMappingURL=string.js.map + + +/***/ }), + +/***/ 73872: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const debugBuild = __nccwpck_require__(87038); +const logger = __nccwpck_require__(38752); +const worldwide = __nccwpck_require__(10891); + +const WINDOW = worldwide.GLOBAL_OBJ ; + +/** + * Tells whether current environment supports ErrorEvent objects + * {@link supportsErrorEvent}. + * + * @returns Answer to the given question. + */ +function supportsErrorEvent() { + try { + new ErrorEvent(''); + return true; + } catch (e) { + return false; + } +} + +/** + * Tells whether current environment supports DOMError objects + * {@link supportsDOMError}. + * + * @returns Answer to the given question. + */ +function supportsDOMError() { + try { + // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError': + // 1 argument required, but only 0 present. + // @ts-expect-error It really needs 1 argument, not 0. + new DOMError(''); + return true; + } catch (e) { + return false; + } +} + +/** + * Tells whether current environment supports DOMException objects + * {@link supportsDOMException}. + * + * @returns Answer to the given question. + */ +function supportsDOMException() { + try { + new DOMException(''); + return true; + } catch (e) { + return false; + } +} + +/** + * Tells whether current environment supports Fetch API + * {@link supportsFetch}. + * + * @returns Answer to the given question. + */ +function supportsFetch() { + if (!('fetch' in WINDOW)) { + return false; + } + + try { + new Headers(); + new Request('http://www.example.com'); + new Response(); + return true; + } catch (e) { + return false; + } +} + +/** + * isNative checks if the given function is a native implementation + */ +// eslint-disable-next-line @typescript-eslint/ban-types +function isNativeFunction(func) { + return func && /^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString()); +} + +/** + * Tells whether current environment supports Fetch API natively + * {@link supportsNativeFetch}. + * + * @returns true if `window.fetch` is natively implemented, false otherwise + */ +function supportsNativeFetch() { + if (typeof EdgeRuntime === 'string') { + return true; + } + + if (!supportsFetch()) { + return false; + } + + // Fast path to avoid DOM I/O + // eslint-disable-next-line @typescript-eslint/unbound-method + if (isNativeFunction(WINDOW.fetch)) { + return true; + } + + // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension) + // so create a "pure" iframe to see if that has native fetch + let result = false; + const doc = WINDOW.document; + // eslint-disable-next-line deprecation/deprecation + if (doc && typeof (doc.createElement ) === 'function') { + try { + const sandbox = doc.createElement('iframe'); + sandbox.hidden = true; + doc.head.appendChild(sandbox); + if (sandbox.contentWindow && sandbox.contentWindow.fetch) { + // eslint-disable-next-line @typescript-eslint/unbound-method + result = isNativeFunction(sandbox.contentWindow.fetch); + } + doc.head.removeChild(sandbox); + } catch (err) { + debugBuild.DEBUG_BUILD && + logger.logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err); + } + } + + return result; +} + +/** + * Tells whether current environment supports ReportingObserver API + * {@link supportsReportingObserver}. + * + * @returns Answer to the given question. + */ +function supportsReportingObserver() { + return 'ReportingObserver' in WINDOW; +} + +/** + * Tells whether current environment supports Referrer Policy API + * {@link supportsReferrerPolicy}. + * + * @returns Answer to the given question. + */ +function supportsReferrerPolicy() { + // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default' + // (see https://caniuse.com/#feat=referrer-policy), + // it doesn't. And it throws an exception instead of ignoring this parameter... + // REF: https://github.com/getsentry/raven-js/issues/1233 + + if (!supportsFetch()) { + return false; + } + + try { + new Request('_', { + referrerPolicy: 'origin' , + }); + return true; + } catch (e) { + return false; + } +} + +exports.isNativeFunction = isNativeFunction; +exports.supportsDOMError = supportsDOMError; +exports.supportsDOMException = supportsDOMException; +exports.supportsErrorEvent = supportsErrorEvent; +exports.supportsFetch = supportsFetch; +exports.supportsNativeFetch = supportsNativeFetch; +exports.supportsReferrerPolicy = supportsReferrerPolicy; +exports.supportsReportingObserver = supportsReportingObserver; +//# sourceMappingURL=supports.js.map + + +/***/ }), + +/***/ 15621: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const is = __nccwpck_require__(84085); + +/* eslint-disable @typescript-eslint/explicit-function-return-type */ +/* eslint-disable @typescript-eslint/no-explicit-any */ + +/** SyncPromise internal states */ +var States; (function (States) { + /** Pending */ + const PENDING = 0; States[States["PENDING"] = PENDING] = "PENDING"; + /** Resolved / OK */ + const RESOLVED = 1; States[States["RESOLVED"] = RESOLVED] = "RESOLVED"; + /** Rejected / Error */ + const REJECTED = 2; States[States["REJECTED"] = REJECTED] = "REJECTED"; +})(States || (States = {})); + +// Overloads so we can call resolvedSyncPromise without arguments and generic argument + +/** + * Creates a resolved sync promise. + * + * @param value the value to resolve the promise with + * @returns the resolved sync promise + */ +function resolvedSyncPromise(value) { + return new SyncPromise(resolve => { + resolve(value); + }); +} + +/** + * Creates a rejected sync promise. + * + * @param value the value to reject the promise with + * @returns the rejected sync promise + */ +function rejectedSyncPromise(reason) { + return new SyncPromise((_, reject) => { + reject(reason); + }); +} + +/** + * Thenable class that behaves like a Promise and follows it's interface + * but is not async internally + */ +class SyncPromise { + + constructor( + executor, + ) {SyncPromise.prototype.__init.call(this);SyncPromise.prototype.__init2.call(this);SyncPromise.prototype.__init3.call(this);SyncPromise.prototype.__init4.call(this); + this._state = States.PENDING; + this._handlers = []; + + try { + executor(this._resolve, this._reject); + } catch (e) { + this._reject(e); + } + } + + /** JSDoc */ + then( + onfulfilled, + onrejected, + ) { + return new SyncPromise((resolve, reject) => { + this._handlers.push([ + false, + result => { + if (!onfulfilled) { + // TODO: ¯\_(ツ)_/¯ + // TODO: FIXME + resolve(result ); + } else { + try { + resolve(onfulfilled(result)); + } catch (e) { + reject(e); + } + } + }, + reason => { + if (!onrejected) { + reject(reason); + } else { + try { + resolve(onrejected(reason)); + } catch (e) { + reject(e); + } + } + }, + ]); + this._executeHandlers(); + }); + } + + /** JSDoc */ + catch( + onrejected, + ) { + return this.then(val => val, onrejected); + } + + /** JSDoc */ + finally(onfinally) { + return new SyncPromise((resolve, reject) => { + let val; + let isRejected; + + return this.then( + value => { + isRejected = false; + val = value; + if (onfinally) { + onfinally(); + } + }, + reason => { + isRejected = true; + val = reason; + if (onfinally) { + onfinally(); + } + }, + ).then(() => { + if (isRejected) { + reject(val); + return; + } + + resolve(val ); + }); + }); + } + + /** JSDoc */ + __init() {this._resolve = (value) => { + this._setResult(States.RESOLVED, value); + };} + + /** JSDoc */ + __init2() {this._reject = (reason) => { + this._setResult(States.REJECTED, reason); + };} + + /** JSDoc */ + __init3() {this._setResult = (state, value) => { + if (this._state !== States.PENDING) { + return; + } + + if (is.isThenable(value)) { + void (value ).then(this._resolve, this._reject); + return; + } + + this._state = state; + this._value = value; + + this._executeHandlers(); + };} + + /** JSDoc */ + __init4() {this._executeHandlers = () => { + if (this._state === States.PENDING) { + return; + } + + const cachedHandlers = this._handlers.slice(); + this._handlers = []; + + cachedHandlers.forEach(handler => { + if (handler[0]) { + return; + } + + if (this._state === States.RESOLVED) { + handler[1](this._value ); + } + + if (this._state === States.REJECTED) { + handler[2](this._value); + } + + handler[0] = true; + }); + };} +} + +exports.SyncPromise = SyncPromise; +exports.rejectedSyncPromise = rejectedSyncPromise; +exports.resolvedSyncPromise = resolvedSyncPromise; +//# sourceMappingURL=syncpromise.js.map + + +/***/ }), + +/***/ 75872: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const worldwide = __nccwpck_require__(10891); + +const ONE_SECOND_IN_MS = 1000; + +/** + * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance} + * for accessing a high-resolution monotonic clock. + */ + +/** + * Returns a timestamp in seconds since the UNIX epoch using the Date API. + * + * TODO(v8): Return type should be rounded. + */ +function dateTimestampInSeconds() { + return Date.now() / ONE_SECOND_IN_MS; +} + +/** + * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not + * support the API. + * + * Wrapping the native API works around differences in behavior from different browsers. + */ +function createUnixTimestampInSecondsFunc() { + const { performance } = worldwide.GLOBAL_OBJ ; + if (!performance || !performance.now) { + return dateTimestampInSeconds; + } + + // Some browser and environments don't have a timeOrigin, so we fallback to + // using Date.now() to compute the starting time. + const approxStartingTimeOrigin = Date.now() - performance.now(); + const timeOrigin = performance.timeOrigin == undefined ? approxStartingTimeOrigin : performance.timeOrigin; + + // performance.now() is a monotonic clock, which means it starts at 0 when the process begins. To get the current + // wall clock time (actual UNIX timestamp), we need to add the starting time origin and the current time elapsed. + // + // TODO: This does not account for the case where the monotonic clock that powers performance.now() drifts from the + // wall clock time, which causes the returned timestamp to be inaccurate. We should investigate how to detect and + // correct for this. + // See: https://github.com/getsentry/sentry-javascript/issues/2590 + // See: https://github.com/mdn/content/issues/4713 + // See: https://dev.to/noamr/when-a-millisecond-is-not-a-millisecond-3h6 + return () => { + return (timeOrigin + performance.now()) / ONE_SECOND_IN_MS; + }; +} + +/** + * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the + * availability of the Performance API. + * + * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is + * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The + * skew can grow to arbitrary amounts like days, weeks or months. + * See https://github.com/getsentry/sentry-javascript/issues/2590. + */ +const timestampInSeconds = createUnixTimestampInSecondsFunc(); + +/** + * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only. + * + * @deprecated This variable will be removed in the next major version. + */ +exports._browserPerformanceTimeOriginMode = void 0; + +/** + * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the + * performance API is available. + */ +const browserPerformanceTimeOrigin = (() => { + // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or + // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin + // data as reliable if they are within a reasonable threshold of the current time. + + const { performance } = worldwide.GLOBAL_OBJ ; + if (!performance || !performance.now) { + // eslint-disable-next-line deprecation/deprecation + exports._browserPerformanceTimeOriginMode = 'none'; + return undefined; + } + + const threshold = 3600 * 1000; + const performanceNow = performance.now(); + const dateNow = Date.now(); + + // if timeOrigin isn't available set delta to threshold so it isn't used + const timeOriginDelta = performance.timeOrigin + ? Math.abs(performance.timeOrigin + performanceNow - dateNow) + : threshold; + const timeOriginIsReliable = timeOriginDelta < threshold; + + // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin + // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing. + // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always + // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the + // Date API. + // eslint-disable-next-line deprecation/deprecation + const navigationStart = performance.timing && performance.timing.navigationStart; + const hasNavigationStart = typeof navigationStart === 'number'; + // if navigationStart isn't available set delta to threshold so it isn't used + const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold; + const navigationStartIsReliable = navigationStartDelta < threshold; + + if (timeOriginIsReliable || navigationStartIsReliable) { + // Use the more reliable time origin + if (timeOriginDelta <= navigationStartDelta) { + // eslint-disable-next-line deprecation/deprecation + exports._browserPerformanceTimeOriginMode = 'timeOrigin'; + return performance.timeOrigin; + } else { + // eslint-disable-next-line deprecation/deprecation + exports._browserPerformanceTimeOriginMode = 'navigationStart'; + return navigationStart; + } + } + + // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date. + // eslint-disable-next-line deprecation/deprecation + exports._browserPerformanceTimeOriginMode = 'dateNow'; + return dateNow; +})(); + +exports.browserPerformanceTimeOrigin = browserPerformanceTimeOrigin; +exports.dateTimestampInSeconds = dateTimestampInSeconds; +exports.timestampInSeconds = timestampInSeconds; +//# sourceMappingURL=time.js.map + + +/***/ }), + +/***/ 15977: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const baggage = __nccwpck_require__(86741); +const propagationContext = __nccwpck_require__(37264); + +// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor -- RegExp is used for readability here +const TRACEPARENT_REGEXP = new RegExp( + '^[ \\t]*' + // whitespace + '([0-9a-f]{32})?' + // trace_id + '-?([0-9a-f]{16})?' + // span_id + '-?([01])?' + // sampled + '[ \\t]*$', // whitespace +); + +/** + * Extract transaction context data from a `sentry-trace` header. + * + * @param traceparent Traceparent string + * + * @returns Object containing data from the header, or undefined if traceparent string is malformed + */ +function extractTraceparentData(traceparent) { + if (!traceparent) { + return undefined; + } + + const matches = traceparent.match(TRACEPARENT_REGEXP); + if (!matches) { + return undefined; + } + + let parentSampled; + if (matches[3] === '1') { + parentSampled = true; + } else if (matches[3] === '0') { + parentSampled = false; + } + + return { + traceId: matches[1], + parentSampled, + parentSpanId: matches[2], + }; +} + +/** + * Create a propagation context from incoming headers or + * creates a minimal new one if the headers are undefined. + */ +function propagationContextFromHeaders( + sentryTrace, + baggage$1, +) { + const traceparentData = extractTraceparentData(sentryTrace); + const dynamicSamplingContext = baggage.baggageHeaderToDynamicSamplingContext(baggage$1); + + if (!traceparentData || !traceparentData.traceId) { + return { traceId: propagationContext.generateTraceId(), spanId: propagationContext.generateSpanId() }; + } + + const { traceId, parentSpanId, parentSampled } = traceparentData; + + const virtualSpanId = propagationContext.generateSpanId(); + + return { + traceId, + parentSpanId, + spanId: virtualSpanId, + sampled: parentSampled, + dsc: dynamicSamplingContext || {}, // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it + }; +} + +/** + * Create sentry-trace header from span context values. + */ +function generateSentryTraceHeader( + traceId = propagationContext.generateTraceId(), + spanId = propagationContext.generateSpanId(), + sampled, +) { + let sampledString = ''; + if (sampled !== undefined) { + sampledString = sampled ? '-1' : '-0'; + } + return `${traceId}-${spanId}${sampledString}`; +} + +exports.TRACEPARENT_REGEXP = TRACEPARENT_REGEXP; +exports.extractTraceparentData = extractTraceparentData; +exports.generateSentryTraceHeader = generateSentryTraceHeader; +exports.propagationContextFromHeaders = propagationContextFromHeaders; +//# sourceMappingURL=tracing.js.map + + +/***/ }), + +/***/ 44673: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/** + * Parses string form of URL into an object + * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B + * // intentionally using regex and not href parsing trick because React Native and other + * // environments where DOM might not be available + * @returns parsed URL object + */ +function parseUrl(url) { + if (!url) { + return {}; + } + + const match = url.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/); + + if (!match) { + return {}; + } + + // coerce to undefined values to empty string so we don't get 'undefined' + const query = match[6] || ''; + const fragment = match[8] || ''; + return { + host: match[4], + path: match[5], + protocol: match[2], + search: query, + hash: fragment, + relative: match[5] + query + fragment, // everything minus origin + }; +} + +/** + * Strip the query string and fragment off of a given URL or path (if present) + * + * @param urlPath Full URL or path, including possible query string and/or fragment + * @returns URL or path without query string or fragment + */ +function stripUrlQueryAndFragment(urlPath) { + return (urlPath.split(/[?#]/, 1) )[0]; +} + +/** + * Returns number of URL segments of a passed string URL. + * + * @deprecated This function will be removed in the next major version. + */ +// TODO(v9): Hoist this function into the places where we use it. (as it stands only react router v6 instrumentation) +function getNumberOfUrlSegments(url) { + // split at '/' or at '\/' to split regex urls correctly + return url.split(/\\?\//).filter(s => s.length > 0 && s !== ',').length; +} + +/** + * Takes a URL object and returns a sanitized string which is safe to use as span name + * see: https://develop.sentry.dev/sdk/data-handling/#structuring-data + */ +function getSanitizedUrlString(url) { + const { protocol, host, path } = url; + + const filteredHost = + (host && + host + // Always filter out authority + .replace(/^.*@/, '[filtered]:[filtered]@') + // Don't show standard :80 (http) and :443 (https) ports to reduce the noise + // TODO: Use new URL global if it exists + .replace(/(:80)$/, '') + .replace(/(:443)$/, '')) || + ''; + + return `${protocol ? `${protocol}://` : ''}${filteredHost}${path}`; +} + +exports.getNumberOfUrlSegments = getNumberOfUrlSegments; +exports.getSanitizedUrlString = getSanitizedUrlString; +exports.parseUrl = parseUrl; +exports.stripUrlQueryAndFragment = stripUrlQueryAndFragment; +//# sourceMappingURL=url.js.map + + +/***/ }), + +/***/ 20677: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +// Based on https://github.com/sindresorhus/escape-string-regexp but with modifications to: +// a) reduce the size by skipping the runtime type - checking +// b) ensure it gets down - compiled for old versions of Node(the published package only supports Node 14+). +// +// MIT License +// +// Copyright (c) Sindre Sorhus (https://sindresorhus.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files(the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions of +// the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO +// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. + +/** + * Given a string, escape characters which have meaning in the regex grammar, such that the result is safe to feed to + * `new RegExp()`. + * + * @param regexString The string to escape + * @returns An version of the string with all special regex characters escaped + */ +function escapeStringForRegex(regexString) { + // escape the hyphen separately so we can also replace it with a unicode literal hyphen, to avoid the problems + // discussed in https://github.com/sindresorhus/escape-string-regexp/issues/20. + return regexString.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d'); +} + +exports.escapeStringForRegex = escapeStringForRegex; +//# sourceMappingURL=escapeStringForRegex.js.map + + +/***/ }), + +/***/ 51395: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +// Vendored / modified from @sergiodxa/remix-utils + +// https://github.com/sergiodxa/remix-utils/blob/02af80e12829a53696bfa8f3c2363975cf59f55e/src/server/get-client-ip-address.ts +// MIT License + +// Copyright (c) 2021 Sergio Xalambrí + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +// The headers to check, in priority order +const ipHeaderNames = [ + 'X-Client-IP', + 'X-Forwarded-For', + 'Fly-Client-IP', + 'CF-Connecting-IP', + 'Fastly-Client-Ip', + 'True-Client-Ip', + 'X-Real-IP', + 'X-Cluster-Client-IP', + 'X-Forwarded', + 'Forwarded-For', + 'Forwarded', + 'X-Vercel-Forwarded-For', +]; + +/** + * Get the IP address of the client sending a request. + * + * It receives a Request headers object and use it to get the + * IP address from one of the following headers in order. + * + * If the IP address is valid, it will be returned. Otherwise, null will be + * returned. + * + * If the header values contains more than one IP address, the first valid one + * will be returned. + */ +function getClientIPAddress(headers) { + // This will end up being Array because of the various possible values a header + // can take + const headerValues = ipHeaderNames.map((headerName) => { + const rawValue = headers[headerName]; + const value = Array.isArray(rawValue) ? rawValue.join(';') : rawValue; + + if (headerName === 'Forwarded') { + return parseForwardedHeader(value); + } + + return value && value.split(',').map((v) => v.trim()); + }); + + // Flatten the array and filter out any falsy entries + const flattenedHeaderValues = headerValues.reduce((acc, val) => { + if (!val) { + return acc; + } + + return acc.concat(val); + }, []); + + // Find the first value which is a valid IP address, if any + const ipAddress = flattenedHeaderValues.find(ip => ip !== null && isIP(ip)); + + return ipAddress || null; +} + +function parseForwardedHeader(value) { + if (!value) { + return null; + } + + for (const part of value.split(';')) { + if (part.startsWith('for=')) { + return part.slice(4); + } + } + + return null; +} + +// +/** + * Custom method instead of importing this from `net` package, as this only exists in node + * Accepts: + * 127.0.0.1 + * 192.168.1.1 + * 192.168.1.255 + * 255.255.255.255 + * 10.1.1.1 + * 0.0.0.0 + * 2b01:cb19:8350:ed00:d0dd:fa5b:de31:8be5 + * + * Rejects: + * 1.1.1.01 + * 30.168.1.255.1 + * 127.1 + * 192.168.1.256 + * -1.2.3.4 + * 1.1.1.1. + * 3...3 + * 192.168.1.099 + */ +function isIP(str) { + const regex = + /(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$)/; + return regex.test(str); +} + +exports.getClientIPAddress = getClientIPAddress; +exports.ipHeaderNames = ipHeaderNames; +//# sourceMappingURL=getIpAddress.js.map + + +/***/ }), + +/***/ 86017: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const worldwide = __nccwpck_require__(10891); + +// Based on https://github.com/angular/angular.js/pull/13945/files +// The MIT License + + +const WINDOW = worldwide.GLOBAL_OBJ ; + +/** + * Tells whether current environment supports History API + * {@link supportsHistory}. + * + * @returns Answer to the given question. + */ +function supportsHistory() { + // NOTE: in Chrome App environment, touching history.pushState, *even inside + // a try/catch block*, will cause Chrome to output an error to console.error + // borrowed from: https://github.com/angular/angular.js/pull/13945/files + // TODO(v9): Remove this custom check, it is pretty old and likely not needed anymore + const chromeVar = (WINDOW ).chrome; + const isChromePackagedApp = chromeVar && chromeVar.app && chromeVar.app.runtime; + const hasHistoryApi = 'history' in WINDOW && !!WINDOW.history.pushState && !!WINDOW.history.replaceState; + + return !isChromePackagedApp && hasHistoryApi; +} + +exports.supportsHistory = supportsHistory; +//# sourceMappingURL=supportsHistory.js.map + + +/***/ }), + +/***/ 77437: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const worldwide = __nccwpck_require__(10891); + +/** + * Function that delays closing of a Vercel lambda until the provided promise is resolved. + * + * Vendored from https://www.npmjs.com/package/@vercel/functions + */ +function vercelWaitUntil(task) { + const vercelRequestContextGlobal = + // @ts-expect-error This is not typed + worldwide.GLOBAL_OBJ[Symbol.for('@vercel/request-context')]; + + const ctx = + vercelRequestContextGlobal && vercelRequestContextGlobal.get && vercelRequestContextGlobal.get() + ? vercelRequestContextGlobal.get() + : {}; + + if (ctx && ctx.waitUntil) { + ctx.waitUntil(task); + } +} + +exports.vercelWaitUntil = vercelWaitUntil; +//# sourceMappingURL=vercelWaitUntil.js.map + + +/***/ }), + +/***/ 17370: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +// This is a magic string replaced by rollup + +const SDK_VERSION = "8.54.0" ; + +exports.SDK_VERSION = SDK_VERSION; +//# sourceMappingURL=version.js.map + + +/***/ }), + +/***/ 10891: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const version = __nccwpck_require__(17370); + +/** Get's the global object for the current JavaScript runtime */ +const GLOBAL_OBJ = globalThis ; + +/** + * Returns a global singleton contained in the global `__SENTRY__[]` object. + * + * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory + * function and added to the `__SENTRY__` object. + * + * @param name name of the global singleton on __SENTRY__ + * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__` + * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value + * @returns the singleton + */ +function getGlobalSingleton(name, creator, obj) { + const gbl = (obj || GLOBAL_OBJ) ; + const __SENTRY__ = (gbl.__SENTRY__ = gbl.__SENTRY__ || {}); + const versionedCarrier = (__SENTRY__[version.SDK_VERSION] = __SENTRY__[version.SDK_VERSION] || {}); + return versionedCarrier[name] || (versionedCarrier[name] = creator()); +} + +exports.GLOBAL_OBJ = GLOBAL_OBJ; +exports.getGlobalSingleton = getGlobalSingleton; +//# sourceMappingURL=worldwide.js.map + + +/***/ }), + +/***/ 87359: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const dynamicSamplingContext = __nccwpck_require__(29724); +const object = __nccwpck_require__(16100); +const merge = __nccwpck_require__(32003); +const spanUtils = __nccwpck_require__(47569); + +/** + * Applies data from the scope to the event and runs all event processors on it. + */ +function applyScopeDataToEvent(event, data) { + const { fingerprint, span, breadcrumbs, sdkProcessingMetadata } = data; + + // Apply general data + applyDataToEvent(event, data); + + // We want to set the trace context for normal events only if there isn't already + // a trace context on the event. There is a product feature in place where we link + // errors with transaction and it relies on that. + if (span) { + applySpanToEvent(event, span); + } + + applyFingerprintToEvent(event, fingerprint); + applyBreadcrumbsToEvent(event, breadcrumbs); + applySdkMetadataToEvent(event, sdkProcessingMetadata); +} + +/** Merge data of two scopes together. */ +function mergeScopeData(data, mergeData) { + const { + extra, + tags, + user, + contexts, + level, + sdkProcessingMetadata, + breadcrumbs, + fingerprint, + eventProcessors, + attachments, + propagationContext, + transactionName, + span, + } = mergeData; + + mergeAndOverwriteScopeData(data, 'extra', extra); + mergeAndOverwriteScopeData(data, 'tags', tags); + mergeAndOverwriteScopeData(data, 'user', user); + mergeAndOverwriteScopeData(data, 'contexts', contexts); + + data.sdkProcessingMetadata = merge.merge(data.sdkProcessingMetadata, sdkProcessingMetadata, 2); + + if (level) { + data.level = level; + } + + if (transactionName) { + data.transactionName = transactionName; + } + + if (span) { + data.span = span; + } + + if (breadcrumbs.length) { + data.breadcrumbs = [...data.breadcrumbs, ...breadcrumbs]; + } + + if (fingerprint.length) { + data.fingerprint = [...data.fingerprint, ...fingerprint]; + } + + if (eventProcessors.length) { + data.eventProcessors = [...data.eventProcessors, ...eventProcessors]; + } + + if (attachments.length) { + data.attachments = [...data.attachments, ...attachments]; + } + + data.propagationContext = { ...data.propagationContext, ...propagationContext }; +} + +/** + * Merges certain scope data. Undefined values will overwrite any existing values. + * Exported only for tests. + */ +function mergeAndOverwriteScopeData + +(data, prop, mergeVal) { + data[prop] = merge.merge(data[prop], mergeVal, 1); +} + +function applyDataToEvent(event, data) { + const { extra, tags, user, contexts, level, transactionName } = data; + + const cleanedExtra = object.dropUndefinedKeys(extra); + if (cleanedExtra && Object.keys(cleanedExtra).length) { + event.extra = { ...cleanedExtra, ...event.extra }; + } + + const cleanedTags = object.dropUndefinedKeys(tags); + if (cleanedTags && Object.keys(cleanedTags).length) { + event.tags = { ...cleanedTags, ...event.tags }; + } + + const cleanedUser = object.dropUndefinedKeys(user); + if (cleanedUser && Object.keys(cleanedUser).length) { + event.user = { ...cleanedUser, ...event.user }; + } + + const cleanedContexts = object.dropUndefinedKeys(contexts); + if (cleanedContexts && Object.keys(cleanedContexts).length) { + event.contexts = { ...cleanedContexts, ...event.contexts }; + } + + if (level) { + event.level = level; + } + + // transaction events get their `transaction` from the root span name + if (transactionName && event.type !== 'transaction') { + event.transaction = transactionName; + } +} + +function applyBreadcrumbsToEvent(event, breadcrumbs) { + const mergedBreadcrumbs = [...(event.breadcrumbs || []), ...breadcrumbs]; + event.breadcrumbs = mergedBreadcrumbs.length ? mergedBreadcrumbs : undefined; +} + +function applySdkMetadataToEvent(event, sdkProcessingMetadata) { + event.sdkProcessingMetadata = { + ...event.sdkProcessingMetadata, + ...sdkProcessingMetadata, + }; +} + +function applySpanToEvent(event, span) { + event.contexts = { + trace: spanUtils.spanToTraceContext(span), + ...event.contexts, + }; + + event.sdkProcessingMetadata = { + dynamicSamplingContext: dynamicSamplingContext.getDynamicSamplingContextFromSpan(span), + ...event.sdkProcessingMetadata, + }; + + const rootSpan = spanUtils.getRootSpan(span); + const transactionName = spanUtils.spanToJSON(rootSpan).description; + if (transactionName && !event.transaction && event.type === 'transaction') { + event.transaction = transactionName; + } +} + +/** + * Applies fingerprint from the scope to the event if there's one, + * uses message if there's one instead or get rid of empty fingerprint + */ +function applyFingerprintToEvent(event, fingerprint) { + // Make sure it's an array first and we actually have something in place + event.fingerprint = event.fingerprint + ? Array.isArray(event.fingerprint) + ? event.fingerprint + : [event.fingerprint] + : []; + + // If we have something on the scope, then merge it with event + if (fingerprint) { + event.fingerprint = event.fingerprint.concat(fingerprint); + } + + // If we have no data at all, remove empty array default + if (event.fingerprint && !event.fingerprint.length) { + delete event.fingerprint; + } +} + +exports.applyScopeDataToEvent = applyScopeDataToEvent; +exports.mergeAndOverwriteScopeData = mergeAndOverwriteScopeData; +exports.mergeScopeData = mergeScopeData; +//# sourceMappingURL=applyScopeDataToEvent.js.map + + +/***/ }), + +/***/ 77864: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const is = __nccwpck_require__(84085); + +/** + * Wrap a callback function with error handling. + * If an error is thrown, it will be passed to the `onError` callback and re-thrown. + * + * If the return value of the function is a promise, it will be handled with `maybeHandlePromiseRejection`. + * + * If an `onFinally` callback is provided, this will be called when the callback has finished + * - so if it returns a promise, once the promise resolved/rejected, + * else once the callback has finished executing. + * The `onFinally` callback will _always_ be called, no matter if an error was thrown or not. + */ +function handleCallbackErrors + +( + fn, + onError, + // eslint-disable-next-line @typescript-eslint/no-empty-function + onFinally = () => {}, +) { + let maybePromiseResult; + try { + maybePromiseResult = fn(); + } catch (e) { + onError(e); + onFinally(); + throw e; + } + + return maybeHandlePromiseRejection(maybePromiseResult, onError, onFinally); +} + +/** + * Maybe handle a promise rejection. + * This expects to be given a value that _may_ be a promise, or any other value. + * If it is a promise, and it rejects, it will call the `onError` callback. + * Other than this, it will generally return the given value as-is. + */ +function maybeHandlePromiseRejection( + value, + onError, + onFinally, +) { + if (is.isThenable(value)) { + // @ts-expect-error - the isThenable check returns the "wrong" type here + return value.then( + res => { + onFinally(); + return res; + }, + e => { + onError(e); + onFinally(); + throw e; + }, + ); + } + + onFinally(); + return value; +} + +exports.handleCallbackErrors = handleCallbackErrors; +//# sourceMappingURL=handleCallbackErrors.js.map + + +/***/ }), + +/***/ 79223: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const currentScopes = __nccwpck_require__(8131); + +// Treeshakable guard to remove all code related to tracing + +/** + * Determines if tracing is currently enabled. + * + * Tracing is enabled when at least one of `tracesSampleRate` and `tracesSampler` is defined in the SDK config. + */ +function hasTracingEnabled( + maybeOptions, +) { + if (typeof __SENTRY_TRACING__ === 'boolean' && !__SENTRY_TRACING__) { + return false; + } + + const client = currentScopes.getClient(); + const options = maybeOptions || (client && client.getOptions()); + // eslint-disable-next-line deprecation/deprecation + return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options); +} + +exports.hasTracingEnabled = hasTracingEnabled; +//# sourceMappingURL=hasTracingEnabled.js.map + + +/***/ }), + +/***/ 2554: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/** + * Checks whether given url points to Sentry server + * + * @param url url to verify + */ +function isSentryRequestUrl(url, client) { + const dsn = client && client.getDsn(); + const tunnel = client && client.getOptions().tunnel; + return checkDsn(url, dsn) || checkTunnel(url, tunnel); +} + +function checkTunnel(url, tunnel) { + if (!tunnel) { + return false; + } + + return removeTrailingSlash(url) === removeTrailingSlash(tunnel); +} + +function checkDsn(url, dsn) { + return dsn ? url.includes(dsn.host) : false; +} + +function removeTrailingSlash(str) { + return str[str.length - 1] === '/' ? str.slice(0, -1) : str; +} + +exports.isSentryRequestUrl = isSentryRequestUrl; +//# sourceMappingURL=isSentryRequestUrl.js.map + + +/***/ }), + +/***/ 32003: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/** + * Shallow merge two objects. + * Does not mutate the passed in objects. + * Undefined/empty values in the merge object will overwrite existing values. + * + * By default, this merges 2 levels deep. + */ +function merge(initialObj, mergeObj, levels = 2) { + // If the merge value is not an object, or we have no merge levels left, + // we just set the value to the merge value + if (!mergeObj || typeof mergeObj !== 'object' || levels <= 0) { + return mergeObj; + } + + // If the merge object is an empty object, and the initial object is not undefined, we return the initial object + if (initialObj && mergeObj && Object.keys(mergeObj).length === 0) { + return initialObj; + } + + // Clone object + const output = { ...initialObj }; + + // Merge values into output, resursively + for (const key in mergeObj) { + if (Object.prototype.hasOwnProperty.call(mergeObj, key)) { + output[key] = merge(output[key], mergeObj[key], levels - 1); + } + } + + return output; +} + +exports.merge = merge; +//# sourceMappingURL=merge.js.map + + +/***/ }), + +/***/ 34314: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const traceData = __nccwpck_require__(7522); + +/** + * Returns a string of meta tags that represent the current trace data. + * + * You can use this to propagate a trace from your server-side rendered Html to the browser. + * This function returns up to two meta tags, `sentry-trace` and `baggage`, depending on the + * current trace data state. + * + * @example + * Usage example: + * + * ```js + * function renderHtml() { + * return ` + * + * ${getTraceMetaTags()} + * + * `; + * } + * ``` + * + */ +function getTraceMetaTags() { + return Object.entries(traceData.getTraceData()) + .map(([key, value]) => ``) + .join('\n'); +} + +exports.getTraceMetaTags = getTraceMetaTags; +//# sourceMappingURL=meta.js.map + + +/***/ }), + +/***/ 32957: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/** + * Tagged template function which returns parameterized representation of the message + * For example: parameterize`This is a log statement with ${x} and ${y} params`, would return: + * "__sentry_template_string__": 'This is a log statement with %s and %s params', + * "__sentry_template_values__": ['first', 'second'] + * @param strings An array of string values splitted between expressions + * @param values Expressions extracted from template string + * @returns String with template information in __sentry_template_string__ and __sentry_template_values__ properties + */ +function parameterize(strings, ...values) { + const formatted = new String(String.raw(strings, ...values)) ; + formatted.__sentry_template_string__ = strings.join('\x00').replace(/%/g, '%%').replace(/\0/g, '%s'); + formatted.__sentry_template_values__ = values; + return formatted; +} + +exports.parameterize = parameterize; +//# sourceMappingURL=parameterize.js.map + + +/***/ }), + +/***/ 54078: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const debugBuild = __nccwpck_require__(14488); +const logger = __nccwpck_require__(38752); + +/** + * Parse a sample rate from a given value. + * This will either return a boolean or number sample rate, if the sample rate is valid (between 0 and 1). + * If a string is passed, we try to convert it to a number. + * + * Any invalid sample rate will return `undefined`. + */ +function parseSampleRate(sampleRate) { + if (typeof sampleRate === 'boolean') { + return Number(sampleRate); + } + + const rate = typeof sampleRate === 'string' ? parseFloat(sampleRate) : sampleRate; + if (typeof rate !== 'number' || isNaN(rate) || rate < 0 || rate > 1) { + debugBuild.DEBUG_BUILD && + logger.logger.warn( + `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify( + sampleRate, + )} of type ${JSON.stringify(typeof sampleRate)}.`, + ); + return undefined; + } + + return rate; +} + +exports.parseSampleRate = parseSampleRate; +//# sourceMappingURL=parseSampleRate.js.map + + +/***/ }), + +/***/ 22264: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const constants = __nccwpck_require__(5958); +const currentScopes = __nccwpck_require__(8131); +const eventProcessors = __nccwpck_require__(45796); +const scope = __nccwpck_require__(49417); +const debugIds = __nccwpck_require__(4263); +const misc = __nccwpck_require__(3181); +const normalize = __nccwpck_require__(65543); +const string = __nccwpck_require__(93529); +const time = __nccwpck_require__(75872); +const applyScopeDataToEvent = __nccwpck_require__(87359); + +/** + * This type makes sure that we get either a CaptureContext, OR an EventHint. + * It does not allow mixing them, which could lead to unexpected outcomes, e.g. this is disallowed: + * { user: { id: '123' }, mechanism: { handled: false } } + */ + +/** + * Adds common information to events. + * + * The information includes release and environment from `options`, + * breadcrumbs and context (extra, tags and user) from the scope. + * + * Information that is already present in the event is never overwritten. For + * nested objects, such as the context, keys are merged. + * + * @param event The original event. + * @param hint May contain additional information about the original exception. + * @param scope A scope containing event metadata. + * @returns A new event with more information. + * @hidden + */ +function prepareEvent( + options, + event, + hint, + scope, + client, + isolationScope, +) { + const { normalizeDepth = 3, normalizeMaxBreadth = 1000 } = options; + const prepared = { + ...event, + event_id: event.event_id || hint.event_id || misc.uuid4(), + timestamp: event.timestamp || time.dateTimestampInSeconds(), + }; + const integrations = hint.integrations || options.integrations.map(i => i.name); + + applyClientOptions(prepared, options); + applyIntegrationsMetadata(prepared, integrations); + + if (client) { + client.emit('applyFrameMetadata', event); + } + + // Only put debug IDs onto frames for error events. + if (event.type === undefined) { + applyDebugIds(prepared, options.stackParser); + } + + // If we have scope given to us, use it as the base for further modifications. + // This allows us to prevent unnecessary copying of data if `captureContext` is not provided. + const finalScope = getFinalScope(scope, hint.captureContext); + + if (hint.mechanism) { + misc.addExceptionMechanism(prepared, hint.mechanism); + } + + const clientEventProcessors = client ? client.getEventProcessors() : []; + + // This should be the last thing called, since we want that + // {@link Scope.addEventProcessor} gets the finished prepared event. + // Merge scope data together + const data = currentScopes.getGlobalScope().getScopeData(); + + if (isolationScope) { + const isolationData = isolationScope.getScopeData(); + applyScopeDataToEvent.mergeScopeData(data, isolationData); + } + + if (finalScope) { + const finalScopeData = finalScope.getScopeData(); + applyScopeDataToEvent.mergeScopeData(data, finalScopeData); + } + + const attachments = [...(hint.attachments || []), ...data.attachments]; + if (attachments.length) { + hint.attachments = attachments; + } + + applyScopeDataToEvent.applyScopeDataToEvent(prepared, data); + + const eventProcessors$1 = [ + ...clientEventProcessors, + // Run scope event processors _after_ all other processors + ...data.eventProcessors, + ]; + + const result = eventProcessors.notifyEventProcessors(eventProcessors$1, prepared, hint); + + return result.then(evt => { + if (evt) { + // We apply the debug_meta field only after all event processors have ran, so that if any event processors modified + // file names (e.g.the RewriteFrames integration) the filename -> debug ID relationship isn't destroyed. + // This should not cause any PII issues, since we're only moving data that is already on the event and not adding + // any new data + applyDebugMeta(evt); + } + + if (typeof normalizeDepth === 'number' && normalizeDepth > 0) { + return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth); + } + return evt; + }); +} + +/** + * Enhances event using the client configuration. + * It takes care of all "static" values like environment, release and `dist`, + * as well as truncating overly long values. + * + * Only exported for tests. + * + * @param event event instance to be enhanced + */ +function applyClientOptions(event, options) { + const { environment, release, dist, maxValueLength = 250 } = options; + + // empty strings do not make sense for environment, release, and dist + // so we handle them the same as if they were not provided + event.environment = event.environment || environment || constants.DEFAULT_ENVIRONMENT; + + if (!event.release && release) { + event.release = release; + } + + if (!event.dist && dist) { + event.dist = dist; + } + + if (event.message) { + event.message = string.truncate(event.message, maxValueLength); + } + + const exception = event.exception && event.exception.values && event.exception.values[0]; + if (exception && exception.value) { + exception.value = string.truncate(exception.value, maxValueLength); + } + + const request = event.request; + if (request && request.url) { + request.url = string.truncate(request.url, maxValueLength); + } +} + +/** + * Puts debug IDs into the stack frames of an error event. + */ +function applyDebugIds(event, stackParser) { + // Build a map of filename -> debug_id + const filenameDebugIdMap = debugIds.getFilenameToDebugIdMap(stackParser); + + try { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + event.exception.values.forEach(exception => { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + exception.stacktrace.frames.forEach(frame => { + if (filenameDebugIdMap && frame.filename) { + frame.debug_id = filenameDebugIdMap[frame.filename]; + } + }); + }); + } catch (e) { + // To save bundle size we're just try catching here instead of checking for the existence of all the different objects. + } +} + +/** + * Moves debug IDs from the stack frames of an error event into the debug_meta field. + */ +function applyDebugMeta(event) { + // Extract debug IDs and filenames from the stack frames on the event. + const filenameDebugIdMap = {}; + try { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + event.exception.values.forEach(exception => { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + exception.stacktrace.frames.forEach(frame => { + if (frame.debug_id) { + if (frame.abs_path) { + filenameDebugIdMap[frame.abs_path] = frame.debug_id; + } else if (frame.filename) { + filenameDebugIdMap[frame.filename] = frame.debug_id; + } + delete frame.debug_id; + } + }); + }); + } catch (e) { + // To save bundle size we're just try catching here instead of checking for the existence of all the different objects. + } + + if (Object.keys(filenameDebugIdMap).length === 0) { + return; + } + + // Fill debug_meta information + event.debug_meta = event.debug_meta || {}; + event.debug_meta.images = event.debug_meta.images || []; + const images = event.debug_meta.images; + Object.entries(filenameDebugIdMap).forEach(([filename, debug_id]) => { + images.push({ + type: 'sourcemap', + code_file: filename, + debug_id, + }); + }); +} + +/** + * This function adds all used integrations to the SDK info in the event. + * @param event The event that will be filled with all integrations. + */ +function applyIntegrationsMetadata(event, integrationNames) { + if (integrationNames.length > 0) { + event.sdk = event.sdk || {}; + event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames]; + } +} + +/** + * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization. + * Normalized keys: + * - `breadcrumbs.data` + * - `user` + * - `contexts` + * - `extra` + * @param event Event + * @returns Normalized event + */ +function normalizeEvent(event, depth, maxBreadth) { + if (!event) { + return null; + } + + const normalized = { + ...event, + ...(event.breadcrumbs && { + breadcrumbs: event.breadcrumbs.map(b => ({ + ...b, + ...(b.data && { + data: normalize.normalize(b.data, depth, maxBreadth), + }), + })), + }), + ...(event.user && { + user: normalize.normalize(event.user, depth, maxBreadth), + }), + ...(event.contexts && { + contexts: normalize.normalize(event.contexts, depth, maxBreadth), + }), + ...(event.extra && { + extra: normalize.normalize(event.extra, depth, maxBreadth), + }), + }; + + // event.contexts.trace stores information about a Transaction. Similarly, + // event.spans[] stores information about child Spans. Given that a + // Transaction is conceptually a Span, normalization should apply to both + // Transactions and Spans consistently. + // For now the decision is to skip normalization of Transactions and Spans, + // so this block overwrites the normalized event to add back the original + // Transaction information prior to normalization. + if (event.contexts && event.contexts.trace && normalized.contexts) { + normalized.contexts.trace = event.contexts.trace; + + // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it + if (event.contexts.trace.data) { + normalized.contexts.trace.data = normalize.normalize(event.contexts.trace.data, depth, maxBreadth); + } + } + + // event.spans[].data may contain circular/dangerous data so we need to normalize it + if (event.spans) { + normalized.spans = event.spans.map(span => { + return { + ...span, + ...(span.data && { + data: normalize.normalize(span.data, depth, maxBreadth), + }), + }; + }); + } + + // event.contexts.flags (FeatureFlagContext) stores context for our feature + // flag integrations. It has a greater nesting depth than our other typed + // Contexts, so we re-normalize with a fixed depth of 3 here. We do not want + // to skip this in case of conflicting, user-provided context. + if (event.contexts && event.contexts.flags && normalized.contexts) { + normalized.contexts.flags = normalize.normalize(event.contexts.flags, 3, maxBreadth); + } + + return normalized; +} + +function getFinalScope( + scope$1, + captureContext, +) { + if (!captureContext) { + return scope$1; + } + + const finalScope = scope$1 ? scope$1.clone() : new scope.Scope(); + finalScope.update(captureContext); + return finalScope; +} + +/** + * Parse either an `EventHint` directly, or convert a `CaptureContext` to an `EventHint`. + * This is used to allow to update method signatures that used to accept a `CaptureContext` but should now accept an `EventHint`. + */ +function parseEventHintOrCaptureContext( + hint, +) { + if (!hint) { + return undefined; + } + + // If you pass a Scope or `() => Scope` as CaptureContext, we just return this as captureContext + if (hintIsScopeOrFunction(hint)) { + return { captureContext: hint }; + } + + if (hintIsScopeContext(hint)) { + return { + captureContext: hint, + }; + } + + return hint; +} + +function hintIsScopeOrFunction( + hint, +) { + return hint instanceof scope.Scope || typeof hint === 'function'; +} + +const captureContextKeys = [ + 'user', + 'level', + 'extra', + 'contexts', + 'tags', + 'fingerprint', + 'requestSession', + 'propagationContext', +] ; + +function hintIsScopeContext(hint) { + return Object.keys(hint).some(key => captureContextKeys.includes(key )); +} + +exports.applyClientOptions = applyClientOptions; +exports.applyDebugIds = applyDebugIds; +exports.applyDebugMeta = applyDebugMeta; +exports.parseEventHintOrCaptureContext = parseEventHintOrCaptureContext; +exports.prepareEvent = prepareEvent; +//# sourceMappingURL=prepareEvent.js.map + + +/***/ }), + +/***/ 24054: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const version = __nccwpck_require__(17370); + +/** + * A builder for the SDK metadata in the options for the SDK initialization. + * + * Note: This function is identical to `buildMetadata` in Remix and NextJS and SvelteKit. + * We don't extract it for bundle size reasons. + * @see https://github.com/getsentry/sentry-javascript/pull/7404 + * @see https://github.com/getsentry/sentry-javascript/pull/4196 + * + * If you make changes to this function consider updating the others as well. + * + * @param options SDK options object that gets mutated + * @param names list of package names + */ +function applySdkMetadata(options, name, names = [name], source = 'npm') { + const metadata = options._metadata || {}; + + if (!metadata.sdk) { + metadata.sdk = { + name: `sentry.javascript.${name}`, + packages: names.map(name => ({ + name: `${source}:@sentry/${name}`, + version: version.SDK_VERSION, + })), + version: version.SDK_VERSION, + }; + } + + options._metadata = metadata; +} + +exports.applySdkMetadata = applySdkMetadata; +//# sourceMappingURL=sdkMetadata.js.map + + +/***/ }), + +/***/ 14379: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const object = __nccwpck_require__(16100); + +const SCOPE_SPAN_FIELD = '_sentrySpan'; + +/** + * Set the active span for a given scope. + * NOTE: This should NOT be used directly, but is only used internally by the trace methods. + */ +function _setSpanForScope(scope, span) { + if (span) { + object.addNonEnumerableProperty(scope , SCOPE_SPAN_FIELD, span); + } else { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete (scope )[SCOPE_SPAN_FIELD]; + } +} + +/** + * Get the active span for a given scope. + * NOTE: This should NOT be used directly, but is only used internally by the trace methods. + */ +function _getSpanForScope(scope) { + return scope[SCOPE_SPAN_FIELD]; +} + +exports._getSpanForScope = _getSpanForScope; +exports._setSpanForScope = _setSpanForScope; +//# sourceMappingURL=spanOnScope.js.map + + +/***/ }), + +/***/ 47569: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const index = __nccwpck_require__(29878); +const carrier = __nccwpck_require__(38080); +const currentScopes = __nccwpck_require__(8131); +const metricSummary = __nccwpck_require__(48306); +const semanticAttributes = __nccwpck_require__(36827); +const spanstatus = __nccwpck_require__(21119); +const logger = __nccwpck_require__(38752); +const object = __nccwpck_require__(16100); +const propagationContext = __nccwpck_require__(37264); +const time = __nccwpck_require__(75872); +const tracing = __nccwpck_require__(15977); +const spanOnScope = __nccwpck_require__(14379); + +// These are aligned with OpenTelemetry trace flags +const TRACE_FLAG_NONE = 0x0; +const TRACE_FLAG_SAMPLED = 0x1; + +// todo(v9): Remove this once we've stopped dropping spans via `beforeSendSpan` +let hasShownSpanDropWarning = false; + +/** + * Convert a span to a trace context, which can be sent as the `trace` context in an event. + * By default, this will only include trace_id, span_id & parent_span_id. + * If `includeAllData` is true, it will also include data, op, status & origin. + */ +function spanToTransactionTraceContext(span) { + const { spanId: span_id, traceId: trace_id } = span.spanContext(); + const { data, op, parent_span_id, status, origin } = spanToJSON(span); + + return object.dropUndefinedKeys({ + parent_span_id, + span_id, + trace_id, + data, + op, + status, + origin, + }); +} + +/** + * Convert a span to a trace context, which can be sent as the `trace` context in a non-transaction event. + */ +function spanToTraceContext(span) { + const { spanId, traceId: trace_id, isRemote } = span.spanContext(); + + // If the span is remote, we use a random/virtual span as span_id to the trace context, + // and the remote span as parent_span_id + const parent_span_id = isRemote ? spanId : spanToJSON(span).parent_span_id; + const span_id = isRemote ? propagationContext.generateSpanId() : spanId; + + return object.dropUndefinedKeys({ + parent_span_id, + span_id, + trace_id, + }); +} + +/** + * Convert a Span to a Sentry trace header. + */ +function spanToTraceHeader(span) { + const { traceId, spanId } = span.spanContext(); + const sampled = spanIsSampled(span); + return tracing.generateSentryTraceHeader(traceId, spanId, sampled); +} + +/** + * Convert a span time input into a timestamp in seconds. + */ +function spanTimeInputToSeconds(input) { + if (typeof input === 'number') { + return ensureTimestampInSeconds(input); + } + + if (Array.isArray(input)) { + // See {@link HrTime} for the array-based time format + return input[0] + input[1] / 1e9; + } + + if (input instanceof Date) { + return ensureTimestampInSeconds(input.getTime()); + } + + return time.timestampInSeconds(); +} + +/** + * Converts a timestamp to second, if it was in milliseconds, or keeps it as second. + */ +function ensureTimestampInSeconds(timestamp) { + const isMs = timestamp > 9999999999; + return isMs ? timestamp / 1000 : timestamp; +} + +/** + * Convert a span to a JSON representation. + */ +// Note: Because of this, we currently have a circular type dependency (which we opted out of in package.json). +// This is not avoidable as we need `spanToJSON` in `spanUtils.ts`, which in turn is needed by `span.ts` for backwards compatibility. +// And `spanToJSON` needs the Span class from `span.ts` to check here. +function spanToJSON(span) { + if (spanIsSentrySpan(span)) { + return span.getSpanJSON(); + } + + try { + const { spanId: span_id, traceId: trace_id } = span.spanContext(); + + // Handle a span from @opentelemetry/sdk-base-trace's `Span` class + if (spanIsOpenTelemetrySdkTraceBaseSpan(span)) { + const { attributes, startTime, name, endTime, parentSpanId, status } = span; + + return object.dropUndefinedKeys({ + span_id, + trace_id, + data: attributes, + description: name, + parent_span_id: parentSpanId, + start_timestamp: spanTimeInputToSeconds(startTime), + // This is [0,0] by default in OTEL, in which case we want to interpret this as no end time + timestamp: spanTimeInputToSeconds(endTime) || undefined, + status: getStatusMessage(status), + op: attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP], + origin: attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] , + _metrics_summary: metricSummary.getMetricSummaryJsonForSpan(span), + }); + } + + // Finally, at least we have `spanContext()`.... + return { + span_id, + trace_id, + }; + } catch (e) { + return {}; + } +} + +function spanIsOpenTelemetrySdkTraceBaseSpan(span) { + const castSpan = span ; + return !!castSpan.attributes && !!castSpan.startTime && !!castSpan.name && !!castSpan.endTime && !!castSpan.status; +} + +/** Exported only for tests. */ + +/** + * Sadly, due to circular dependency checks we cannot actually import the Span class here and check for instanceof. + * :( So instead we approximate this by checking if it has the `getSpanJSON` method. + */ +function spanIsSentrySpan(span) { + return typeof (span ).getSpanJSON === 'function'; +} + +/** + * Returns true if a span is sampled. + * In most cases, you should just use `span.isRecording()` instead. + * However, this has a slightly different semantic, as it also returns false if the span is finished. + * So in the case where this distinction is important, use this method. + */ +function spanIsSampled(span) { + // We align our trace flags with the ones OpenTelemetry use + // So we also check for sampled the same way they do. + const { traceFlags } = span.spanContext(); + return traceFlags === TRACE_FLAG_SAMPLED; +} + +/** Get the status message to use for a JSON representation of a span. */ +function getStatusMessage(status) { + if (!status || status.code === spanstatus.SPAN_STATUS_UNSET) { + return undefined; + } + + if (status.code === spanstatus.SPAN_STATUS_OK) { + return 'ok'; + } + + return status.message || 'unknown_error'; +} + +const CHILD_SPANS_FIELD = '_sentryChildSpans'; +const ROOT_SPAN_FIELD = '_sentryRootSpan'; + +/** + * Adds an opaque child span reference to a span. + */ +function addChildSpanToSpan(span, childSpan) { + // We store the root span reference on the child span + // We need this for `getRootSpan()` to work + const rootSpan = span[ROOT_SPAN_FIELD] || span; + object.addNonEnumerableProperty(childSpan , ROOT_SPAN_FIELD, rootSpan); + + // We store a list of child spans on the parent span + // We need this for `getSpanDescendants()` to work + if (span[CHILD_SPANS_FIELD]) { + span[CHILD_SPANS_FIELD].add(childSpan); + } else { + object.addNonEnumerableProperty(span, CHILD_SPANS_FIELD, new Set([childSpan])); + } +} + +/** This is only used internally by Idle Spans. */ +function removeChildSpanFromSpan(span, childSpan) { + if (span[CHILD_SPANS_FIELD]) { + span[CHILD_SPANS_FIELD].delete(childSpan); + } +} + +/** + * Returns an array of the given span and all of its descendants. + */ +function getSpanDescendants(span) { + const resultSet = new Set(); + + function addSpanChildren(span) { + // This exit condition is required to not infinitely loop in case of a circular dependency. + if (resultSet.has(span)) { + return; + // We want to ignore unsampled spans (e.g. non recording spans) + } else if (spanIsSampled(span)) { + resultSet.add(span); + const childSpans = span[CHILD_SPANS_FIELD] ? Array.from(span[CHILD_SPANS_FIELD]) : []; + for (const childSpan of childSpans) { + addSpanChildren(childSpan); + } + } + } + + addSpanChildren(span); + + return Array.from(resultSet); +} + +/** + * Returns the root span of a given span. + */ +function getRootSpan(span) { + return span[ROOT_SPAN_FIELD] || span; +} + +/** + * Returns the currently active span. + */ +function getActiveSpan() { + const carrier$1 = carrier.getMainCarrier(); + const acs = index.getAsyncContextStrategy(carrier$1); + if (acs.getActiveSpan) { + return acs.getActiveSpan(); + } + + return spanOnScope._getSpanForScope(currentScopes.getCurrentScope()); +} + +/** + * Updates the metric summary on the currently active span + */ +function updateMetricSummaryOnActiveSpan( + metricType, + sanitizedName, + value, + unit, + tags, + bucketKey, +) { + const span = getActiveSpan(); + if (span) { + metricSummary.updateMetricSummaryOnSpan(span, metricType, sanitizedName, value, unit, tags, bucketKey); + } +} + +/** + * Logs a warning once if `beforeSendSpan` is used to drop spans. + * + * todo(v9): Remove this once we've stopped dropping spans via `beforeSendSpan`. + */ +function showSpanDropWarning() { + if (!hasShownSpanDropWarning) { + logger.consoleSandbox(() => { + // eslint-disable-next-line no-console + console.warn( + '[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly.', + ); + }); + hasShownSpanDropWarning = true; + } +} + +/** + * Updates the name of the given span and ensures that the span name is not + * overwritten by the Sentry SDK. + * + * Use this function instead of `span.updateName()` if you want to make sure that + * your name is kept. For some spans, for example root `http.server` spans the + * Sentry SDK would otherwise overwrite the span name with a high-quality name + * it infers when the span ends. + * + * Use this function in server code or when your span is started on the server + * and on the client (browser). If you only update a span name on the client, + * you can also use `span.updateName()` the SDK does not overwrite the name. + * + * @param span - The span to update the name of. + * @param name - The name to set on the span. + */ +function updateSpanName(span, name) { + span.updateName(name); + span.setAttributes({ + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'custom', + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]: name, + }); +} + +exports.TRACE_FLAG_NONE = TRACE_FLAG_NONE; +exports.TRACE_FLAG_SAMPLED = TRACE_FLAG_SAMPLED; +exports.addChildSpanToSpan = addChildSpanToSpan; +exports.getActiveSpan = getActiveSpan; +exports.getRootSpan = getRootSpan; +exports.getSpanDescendants = getSpanDescendants; +exports.getStatusMessage = getStatusMessage; +exports.removeChildSpanFromSpan = removeChildSpanFromSpan; +exports.showSpanDropWarning = showSpanDropWarning; +exports.spanIsSampled = spanIsSampled; +exports.spanTimeInputToSeconds = spanTimeInputToSeconds; +exports.spanToJSON = spanToJSON; +exports.spanToTraceContext = spanToTraceContext; +exports.spanToTraceHeader = spanToTraceHeader; +exports.spanToTransactionTraceContext = spanToTransactionTraceContext; +exports.updateMetricSummaryOnActiveSpan = updateMetricSummaryOnActiveSpan; +exports.updateSpanName = updateSpanName; +//# sourceMappingURL=spanUtils.js.map + + +/***/ }), + +/***/ 7522: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const index = __nccwpck_require__(29878); +const carrier = __nccwpck_require__(38080); +const currentScopes = __nccwpck_require__(8131); +const exports$1 = __nccwpck_require__(10779); +__nccwpck_require__(21834); +__nccwpck_require__(87038); +const logger = __nccwpck_require__(38752); +__nccwpck_require__(14488); +__nccwpck_require__(75872); +const spanUtils = __nccwpck_require__(47569); +const tracing = __nccwpck_require__(15977); +const dynamicSamplingContext = __nccwpck_require__(29724); +const baggage = __nccwpck_require__(86741); + +/** + * Extracts trace propagation data from the current span or from the client's scope (via transaction or propagation + * context) and serializes it to `sentry-trace` and `baggage` values to strings. These values can be used to propagate + * a trace via our tracing Http headers or Html `` tags. + * + * This function also applies some validation to the generated sentry-trace and baggage values to ensure that + * only valid strings are returned. + * + * @returns an object with the tracing data values. The object keys are the name of the tracing key to be used as header + * or meta tag name. + */ +function getTraceData(options = {}) { + const client = currentScopes.getClient(); + if (!exports$1.isEnabled() || !client) { + return {}; + } + + const carrier$1 = carrier.getMainCarrier(); + const acs = index.getAsyncContextStrategy(carrier$1); + if (acs.getTraceData) { + return acs.getTraceData(options); + } + + const scope = currentScopes.getCurrentScope(); + const span = options.span || spanUtils.getActiveSpan(); + const sentryTrace = span ? spanUtils.spanToTraceHeader(span) : scopeToTraceHeader(scope); + const dsc = span ? dynamicSamplingContext.getDynamicSamplingContextFromSpan(span) : dynamicSamplingContext.getDynamicSamplingContextFromScope(client, scope); + const baggage$1 = baggage.dynamicSamplingContextToSentryBaggageHeader(dsc); + + const isValidSentryTraceHeader = tracing.TRACEPARENT_REGEXP.test(sentryTrace); + if (!isValidSentryTraceHeader) { + logger.logger.warn('Invalid sentry-trace data. Cannot generate trace data'); + return {}; + } + + return { + 'sentry-trace': sentryTrace, + baggage: baggage$1, + }; +} + +/** + * Get a sentry-trace header value for the given scope. + */ +function scopeToTraceHeader(scope) { + // TODO(v9): Use generateSpanId() instead of spanId + // eslint-disable-next-line deprecation/deprecation + const { traceId, sampled, spanId } = scope.getPropagationContext(); + return tracing.generateSentryTraceHeader(traceId, spanId, sampled); +} + +exports.getTraceData = getTraceData; +//# sourceMappingURL=traceData.js.map + + +/***/ }), + +/***/ 13508: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const replacements = [ + ['january', '1'], + ['february', '2'], + ['march', '3'], + ['april', '4'], + ['may', '5'], + ['june', '6'], + ['july', '7'], + ['august', '8'], + ['september', '9'], + ['october', '10'], + ['november', '11'], + ['december', '12'], + ['jan', '1'], + ['feb', '2'], + ['mar', '3'], + ['apr', '4'], + ['may', '5'], + ['jun', '6'], + ['jul', '7'], + ['aug', '8'], + ['sep', '9'], + ['oct', '10'], + ['nov', '11'], + ['dec', '12'], + ['sunday', '0'], + ['monday', '1'], + ['tuesday', '2'], + ['wednesday', '3'], + ['thursday', '4'], + ['friday', '5'], + ['saturday', '6'], + ['sun', '0'], + ['mon', '1'], + ['tue', '2'], + ['wed', '3'], + ['thu', '4'], + ['fri', '5'], + ['sat', '6'], +]; + +/** + * Replaces names in cron expressions + */ +function replaceCronNames(cronExpression) { + return replacements.reduce( + // eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor + (acc, [name, replacement]) => acc.replace(new RegExp(name, 'gi'), replacement), + cronExpression, + ); +} + +exports.replaceCronNames = replaceCronNames; +//# sourceMappingURL=common.js.map + + +/***/ }), + +/***/ 77499: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const core = __nccwpck_require__(84466); +const common = __nccwpck_require__(13508); + +const ERROR_TEXT = 'Automatic instrumentation of CronJob only supports crontab string'; + +/** + * Instruments the `cron` library to send a check-in event to Sentry for each job execution. + * + * ```ts + * import * as Sentry from '@sentry/node'; + * import { CronJob } from 'cron'; + * + * const CronJobWithCheckIn = Sentry.cron.instrumentCron(CronJob, 'my-cron-job'); + * + * // use the constructor + * const job = new CronJobWithCheckIn('* * * * *', () => { + * console.log('You will see this message every minute'); + * }); + * + * // or from + * const job = CronJobWithCheckIn.from({ cronTime: '* * * * *', onTick: () => { + * console.log('You will see this message every minute'); + * }); + * ``` + */ +function instrumentCron(lib, monitorSlug) { + let jobScheduled = false; + + return new Proxy(lib, { + construct(target, args) { + const [cronTime, onTick, onComplete, start, timeZone, ...rest] = args; + + if (typeof cronTime !== 'string') { + throw new Error(ERROR_TEXT); + } + + if (jobScheduled) { + throw new Error(`A job named '${monitorSlug}' has already been scheduled`); + } + + jobScheduled = true; + + const cronString = common.replaceCronNames(cronTime); + + async function monitoredTick(context, onComplete) { + return core.withMonitor( + monitorSlug, + async () => { + try { + await onTick(context, onComplete); + } catch (e) { + core.captureException(e); + throw e; + } + }, + { + schedule: { type: 'crontab', value: cronString }, + timezone: timeZone || undefined, + }, + ); + } + + return new target(cronTime, monitoredTick, onComplete, start, timeZone, ...rest); + }, + get(target, prop) { + if (prop === 'from') { + return (param) => { + const { cronTime, onTick, timeZone } = param; + + if (typeof cronTime !== 'string') { + throw new Error(ERROR_TEXT); + } + + if (jobScheduled) { + throw new Error(`A job named '${monitorSlug}' has already been scheduled`); + } + + jobScheduled = true; + + const cronString = common.replaceCronNames(cronTime); + + param.onTick = async (context, onComplete) => { + return core.withMonitor( + monitorSlug, + async () => { + try { + await onTick(context, onComplete); + } catch (e) { + core.captureException(e); + throw e; + } + }, + { + schedule: { type: 'crontab', value: cronString }, + timezone: timeZone || undefined, + }, + ); + }; + + return target.from(param); + }; + } else { + return target[prop]; + } + }, + }); +} + +exports.instrumentCron = instrumentCron; +//# sourceMappingURL=cron.js.map + + +/***/ }), + +/***/ 51153: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const cron$1 = __nccwpck_require__(77499); +const nodeCron = __nccwpck_require__(70543); +const nodeSchedule = __nccwpck_require__(45666); + +/** Methods to instrument cron libraries for Sentry check-ins */ +const cron = { + instrumentCron: cron$1.instrumentCron, + instrumentNodeCron: nodeCron.instrumentNodeCron, + instrumentNodeSchedule: nodeSchedule.instrumentNodeSchedule, +}; + +exports.cron = cron; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 70543: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const core = __nccwpck_require__(84466); +const common = __nccwpck_require__(13508); + +/** + * Wraps the `node-cron` library with check-in monitoring. + * + * ```ts + * import * as Sentry from "@sentry/node"; + * import * as cron from "node-cron"; + * + * const cronWithCheckIn = Sentry.cron.instrumentNodeCron(cron); + * + * cronWithCheckIn.schedule( + * "* * * * *", + * () => { + * console.log("running a task every minute"); + * }, + * { name: "my-cron-job" }, + * ); + * ``` + */ +function instrumentNodeCron(lib) { + return new Proxy(lib, { + get(target, prop) { + if (prop === 'schedule' && target.schedule) { + // When 'get' is called for schedule, return a proxied version of the schedule function + return new Proxy(target.schedule, { + apply(target, thisArg, argArray) { + const [expression, callback, options] = argArray; + + if (!_optionalChain([options, 'optionalAccess', _ => _.name])) { + throw new Error('Missing "name" for scheduled job. A name is required for Sentry check-in monitoring.'); + } + + async function monitoredCallback() { + return core.withMonitor( + options.name, + async () => { + // We have to manually catch here and capture the exception because node-cron swallows errors + // https://github.com/node-cron/node-cron/issues/399 + try { + return await callback(); + } catch (e) { + core.captureException(e); + throw e; + } + }, + { + schedule: { type: 'crontab', value: common.replaceCronNames(expression) }, + timezone: _optionalChain([options, 'optionalAccess', _2 => _2.timezone]), + }, + ); + } + + return target.apply(thisArg, [expression, monitoredCallback, options]); + }, + }); + } else { + return target[prop]; + } + }, + }); +} + +exports.instrumentNodeCron = instrumentNodeCron; +//# sourceMappingURL=node-cron.js.map + + +/***/ }), + +/***/ 45666: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const core = __nccwpck_require__(84466); +const common = __nccwpck_require__(13508); + +/** + * Instruments the `node-schedule` library to send a check-in event to Sentry for each job execution. + * + * ```ts + * import * as Sentry from '@sentry/node'; + * import * as schedule from 'node-schedule'; + * + * const scheduleWithCheckIn = Sentry.cron.instrumentNodeSchedule(schedule); + * + * const job = scheduleWithCheckIn.scheduleJob('my-cron-job', '* * * * *', () => { + * console.log('You will see this message every minute'); + * }); + * ``` + */ +function instrumentNodeSchedule(lib) { + return new Proxy(lib, { + get(target, prop) { + if (prop === 'scheduleJob') { + // eslint-disable-next-line @typescript-eslint/unbound-method + return new Proxy(target.scheduleJob, { + apply(target, thisArg, argArray) { + const [nameOrExpression, expressionOrCallback, callback] = argArray; + + if ( + typeof nameOrExpression !== 'string' || + typeof expressionOrCallback !== 'string' || + typeof callback !== 'function' + ) { + throw new Error( + "Automatic instrumentation of 'node-schedule' requires the first parameter of 'scheduleJob' to be a job name string and the second parameter to be a crontab string", + ); + } + + const monitorSlug = nameOrExpression; + const expression = expressionOrCallback; + + async function monitoredCallback() { + return core.withMonitor( + monitorSlug, + async () => { + await _optionalChain([callback, 'optionalCall', _ => _()]); + }, + { + schedule: { type: 'crontab', value: common.replaceCronNames(expression) }, + }, + ); + } + + return target.apply(thisArg, [monitorSlug, expression, monitoredCallback]); + }, + }); + } + + return target[prop]; + }, + }); +} + +exports.instrumentNodeSchedule = instrumentNodeSchedule; +//# sourceMappingURL=node-schedule.js.map + + +/***/ }), + +/***/ 8421: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/** + * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code. + * + * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking. + */ +const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__); + +exports.DEBUG_BUILD = DEBUG_BUILD; +//# sourceMappingURL=debug-build.js.map + + +/***/ }), + +/***/ 17374: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const index = __nccwpck_require__(50289); +const nodeFetch = __nccwpck_require__(40839); +const fs = __nccwpck_require__(91776); +const console = __nccwpck_require__(61139); +const context = __nccwpck_require__(15834); +const contextlines = __nccwpck_require__(57582); +const index$1 = __nccwpck_require__(4530); +const modules = __nccwpck_require__(43791); +const onuncaughtexception = __nccwpck_require__(79100); +const onunhandledrejection = __nccwpck_require__(70694); +const index$2 = __nccwpck_require__(83835); +const express = __nccwpck_require__(89660); +const fastify = __nccwpck_require__(3372); +const graphql = __nccwpck_require__(64448); +const kafka = __nccwpck_require__(8430); +const lrumemoizer = __nccwpck_require__(47006); +const mongo = __nccwpck_require__(57036); +const mongoose = __nccwpck_require__(28975); +const mysql = __nccwpck_require__(5432); +const mysql2 = __nccwpck_require__(56910); +const redis = __nccwpck_require__(87260); +const nest = __nccwpck_require__(60876); +const postgres = __nccwpck_require__(96003); +const prisma = __nccwpck_require__(53769); +const index$3 = __nccwpck_require__(69741); +const koa = __nccwpck_require__(57910); +const connect = __nccwpck_require__(56711); +const spotlight = __nccwpck_require__(23284); +const knex = __nccwpck_require__(46350); +const tedious = __nccwpck_require__(78622); +const genericPool = __nccwpck_require__(78505); +const dataloader = __nccwpck_require__(83491); +const amqplib = __nccwpck_require__(40782); +const childProcess = __nccwpck_require__(13557); +const contextManager = __nccwpck_require__(37859); +const instrument = __nccwpck_require__(64074); +const index$4 = __nccwpck_require__(59198); +const initOtel = __nccwpck_require__(16049); +const index$5 = __nccwpck_require__(59020); +const api = __nccwpck_require__(75168); +const module$1 = __nccwpck_require__(64177); +const http = __nccwpck_require__(73009); +const client = __nccwpck_require__(49951); +const index$6 = __nccwpck_require__(51153); +const core = __nccwpck_require__(84466); +const opentelemetry = __nccwpck_require__(78369); + + + +exports.httpIntegration = index.httpIntegration; +exports.nativeNodeFetchIntegration = nodeFetch.nativeNodeFetchIntegration; +exports.fsIntegration = fs.fsIntegration; +exports.consoleIntegration = console.consoleIntegration; +exports.nodeContextIntegration = context.nodeContextIntegration; +exports.contextLinesIntegration = contextlines.contextLinesIntegration; +exports.localVariablesIntegration = index$1.localVariablesIntegration; +exports.modulesIntegration = modules.modulesIntegration; +exports.onUncaughtExceptionIntegration = onuncaughtexception.onUncaughtExceptionIntegration; +exports.onUnhandledRejectionIntegration = onunhandledrejection.onUnhandledRejectionIntegration; +exports.anrIntegration = index$2.anrIntegration; +exports.disableAnrDetectionForCallback = index$2.disableAnrDetectionForCallback; +exports.expressErrorHandler = express.expressErrorHandler; +exports.expressIntegration = express.expressIntegration; +exports.setupExpressErrorHandler = express.setupExpressErrorHandler; +exports.fastifyIntegration = fastify.fastifyIntegration; +exports.setupFastifyErrorHandler = fastify.setupFastifyErrorHandler; +exports.graphqlIntegration = graphql.graphqlIntegration; +exports.kafkaIntegration = kafka.kafkaIntegration; +exports.lruMemoizerIntegration = lrumemoizer.lruMemoizerIntegration; +exports.mongoIntegration = mongo.mongoIntegration; +exports.mongooseIntegration = mongoose.mongooseIntegration; +exports.mysqlIntegration = mysql.mysqlIntegration; +exports.mysql2Integration = mysql2.mysql2Integration; +exports.redisIntegration = redis.redisIntegration; +exports.nestIntegration = nest.nestIntegration; +exports.setupNestErrorHandler = nest.setupNestErrorHandler; +exports.postgresIntegration = postgres.postgresIntegration; +exports.prismaIntegration = prisma.prismaIntegration; +exports.hapiIntegration = index$3.hapiIntegration; +exports.setupHapiErrorHandler = index$3.setupHapiErrorHandler; +exports.koaIntegration = koa.koaIntegration; +exports.setupKoaErrorHandler = koa.setupKoaErrorHandler; +exports.connectIntegration = connect.connectIntegration; +exports.setupConnectErrorHandler = connect.setupConnectErrorHandler; +exports.spotlightIntegration = spotlight.spotlightIntegration; +exports.knexIntegration = knex.knexIntegration; +exports.tediousIntegration = tedious.tediousIntegration; +exports.genericPoolIntegration = genericPool.genericPoolIntegration; +exports.dataloaderIntegration = dataloader.dataloaderIntegration; +exports.amqplibIntegration = amqplib.amqplibIntegration; +exports.childProcessIntegration = childProcess.childProcessIntegration; +exports.processThreadBreadcrumbIntegration = childProcess.processThreadBreadcrumbIntegration; +exports.SentryContextManager = contextManager.SentryContextManager; +exports.generateInstrumentOnce = instrument.generateInstrumentOnce; +exports.getDefaultIntegrations = index$4.getDefaultIntegrations; +exports.getDefaultIntegrationsWithoutPerformance = index$4.getDefaultIntegrationsWithoutPerformance; +exports.init = index$4.init; +exports.initWithoutDefaultIntegrations = index$4.initWithoutDefaultIntegrations; +exports.validateOpenTelemetrySetup = index$4.validateOpenTelemetrySetup; +exports.initOpenTelemetry = initOtel.initOpenTelemetry; +exports.preloadOpenTelemetry = initOtel.preloadOpenTelemetry; +exports.getAutoPerformanceIntegrations = index$5.getAutoPerformanceIntegrations; +exports.defaultStackParser = api.defaultStackParser; +exports.getSentryRelease = api.getSentryRelease; +exports.createGetModuleFromFilename = module$1.createGetModuleFromFilename; +exports.makeNodeTransport = http.makeNodeTransport; +exports.NodeClient = client.NodeClient; +exports.cron = index$6.cron; +exports.DEFAULT_USER_INCLUDES = core.DEFAULT_USER_INCLUDES; +exports.SDK_VERSION = core.SDK_VERSION; +exports.SEMANTIC_ATTRIBUTE_SENTRY_OP = core.SEMANTIC_ATTRIBUTE_SENTRY_OP; +exports.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN; +exports.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = core.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE; +exports.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE; +exports.Scope = core.Scope; +exports.addBreadcrumb = core.addBreadcrumb; +exports.addEventProcessor = core.addEventProcessor; +exports.addIntegration = core.addIntegration; +exports.addRequestDataToEvent = core.addRequestDataToEvent; +exports.captureCheckIn = core.captureCheckIn; +exports.captureConsoleIntegration = core.captureConsoleIntegration; +exports.captureEvent = core.captureEvent; +exports.captureException = core.captureException; +exports.captureFeedback = core.captureFeedback; +exports.captureMessage = core.captureMessage; +exports.captureSession = core.captureSession; +exports.close = core.close; +exports.continueTrace = core.continueTrace; +exports.createTransport = core.createTransport; +exports.debugIntegration = core.debugIntegration; +exports.dedupeIntegration = core.dedupeIntegration; +exports.endSession = core.endSession; +exports.extraErrorDataIntegration = core.extraErrorDataIntegration; +exports.extractRequestData = core.extractRequestData; +exports.flush = core.flush; +exports.functionToStringIntegration = core.functionToStringIntegration; +exports.getActiveSpan = core.getActiveSpan; +exports.getClient = core.getClient; +exports.getCurrentHub = core.getCurrentHub; +exports.getCurrentScope = core.getCurrentScope; +exports.getGlobalScope = core.getGlobalScope; +exports.getIsolationScope = core.getIsolationScope; +exports.getRootSpan = core.getRootSpan; +exports.getSpanDescendants = core.getSpanDescendants; +exports.getSpanStatusFromHttpCode = core.getSpanStatusFromHttpCode; +exports.getTraceData = core.getTraceData; +exports.getTraceMetaTags = core.getTraceMetaTags; +exports.inboundFiltersIntegration = core.inboundFiltersIntegration; +exports.isInitialized = core.isInitialized; +exports.lastEventId = core.lastEventId; +exports.linkedErrorsIntegration = core.linkedErrorsIntegration; +exports.metrics = core.metricsDefault; +exports.parameterize = core.parameterize; +exports.profiler = core.profiler; +exports.requestDataIntegration = core.requestDataIntegration; +exports.rewriteFramesIntegration = core.rewriteFramesIntegration; +exports.sessionTimingIntegration = core.sessionTimingIntegration; +exports.setContext = core.setContext; +exports.setCurrentClient = core.setCurrentClient; +exports.setExtra = core.setExtra; +exports.setExtras = core.setExtras; +exports.setHttpStatus = core.setHttpStatus; +exports.setMeasurement = core.setMeasurement; +exports.setTag = core.setTag; +exports.setTags = core.setTags; +exports.setUser = core.setUser; +exports.spanToBaggageHeader = core.spanToBaggageHeader; +exports.spanToJSON = core.spanToJSON; +exports.spanToTraceHeader = core.spanToTraceHeader; +exports.startInactiveSpan = core.startInactiveSpan; +exports.startNewTrace = core.startNewTrace; +exports.startSession = core.startSession; +exports.startSpan = core.startSpan; +exports.startSpanManual = core.startSpanManual; +exports.suppressTracing = core.suppressTracing; +exports.trpcMiddleware = core.trpcMiddleware; +exports.updateSpanName = core.updateSpanName; +exports.withActiveSpan = core.withActiveSpan; +exports.withIsolationScope = core.withIsolationScope; +exports.withMonitor = core.withMonitor; +exports.withScope = core.withScope; +exports.zodErrorsIntegration = core.zodErrorsIntegration; +exports.addOpenTelemetryInstrumentation = opentelemetry.addOpenTelemetryInstrumentation; +exports.setNodeAsyncContextStrategy = opentelemetry.setOpenTelemetryContextAsyncContextStrategy; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 83835: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain, + _optionalChainDelete +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const util = __nccwpck_require__(47261); +const node_worker_threads = __nccwpck_require__(24086); +const core = __nccwpck_require__(84466); +const nodeVersion = __nccwpck_require__(88196); +const debug = __nccwpck_require__(75915); + +const { isPromise } = util.types; + +// This string is a placeholder that gets overwritten with the worker code. +const base64WorkerScript = 'LyohIEBzZW50cnkvbm9kZSA4LjU0LjAgKGU5YTQ1ZmUpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyB0fWZyb20ibm9kZTppbnNwZWN0b3IiO2ltcG9ydHtwYXJlbnRQb3J0IGFzIG4sd29ya2VyRGF0YSBhcyBlfWZyb20ibm9kZTp3b3JrZXJfdGhyZWFkcyI7aW1wb3J0e3Bvc2l4IGFzIHIsc2VwIGFzIG99ZnJvbSJub2RlOnBhdGgiO2ltcG9ydCphcyBzIGZyb20ibm9kZTpodHRwIjtpbXBvcnQqYXMgaSBmcm9tIm5vZGU6aHR0cHMiO2ltcG9ydHtSZWFkYWJsZSBhcyBjfWZyb20ibm9kZTpzdHJlYW0iO2ltcG9ydHtjcmVhdGVHemlwIGFzIHV9ZnJvbSJub2RlOnpsaWIiO2ltcG9ydCphcyBhIGZyb20ibm9kZTpuZXQiO2ltcG9ydCphcyBmIGZyb20ibm9kZTp0bHMiO2NvbnN0IGg9InVuZGVmaW5lZCI9PXR5cGVvZiBfX1NFTlRSWV9ERUJVR19ffHxfX1NFTlRSWV9ERUJVR19fLHA9IjguNTQuMCIsbD1nbG9iYWxUaGlzO2Z1bmN0aW9uIGQodCxuLGUpe2NvbnN0IHI9bCxvPXIuX19TRU5UUllfXz1yLl9fU0VOVFJZX198fHt9LHM9b1twXT1vW3BdfHx7fTtyZXR1cm4gc1t0XXx8KHNbdF09bigpKX1jb25zdCBtPSJ1bmRlZmluZWQiPT10eXBlb2YgX19TRU5UUllfREVCVUdfX3x8X19TRU5UUllfREVCVUdfXyx5PVsiZGVidWciLCJpbmZvIiwid2FybiIsImVycm9yIiwibG9nIiwiYXNzZXJ0IiwidHJhY2UiXSxnPXt9O2Z1bmN0aW9uIGIodCl7aWYoISgiY29uc29sZSJpbiBsKSlyZXR1cm4gdCgpO2NvbnN0IG49bC5jb25zb2xlLGU9e30scj1PYmplY3Qua2V5cyhnKTtyLmZvckVhY2goKHQ9Pntjb25zdCByPWdbdF07ZVt0XT1uW3RdLG5bdF09cn0pKTt0cnl7cmV0dXJuIHQoKX1maW5hbGx5e3IuZm9yRWFjaCgodD0+e25bdF09ZVt0XX0pKX19Y29uc3QgXz1kKCJsb2dnZXIiLChmdW5jdGlvbigpe2xldCB0PSExO2NvbnN0IG49e2VuYWJsZTooKT0+e3Q9ITB9LGRpc2FibGU6KCk9Pnt0PSExfSxpc0VuYWJsZWQ6KCk9PnR9O3JldHVybiBtP3kuZm9yRWFjaCgoZT0+e25bZV09KC4uLm4pPT57dCYmYigoKCk9PntsLmNvbnNvbGVbZV0oYFNlbnRyeSBMb2dnZXIgWyR7ZX1dOmAsLi4ubil9KSl9fSkpOnkuZm9yRWFjaCgodD0+e25bdF09KCk9Pnt9fSkpLG59KSksdj01MCx3PSI/IixTPS9jYXB0dXJlTWVzc2FnZXxjYXB0dXJlRXhjZXB0aW9uLztmdW5jdGlvbiAkKHQpe3JldHVybiB0W3QubGVuZ3RoLTFdfHx7fX1jb25zdCBFPSI8YW5vbnltb3VzPiI7ZnVuY3Rpb24geCgpe3JldHVybiBOKGwpLGx9ZnVuY3Rpb24gTih0KXtjb25zdCBuPXQuX19TRU5UUllfXz10Ll9fU0VOVFJZX198fHt9O3JldHVybiBuLnZlcnNpb249bi52ZXJzaW9ufHxwLG5bcF09bltwXXx8e319Y29uc3QgVD1PYmplY3QucHJvdG90eXBlLnRvU3RyaW5nO2Z1bmN0aW9uIEModCxuKXtyZXR1cm4gVC5jYWxsKHQpPT09YFtvYmplY3QgJHtufV1gfWZ1bmN0aW9uIGoodCl7cmV0dXJuIEModCwiU3RyaW5nIil9ZnVuY3Rpb24gayh0KXtyZXR1cm4gQyh0LCJPYmplY3QiKX1mdW5jdGlvbiBSKHQpe3JldHVybiBCb29sZWFuKHQmJnQudGhlbiYmImZ1bmN0aW9uIj09dHlwZW9mIHQudGhlbil9ZnVuY3Rpb24gTyh0LG4pe3RyeXtyZXR1cm4gdCBpbnN0YW5jZW9mIG59Y2F0Y2godCl7cmV0dXJuITF9fWNvbnN0IEQ9bCxBPTgwO2Z1bmN0aW9uIEkodCxuKXtjb25zdCBlPXQscj1bXTtpZighZXx8IWUudGFnTmFtZSlyZXR1cm4iIjtpZihELkhUTUxFbGVtZW50JiZlIGluc3RhbmNlb2YgSFRNTEVsZW1lbnQmJmUuZGF0YXNldCl7aWYoZS5kYXRhc2V0LnNlbnRyeUNvbXBvbmVudClyZXR1cm4gZS5kYXRhc2V0LnNlbnRyeUNvbXBvbmVudDtpZihlLmRhdGFzZXQuc2VudHJ5RWxlbWVudClyZXR1cm4gZS5kYXRhc2V0LnNlbnRyeUVsZW1lbnR9ci5wdXNoKGUudGFnTmFtZS50b0xvd2VyQ2FzZSgpKTtjb25zdCBvPW4mJm4ubGVuZ3RoP24uZmlsdGVyKCh0PT5lLmdldEF0dHJpYnV0ZSh0KSkpLm1hcCgodD0+W3QsZS5nZXRBdHRyaWJ1dGUodCldKSk6bnVsbDtpZihvJiZvLmxlbmd0aClvLmZvckVhY2goKHQ9PntyLnB1c2goYFske3RbMF19PSIke3RbMV19Il1gKX0pKTtlbHNle2UuaWQmJnIucHVzaChgIyR7ZS5pZH1gKTtjb25zdCB0PWUuY2xhc3NOYW1lO2lmKHQmJmoodCkpe2NvbnN0IG49dC5zcGxpdCgvXHMrLyk7Zm9yKGNvbnN0IHQgb2YgbilyLnB1c2goYC4ke3R9YCl9fWNvbnN0IHM9WyJhcmlhLWxhYmVsIiwidHlwZSIsIm5hbWUiLCJ0aXRsZSIsImFsdCJdO2Zvcihjb25zdCB0IG9mIHMpe2NvbnN0IG49ZS5nZXRBdHRyaWJ1dGUodCk7biYmci5wdXNoKGBbJHt0fT0iJHtufSJdYCl9cmV0dXJuIHIuam9pbigiIil9ZnVuY3Rpb24gUCh0KXtpZihmdW5jdGlvbih0KXtzd2l0Y2goVC5jYWxsKHQpKXtjYXNlIltvYmplY3QgRXJyb3JdIjpjYXNlIltvYmplY3QgRXhjZXB0aW9uXSI6Y2FzZSJbb2JqZWN0IERPTUV4Y2VwdGlvbl0iOmNhc2UiW29iamVjdCBXZWJBc3NlbWJseS5FeGNlcHRpb25dIjpyZXR1cm4hMDtkZWZhdWx0OnJldHVybiBPKHQsRXJyb3IpfX0odCkpcmV0dXJue21lc3NhZ2U6dC5tZXNzYWdlLG5hbWU6dC5uYW1lLHN0YWNrOnQuc3RhY2ssLi4uTSh0KX07aWYobj10LCJ1bmRlZmluZWQiIT10eXBlb2YgRXZlbnQmJk8obixFdmVudCkpe2NvbnN0IG49e3R5cGU6dC50eXBlLHRhcmdldDpVKHQudGFyZ2V0KSxjdXJyZW50VGFyZ2V0OlUodC5jdXJyZW50VGFyZ2V0KSwuLi5NKHQpfTtyZXR1cm4idW5kZWZpbmVkIiE9dHlwZW9mIEN1c3RvbUV2ZW50JiZPKHQsQ3VzdG9tRXZlbnQpJiYobi5kZXRhaWw9dC5kZXRhaWwpLG59cmV0dXJuIHQ7dmFyIG59ZnVuY3Rpb24gVSh0KXt0cnl7cmV0dXJuIG49dCwidW5kZWZpbmVkIiE9dHlwZW9mIEVsZW1lbnQmJk8obixFbGVtZW50KT9mdW5jdGlvbih0LG49e30pe2lmKCF0KXJldHVybiI8dW5rbm93bj4iO3RyeXtsZXQgZT10O2NvbnN0IHI9NSxvPVtdO2xldCBzPTAsaT0wO2NvbnN0IGM9IiA+ICIsdT1jLmxlbmd0aDtsZXQgYTtjb25zdCBmPUFycmF5LmlzQXJyYXkobik/bjpuLmtleUF0dHJzLGg9IUFycmF5LmlzQXJyYXkobikmJm4ubWF4U3RyaW5nTGVuZ3RofHxBO2Zvcig7ZSYmcysrPHImJihhPUkoZSxmKSwhKCJodG1sIj09PWF8fHM+MSYmaStvLmxlbmd0aCp1K2EubGVuZ3RoPj1oKSk7KW8ucHVzaChhKSxpKz1hLmxlbmd0aCxlPWUucGFyZW50Tm9kZTtyZXR1cm4gby5yZXZlcnNlKCkuam9pbihjKX1jYXRjaCh0KXtyZXR1cm4iPHVua25vd24+In19KHQpOk9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbCh0KX1jYXRjaCh0KXtyZXR1cm4iPHVua25vd24+In12YXIgbn1mdW5jdGlvbiBNKHQpe2lmKCJvYmplY3QiPT10eXBlb2YgdCYmbnVsbCE9PXQpe2NvbnN0IG49e307Zm9yKGNvbnN0IGUgaW4gdClPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwodCxlKSYmKG5bZV09dFtlXSk7cmV0dXJuIG59cmV0dXJue319ZnVuY3Rpb24gTCh0KXtyZXR1cm4gQih0LG5ldyBNYXApfWZ1bmN0aW9uIEIodCxuKXtpZihmdW5jdGlvbih0KXtpZighayh0KSlyZXR1cm4hMTt0cnl7Y29uc3Qgbj1PYmplY3QuZ2V0UHJvdG90eXBlT2YodCkuY29uc3RydWN0b3IubmFtZTtyZXR1cm4hbnx8Ik9iamVjdCI9PT1ufWNhdGNoKHQpe3JldHVybiEwfX0odCkpe2NvbnN0IGU9bi5nZXQodCk7aWYodm9pZCAwIT09ZSlyZXR1cm4gZTtjb25zdCByPXt9O24uc2V0KHQscik7Zm9yKGNvbnN0IGUgb2YgT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXModCkpdm9pZCAwIT09dFtlXSYmKHJbZV09Qih0W2VdLG4pKTtyZXR1cm4gcn1pZihBcnJheS5pc0FycmF5KHQpKXtjb25zdCBlPW4uZ2V0KHQpO2lmKHZvaWQgMCE9PWUpcmV0dXJuIGU7Y29uc3Qgcj1bXTtyZXR1cm4gbi5zZXQodCxyKSx0LmZvckVhY2goKHQ9PntyLnB1c2goQih0LG4pKX0pKSxyfXJldHVybiB0fWNvbnN0IEc9MWUzO2Z1bmN0aW9uIEooKXtyZXR1cm4gRGF0ZS5ub3coKS9HfWNvbnN0IFk9ZnVuY3Rpb24oKXtjb25zdHtwZXJmb3JtYW5jZTp0fT1sO2lmKCF0fHwhdC5ub3cpcmV0dXJuIEo7Y29uc3Qgbj1EYXRlLm5vdygpLXQubm93KCksZT1udWxsPT10LnRpbWVPcmlnaW4/bjp0LnRpbWVPcmlnaW47cmV0dXJuKCk9PihlK3Qubm93KCkpL0d9KCk7ZnVuY3Rpb24geigpe2NvbnN0IHQ9bCxuPXQuY3J5cHRvfHx0Lm1zQ3J5cHRvO2xldCBlPSgpPT4xNipNYXRoLnJhbmRvbSgpO3RyeXtpZihuJiZuLnJhbmRvbVVVSUQpcmV0dXJuIG4ucmFuZG9tVVVJRCgpLnJlcGxhY2UoLy0vZywiIik7biYmbi5nZXRSYW5kb21WYWx1ZXMmJihlPSgpPT57Y29uc3QgdD1uZXcgVWludDhBcnJheSgxKTtyZXR1cm4gbi5nZXRSYW5kb21WYWx1ZXModCksdFswXX0pfWNhdGNoKHQpe31yZXR1cm4oWzFlN10rMWUzKzRlMys4ZTMrMWUxMSkucmVwbGFjZSgvWzAxOF0vZywodD0+KHReKDE1JmUoKSk+PnQvNCkudG9TdHJpbmcoMTYpKSl9dmFyIEg7ZnVuY3Rpb24gVyh0KXtyZXR1cm4gbmV3IEYoKG49PntuKHQpfSkpfSgoKT0+e2NvbnN0e3BlcmZvcm1hbmNlOnR9PWw7aWYoIXR8fCF0Lm5vdylyZXR1cm47Y29uc3Qgbj0zNmU1LGU9dC5ub3coKSxyPURhdGUubm93KCksbz10LnRpbWVPcmlnaW4/TWF0aC5hYnModC50aW1lT3JpZ2luK2Utcik6bixzPW88bixpPXQudGltaW5nJiZ0LnRpbWluZy5uYXZpZ2F0aW9uU3RhcnQsYz0ibnVtYmVyIj09dHlwZW9mIGk/TWF0aC5hYnMoaStlLXIpOm47KHN8fGM8bikmJihvPD1jJiZ0LnRpbWVPcmlnaW4pfSkoKSxmdW5jdGlvbih0KXt0W3QuUEVORElORz0wXT0iUEVORElORyI7dFt0LlJFU09MVkVEPTFdPSJSRVNPTFZFRCI7dFt0LlJFSkVDVEVEPTJdPSJSRUpFQ1RFRCJ9KEh8fChIPXt9KSk7Y2xhc3MgRntjb25zdHJ1Y3Rvcih0KXtGLnByb3RvdHlwZS5fX2luaXQuY2FsbCh0aGlzKSxGLnByb3RvdHlwZS5fX2luaXQyLmNhbGwodGhpcyksRi5wcm90b3R5cGUuX19pbml0My5jYWxsKHRoaXMpLEYucHJvdG90eXBlLl9faW5pdDQuY2FsbCh0aGlzKSx0aGlzLnQ9SC5QRU5ESU5HLHRoaXMubz1bXTt0cnl7dCh0aGlzLmksdGhpcy51KX1jYXRjaCh0KXt0aGlzLnUodCl9fXRoZW4odCxuKXtyZXR1cm4gbmV3IEYoKChlLHIpPT57dGhpcy5vLnB1c2goWyExLG49PntpZih0KXRyeXtlKHQobikpfWNhdGNoKHQpe3IodCl9ZWxzZSBlKG4pfSx0PT57aWYobil0cnl7ZShuKHQpKX1jYXRjaCh0KXtyKHQpfWVsc2Ugcih0KX1dKSx0aGlzLmgoKX0pKX1jYXRjaCh0KXtyZXR1cm4gdGhpcy50aGVuKCh0PT50KSx0KX1maW5hbGx5KHQpe3JldHVybiBuZXcgRigoKG4sZSk9PntsZXQgcixvO3JldHVybiB0aGlzLnRoZW4oKG49PntvPSExLHI9bix0JiZ0KCl9KSwobj0+e289ITAscj1uLHQmJnQoKX0pKS50aGVuKCgoKT0+e28/ZShyKTpuKHIpfSkpfSkpfV9faW5pdCgpe3RoaXMuaT10PT57dGhpcy5wKEguUkVTT0xWRUQsdCl9fV9faW5pdDIoKXt0aGlzLnU9dD0+e3RoaXMucChILlJFSkVDVEVELHQpfX1fX2luaXQzKCl7dGhpcy5wPSh0LG4pPT57dGhpcy50PT09SC5QRU5ESU5HJiYoUihuKT9uLnRoZW4odGhpcy5pLHRoaXMudSk6KHRoaXMudD10LHRoaXMubD1uLHRoaXMuaCgpKSl9fV9faW5pdDQoKXt0aGlzLmg9KCk9PntpZih0aGlzLnQ9PT1ILlBFTkRJTkcpcmV0dXJuO2NvbnN0IHQ9dGhpcy5vLnNsaWNlKCk7dGhpcy5vPVtdLHQuZm9yRWFjaCgodD0+e3RbMF18fCh0aGlzLnQ9PT1ILlJFU09MVkVEJiZ0WzFdKHRoaXMubCksdGhpcy50PT09SC5SRUpFQ1RFRCYmdFsyXSh0aGlzLmwpLHRbMF09ITApfSkpfX19ZnVuY3Rpb24gSyh0KXtjb25zdCBuPVkoKSxlPXtzaWQ6eigpLGluaXQ6ITAsdGltZXN0YW1wOm4sc3RhcnRlZDpuLGR1cmF0aW9uOjAsc3RhdHVzOiJvayIsZXJyb3JzOjAsaWdub3JlRHVyYXRpb246ITEsdG9KU09OOigpPT5mdW5jdGlvbih0KXtyZXR1cm4gTCh7c2lkOmAke3Quc2lkfWAsaW5pdDp0LmluaXQsc3RhcnRlZDpuZXcgRGF0ZSgxZTMqdC5zdGFydGVkKS50b0lTT1N0cmluZygpLHRpbWVzdGFtcDpuZXcgRGF0ZSgxZTMqdC50aW1lc3RhbXApLnRvSVNPU3RyaW5nKCksc3RhdHVzOnQuc3RhdHVzLGVycm9yczp0LmVycm9ycyxkaWQ6Im51bWJlciI9PXR5cGVvZiB0LmRpZHx8InN0cmluZyI9PXR5cGVvZiB0LmRpZD9gJHt0LmRpZH1gOnZvaWQgMCxkdXJhdGlvbjp0LmR1cmF0aW9uLGFibm9ybWFsX21lY2hhbmlzbTp0LmFibm9ybWFsX21lY2hhbmlzbSxhdHRyczp7cmVsZWFzZTp0LnJlbGVhc2UsZW52aXJvbm1lbnQ6dC5lbnZpcm9ubWVudCxpcF9hZGRyZXNzOnQuaXBBZGRyZXNzLHVzZXJfYWdlbnQ6dC51c2VyQWdlbnR9fSl9KGUpfTtyZXR1cm4gdCYmVihlLHQpLGV9ZnVuY3Rpb24gVih0LG49e30pe2lmKG4udXNlciYmKCF0LmlwQWRkcmVzcyYmbi51c2VyLmlwX2FkZHJlc3MmJih0LmlwQWRkcmVzcz1uLnVzZXIuaXBfYWRkcmVzcyksdC5kaWR8fG4uZGlkfHwodC5kaWQ9bi51c2VyLmlkfHxuLnVzZXIuZW1haWx8fG4udXNlci51c2VybmFtZSkpLHQudGltZXN0YW1wPW4udGltZXN0YW1wfHxZKCksbi5hYm5vcm1hbF9tZWNoYW5pc20mJih0LmFibm9ybWFsX21lY2hhbmlzbT1uLmFibm9ybWFsX21lY2hhbmlzbSksbi5pZ25vcmVEdXJhdGlvbiYmKHQuaWdub3JlRHVyYXRpb249bi5pZ25vcmVEdXJhdGlvbiksbi5zaWQmJih0LnNpZD0zMj09PW4uc2lkLmxlbmd0aD9uLnNpZDp6KCkpLHZvaWQgMCE9PW4uaW5pdCYmKHQuaW5pdD1uLmluaXQpLCF0LmRpZCYmbi5kaWQmJih0LmRpZD1gJHtuLmRpZH1gKSwibnVtYmVyIj09dHlwZW9mIG4uc3RhcnRlZCYmKHQuc3RhcnRlZD1uLnN0YXJ0ZWQpLHQuaWdub3JlRHVyYXRpb24pdC5kdXJhdGlvbj12b2lkIDA7ZWxzZSBpZigibnVtYmVyIj09dHlwZW9mIG4uZHVyYXRpb24pdC5kdXJhdGlvbj1uLmR1cmF0aW9uO2Vsc2V7Y29uc3Qgbj10LnRpbWVzdGFtcC10LnN0YXJ0ZWQ7dC5kdXJhdGlvbj1uPj0wP246MH1uLnJlbGVhc2UmJih0LnJlbGVhc2U9bi5yZWxlYXNlKSxuLmVudmlyb25tZW50JiYodC5lbnZpcm9ubWVudD1uLmVudmlyb25tZW50KSwhdC5pcEFkZHJlc3MmJm4uaXBBZGRyZXNzJiYodC5pcEFkZHJlc3M9bi5pcEFkZHJlc3MpLCF0LnVzZXJBZ2VudCYmbi51c2VyQWdlbnQmJih0LnVzZXJBZ2VudD1uLnVzZXJBZ2VudCksIm51bWJlciI9PXR5cGVvZiBuLmVycm9ycyYmKHQuZXJyb3JzPW4uZXJyb3JzKSxuLnN0YXR1cyYmKHQuc3RhdHVzPW4uc3RhdHVzKX1mdW5jdGlvbiBaKCl7cmV0dXJuIHooKX1mdW5jdGlvbiBxKCl7cmV0dXJuIHooKS5zdWJzdHJpbmcoMTYpfWZ1bmN0aW9uIFEodCxuLGU9Mil7aWYoIW58fCJvYmplY3QiIT10eXBlb2Ygbnx8ZTw9MClyZXR1cm4gbjtpZih0JiZuJiYwPT09T2JqZWN0LmtleXMobikubGVuZ3RoKXJldHVybiB0O2NvbnN0IHI9ey4uLnR9O2Zvcihjb25zdCB0IGluIG4pT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKG4sdCkmJihyW3RdPVEoclt0XSxuW3RdLGUtMSkpO3JldHVybiByfWNvbnN0IFg9Il9zZW50cnlTcGFuIjtmdW5jdGlvbiB0dCh0LG4pe24/ZnVuY3Rpb24odCxuLGUpe3RyeXtPYmplY3QuZGVmaW5lUHJvcGVydHkodCxuLHt2YWx1ZTplLHdyaXRhYmxlOiEwLGNvbmZpZ3VyYWJsZTohMH0pfWNhdGNoKGUpe20mJl8ubG9nKGBGYWlsZWQgdG8gYWRkIG5vbi1lbnVtZXJhYmxlIHByb3BlcnR5ICIke259IiB0byBvYmplY3RgLHQpfX0odCxYLG4pOmRlbGV0ZSB0W1hdfWZ1bmN0aW9uIG50KHQpe3JldHVybiB0W1hdfWNsYXNzIGV0e2NvbnN0cnVjdG9yKCl7dGhpcy5tPSExLHRoaXMuXz1bXSx0aGlzLnY9W10sdGhpcy5TPVtdLHRoaXMuTj1bXSx0aGlzLlQ9e30sdGhpcy5DPXt9LHRoaXMuaj17fSx0aGlzLms9e30sdGhpcy5SPXt9LHRoaXMuTz17dHJhY2VJZDpaKCksc3BhbklkOnEoKX19Y2xvbmUoKXtjb25zdCB0PW5ldyBldDtyZXR1cm4gdC5TPVsuLi50aGlzLlNdLHQuQz17Li4udGhpcy5DfSx0Lmo9ey4uLnRoaXMuan0sdC5rPXsuLi50aGlzLmt9LHRoaXMuay5mbGFncyYmKHQuay5mbGFncz17dmFsdWVzOlsuLi50aGlzLmsuZmxhZ3MudmFsdWVzXX0pLHQuVD10aGlzLlQsdC5EPXRoaXMuRCx0LkE9dGhpcy5BLHQuST10aGlzLkksdC5QPXRoaXMuUCx0LnY9Wy4uLnRoaXMudl0sdC5VPXRoaXMuVSx0Lk49Wy4uLnRoaXMuTl0sdC5SPXsuLi50aGlzLlJ9LHQuTz17Li4udGhpcy5PfSx0Lk09dGhpcy5NLHQuTD10aGlzLkwsdHQodCxudCh0aGlzKSksdH1zZXRDbGllbnQodCl7dGhpcy5NPXR9c2V0TGFzdEV2ZW50SWQodCl7dGhpcy5MPXR9Z2V0Q2xpZW50KCl7cmV0dXJuIHRoaXMuTX1sYXN0RXZlbnRJZCgpe3JldHVybiB0aGlzLkx9YWRkU2NvcGVMaXN0ZW5lcih0KXt0aGlzLl8ucHVzaCh0KX1hZGRFdmVudFByb2Nlc3Nvcih0KXtyZXR1cm4gdGhpcy52LnB1c2godCksdGhpc31zZXRVc2VyKHQpe3JldHVybiB0aGlzLlQ9dHx8e2VtYWlsOnZvaWQgMCxpZDp2b2lkIDAsaXBfYWRkcmVzczp2b2lkIDAsdXNlcm5hbWU6dm9pZCAwfSx0aGlzLkEmJlYodGhpcy5BLHt1c2VyOnR9KSx0aGlzLkIoKSx0aGlzfWdldFVzZXIoKXtyZXR1cm4gdGhpcy5UfWdldFJlcXVlc3RTZXNzaW9uKCl7cmV0dXJuIHRoaXMuVX1zZXRSZXF1ZXN0U2Vzc2lvbih0KXtyZXR1cm4gdGhpcy5VPXQsdGhpc31zZXRUYWdzKHQpe3JldHVybiB0aGlzLkM9ey4uLnRoaXMuQywuLi50fSx0aGlzLkIoKSx0aGlzfXNldFRhZyh0LG4pe3JldHVybiB0aGlzLkM9ey4uLnRoaXMuQyxbdF06bn0sdGhpcy5CKCksdGhpc31zZXRFeHRyYXModCl7cmV0dXJuIHRoaXMuaj17Li4udGhpcy5qLC4uLnR9LHRoaXMuQigpLHRoaXN9c2V0RXh0cmEodCxuKXtyZXR1cm4gdGhpcy5qPXsuLi50aGlzLmosW3RdOm59LHRoaXMuQigpLHRoaXN9c2V0RmluZ2VycHJpbnQodCl7cmV0dXJuIHRoaXMuUD10LHRoaXMuQigpLHRoaXN9c2V0TGV2ZWwodCl7cmV0dXJuIHRoaXMuRD10LHRoaXMuQigpLHRoaXN9c2V0VHJhbnNhY3Rpb25OYW1lKHQpe3JldHVybiB0aGlzLkk9dCx0aGlzLkIoKSx0aGlzfXNldENvbnRleHQodCxuKXtyZXR1cm4gbnVsbD09PW4/ZGVsZXRlIHRoaXMua1t0XTp0aGlzLmtbdF09bix0aGlzLkIoKSx0aGlzfXNldFNlc3Npb24odCl7cmV0dXJuIHQ/dGhpcy5BPXQ6ZGVsZXRlIHRoaXMuQSx0aGlzLkIoKSx0aGlzfWdldFNlc3Npb24oKXtyZXR1cm4gdGhpcy5BfXVwZGF0ZSh0KXtpZighdClyZXR1cm4gdGhpcztjb25zdCBuPSJmdW5jdGlvbiI9PXR5cGVvZiB0P3QodGhpcyk6dCxbZSxyXT1uIGluc3RhbmNlb2YgcnQ/W24uZ2V0U2NvcGVEYXRhKCksbi5nZXRSZXF1ZXN0U2Vzc2lvbigpXTprKG4pP1t0LHQucmVxdWVzdFNlc3Npb25dOltdLHt0YWdzOm8sZXh0cmE6cyx1c2VyOmksY29udGV4dHM6YyxsZXZlbDp1LGZpbmdlcnByaW50OmE9W10scHJvcGFnYXRpb25Db250ZXh0OmZ9PWV8fHt9O3JldHVybiB0aGlzLkM9ey4uLnRoaXMuQywuLi5vfSx0aGlzLmo9ey4uLnRoaXMuaiwuLi5zfSx0aGlzLms9ey4uLnRoaXMuaywuLi5jfSxpJiZPYmplY3Qua2V5cyhpKS5sZW5ndGgmJih0aGlzLlQ9aSksdSYmKHRoaXMuRD11KSxhLmxlbmd0aCYmKHRoaXMuUD1hKSxmJiYodGhpcy5PPWYpLHImJih0aGlzLlU9ciksdGhpc31jbGVhcigpe3JldHVybiB0aGlzLlM9W10sdGhpcy5DPXt9LHRoaXMuaj17fSx0aGlzLlQ9e30sdGhpcy5rPXt9LHRoaXMuRD12b2lkIDAsdGhpcy5JPXZvaWQgMCx0aGlzLlA9dm9pZCAwLHRoaXMuVT12b2lkIDAsdGhpcy5BPXZvaWQgMCx0dCh0aGlzLHZvaWQgMCksdGhpcy5OPVtdLHRoaXMuc2V0UHJvcGFnYXRpb25Db250ZXh0KHt0cmFjZUlkOlooKX0pLHRoaXMuQigpLHRoaXN9YWRkQnJlYWRjcnVtYih0LG4pe2NvbnN0IGU9Im51bWJlciI9PXR5cGVvZiBuP246MTAwO2lmKGU8PTApcmV0dXJuIHRoaXM7Y29uc3Qgcj17dGltZXN0YW1wOkooKSwuLi50fTtyZXR1cm4gdGhpcy5TLnB1c2gociksdGhpcy5TLmxlbmd0aD5lJiYodGhpcy5TPXRoaXMuUy5zbGljZSgtZSksdGhpcy5NJiZ0aGlzLk0ucmVjb3JkRHJvcHBlZEV2ZW50KCJidWZmZXJfb3ZlcmZsb3ciLCJsb2dfaXRlbSIpKSx0aGlzLkIoKSx0aGlzfWdldExhc3RCcmVhZGNydW1iKCl7cmV0dXJuIHRoaXMuU1t0aGlzLlMubGVuZ3RoLTFdfWNsZWFyQnJlYWRjcnVtYnMoKXtyZXR1cm4gdGhpcy5TPVtdLHRoaXMuQigpLHRoaXN9YWRkQXR0YWNobWVudCh0KXtyZXR1cm4gdGhpcy5OLnB1c2godCksdGhpc31jbGVhckF0dGFjaG1lbnRzKCl7cmV0dXJuIHRoaXMuTj1bXSx0aGlzfWdldFNjb3BlRGF0YSgpe3JldHVybnticmVhZGNydW1iczp0aGlzLlMsYXR0YWNobWVudHM6dGhpcy5OLGNvbnRleHRzOnRoaXMuayx0YWdzOnRoaXMuQyxleHRyYTp0aGlzLmosdXNlcjp0aGlzLlQsbGV2ZWw6dGhpcy5ELGZpbmdlcnByaW50OnRoaXMuUHx8W10sZXZlbnRQcm9jZXNzb3JzOnRoaXMudixwcm9wYWdhdGlvbkNvbnRleHQ6dGhpcy5PLHNka1Byb2Nlc3NpbmdNZXRhZGF0YTp0aGlzLlIsdHJhbnNhY3Rpb25OYW1lOnRoaXMuSSxzcGFuOm50KHRoaXMpfX1zZXRTREtQcm9jZXNzaW5nTWV0YWRhdGEodCl7cmV0dXJuIHRoaXMuUj1RKHRoaXMuUix0LDIpLHRoaXN9c2V0UHJvcGFnYXRpb25Db250ZXh0KHQpe3JldHVybiB0aGlzLk89e3NwYW5JZDpxKCksLi4udH0sdGhpc31nZXRQcm9wYWdhdGlvbkNvbnRleHQoKXtyZXR1cm4gdGhpcy5PfWNhcHR1cmVFeGNlcHRpb24odCxuKXtjb25zdCBlPW4mJm4uZXZlbnRfaWQ/bi5ldmVudF9pZDp6KCk7aWYoIXRoaXMuTSlyZXR1cm4gXy53YXJuKCJObyBjbGllbnQgY29uZmlndXJlZCBvbiBzY29wZSAtIHdpbGwgbm90IGNhcHR1cmUgZXhjZXB0aW9uISIpLGU7Y29uc3Qgcj1uZXcgRXJyb3IoIlNlbnRyeSBzeW50aGV0aWNFeGNlcHRpb24iKTtyZXR1cm4gdGhpcy5NLmNhcHR1cmVFeGNlcHRpb24odCx7b3JpZ2luYWxFeGNlcHRpb246dCxzeW50aGV0aWNFeGNlcHRpb246ciwuLi5uLGV2ZW50X2lkOmV9LHRoaXMpLGV9Y2FwdHVyZU1lc3NhZ2UodCxuLGUpe2NvbnN0IHI9ZSYmZS5ldmVudF9pZD9lLmV2ZW50X2lkOnooKTtpZighdGhpcy5NKXJldHVybiBfLndhcm4oIk5vIGNsaWVudCBjb25maWd1cmVkIG9uIHNjb3BlIC0gd2lsbCBub3QgY2FwdHVyZSBtZXNzYWdlISIpLHI7Y29uc3Qgbz1uZXcgRXJyb3IodCk7cmV0dXJuIHRoaXMuTS5jYXB0dXJlTWVzc2FnZSh0LG4se29yaWdpbmFsRXhjZXB0aW9uOnQsc3ludGhldGljRXhjZXB0aW9uOm8sLi4uZSxldmVudF9pZDpyfSx0aGlzKSxyfWNhcHR1cmVFdmVudCh0LG4pe2NvbnN0IGU9biYmbi5ldmVudF9pZD9uLmV2ZW50X2lkOnooKTtyZXR1cm4gdGhpcy5NPyh0aGlzLk0uY2FwdHVyZUV2ZW50KHQsey4uLm4sZXZlbnRfaWQ6ZX0sdGhpcyksZSk6KF8ud2FybigiTm8gY2xpZW50IGNvbmZpZ3VyZWQgb24gc2NvcGUgLSB3aWxsIG5vdCBjYXB0dXJlIGV2ZW50ISIpLGUpfUIoKXt0aGlzLm18fCh0aGlzLm09ITAsdGhpcy5fLmZvckVhY2goKHQ9Pnt0KHRoaXMpfSkpLHRoaXMubT0hMSl9fWNvbnN0IHJ0PWV0O2NsYXNzIG90e2NvbnN0cnVjdG9yKHQsbil7bGV0IGUscjtlPXR8fG5ldyBydCxyPW58fG5ldyBydCx0aGlzLkc9W3tzY29wZTplfV0sdGhpcy5KPXJ9d2l0aFNjb3BlKHQpe2NvbnN0IG49dGhpcy5ZKCk7bGV0IGU7dHJ5e2U9dChuKX1jYXRjaCh0KXt0aHJvdyB0aGlzLkgoKSx0fXJldHVybiBSKGUpP2UudGhlbigodD0+KHRoaXMuSCgpLHQpKSwodD0+e3Rocm93IHRoaXMuSCgpLHR9KSk6KHRoaXMuSCgpLGUpfWdldENsaWVudCgpe3JldHVybiB0aGlzLmdldFN0YWNrVG9wKCkuY2xpZW50fWdldFNjb3BlKCl7cmV0dXJuIHRoaXMuZ2V0U3RhY2tUb3AoKS5zY29wZX1nZXRJc29sYXRpb25TY29wZSgpe3JldHVybiB0aGlzLkp9Z2V0U3RhY2tUb3AoKXtyZXR1cm4gdGhpcy5HW3RoaXMuRy5sZW5ndGgtMV19WSgpe2NvbnN0IHQ9dGhpcy5nZXRTY29wZSgpLmNsb25lKCk7cmV0dXJuIHRoaXMuRy5wdXNoKHtjbGllbnQ6dGhpcy5nZXRDbGllbnQoKSxzY29wZTp0fSksdH1IKCl7cmV0dXJuISh0aGlzLkcubGVuZ3RoPD0xKSYmISF0aGlzLkcucG9wKCl9fWZ1bmN0aW9uIHN0KCl7Y29uc3QgdD1OKHgoKSk7cmV0dXJuIHQuc3RhY2s9dC5zdGFja3x8bmV3IG90KGQoImRlZmF1bHRDdXJyZW50U2NvcGUiLCgoKT0+bmV3IHJ0KSksZCgiZGVmYXVsdElzb2xhdGlvblNjb3BlIiwoKCk9Pm5ldyBydCkpKX1mdW5jdGlvbiBpdCh0KXtyZXR1cm4gc3QoKS53aXRoU2NvcGUodCl9ZnVuY3Rpb24gY3QodCxuKXtjb25zdCBlPXN0KCk7cmV0dXJuIGUud2l0aFNjb3BlKCgoKT0+KGUuZ2V0U3RhY2tUb3AoKS5zY29wZT10LG4odCkpKSl9ZnVuY3Rpb24gdXQodCl7cmV0dXJuIHN0KCkud2l0aFNjb3BlKCgoKT0+dChzdCgpLmdldElzb2xhdGlvblNjb3BlKCkpKSl9ZnVuY3Rpb24gYXQodCl7Y29uc3Qgbj1OKHQpO3JldHVybiBuLmFjcz9uLmFjczp7d2l0aElzb2xhdGlvblNjb3BlOnV0LHdpdGhTY29wZTppdCx3aXRoU2V0U2NvcGU6Y3Qsd2l0aFNldElzb2xhdGlvblNjb3BlOih0LG4pPT51dChuKSxnZXRDdXJyZW50U2NvcGU6KCk9PnN0KCkuZ2V0U2NvcGUoKSxnZXRJc29sYXRpb25TY29wZTooKT0+c3QoKS5nZXRJc29sYXRpb25TY29wZSgpfX1mdW5jdGlvbiBmdCgpe3JldHVybiBhdCh4KCkpLmdldEN1cnJlbnRTY29wZSgpLmdldENsaWVudCgpfWNvbnN0IGh0PSJfc2VudHJ5TWV0cmljcyI7ZnVuY3Rpb24gcHQodCl7Y29uc3Qgbj10W2h0XTtpZighbilyZXR1cm47Y29uc3QgZT17fTtmb3IoY29uc3RbLFt0LHJdXW9mIG4peyhlW3RdfHwoZVt0XT1bXSkpLnB1c2goTChyKSl9cmV0dXJuIGV9Y29uc3QgbHQ9InNlbnRyeS5zb3VyY2UiLGR0PSJzZW50cnkuc2FtcGxlX3JhdGUiLG10PSJzZW50cnkub3AiLHl0PSJzZW50cnkub3JpZ2luIixndD0wLGJ0PTEsX3Q9InNlbnRyeS0iLHZ0PS9ec2VudHJ5LS87ZnVuY3Rpb24gd3QodCl7Y29uc3Qgbj1mdW5jdGlvbih0KXtpZighdHx8IWoodCkmJiFBcnJheS5pc0FycmF5KHQpKXJldHVybjtpZihBcnJheS5pc0FycmF5KHQpKXJldHVybiB0LnJlZHVjZSgoKHQsbik9Pntjb25zdCBlPVN0KG4pO3JldHVybiBPYmplY3QuZW50cmllcyhlKS5mb3JFYWNoKCgoW24sZV0pPT57dFtuXT1lfSkpLHR9KSx7fSk7cmV0dXJuIFN0KHQpfSh0KTtpZighbilyZXR1cm47Y29uc3QgZT1PYmplY3QuZW50cmllcyhuKS5yZWR1Y2UoKCh0LFtuLGVdKT0+e2lmKG4ubWF0Y2godnQpKXt0W24uc2xpY2UoX3QubGVuZ3RoKV09ZX1yZXR1cm4gdH0pLHt9KTtyZXR1cm4gT2JqZWN0LmtleXMoZSkubGVuZ3RoPjA/ZTp2b2lkIDB9ZnVuY3Rpb24gU3QodCl7cmV0dXJuIHQuc3BsaXQoIiwiKS5tYXAoKHQ9PnQuc3BsaXQoIj0iKS5tYXAoKHQ9PmRlY29kZVVSSUNvbXBvbmVudCh0LnRyaW0oKSkpKSkpLnJlZHVjZSgoKHQsW24sZV0pPT4obiYmZSYmKHRbbl09ZSksdCkpLHt9KX1jb25zdCAkdD0xO2Z1bmN0aW9uIEV0KHQpe2NvbnN0e3NwYW5JZDpuLHRyYWNlSWQ6ZSxpc1JlbW90ZTpyfT10LnNwYW5Db250ZXh0KCk7cmV0dXJuIEwoe3BhcmVudF9zcGFuX2lkOnI/bjpUdCh0KS5wYXJlbnRfc3Bhbl9pZCxzcGFuX2lkOnI/cSgpOm4sdHJhY2VfaWQ6ZX0pfWZ1bmN0aW9uIHh0KHQpe3JldHVybiJudW1iZXIiPT10eXBlb2YgdD9OdCh0KTpBcnJheS5pc0FycmF5KHQpP3RbMF0rdFsxXS8xZTk6dCBpbnN0YW5jZW9mIERhdGU/TnQodC5nZXRUaW1lKCkpOlkoKX1mdW5jdGlvbiBOdCh0KXtyZXR1cm4gdD45OTk5OTk5OTk5P3QvMWUzOnR9ZnVuY3Rpb24gVHQodCl7aWYoZnVuY3Rpb24odCl7cmV0dXJuImZ1bmN0aW9uIj09dHlwZW9mIHQuZ2V0U3BhbkpTT059KHQpKXJldHVybiB0LmdldFNwYW5KU09OKCk7dHJ5e2NvbnN0e3NwYW5JZDpuLHRyYWNlSWQ6ZX09dC5zcGFuQ29udGV4dCgpO2lmKGZ1bmN0aW9uKHQpe2NvbnN0IG49dDtyZXR1cm4hIShuLmF0dHJpYnV0ZXMmJm4uc3RhcnRUaW1lJiZuLm5hbWUmJm4uZW5kVGltZSYmbi5zdGF0dXMpfSh0KSl7Y29uc3R7YXR0cmlidXRlczpyLHN0YXJ0VGltZTpvLG5hbWU6cyxlbmRUaW1lOmkscGFyZW50U3BhbklkOmMsc3RhdHVzOnV9PXQ7cmV0dXJuIEwoe3NwYW5faWQ6bix0cmFjZV9pZDplLGRhdGE6cixkZXNjcmlwdGlvbjpzLHBhcmVudF9zcGFuX2lkOmMsc3RhcnRfdGltZXN0YW1wOnh0KG8pLHRpbWVzdGFtcDp4dChpKXx8dm9pZCAwLHN0YXR1czpDdCh1KSxvcDpyW210XSxvcmlnaW46clt5dF0sX21ldHJpY3Nfc3VtbWFyeTpwdCh0KX0pfXJldHVybntzcGFuX2lkOm4sdHJhY2VfaWQ6ZX19Y2F0Y2godCl7cmV0dXJue319fWZ1bmN0aW9uIEN0KHQpe2lmKHQmJnQuY29kZSE9PWd0KXJldHVybiB0LmNvZGU9PT1idD8ib2siOnQubWVzc2FnZXx8InVua25vd25fZXJyb3IifWNvbnN0IGp0PSJfc2VudHJ5Um9vdFNwYW4iO2Z1bmN0aW9uIGt0KHQpe3JldHVybiB0W2p0XXx8dH1jb25zdCBSdD0icHJvZHVjdGlvbiIsT3Q9Il9mcm96ZW5Ec2MiO2Z1bmN0aW9uIER0KHQpe2NvbnN0IG49ZnQoKTtpZighbilyZXR1cm57fTtjb25zdCBlPWt0KHQpLHI9ZVtPdF07aWYocilyZXR1cm4gcjtjb25zdCBvPWUuc3BhbkNvbnRleHQoKS50cmFjZVN0YXRlLHM9byYmby5nZXQoInNlbnRyeS5kc2MiKSxpPXMmJnd0KHMpO2lmKGkpcmV0dXJuIGk7Y29uc3QgYz1mdW5jdGlvbih0LG4pe2NvbnN0IGU9bi5nZXRPcHRpb25zKCkse3B1YmxpY0tleTpyfT1uLmdldERzbigpfHx7fSxvPUwoe2Vudmlyb25tZW50OmUuZW52aXJvbm1lbnR8fFJ0LHJlbGVhc2U6ZS5yZWxlYXNlLHB1YmxpY19rZXk6cix0cmFjZV9pZDp0fSk7cmV0dXJuIG4uZW1pdCgiY3JlYXRlRHNjIixvKSxvfSh0LnNwYW5Db250ZXh0KCkudHJhY2VJZCxuKSx1PVR0KGUpLGE9dS5kYXRhfHx7fSxmPWFbZHRdO251bGwhPWYmJihjLnNhbXBsZV9yYXRlPWAke2Z9YCk7Y29uc3QgaD1hW2x0XSxwPXUuZGVzY3JpcHRpb247cmV0dXJuInVybCIhPT1oJiZwJiYoYy50cmFuc2FjdGlvbj1wKSxmdW5jdGlvbih0KXtpZigiYm9vbGVhbiI9PXR5cGVvZiBfX1NFTlRSWV9UUkFDSU5HX18mJiFfX1NFTlRSWV9UUkFDSU5HX18pcmV0dXJuITE7Y29uc3Qgbj1mdCgpLGU9biYmbi5nZXRPcHRpb25zKCk7cmV0dXJuISFlJiYoZS5lbmFibGVUcmFjaW5nfHwidHJhY2VzU2FtcGxlUmF0ZSJpbiBlfHwidHJhY2VzU2FtcGxlciJpbiBlKX0oKSYmKGMuc2FtcGxlZD1TdHJpbmcoZnVuY3Rpb24odCl7Y29uc3R7dHJhY2VGbGFnczpufT10LnNwYW5Db250ZXh0KCk7cmV0dXJuIG49PT0kdH0oZSkpKSxuLmVtaXQoImNyZWF0ZURzYyIsYyxlKSxjfWZ1bmN0aW9uIEF0KHQsbj0hMSl7Y29uc3R7aG9zdDplLHBhdGg6cixwYXNzOm8scG9ydDpzLHByb2plY3RJZDppLHByb3RvY29sOmMscHVibGljS2V5OnV9PXQ7cmV0dXJuYCR7Y306Ly8ke3V9JHtuJiZvP2A6JHtvfWA6IiJ9QCR7ZX0ke3M/YDoke3N9YDoiIn0vJHtyP2Ake3J9L2A6cn0ke2l9YH1mdW5jdGlvbiBJdCh0LG49MTAwLGU9MS8wKXt0cnl7cmV0dXJuIFB0KCIiLHQsbixlKX1jYXRjaCh0KXtyZXR1cm57RVJST1I6YCoqbm9uLXNlcmlhbGl6YWJsZSoqICgke3R9KWB9fX1mdW5jdGlvbiBQdCh0LG4sZT0xLzAscj0xLzAsbz1mdW5jdGlvbigpe2NvbnN0IHQ9ImZ1bmN0aW9uIj09dHlwZW9mIFdlYWtTZXQsbj10P25ldyBXZWFrU2V0OltdO3JldHVybltmdW5jdGlvbihlKXtpZih0KXJldHVybiEhbi5oYXMoZSl8fChuLmFkZChlKSwhMSk7Zm9yKGxldCB0PTA7dDxuLmxlbmd0aDt0KyspaWYoblt0XT09PWUpcmV0dXJuITA7cmV0dXJuIG4ucHVzaChlKSwhMX0sZnVuY3Rpb24oZSl7aWYodCluLmRlbGV0ZShlKTtlbHNlIGZvcihsZXQgdD0wO3Q8bi5sZW5ndGg7dCsrKWlmKG5bdF09PT1lKXtuLnNwbGljZSh0LDEpO2JyZWFrfX1dfSgpKXtjb25zdFtzLGldPW87aWYobnVsbD09bnx8WyJib29sZWFuIiwic3RyaW5nIl0uaW5jbHVkZXModHlwZW9mIG4pfHwibnVtYmVyIj09dHlwZW9mIG4mJk51bWJlci5pc0Zpbml0ZShuKSlyZXR1cm4gbjtjb25zdCBjPWZ1bmN0aW9uKHQsbil7dHJ5e2lmKCJkb21haW4iPT09dCYmbiYmIm9iamVjdCI9PXR5cGVvZiBuJiZuLlcpcmV0dXJuIltEb21haW5dIjtpZigiZG9tYWluRW1pdHRlciI9PT10KXJldHVybiJbRG9tYWluRW1pdHRlcl0iO2lmKCJ1bmRlZmluZWQiIT10eXBlb2YgZ2xvYmFsJiZuPT09Z2xvYmFsKXJldHVybiJbR2xvYmFsXSI7aWYoInVuZGVmaW5lZCIhPXR5cGVvZiB3aW5kb3cmJm49PT13aW5kb3cpcmV0dXJuIltXaW5kb3ddIjtpZigidW5kZWZpbmVkIiE9dHlwZW9mIGRvY3VtZW50JiZuPT09ZG9jdW1lbnQpcmV0dXJuIltEb2N1bWVudF0iO2lmKCJvYmplY3QiPT10eXBlb2YoZT1uKSYmbnVsbCE9PWUmJihlLl9faXNWdWV8fGUuRikpcmV0dXJuIltWdWVWaWV3TW9kZWxdIjtpZihmdW5jdGlvbih0KXtyZXR1cm4gayh0KSYmIm5hdGl2ZUV2ZW50ImluIHQmJiJwcmV2ZW50RGVmYXVsdCJpbiB0JiYic3RvcFByb3BhZ2F0aW9uImluIHR9KG4pKXJldHVybiJbU3ludGhldGljRXZlbnRdIjtpZigibnVtYmVyIj09dHlwZW9mIG4mJiFOdW1iZXIuaXNGaW5pdGUobikpcmV0dXJuYFske259XWA7aWYoImZ1bmN0aW9uIj09dHlwZW9mIG4pcmV0dXJuYFtGdW5jdGlvbjogJHtmdW5jdGlvbih0KXt0cnl7cmV0dXJuIHQmJiJmdW5jdGlvbiI9PXR5cGVvZiB0JiZ0Lm5hbWV8fEV9Y2F0Y2godCl7cmV0dXJuIEV9fShuKX1dYDtpZigic3ltYm9sIj09dHlwZW9mIG4pcmV0dXJuYFske1N0cmluZyhuKX1dYDtpZigiYmlnaW50Ij09dHlwZW9mIG4pcmV0dXJuYFtCaWdJbnQ6ICR7U3RyaW5nKG4pfV1gO2NvbnN0IHI9ZnVuY3Rpb24odCl7Y29uc3Qgbj1PYmplY3QuZ2V0UHJvdG90eXBlT2YodCk7cmV0dXJuIG4/bi5jb25zdHJ1Y3Rvci5uYW1lOiJudWxsIHByb3RvdHlwZSJ9KG4pO3JldHVybi9eSFRNTChcdyopRWxlbWVudCQvLnRlc3Qocik/YFtIVE1MRWxlbWVudDogJHtyfV1gOmBbb2JqZWN0ICR7cn1dYH1jYXRjaCh0KXtyZXR1cm5gKipub24tc2VyaWFsaXphYmxlKiogKCR7dH0pYH12YXIgZX0odCxuKTtpZighYy5zdGFydHNXaXRoKCJbb2JqZWN0ICIpKXJldHVybiBjO2lmKG4uX19zZW50cnlfc2tpcF9ub3JtYWxpemF0aW9uX18pcmV0dXJuIG47Y29uc3QgdT0ibnVtYmVyIj09dHlwZW9mIG4uX19zZW50cnlfb3ZlcnJpZGVfbm9ybWFsaXphdGlvbl9kZXB0aF9fP24uX19zZW50cnlfb3ZlcnJpZGVfbm9ybWFsaXphdGlvbl9kZXB0aF9fOmU7aWYoMD09PXUpcmV0dXJuIGMucmVwbGFjZSgib2JqZWN0ICIsIiIpO2lmKHMobikpcmV0dXJuIltDaXJjdWxhciB+XSI7Y29uc3QgYT1uO2lmKGEmJiJmdW5jdGlvbiI9PXR5cGVvZiBhLnRvSlNPTil0cnl7cmV0dXJuIFB0KCIiLGEudG9KU09OKCksdS0xLHIsbyl9Y2F0Y2godCl7fWNvbnN0IGY9QXJyYXkuaXNBcnJheShuKT9bXTp7fTtsZXQgaD0wO2NvbnN0IHA9UChuKTtmb3IoY29uc3QgdCBpbiBwKXtpZighT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKHAsdCkpY29udGludWU7aWYoaD49cil7Zlt0XT0iW01heFByb3BlcnRpZXMgfl0iO2JyZWFrfWNvbnN0IG49cFt0XTtmW3RdPVB0KHQsbix1LTEscixvKSxoKyt9cmV0dXJuIGkobiksZn1mdW5jdGlvbiBVdCh0LG4pe2NvbnN0IGU9bi5yZXBsYWNlKC9cXC9nLCIvIikucmVwbGFjZSgvW3xcXHt9KClbXF1eJCsqPy5dL2csIlxcJCYiKTtsZXQgcj10O3RyeXtyPWRlY29kZVVSSSh0KX1jYXRjaCh0KXt9cmV0dXJuIHIucmVwbGFjZSgvXFwvZywiLyIpLnJlcGxhY2UoL3dlYnBhY2s6XC8/L2csIiIpLnJlcGxhY2UobmV3IFJlZ0V4cChgKGZpbGU6Ly8pPy8qJHtlfS8qYCwiaWciKSwiYXBwOi8vLyIpfWZ1bmN0aW9uIE10KHQsbj1bXSl7cmV0dXJuW3Qsbl19ZnVuY3Rpb24gTHQodCxuKXtjb25zdCBlPXRbMV07Zm9yKGNvbnN0IHQgb2YgZSl7aWYobih0LHRbMF0udHlwZSkpcmV0dXJuITB9cmV0dXJuITF9ZnVuY3Rpb24gQnQodCl7cmV0dXJuIGwuX19TRU5UUllfXyYmbC5fX1NFTlRSWV9fLmVuY29kZVBvbHlmaWxsP2wuX19TRU5UUllfXy5lbmNvZGVQb2x5ZmlsbCh0KToobmV3IFRleHRFbmNvZGVyKS5lbmNvZGUodCl9ZnVuY3Rpb24gR3QodCl7Y29uc3RbbixlXT10O2xldCByPUpTT04uc3RyaW5naWZ5KG4pO2Z1bmN0aW9uIG8odCl7InN0cmluZyI9PXR5cGVvZiByP3I9InN0cmluZyI9PXR5cGVvZiB0P3IrdDpbQnQociksdF06ci5wdXNoKCJzdHJpbmciPT10eXBlb2YgdD9CdCh0KTp0KX1mb3IoY29uc3QgdCBvZiBlKXtjb25zdFtuLGVdPXQ7aWYobyhgXG4ke0pTT04uc3RyaW5naWZ5KG4pfVxuYCksInN0cmluZyI9PXR5cGVvZiBlfHxlIGluc3RhbmNlb2YgVWludDhBcnJheSlvKGUpO2Vsc2V7bGV0IHQ7dHJ5e3Q9SlNPTi5zdHJpbmdpZnkoZSl9Y2F0Y2gobil7dD1KU09OLnN0cmluZ2lmeShJdChlKSl9byh0KX19cmV0dXJuInN0cmluZyI9PXR5cGVvZiByP3I6ZnVuY3Rpb24odCl7Y29uc3Qgbj10LnJlZHVjZSgoKHQsbik9PnQrbi5sZW5ndGgpLDApLGU9bmV3IFVpbnQ4QXJyYXkobik7bGV0IHI9MDtmb3IoY29uc3QgbiBvZiB0KWUuc2V0KG4scikscis9bi5sZW5ndGg7cmV0dXJuIGV9KHIpfWNvbnN0IEp0PXtzZXNzaW9uOiJzZXNzaW9uIixzZXNzaW9uczoic2Vzc2lvbiIsYXR0YWNobWVudDoiYXR0YWNobWVudCIsdHJhbnNhY3Rpb246InRyYW5zYWN0aW9uIixldmVudDoiZXJyb3IiLGNsaWVudF9yZXBvcnQ6ImludGVybmFsIix1c2VyX3JlcG9ydDoiZGVmYXVsdCIscHJvZmlsZToicHJvZmlsZSIscHJvZmlsZV9jaHVuazoicHJvZmlsZSIscmVwbGF5X2V2ZW50OiJyZXBsYXkiLHJlcGxheV9yZWNvcmRpbmc6InJlcGxheSIsY2hlY2tfaW46Im1vbml0b3IiLGZlZWRiYWNrOiJmZWVkYmFjayIsc3Bhbjoic3BhbiIsc3RhdHNkOiJtZXRyaWNfYnVja2V0IixyYXdfc2VjdXJpdHk6InNlY3VyaXR5In07ZnVuY3Rpb24gWXQodCl7aWYoIXR8fCF0LnNkaylyZXR1cm47Y29uc3R7bmFtZTpuLHZlcnNpb246ZX09dC5zZGs7cmV0dXJue25hbWU6bix2ZXJzaW9uOmV9fWZ1bmN0aW9uIHp0KHQsbixlLHIpe2NvbnN0IG89WXQoZSkscz10LnR5cGUmJiJyZXBsYXlfZXZlbnQiIT09dC50eXBlP3QudHlwZToiZXZlbnQiOyFmdW5jdGlvbih0LG4pe24mJih0LnNkaz10LnNka3x8e30sdC5zZGsubmFtZT10LnNkay5uYW1lfHxuLm5hbWUsdC5zZGsudmVyc2lvbj10LnNkay52ZXJzaW9ufHxuLnZlcnNpb24sdC5zZGsuaW50ZWdyYXRpb25zPVsuLi50LnNkay5pbnRlZ3JhdGlvbnN8fFtdLC4uLm4uaW50ZWdyYXRpb25zfHxbXV0sdC5zZGsucGFja2FnZXM9Wy4uLnQuc2RrLnBhY2thZ2VzfHxbXSwuLi5uLnBhY2thZ2VzfHxbXV0pfSh0LGUmJmUuc2RrKTtjb25zdCBpPWZ1bmN0aW9uKHQsbixlLHIpe2NvbnN0IG89dC5zZGtQcm9jZXNzaW5nTWV0YWRhdGEmJnQuc2RrUHJvY2Vzc2luZ01ldGFkYXRhLmR5bmFtaWNTYW1wbGluZ0NvbnRleHQ7cmV0dXJue2V2ZW50X2lkOnQuZXZlbnRfaWQsc2VudF9hdDoobmV3IERhdGUpLnRvSVNPU3RyaW5nKCksLi4ubiYme3NkazpufSwuLi4hIWUmJnImJntkc246QXQocil9LC4uLm8mJnt0cmFjZTpMKHsuLi5vfSl9fX0odCxvLHIsbik7ZGVsZXRlIHQuc2RrUHJvY2Vzc2luZ01ldGFkYXRhO3JldHVybiBNdChpLFtbe3R5cGU6c30sdF1dKX1jb25zdCBIdD0iX19TRU5UUllfU1VQUFJFU1NfVFJBQ0lOR19fIjtmdW5jdGlvbiBXdCh0KXtjb25zdCBuPWF0KHgoKSk7cmV0dXJuIG4uc3VwcHJlc3NUcmFjaW5nP24uc3VwcHJlc3NUcmFjaW5nKHQpOmZ1bmN0aW9uKC4uLnQpe2NvbnN0IG49YXQoeCgpKTtpZigyPT09dC5sZW5ndGgpe2NvbnN0W2Uscl09dDtyZXR1cm4gZT9uLndpdGhTZXRTY29wZShlLHIpOm4ud2l0aFNjb3BlKHIpfXJldHVybiBuLndpdGhTY29wZSh0WzBdKX0oKG49PihuLnNldFNES1Byb2Nlc3NpbmdNZXRhZGF0YSh7W0h0XTohMH0pLHQoKSkpKX1mdW5jdGlvbiBGdCh0LG4pe2NvbnN0e2ZpbmdlcnByaW50OmUsc3BhbjpyLGJyZWFkY3J1bWJzOm8sc2RrUHJvY2Vzc2luZ01ldGFkYXRhOnN9PW47IWZ1bmN0aW9uKHQsbil7Y29uc3R7ZXh0cmE6ZSx0YWdzOnIsdXNlcjpvLGNvbnRleHRzOnMsbGV2ZWw6aSx0cmFuc2FjdGlvbk5hbWU6Y309bix1PUwoZSk7dSYmT2JqZWN0LmtleXModSkubGVuZ3RoJiYodC5leHRyYT17Li4udSwuLi50LmV4dHJhfSk7Y29uc3QgYT1MKHIpO2EmJk9iamVjdC5rZXlzKGEpLmxlbmd0aCYmKHQudGFncz17Li4uYSwuLi50LnRhZ3N9KTtjb25zdCBmPUwobyk7ZiYmT2JqZWN0LmtleXMoZikubGVuZ3RoJiYodC51c2VyPXsuLi5mLC4uLnQudXNlcn0pO2NvbnN0IGg9TChzKTtoJiZPYmplY3Qua2V5cyhoKS5sZW5ndGgmJih0LmNvbnRleHRzPXsuLi5oLC4uLnQuY29udGV4dHN9KTtpJiYodC5sZXZlbD1pKTtjJiYidHJhbnNhY3Rpb24iIT09dC50eXBlJiYodC50cmFuc2FjdGlvbj1jKX0odCxuKSxyJiZmdW5jdGlvbih0LG4pe3QuY29udGV4dHM9e3RyYWNlOkV0KG4pLC4uLnQuY29udGV4dHN9LHQuc2RrUHJvY2Vzc2luZ01ldGFkYXRhPXtkeW5hbWljU2FtcGxpbmdDb250ZXh0OkR0KG4pLC4uLnQuc2RrUHJvY2Vzc2luZ01ldGFkYXRhfTtjb25zdCBlPWt0KG4pLHI9VHQoZSkuZGVzY3JpcHRpb247ciYmIXQudHJhbnNhY3Rpb24mJiJ0cmFuc2FjdGlvbiI9PT10LnR5cGUmJih0LnRyYW5zYWN0aW9uPXIpfSh0LHIpLGZ1bmN0aW9uKHQsbil7dC5maW5nZXJwcmludD10LmZpbmdlcnByaW50P0FycmF5LmlzQXJyYXkodC5maW5nZXJwcmludCk/dC5maW5nZXJwcmludDpbdC5maW5nZXJwcmludF06W10sbiYmKHQuZmluZ2VycHJpbnQ9dC5maW5nZXJwcmludC5jb25jYXQobikpO3QuZmluZ2VycHJpbnQmJiF0LmZpbmdlcnByaW50Lmxlbmd0aCYmZGVsZXRlIHQuZmluZ2VycHJpbnR9KHQsZSksZnVuY3Rpb24odCxuKXtjb25zdCBlPVsuLi50LmJyZWFkY3J1bWJzfHxbXSwuLi5uXTt0LmJyZWFkY3J1bWJzPWUubGVuZ3RoP2U6dm9pZCAwfSh0LG8pLGZ1bmN0aW9uKHQsbil7dC5zZGtQcm9jZXNzaW5nTWV0YWRhdGE9ey4uLnQuc2RrUHJvY2Vzc2luZ01ldGFkYXRhLC4uLm59fSh0LHMpfWNvbnN0IEt0PSI3IjtjbGFzcyBWdCBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQsbj0id2FybiIpe3N1cGVyKHQpLHRoaXMubWVzc2FnZT10LHRoaXMubG9nTGV2ZWw9bn19ZnVuY3Rpb24gWnQodCl7Y29uc3Qgbj1bXTtmdW5jdGlvbiBlKHQpe3JldHVybiBuLnNwbGljZShuLmluZGV4T2YodCksMSlbMF18fFByb21pc2UucmVzb2x2ZSh2b2lkIDApfXJldHVybnskOm4sYWRkOmZ1bmN0aW9uKHIpe2lmKCEodm9pZCAwPT09dHx8bi5sZW5ndGg8dCkpcmV0dXJuIG89bmV3IFZ0KCJOb3QgYWRkaW5nIFByb21pc2UgYmVjYXVzZSBidWZmZXIgbGltaXQgd2FzIHJlYWNoZWQuIiksbmV3IEYoKCh0LG4pPT57bihvKX0pKTt2YXIgbztjb25zdCBzPXIoKTtyZXR1cm4tMT09PW4uaW5kZXhPZihzKSYmbi5wdXNoKHMpLHMudGhlbigoKCk9PmUocykpKS50aGVuKG51bGwsKCgpPT5lKHMpLnRoZW4obnVsbCwoKCk9Pnt9KSkpKSxzfSxkcmFpbjpmdW5jdGlvbih0KXtyZXR1cm4gbmV3IEYoKChlLHIpPT57bGV0IG89bi5sZW5ndGg7aWYoIW8pcmV0dXJuIGUoITApO2NvbnN0IHM9c2V0VGltZW91dCgoKCk9Pnt0JiZ0PjAmJmUoITEpfSksdCk7bi5mb3JFYWNoKCh0PT57Vyh0KS50aGVuKCgoKT0+ey0tb3x8KGNsZWFyVGltZW91dChzKSxlKCEwKSl9KSxyKX0pKX0pKX19fWNvbnN0IHF0PTZlNDtmdW5jdGlvbiBRdCh0LHtzdGF0dXNDb2RlOm4saGVhZGVyczplfSxyPURhdGUubm93KCkpe2NvbnN0IG89ey4uLnR9LHM9ZSYmZVsieC1zZW50cnktcmF0ZS1saW1pdHMiXSxpPWUmJmVbInJldHJ5LWFmdGVyIl07aWYocylmb3IoY29uc3QgdCBvZiBzLnRyaW0oKS5zcGxpdCgiLCIpKXtjb25zdFtuLGUsLCxzXT10LnNwbGl0KCI6Iiw1KSxpPXBhcnNlSW50KG4sMTApLGM9MWUzKihpc05hTihpKT82MDppKTtpZihlKWZvcihjb25zdCB0IG9mIGUuc3BsaXQoIjsiKSkibWV0cmljX2J1Y2tldCI9PT10JiZzJiYhcy5zcGxpdCgiOyIpLmluY2x1ZGVzKCJjdXN0b20iKXx8KG9bdF09citjKTtlbHNlIG8uYWxsPXIrY31lbHNlIGk/by5hbGw9citmdW5jdGlvbih0LG49RGF0ZS5ub3coKSl7Y29uc3QgZT1wYXJzZUludChgJHt0fWAsMTApO2lmKCFpc05hTihlKSlyZXR1cm4gMWUzKmU7Y29uc3Qgcj1EYXRlLnBhcnNlKGAke3R9YCk7cmV0dXJuIGlzTmFOKHIpP3F0OnItbn0oaSxyKTo0Mjk9PT1uJiYoby5hbGw9cis2ZTQpO3JldHVybiBvfWNvbnN0IFh0PTY0O2Z1bmN0aW9uIHRuKHQsbixlPVp0KHQuYnVmZmVyU2l6ZXx8WHQpKXtsZXQgcj17fTtyZXR1cm57c2VuZDpmdW5jdGlvbih0KXtjb25zdCBvPVtdO2lmKEx0KHQsKCh0LG4pPT57Y29uc3QgZT1mdW5jdGlvbih0KXtyZXR1cm4gSnRbdF19KG4pOyhmdW5jdGlvbih0LG4sZT1EYXRlLm5vdygpKXtyZXR1cm4gZnVuY3Rpb24odCxuKXtyZXR1cm4gdFtuXXx8dC5hbGx8fDB9KHQsbik+ZX0pKHIsZSl8fG8ucHVzaCh0KX0pKSwwPT09by5sZW5ndGgpcmV0dXJuIFcoe30pO2NvbnN0IHM9TXQodFswXSxvKSxpPXQ9PntMdChzLCgodCxuKT0+e30pKX07cmV0dXJuIGUuYWRkKCgoKT0+bih7Ym9keTpHdChzKX0pLnRoZW4oKHQ9Pih2b2lkIDAhPT10LnN0YXR1c0NvZGUmJih0LnN0YXR1c0NvZGU8MjAwfHx0LnN0YXR1c0NvZGU+PTMwMCkmJmgmJl8ud2FybihgU2VudHJ5IHJlc3BvbmRlZCB3aXRoIHN0YXR1cyBjb2RlICR7dC5zdGF0dXNDb2RlfSB0byBzZW50IGV2ZW50LmApLHI9UXQocix0KSx0KSksKHQ9Pnt0aHJvdyBpKCksdH0pKSkpLnRoZW4oKHQ9PnQpLCh0PT57aWYodCBpbnN0YW5jZW9mIFZ0KXJldHVybiBoJiZfLmVycm9yKCJTa2lwcGVkIHNlbmRpbmcgZXZlbnQgYmVjYXVzZSBidWZmZXIgaXMgZnVsbC4iKSxpKCksVyh7fSk7dGhyb3cgdH0pKX0sZmx1c2g6dD0+ZS5kcmFpbih0KX19Y29uc3Qgbm49L14oXFMrOlxcfFwvPykoW1xzXFNdKj8pKCg/OlwuezEsMn18W14vXFxdKz98KShcLlteLi9cXF0qfCkpKD86Wy9cXF0qKSQvO2Z1bmN0aW9uIGVuKHQpe2NvbnN0IG49ZnVuY3Rpb24odCl7Y29uc3Qgbj10Lmxlbmd0aD4xMDI0P2A8dHJ1bmNhdGVkPiR7dC5zbGljZSgtMTAyNCl9YDp0LGU9bm4uZXhlYyhuKTtyZXR1cm4gZT9lLnNsaWNlKDEpOltdfSh0KSxlPW5bMF18fCIiO2xldCByPW5bMV07cmV0dXJuIGV8fHI/KHImJihyPXIuc2xpY2UoMCxyLmxlbmd0aC0xKSksZStyKToiLiJ9ZnVuY3Rpb24gcm4odCxuPSExKXtyZXR1cm4hKG58fHQmJiF0LnN0YXJ0c1dpdGgoIi8iKSYmIXQubWF0Y2goL15bQS1aXTovKSYmIXQuc3RhcnRzV2l0aCgiLiIpJiYhdC5tYXRjaCgvXlthLXpBLVpdKFthLXpBLVowLTkuXC0rXSkqOlwvXC8vKSkmJnZvaWQgMCE9PXQmJiF0LmluY2x1ZGVzKCJub2RlX21vZHVsZXMvIil9Y29uc3Qgb249U3ltYm9sKCJBZ2VudEJhc2VJbnRlcm5hbFN0YXRlIik7Y2xhc3Mgc24gZXh0ZW5kcyBzLkFnZW50e1tvbl07b3B0aW9ucztrZWVwQWxpdmU7Y29uc3RydWN0b3IodCl7c3VwZXIodCksdGhpc1tvbl09e319aXNTZWN1cmVFbmRwb2ludCh0KXtpZih0KXtpZigiYm9vbGVhbiI9PXR5cGVvZiB0LnNlY3VyZUVuZHBvaW50KXJldHVybiB0LnNlY3VyZUVuZHBvaW50O2lmKCJzdHJpbmciPT10eXBlb2YgdC5wcm90b2NvbClyZXR1cm4iaHR0cHM6Ij09PXQucHJvdG9jb2x9Y29uc3R7c3RhY2s6bn09bmV3IEVycm9yO3JldHVybiJzdHJpbmciPT10eXBlb2YgbiYmbi5zcGxpdCgiXG4iKS5zb21lKCh0PT4tMSE9PXQuaW5kZXhPZigiKGh0dHBzLmpzOiIpfHwtMSE9PXQuaW5kZXhPZigibm9kZTpodHRwczoiKSkpfWNyZWF0ZVNvY2tldCh0LG4sZSl7Y29uc3Qgcj17Li4ubixzZWN1cmVFbmRwb2ludDp0aGlzLmlzU2VjdXJlRW5kcG9pbnQobil9O1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCgpPT50aGlzLmNvbm5lY3QodCxyKSkpLnRoZW4oKG89PntpZihvIGluc3RhbmNlb2Ygcy5BZ2VudClyZXR1cm4gby5hZGRSZXF1ZXN0KHQscik7dGhpc1tvbl0uY3VycmVudFNvY2tldD1vLHN1cGVyLmNyZWF0ZVNvY2tldCh0LG4sZSl9KSxlKX1jcmVhdGVDb25uZWN0aW9uKCl7Y29uc3QgdD10aGlzW29uXS5jdXJyZW50U29ja2V0O2lmKHRoaXNbb25dLmN1cnJlbnRTb2NrZXQ9dm9pZCAwLCF0KXRocm93IG5ldyBFcnJvcigiTm8gc29ja2V0IHdhcyByZXR1cm5lZCBpbiB0aGUgYGNvbm5lY3QoKWAgZnVuY3Rpb24iKTtyZXR1cm4gdH1nZXQgZGVmYXVsdFBvcnQoKXtyZXR1cm4gdGhpc1tvbl0uZGVmYXVsdFBvcnQ/PygiaHR0cHM6Ij09PXRoaXMucHJvdG9jb2w/NDQzOjgwKX1zZXQgZGVmYXVsdFBvcnQodCl7dGhpc1tvbl0mJih0aGlzW29uXS5kZWZhdWx0UG9ydD10KX1nZXQgcHJvdG9jb2woKXtyZXR1cm4gdGhpc1tvbl0ucHJvdG9jb2w/Pyh0aGlzLmlzU2VjdXJlRW5kcG9pbnQoKT8iaHR0cHM6IjoiaHR0cDoiKX1zZXQgcHJvdG9jb2wodCl7dGhpc1tvbl0mJih0aGlzW29uXS5wcm90b2NvbD10KX19ZnVuY3Rpb24gY24oLi4udCl7Xy5sb2coIltodHRwcy1wcm94eS1hZ2VudDpwYXJzZS1wcm94eS1yZXNwb25zZV0iLC4uLnQpfWZ1bmN0aW9uIHVuKHQpe3JldHVybiBuZXcgUHJvbWlzZSgoKG4sZSk9PntsZXQgcj0wO2NvbnN0IG89W107ZnVuY3Rpb24gcygpe2NvbnN0IGM9dC5yZWFkKCk7Yz9mdW5jdGlvbihjKXtvLnB1c2goYykscis9Yy5sZW5ndGg7Y29uc3QgdT1CdWZmZXIuY29uY2F0KG8sciksYT11LmluZGV4T2YoIlxyXG5cclxuIik7aWYoLTE9PT1hKXJldHVybiBjbigiaGF2ZSBub3QgcmVjZWl2ZWQgZW5kIG9mIEhUVFAgaGVhZGVycyB5ZXQuLi4iKSx2b2lkIHMoKTtjb25zdCBmPXUuc2xpY2UoMCxhKS50b1N0cmluZygiYXNjaWkiKS5zcGxpdCgiXHJcbiIpLGg9Zi5zaGlmdCgpO2lmKCFoKXJldHVybiB0LmRlc3Ryb3koKSxlKG5ldyBFcnJvcigiTm8gaGVhZGVyIHJlY2VpdmVkIGZyb20gcHJveHkgQ09OTkVDVCByZXNwb25zZSIpKTtjb25zdCBwPWguc3BsaXQoIiAiKSxsPSsocFsxXXx8MCksZD1wLnNsaWNlKDIpLmpvaW4oIiAiKSxtPXt9O2Zvcihjb25zdCBuIG9mIGYpe2lmKCFuKWNvbnRpbnVlO2NvbnN0IHI9bi5pbmRleE9mKCI6Iik7aWYoLTE9PT1yKXJldHVybiB0LmRlc3Ryb3koKSxlKG5ldyBFcnJvcihgSW52YWxpZCBoZWFkZXIgZnJvbSBwcm94eSBDT05ORUNUIHJlc3BvbnNlOiAiJHtufSJgKSk7Y29uc3Qgbz1uLnNsaWNlKDAscikudG9Mb3dlckNhc2UoKSxzPW4uc2xpY2UocisxKS50cmltU3RhcnQoKSxpPW1bb107InN0cmluZyI9PXR5cGVvZiBpP21bb109W2ksc106QXJyYXkuaXNBcnJheShpKT9pLnB1c2gocyk6bVtvXT1zfWNuKCJnb3QgcHJveHkgc2VydmVyIHJlc3BvbnNlOiAlbyAlbyIsaCxtKSxpKCksbih7Y29ubmVjdDp7c3RhdHVzQ29kZTpsLHN0YXR1c1RleHQ6ZCxoZWFkZXJzOm19LGJ1ZmZlcmVkOnV9KX0oYyk6dC5vbmNlKCJyZWFkYWJsZSIscyl9ZnVuY3Rpb24gaSgpe3QucmVtb3ZlTGlzdGVuZXIoImVuZCIsYyksdC5yZW1vdmVMaXN0ZW5lcigiZXJyb3IiLHUpLHQucmVtb3ZlTGlzdGVuZXIoInJlYWRhYmxlIixzKX1mdW5jdGlvbiBjKCl7aSgpLGNuKCJvbmVuZCIpLGUobmV3IEVycm9yKCJQcm94eSBjb25uZWN0aW9uIGVuZGVkIGJlZm9yZSByZWNlaXZpbmcgQ09OTkVDVCByZXNwb25zZSIpKX1mdW5jdGlvbiB1KHQpe2koKSxjbigib25lcnJvciAlbyIsdCksZSh0KX10Lm9uKCJlcnJvciIsdSksdC5vbigiZW5kIixjKSxzKCl9KSl9ZnVuY3Rpb24gYW4oLi4udCl7Xy5sb2coIltodHRwcy1wcm94eS1hZ2VudF0iLC4uLnQpfWNsYXNzIGZuIGV4dGVuZHMgc257c3RhdGljIHByb3RvY29scz1bImh0dHAiLCJodHRwcyJdO3Byb3h5O3Byb3h5SGVhZGVycztjb25uZWN0T3B0cztjb25zdHJ1Y3Rvcih0LG4pe3N1cGVyKG4pLHRoaXMub3B0aW9ucz17fSx0aGlzLnByb3h5PSJzdHJpbmciPT10eXBlb2YgdD9uZXcgVVJMKHQpOnQsdGhpcy5wcm94eUhlYWRlcnM9bj8uaGVhZGVycz8/e30sYW4oIkNyZWF0aW5nIG5ldyBIdHRwc1Byb3h5QWdlbnQgaW5zdGFuY2U6ICVvIix0aGlzLnByb3h5LmhyZWYpO2NvbnN0IGU9KHRoaXMucHJveHkuaG9zdG5hbWV8fHRoaXMucHJveHkuaG9zdCkucmVwbGFjZSgvXlxbfFxdJC9nLCIiKSxyPXRoaXMucHJveHkucG9ydD9wYXJzZUludCh0aGlzLnByb3h5LnBvcnQsMTApOiJodHRwczoiPT09dGhpcy5wcm94eS5wcm90b2NvbD80NDM6ODA7dGhpcy5jb25uZWN0T3B0cz17QUxQTlByb3RvY29sczpbImh0dHAvMS4xIl0sLi4ubj9wbihuLCJoZWFkZXJzIik6bnVsbCxob3N0OmUscG9ydDpyfX1hc3luYyBjb25uZWN0KHQsbil7Y29uc3R7cHJveHk6ZX09dGhpcztpZighbi5ob3N0KXRocm93IG5ldyBUeXBlRXJyb3IoJ05vICJob3N0IiBwcm92aWRlZCcpO2xldCByO2lmKCJodHRwczoiPT09ZS5wcm90b2NvbCl7YW4oIkNyZWF0aW5nIGB0bHMuU29ja2V0YDogJW8iLHRoaXMuY29ubmVjdE9wdHMpO2NvbnN0IHQ9dGhpcy5jb25uZWN0T3B0cy5zZXJ2ZXJuYW1lfHx0aGlzLmNvbm5lY3RPcHRzLmhvc3Q7cj1mLmNvbm5lY3Qoey4uLnRoaXMuY29ubmVjdE9wdHMsc2VydmVybmFtZTp0JiZhLmlzSVAodCk/dm9pZCAwOnR9KX1lbHNlIGFuKCJDcmVhdGluZyBgbmV0LlNvY2tldGA6ICVvIix0aGlzLmNvbm5lY3RPcHRzKSxyPWEuY29ubmVjdCh0aGlzLmNvbm5lY3RPcHRzKTtjb25zdCBvPSJmdW5jdGlvbiI9PXR5cGVvZiB0aGlzLnByb3h5SGVhZGVycz90aGlzLnByb3h5SGVhZGVycygpOnsuLi50aGlzLnByb3h5SGVhZGVyc30scz1hLmlzSVB2NihuLmhvc3QpP2BbJHtuLmhvc3R9XWA6bi5ob3N0O2xldCBpPWBDT05ORUNUICR7c306JHtuLnBvcnR9IEhUVFAvMS4xXHJcbmA7aWYoZS51c2VybmFtZXx8ZS5wYXNzd29yZCl7Y29uc3QgdD1gJHtkZWNvZGVVUklDb21wb25lbnQoZS51c2VybmFtZSl9OiR7ZGVjb2RlVVJJQ29tcG9uZW50KGUucGFzc3dvcmQpfWA7b1siUHJveHktQXV0aG9yaXphdGlvbiJdPWBCYXNpYyAke0J1ZmZlci5mcm9tKHQpLnRvU3RyaW5nKCJiYXNlNjQiKX1gfW8uSG9zdD1gJHtzfToke24ucG9ydH1gLG9bIlByb3h5LUNvbm5lY3Rpb24iXXx8KG9bIlByb3h5LUNvbm5lY3Rpb24iXT10aGlzLmtlZXBBbGl2ZT8iS2VlcC1BbGl2ZSI6ImNsb3NlIik7Zm9yKGNvbnN0IHQgb2YgT2JqZWN0LmtleXMobykpaSs9YCR7dH06ICR7b1t0XX1cclxuYDtjb25zdCBjPXVuKHIpO3Iud3JpdGUoYCR7aX1cclxuYCk7Y29uc3R7Y29ubmVjdDp1LGJ1ZmZlcmVkOmh9PWF3YWl0IGM7aWYodC5lbWl0KCJwcm94eUNvbm5lY3QiLHUpLHRoaXMuZW1pdCgicHJveHlDb25uZWN0Iix1LHQpLDIwMD09PXUuc3RhdHVzQ29kZSl7aWYodC5vbmNlKCJzb2NrZXQiLGhuKSxuLnNlY3VyZUVuZHBvaW50KXthbigiVXBncmFkaW5nIHNvY2tldCBjb25uZWN0aW9uIHRvIFRMUyIpO2NvbnN0IHQ9bi5zZXJ2ZXJuYW1lfHxuLmhvc3Q7cmV0dXJuIGYuY29ubmVjdCh7Li4ucG4obiwiaG9zdCIsInBhdGgiLCJwb3J0Iiksc29ja2V0OnIsc2VydmVybmFtZTphLmlzSVAodCk/dm9pZCAwOnR9KX1yZXR1cm4gcn1yLmRlc3Ryb3koKTtjb25zdCBwPW5ldyBhLlNvY2tldCh7d3JpdGFibGU6ITF9KTtyZXR1cm4gcC5yZWFkYWJsZT0hMCx0Lm9uY2UoInNvY2tldCIsKHQ9PnthbigiUmVwbGF5aW5nIHByb3h5IGJ1ZmZlciBmb3IgZmFpbGVkIHJlcXVlc3QiKSx0LnB1c2goaCksdC5wdXNoKG51bGwpfSkpLHB9fWZ1bmN0aW9uIGhuKHQpe3QucmVzdW1lKCl9ZnVuY3Rpb24gcG4odCwuLi5uKXtjb25zdCBlPXt9O2xldCByO2ZvcihyIGluIHQpbi5pbmNsdWRlcyhyKXx8KGVbcl09dFtyXSk7cmV0dXJuIGV9Y29uc3QgbG49MzI3Njg7ZnVuY3Rpb24gZG4odCl7cmV0dXJuIHQucmVwbGFjZSgvXltBLVpdOi8sIiIpLnJlcGxhY2UoL1xcL2csIi8iKX1jb25zdCBtbj1lO2xldCB5bixnbj0wLGJuPXt9O2Z1bmN0aW9uIF9uKHQpe21uLmRlYnVnJiZjb25zb2xlLmxvZyhgW0FOUiBXb3JrZXJdICR7dH1gKX12YXIgdm4sd24sU247Y29uc3QgJG49ZnVuY3Rpb24odCl7bGV0IG47dHJ5e249bmV3IFVSTCh0LnVybCl9Y2F0Y2gobil7cmV0dXJuIGIoKCgpPT57Y29uc29sZS53YXJuKCJbQHNlbnRyeS9ub2RlXTogSW52YWxpZCBkc24gb3IgdHVubmVsIG9wdGlvbiwgd2lsbCBub3Qgc2VuZCBhbnkgZXZlbnRzLiBUaGUgdHVubmVsIG9wdGlvbiBtdXN0IGJlIGEgZnVsbCBVUkwgd2hlbiB1c2VkLiIpfSkpLHRuKHQsKCgpPT5Qcm9taXNlLnJlc29sdmUoe30pKSl9Y29uc3QgZT0iaHR0cHM6Ij09PW4ucHJvdG9jb2wscj1mdW5jdGlvbih0LG4pe2NvbnN0e25vX3Byb3h5OmV9PXByb2Nlc3MuZW52O3JldHVybiBlJiZlLnNwbGl0KCIsIikuc29tZSgobj0+dC5ob3N0LmVuZHNXaXRoKG4pfHx0Lmhvc3RuYW1lLmVuZHNXaXRoKG4pKSk/dm9pZCAwOm59KG4sdC5wcm94eXx8KGU/cHJvY2Vzcy5lbnYuaHR0cHNfcHJveHk6dm9pZCAwKXx8cHJvY2Vzcy5lbnYuaHR0cF9wcm94eSksbz1lP2k6cyxhPXZvaWQgMCE9PXQua2VlcEFsaXZlJiZ0LmtlZXBBbGl2ZSxmPXI/bmV3IGZuKHIpOm5ldyBvLkFnZW50KHtrZWVwQWxpdmU6YSxtYXhTb2NrZXRzOjMwLHRpbWVvdXQ6MmUzfSksaD1mdW5jdGlvbih0LG4sZSl7Y29uc3R7aG9zdG5hbWU6cixwYXRobmFtZTpvLHBvcnQ6cyxwcm90b2NvbDppLHNlYXJjaDphfT1uZXcgVVJMKHQudXJsKTtyZXR1cm4gZnVuY3Rpb24oZil7cmV0dXJuIG5ldyBQcm9taXNlKCgoaCxwKT0+e1d0KCgoKT0+e2xldCBsPWZ1bmN0aW9uKHQpe3JldHVybiBuZXcgYyh7cmVhZCgpe3RoaXMucHVzaCh0KSx0aGlzLnB1c2gobnVsbCl9fSl9KGYuYm9keSk7Y29uc3QgZD17Li4udC5oZWFkZXJzfTtmLmJvZHkubGVuZ3RoPmxuJiYoZFsiY29udGVudC1lbmNvZGluZyJdPSJnemlwIixsPWwucGlwZSh1KCkpKTtjb25zdCBtPW4ucmVxdWVzdCh7bWV0aG9kOiJQT1NUIixhZ2VudDplLGhlYWRlcnM6ZCxob3N0bmFtZTpyLHBhdGg6YCR7b30ke2F9YCxwb3J0OnMscHJvdG9jb2w6aSxjYTp0LmNhQ2VydHN9LCh0PT57dC5vbigiZGF0YSIsKCgpPT57fSkpLHQub24oImVuZCIsKCgpPT57fSkpLHQuc2V0RW5jb2RpbmcoInV0ZjgiKTtjb25zdCBuPXQuaGVhZGVyc1sicmV0cnktYWZ0ZXIiXT8/bnVsbCxlPXQuaGVhZGVyc1sieC1zZW50cnktcmF0ZS1saW1pdHMiXT8/bnVsbDtoKHtzdGF0dXNDb2RlOnQuc3RhdHVzQ29kZSxoZWFkZXJzOnsicmV0cnktYWZ0ZXIiOm4sIngtc2VudHJ5LXJhdGUtbGltaXRzIjpBcnJheS5pc0FycmF5KGUpP2VbMF18fG51bGw6ZX19KX0pKTttLm9uKCJlcnJvciIscCksbC5waXBlKG0pfSkpfSkpfX0odCx0Lmh0dHBNb2R1bGU/P28sZik7cmV0dXJuIHRuKHQsaCl9KHt1cmw6KHZuPW1uLmRzbix3bj1tbi50dW5uZWwsU249bW4uc2RrTWV0YWRhdGEuc2RrLHdufHxgJHtmdW5jdGlvbih0KXtyZXR1cm5gJHtmdW5jdGlvbih0KXtjb25zdCBuPXQucHJvdG9jb2w/YCR7dC5wcm90b2NvbH06YDoiIixlPXQucG9ydD9gOiR7dC5wb3J0fWA6IiI7cmV0dXJuYCR7bn0vLyR7dC5ob3N0fSR7ZX0ke3QucGF0aD9gLyR7dC5wYXRofWA6IiJ9L2FwaS9gfSh0KX0ke3QucHJvamVjdElkfS9lbnZlbG9wZS9gfSh2bil9PyR7ZnVuY3Rpb24odCxuKXtjb25zdCBlPXtzZW50cnlfdmVyc2lvbjpLdH07cmV0dXJuIHQucHVibGljS2V5JiYoZS5zZW50cnlfa2V5PXQucHVibGljS2V5KSxuJiYoZS5zZW50cnlfY2xpZW50PWAke24ubmFtZX0vJHtuLnZlcnNpb259YCksbmV3IFVSTFNlYXJjaFBhcmFtcyhlKS50b1N0cmluZygpfSh2bixTbil9YCkscmVjb3JkRHJvcHBlZEV2ZW50OigpPT57fX0pO2FzeW5jIGZ1bmN0aW9uIEVuKCl7aWYoeW4pe19uKCJTZW5kaW5nIGFibm9ybWFsIHNlc3Npb24iKSxWKHluLHtzdGF0dXM6ImFibm9ybWFsIixhYm5vcm1hbF9tZWNoYW5pc206ImFucl9mb3JlZ3JvdW5kIn0pO2NvbnN0IHQ9ZnVuY3Rpb24odCxuLGUscil7Y29uc3Qgbz1ZdChlKTtyZXR1cm4gTXQoe3NlbnRfYXQ6KG5ldyBEYXRlKS50b0lTT1N0cmluZygpLC4uLm8mJntzZGs6b30sLi4uISFyJiZuJiZ7ZHNuOkF0KG4pfX0sWyJhZ2dyZWdhdGVzImluIHQ/W3t0eXBlOiJzZXNzaW9ucyJ9LHRdOlt7dHlwZToic2Vzc2lvbiJ9LHQudG9KU09OKCldXSl9KHluLG1uLmRzbixtbi5zZGtNZXRhZGF0YSxtbi50dW5uZWwpO19uKEpTT04uc3RyaW5naWZ5KHQpKSxhd2FpdCAkbi5zZW5kKHQpO3RyeXtuPy5wb3N0TWVzc2FnZSgic2Vzc2lvbi1lbmRlZCIpfWNhdGNoKHQpe319fWZ1bmN0aW9uIHhuKHQpe2lmKCF0KXJldHVybjtjb25zdCBuPWZ1bmN0aW9uKHQpe2lmKCF0Lmxlbmd0aClyZXR1cm5bXTtjb25zdCBuPUFycmF5LmZyb20odCk7cmV0dXJuL3NlbnRyeVdyYXBwZWQvLnRlc3QoJChuKS5mdW5jdGlvbnx8IiIpJiZuLnBvcCgpLG4ucmV2ZXJzZSgpLFMudGVzdCgkKG4pLmZ1bmN0aW9ufHwiIikmJihuLnBvcCgpLFMudGVzdCgkKG4pLmZ1bmN0aW9ufHwiIikmJm4ucG9wKCkpLG4uc2xpY2UoMCx2KS5tYXAoKHQ9Pih7Li4udCxmaWxlbmFtZTp0LmZpbGVuYW1lfHwkKG4pLmZpbGVuYW1lLGZ1bmN0aW9uOnQuZnVuY3Rpb258fHd9KSkpfSh0KTtpZihtbi5hcHBSb290UGF0aClmb3IoY29uc3QgdCBvZiBuKXQuZmlsZW5hbWUmJih0LmZpbGVuYW1lPVV0KHQuZmlsZW5hbWUsbW4uYXBwUm9vdFBhdGgpKTtyZXR1cm4gbn1hc3luYyBmdW5jdGlvbiBObih0LG4pe2lmKGduPj1tbi5tYXhBbnJFdmVudHMpcmV0dXJuO2duKz0xLGF3YWl0IEVuKCksX24oIlNlbmRpbmcgZXZlbnQiKTtjb25zdCBlPXtldmVudF9pZDp6KCksY29udGV4dHM6bW4uY29udGV4dHMscmVsZWFzZTptbi5yZWxlYXNlLGVudmlyb25tZW50Om1uLmVudmlyb25tZW50LGRpc3Q6bW4uZGlzdCxwbGF0Zm9ybToibm9kZSIsbGV2ZWw6ImVycm9yIixleGNlcHRpb246e3ZhbHVlczpbe3R5cGU6IkFwcGxpY2F0aW9uTm90UmVzcG9uZGluZyIsdmFsdWU6YEFwcGxpY2F0aW9uIE5vdCBSZXNwb25kaW5nIGZvciBhdCBsZWFzdCAke21uLmFuclRocmVzaG9sZH0gbXNgLHN0YWNrdHJhY2U6e2ZyYW1lczp4bih0KX0sbWVjaGFuaXNtOnt0eXBlOiJBTlIifX1dfSx0YWdzOm1uLnN0YXRpY1RhZ3N9O24mJmZ1bmN0aW9uKHQsbil7aWYoRnQodCxuKSwhdC5jb250ZXh0cz8udHJhY2Upe2NvbnN0e3RyYWNlSWQ6ZSxzcGFuSWQ6cixwYXJlbnRTcGFuSWQ6b309bi5wcm9wYWdhdGlvbkNvbnRleHQ7dC5jb250ZXh0cz17dHJhY2U6e3RyYWNlX2lkOmUsc3Bhbl9pZDpyLHBhcmVudF9zcGFuX2lkOm99LC4uLnQuY29udGV4dHN9fX0oZSxuKSxmdW5jdGlvbih0KXtpZigwPT09T2JqZWN0LmtleXMoYm4pLmxlbmd0aClyZXR1cm47Y29uc3Qgbj1tbi5hcHBSb290UGF0aD97fTpibjtpZihtbi5hcHBSb290UGF0aClmb3IoY29uc3RbdCxlXW9mIE9iamVjdC5lbnRyaWVzKGJuKSluW1V0KHQsbW4uYXBwUm9vdFBhdGgpXT1lO2NvbnN0IGU9bmV3IE1hcDtmb3IoY29uc3QgciBvZiB0LmV4Y2VwdGlvbj8udmFsdWVzfHxbXSlmb3IoY29uc3QgdCBvZiByLnN0YWNrdHJhY2U/LmZyYW1lc3x8W10pe2NvbnN0IHI9dC5hYnNfcGF0aHx8dC5maWxlbmFtZTtyJiZuW3JdJiZlLnNldChyLG5bcl0pfWlmKGUuc2l6ZT4wKXtjb25zdCBuPVtdO2Zvcihjb25zdFt0LHJdb2YgZS5lbnRyaWVzKCkpbi5wdXNoKHt0eXBlOiJzb3VyY2VtYXAiLGNvZGVfZmlsZTp0LGRlYnVnX2lkOnJ9KTt0LmRlYnVnX21ldGE9e2ltYWdlczpufX19KGUpO2NvbnN0IHI9enQoZSxtbi5kc24sbW4uc2RrTWV0YWRhdGEsbW4udHVubmVsKTtfbihKU09OLnN0cmluZ2lmeShyKSksYXdhaXQgJG4uc2VuZChyKSxhd2FpdCAkbi5mbHVzaCgyZTMpLGduPj1tbi5tYXhBbnJFdmVudHMmJnNldFRpbWVvdXQoKCgpPT57cHJvY2Vzcy5leGl0KDApfSksNWUzKX1sZXQgVG47aWYoX24oIlN0YXJ0ZWQiKSxtbi5jYXB0dXJlU3RhY2tUcmFjZSl7X24oIkNvbm5lY3RpbmcgdG8gZGVidWdnZXIiKTtjb25zdCBuPW5ldyB0O24uY29ubmVjdFRvTWFpblRocmVhZCgpLF9uKCJDb25uZWN0ZWQgdG8gZGVidWdnZXIiKTtjb25zdCBlPW5ldyBNYXA7bi5vbigiRGVidWdnZXIuc2NyaXB0UGFyc2VkIiwodD0+e2Uuc2V0KHQucGFyYW1zLnNjcmlwdElkLHQucGFyYW1zLnVybCl9KSksbi5vbigiRGVidWdnZXIucGF1c2VkIiwodD0+e2lmKCJvdGhlciI9PT10LnBhcmFtcy5yZWFzb24pdHJ5e19uKCJEZWJ1Z2dlciBwYXVzZWQiKTtjb25zdCBzPVsuLi50LnBhcmFtcy5jYWxsRnJhbWVzXSxpPW1uLmFwcFJvb3RQYXRoP2Z1bmN0aW9uKHQ9KHByb2Nlc3MuYXJndlsxXT9lbihwcm9jZXNzLmFyZ3ZbMV0pOnByb2Nlc3MuY3dkKCkpLG49IlxcIj09PW8pe2NvbnN0IGU9bj9kbih0KTp0O3JldHVybiB0PT57aWYoIXQpcmV0dXJuO2NvbnN0IG89bj9kbih0KTp0O2xldHtkaXI6cyxiYXNlOmksZXh0OmN9PXIucGFyc2Uobyk7Ii5qcyIhPT1jJiYiLm1qcyIhPT1jJiYiLmNqcyIhPT1jfHwoaT1pLnNsaWNlKDAsLTEqYy5sZW5ndGgpKTtjb25zdCB1PWRlY29kZVVSSUNvbXBvbmVudChpKTtzfHwocz0iLiIpO2NvbnN0IGE9cy5sYXN0SW5kZXhPZigiL25vZGVfbW9kdWxlcyIpO2lmKGE+LTEpcmV0dXJuYCR7cy5zbGljZShhKzE0KS5yZXBsYWNlKC9cLy9nLCIuIil9OiR7dX1gO2lmKHMuc3RhcnRzV2l0aChlKSl7Y29uc3QgdD1zLnNsaWNlKGUubGVuZ3RoKzEpLnJlcGxhY2UoL1wvL2csIi4iKTtyZXR1cm4gdD9gJHt0fToke3V9YDp1fXJldHVybiB1fX0obW4uYXBwUm9vdFBhdGgpOigpPT57fSxjPXMubWFwKCh0PT5mdW5jdGlvbih0LG4sZSl7Y29uc3Qgcj1uP24ucmVwbGFjZSgvXmZpbGU6XC9cLy8sIiIpOnZvaWQgMCxvPXQubG9jYXRpb24uY29sdW1uTnVtYmVyP3QubG9jYXRpb24uY29sdW1uTnVtYmVyKzE6dm9pZCAwLHM9dC5sb2NhdGlvbi5saW5lTnVtYmVyP3QubG9jYXRpb24ubGluZU51bWJlcisxOnZvaWQgMDtyZXR1cm4gTCh7ZmlsZW5hbWU6cixtb2R1bGU6ZShyKSxmdW5jdGlvbjp0LmZ1bmN0aW9uTmFtZXx8dyxjb2xubzpvLGxpbmVubzpzLGluX2FwcDpyP3JuKHIpOnZvaWQgMH0pfSh0LGUuZ2V0KHQubG9jYXRpb24uc2NyaXB0SWQpLGkpKSksdT1zZXRUaW1lb3V0KCgoKT0+e05uKGMpLnRoZW4obnVsbCwoKCk9PntfbigiU2VuZGluZyBBTlIgZXZlbnQgZmFpbGVkLiIpfSkpfSksNWUzKTtuLnBvc3QoIlJ1bnRpbWUuZXZhbHVhdGUiLHtleHByZXNzaW9uOiJnbG9iYWwuX19TRU5UUllfR0VUX1NDT1BFU19fKCk7IixzaWxlbnQ6ITAscmV0dXJuQnlWYWx1ZTohMH0sKCh0LGUpPT57dCYmX24oYEVycm9yIGV4ZWN1dGluZyBzY3JpcHQ6ICcke3QubWVzc2FnZX0nYCksY2xlYXJUaW1lb3V0KHUpO2NvbnN0IHI9ZSYmZS5yZXN1bHQ/ZS5yZXN1bHQudmFsdWU6dm9pZCAwO24ucG9zdCgiRGVidWdnZXIucmVzdW1lIiksbi5wb3N0KCJEZWJ1Z2dlci5kaXNhYmxlIiksTm4oYyxyKS50aGVuKG51bGwsKCgpPT57X24oIlNlbmRpbmcgQU5SIGV2ZW50IGZhaWxlZC4iKX0pKX0pKX1jYXRjaCh0KXt0aHJvdyBuLnBvc3QoIkRlYnVnZ2VyLnJlc3VtZSIpLG4ucG9zdCgiRGVidWdnZXIuZGlzYWJsZSIpLHR9fSkpLFRuPSgpPT57dHJ5e24ucG9zdCgiRGVidWdnZXIuZW5hYmxlIiwoKCk9PntuLnBvc3QoIkRlYnVnZ2VyLnBhdXNlIil9KSl9Y2F0Y2godCl7fX19Y29uc3R7cG9sbDpDbn09ZnVuY3Rpb24odCxuLGUscil7Y29uc3Qgbz10KCk7bGV0IHM9ITEsaT0hMDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCgpPT57Y29uc3QgdD1vLmdldFRpbWVNcygpOyExPT09cyYmdD5uK2UmJihzPSEwLGkmJnIoKSksdDxuK2UmJihzPSExKX0pLDIwKSx7cG9sbDooKT0+e28ucmVzZXQoKX0sZW5hYmxlZDp0PT57aT10fX19KChmdW5jdGlvbigpe2xldCB0PXByb2Nlc3MuaHJ0aW1lKCk7cmV0dXJue2dldFRpbWVNczooKT0+e2NvbnN0W24sZV09cHJvY2Vzcy5ocnRpbWUodCk7cmV0dXJuIE1hdGguZmxvb3IoMWUzKm4rZS8xZTYpfSxyZXNldDooKT0+e3Q9cHJvY2Vzcy5ocnRpbWUoKX19fSksbW4ucG9sbEludGVydmFsLG1uLmFuclRocmVzaG9sZCwoZnVuY3Rpb24oKXtfbigiV2F0Y2hkb2cgdGltZW91dCIpLFRuPyhfbigiUGF1c2luZyBkZWJ1Z2dlciB0byBjYXB0dXJlIHN0YWNrIHRyYWNlIiksVG4oKSk6KF9uKCJDYXB0dXJpbmcgZXZlbnQgd2l0aG91dCBhIHN0YWNrIHRyYWNlIiksTm4oKS50aGVuKG51bGwsKCgpPT57X24oIlNlbmRpbmcgQU5SIGV2ZW50IGZhaWxlZCBvbiB3YXRjaGRvZyB0aW1lb3V0LiIpfSkpKX0pKTtuPy5vbigibWVzc2FnZSIsKHQ9Pnt0LnNlc3Npb24mJih5bj1LKHQuc2Vzc2lvbikpLHQuZGVidWdJbWFnZXMmJihibj10LmRlYnVnSW1hZ2VzKSxDbigpfSkpOw=='; + +const DEFAULT_INTERVAL = 50; +const DEFAULT_HANG_THRESHOLD = 5000; + +function log(message, ...args) { + core.logger.log(`[ANR] ${message}`, ...args); +} + +function globalWithScopeFetchFn() { + return core.GLOBAL_OBJ; +} + +/** Fetches merged scope data */ +function getScopeData() { + const scope = core.getGlobalScope().getScopeData(); + core.mergeScopeData(scope, core.getIsolationScope().getScopeData()); + core.mergeScopeData(scope, core.getCurrentScope().getScopeData()); + + // We remove attachments because they likely won't serialize well as json + scope.attachments = []; + // We can't serialize event processor functions + scope.eventProcessors = []; + + return scope; +} + +/** + * Gets contexts by calling all event processors. This shouldn't be called until all integrations are setup + */ +async function getContexts(client) { + let event = { message: 'ANR' }; + const eventHint = {}; + + for (const processor of client.getEventProcessors()) { + if (event === null) break; + event = await processor(event, eventHint); + } + + return _optionalChain([event, 'optionalAccess', _2 => _2.contexts]) || {}; +} + +const INTEGRATION_NAME = 'Anr'; + +const _anrIntegration = ((options = {}) => { + if (nodeVersion.NODE_VERSION.major < 16 || (nodeVersion.NODE_VERSION.major === 16 && nodeVersion.NODE_VERSION.minor < 17)) { + throw new Error('ANR detection requires Node 16.17.0 or later'); + } + + let worker; + let client; + + // Hookup the scope fetch function to the global object so that it can be called from the worker thread via the + // debugger when it pauses + const gbl = globalWithScopeFetchFn(); + gbl.__SENTRY_GET_SCOPES__ = getScopeData; + + return { + name: INTEGRATION_NAME, + startWorker: () => { + if (worker) { + return; + } + + if (client) { + worker = _startWorker(client, options); + } + }, + stopWorker: () => { + if (worker) { + // eslint-disable-next-line @typescript-eslint/no-floating-promises + worker.then(stop => { + stop(); + worker = undefined; + }); + } + }, + async setup(initClient) { + client = initClient; + + if (options.captureStackTrace && (await debug.isDebuggerEnabled())) { + core.logger.warn('ANR captureStackTrace has been disabled because the debugger was already enabled'); + options.captureStackTrace = false; + } + + // setImmediate is used to ensure that all other integrations have had their setup called first. + // This allows us to call into all integrations to fetch the full context + setImmediate(() => this.startWorker()); + }, + } ; +}) ; + +const anrIntegration = core.defineIntegration(_anrIntegration) ; + +/** + * Starts the ANR worker thread + * + * @returns A function to stop the worker + */ +async function _startWorker( + client, + integrationOptions, +) { + const dsn = client.getDsn(); + + if (!dsn) { + return () => { + // + }; + } + + const contexts = await getContexts(client); + + // These will not be accurate if sent later from the worker thread + _optionalChainDelete([contexts, 'access', _3 => _3.app, 'optionalAccess', _4 => delete _4.app_memory]); + _optionalChainDelete([contexts, 'access', _5 => _5.device, 'optionalAccess', _6 => delete _6.free_memory]); + + const initOptions = client.getOptions(); + + const sdkMetadata = client.getSdkMetadata() || {}; + if (sdkMetadata.sdk) { + sdkMetadata.sdk.integrations = initOptions.integrations.map(i => i.name); + } + + const options = { + debug: core.logger.isEnabled(), + dsn, + tunnel: initOptions.tunnel, + environment: initOptions.environment || 'production', + release: initOptions.release, + dist: initOptions.dist, + sdkMetadata, + appRootPath: integrationOptions.appRootPath, + pollInterval: integrationOptions.pollInterval || DEFAULT_INTERVAL, + anrThreshold: integrationOptions.anrThreshold || DEFAULT_HANG_THRESHOLD, + captureStackTrace: !!integrationOptions.captureStackTrace, + maxAnrEvents: integrationOptions.maxAnrEvents || 1, + staticTags: integrationOptions.staticTags || {}, + contexts, + }; + + if (options.captureStackTrace) { + const inspector = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 85690, 23)); + if (!inspector.url()) { + inspector.open(0); + } + } + + const worker = new node_worker_threads.Worker(new URL(`data:application/javascript;base64,${base64WorkerScript}`), { + workerData: options, + // We don't want any Node args to be passed to the worker + execArgv: [], + env: { ...process.env, NODE_OPTIONS: undefined }, + }); + + process.on('exit', () => { + // eslint-disable-next-line @typescript-eslint/no-floating-promises + worker.terminate(); + }); + + const timer = setInterval(() => { + try { + const currentSession = core.getCurrentScope().getSession(); + // We need to copy the session object and remove the toJSON method so it can be sent to the worker + // serialized without making it a SerializedSession + const session = currentSession ? { ...currentSession, toJSON: undefined } : undefined; + // message the worker to tell it the main event loop is still running + worker.postMessage({ session, debugImages: core.getFilenameToDebugIdMap(initOptions.stackParser) }); + } catch (_) { + // + } + }, options.pollInterval); + // Timer should not block exit + timer.unref(); + + worker.on('message', (msg) => { + if (msg === 'session-ended') { + log('ANR event sent from ANR worker. Clearing session in this thread.'); + core.getCurrentScope().setSession(undefined); + } + }); + + worker.once('error', (err) => { + clearInterval(timer); + log('ANR worker error', err); + }); + + worker.once('exit', (code) => { + clearInterval(timer); + log('ANR worker exit', code); + }); + + // Ensure this thread can't block app exit + worker.unref(); + + return () => { + // eslint-disable-next-line @typescript-eslint/no-floating-promises + worker.terminate(); + clearInterval(timer); + }; +} + +/** + * Disables ANR detection for the duration of the callback + */ +function disableAnrDetectionForCallback(callback) { + const integration = _optionalChain([core.getClient, 'call', _7 => _7(), 'optionalAccess', _8 => _8.getIntegrationByName, 'call', _9 => _9(INTEGRATION_NAME)]) ; + + if (!integration) { + return callback(); + } + + integration.stopWorker(); + + const result = callback(); + if (isPromise(result)) { + return result.finally(() => integration.startWorker()); + } + + integration.startWorker(); + return result; +} + +exports.anrIntegration = anrIntegration; +exports.base64WorkerScript = base64WorkerScript; +exports.disableAnrDetectionForCallback = disableAnrDetectionForCallback; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 13557: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); + +// TODO(v9): Update this name and mention in migration docs. +const INTEGRATION_NAME = 'ProcessAndThreadBreadcrumbs'; + +/** + * Capture breadcrumbs for child processes and worker threads. + */ +const childProcessIntegration = core.defineIntegration((options = {}) => { + return { + name: INTEGRATION_NAME, + setup(_client) { + // eslint-disable-next-line deprecation/deprecation + diagnosticsChannel.channel('child_process').subscribe((event) => { + if (event && typeof event === 'object' && 'process' in event) { + captureChildProcessEvents(event.process , options); + } + }); + + // eslint-disable-next-line deprecation/deprecation + diagnosticsChannel.channel('worker_threads').subscribe((event) => { + if (event && typeof event === 'object' && 'worker' in event) { + captureWorkerThreadEvents(event.worker ); + } + }); + }, + }; +}); + +/** + * Capture breadcrumbs for child processes and worker threads. + * + * @deprecated Use `childProcessIntegration` integration instead. Functionally they are the same. `processThreadBreadcrumbIntegration` will be removed in the next major version. + */ +const processThreadBreadcrumbIntegration = childProcessIntegration; + +function captureChildProcessEvents(child, options) { + let hasExited = false; + let data; + + child + .on('spawn', () => { + // This is Sentry getting macOS OS context + if (child.spawnfile === '/usr/bin/sw_vers') { + hasExited = true; + return; + } + + data = { spawnfile: child.spawnfile }; + if (options.includeChildProcessArgs) { + data.spawnargs = child.spawnargs; + } + }) + .on('exit', code => { + if (!hasExited) { + hasExited = true; + + // Only log for non-zero exit codes + if (code !== null && code !== 0) { + core.addBreadcrumb({ + category: 'child_process', + message: `Child process exited with code '${code}'`, + level: 'warning', + data, + }); + } + } + }) + .on('error', error => { + if (!hasExited) { + hasExited = true; + + core.addBreadcrumb({ + category: 'child_process', + message: `Child process errored with '${error.message}'`, + level: 'error', + data, + }); + } + }); +} + +function captureWorkerThreadEvents(worker) { + let threadId; + + worker + .on('online', () => { + threadId = worker.threadId; + }) + .on('error', error => { + core.addBreadcrumb({ + category: 'worker_thread', + message: `Worker thread errored with '${error.message}'`, + level: 'error', + data: { threadId }, + }); + }); +} + +exports.childProcessIntegration = childProcessIntegration; +exports.processThreadBreadcrumbIntegration = processThreadBreadcrumbIntegration; +//# sourceMappingURL=childProcess.js.map + + +/***/ }), + +/***/ 61139: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const util = __nccwpck_require__(47261); +const core = __nccwpck_require__(84466); + +const INTEGRATION_NAME = 'Console'; + +/** + * Capture console logs as breadcrumbs. + */ +const consoleIntegration = core.defineIntegration(() => { + return { + name: INTEGRATION_NAME, + setup(client) { + core.addConsoleInstrumentationHandler(({ args, level }) => { + if (core.getClient() !== client) { + return; + } + + core.addBreadcrumb( + { + category: 'console', + level: core.severityLevelFromString(level), + message: core.truncate(util.format.apply(undefined, args), 2048), // 2KB + }, + { + input: [...args], + level, + }, + ); + }); + }, + }; +}); + +exports.consoleIntegration = consoleIntegration; +//# sourceMappingURL=console.js.map + + +/***/ }), + +/***/ 15834: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const node_child_process = __nccwpck_require__(17718); +const node_fs = __nccwpck_require__(87561); +const os = __nccwpck_require__(70612); +const node_path = __nccwpck_require__(49411); +const util = __nccwpck_require__(47261); +const core = __nccwpck_require__(84466); + +/* eslint-disable max-lines */ + +const readFileAsync = util.promisify(node_fs.readFile); +const readDirAsync = util.promisify(node_fs.readdir); + +// Process enhanced with methods from Node 18, 20, 22 as @types/node +// is on `14.18.0` to match minimum version requirements of the SDK + +const INTEGRATION_NAME = 'Context'; + +const _nodeContextIntegration = ((options = {}) => { + let cachedContext; + + const _options = { + app: true, + os: true, + device: true, + culture: true, + cloudResource: true, + ...options, + }; + + /** Add contexts to the event. Caches the context so we only look it up once. */ + async function addContext(event) { + if (cachedContext === undefined) { + cachedContext = _getContexts(); + } + + const updatedContext = _updateContext(await cachedContext); + + event.contexts = { + ...event.contexts, + app: { ...updatedContext.app, ..._optionalChain([event, 'access', _ => _.contexts, 'optionalAccess', _2 => _2.app]) }, + os: { ...updatedContext.os, ..._optionalChain([event, 'access', _3 => _3.contexts, 'optionalAccess', _4 => _4.os]) }, + device: { ...updatedContext.device, ..._optionalChain([event, 'access', _5 => _5.contexts, 'optionalAccess', _6 => _6.device]) }, + culture: { ...updatedContext.culture, ..._optionalChain([event, 'access', _7 => _7.contexts, 'optionalAccess', _8 => _8.culture]) }, + cloud_resource: { ...updatedContext.cloud_resource, ..._optionalChain([event, 'access', _9 => _9.contexts, 'optionalAccess', _10 => _10.cloud_resource]) }, + }; + + return event; + } + + /** Get the contexts from node. */ + async function _getContexts() { + const contexts = {}; + + if (_options.os) { + contexts.os = await getOsContext(); + } + + if (_options.app) { + contexts.app = getAppContext(); + } + + if (_options.device) { + contexts.device = getDeviceContext(_options.device); + } + + if (_options.culture) { + const culture = getCultureContext(); + + if (culture) { + contexts.culture = culture; + } + } + + if (_options.cloudResource) { + contexts.cloud_resource = getCloudResourceContext(); + } + + return contexts; + } + + return { + name: INTEGRATION_NAME, + processEvent(event) { + return addContext(event); + }, + }; +}) ; + +/** + * Capture context about the environment and the device that the client is running on, to events. + */ +const nodeContextIntegration = core.defineIntegration(_nodeContextIntegration); + +/** + * Updates the context with dynamic values that can change + */ +function _updateContext(contexts) { + // Only update properties if they exist + + if (_optionalChain([contexts, 'optionalAccess', _11 => _11.app, 'optionalAccess', _12 => _12.app_memory])) { + contexts.app.app_memory = process.memoryUsage().rss; + } + + if (_optionalChain([contexts, 'optionalAccess', _13 => _13.app, 'optionalAccess', _14 => _14.free_memory]) && typeof (process ).availableMemory === 'function') { + const freeMemory = _optionalChain([(process ), 'access', _15 => _15.availableMemory, 'optionalCall', _16 => _16()]); + if (freeMemory != null) { + contexts.app.free_memory = freeMemory; + } + } + + if (_optionalChain([contexts, 'optionalAccess', _17 => _17.device, 'optionalAccess', _18 => _18.free_memory])) { + contexts.device.free_memory = os.freemem(); + } + + return contexts; +} + +/** + * Returns the operating system context. + * + * Based on the current platform, this uses a different strategy to provide the + * most accurate OS information. Since this might involve spawning subprocesses + * or accessing the file system, this should only be executed lazily and cached. + * + * - On macOS (Darwin), this will execute the `sw_vers` utility. The context + * has a `name`, `version`, `build` and `kernel_version` set. + * - On Linux, this will try to load a distribution release from `/etc` and set + * the `name`, `version` and `kernel_version` fields. + * - On all other platforms, only a `name` and `version` will be returned. Note + * that `version` might actually be the kernel version. + */ +async function getOsContext() { + const platformId = os.platform(); + switch (platformId) { + case 'darwin': + return getDarwinInfo(); + case 'linux': + return getLinuxInfo(); + default: + return { + name: PLATFORM_NAMES[platformId] || platformId, + version: os.release(), + }; + } +} + +function getCultureContext() { + try { + if (typeof process.versions.icu !== 'string') { + // Node was built without ICU support + return; + } + + // Check that node was built with full Intl support. Its possible it was built without support for non-English + // locales which will make resolvedOptions inaccurate + // + // https://nodejs.org/api/intl.html#detecting-internationalization-support + const january = new Date(9e8); + const spanish = new Intl.DateTimeFormat('es', { month: 'long' }); + if (spanish.format(january) === 'enero') { + const options = Intl.DateTimeFormat().resolvedOptions(); + + return { + locale: options.locale, + timezone: options.timeZone, + }; + } + } catch (err) { + // + } + + return; +} + +/** + * Get app context information from process + */ +function getAppContext() { + const app_memory = process.memoryUsage().rss; + const app_start_time = new Date(Date.now() - process.uptime() * 1000).toISOString(); + // https://nodejs.org/api/process.html#processavailablememory + const appContext = { app_start_time, app_memory }; + + if (typeof (process ).availableMemory === 'function') { + const freeMemory = _optionalChain([(process ), 'access', _19 => _19.availableMemory, 'optionalCall', _20 => _20()]); + if (freeMemory != null) { + appContext.free_memory = freeMemory; + } + } + + return appContext; +} + +/** + * Gets device information from os + */ +function getDeviceContext(deviceOpt) { + const device = {}; + + // Sometimes os.uptime() throws due to lacking permissions: https://github.com/getsentry/sentry-javascript/issues/8202 + let uptime; + try { + uptime = os.uptime && os.uptime(); + } catch (e) { + // noop + } + + // os.uptime or its return value seem to be undefined in certain environments (e.g. Azure functions). + // Hence, we only set boot time, if we get a valid uptime value. + // @see https://github.com/getsentry/sentry-javascript/issues/5856 + if (typeof uptime === 'number') { + device.boot_time = new Date(Date.now() - uptime * 1000).toISOString(); + } + + device.arch = os.arch(); + + if (deviceOpt === true || deviceOpt.memory) { + device.memory_size = os.totalmem(); + device.free_memory = os.freemem(); + } + + if (deviceOpt === true || deviceOpt.cpu) { + const cpuInfo = os.cpus(); + const firstCpu = cpuInfo && cpuInfo[0]; + if (firstCpu) { + device.processor_count = cpuInfo.length; + device.cpu_description = firstCpu.model; + device.processor_frequency = firstCpu.speed; + } + } + + return device; +} + +/** Mapping of Node's platform names to actual OS names. */ +const PLATFORM_NAMES = { + aix: 'IBM AIX', + freebsd: 'FreeBSD', + openbsd: 'OpenBSD', + sunos: 'SunOS', + win32: 'Windows', +}; + +/** Linux version file to check for a distribution. */ + +/** Mapping of linux release files located in /etc to distributions. */ +const LINUX_DISTROS = [ + { name: 'fedora-release', distros: ['Fedora'] }, + { name: 'redhat-release', distros: ['Red Hat Linux', 'Centos'] }, + { name: 'redhat_version', distros: ['Red Hat Linux'] }, + { name: 'SuSE-release', distros: ['SUSE Linux'] }, + { name: 'lsb-release', distros: ['Ubuntu Linux', 'Arch Linux'] }, + { name: 'debian_version', distros: ['Debian'] }, + { name: 'debian_release', distros: ['Debian'] }, + { name: 'arch-release', distros: ['Arch Linux'] }, + { name: 'gentoo-release', distros: ['Gentoo Linux'] }, + { name: 'novell-release', distros: ['SUSE Linux'] }, + { name: 'alpine-release', distros: ['Alpine Linux'] }, +]; + +/** Functions to extract the OS version from Linux release files. */ +const LINUX_VERSIONS + + = { + alpine: content => content, + arch: content => matchFirst(/distrib_release=(.*)/, content), + centos: content => matchFirst(/release ([^ ]+)/, content), + debian: content => content, + fedora: content => matchFirst(/release (..)/, content), + mint: content => matchFirst(/distrib_release=(.*)/, content), + red: content => matchFirst(/release ([^ ]+)/, content), + suse: content => matchFirst(/VERSION = (.*)\n/, content), + ubuntu: content => matchFirst(/distrib_release=(.*)/, content), +}; + +/** + * Executes a regular expression with one capture group. + * + * @param regex A regular expression to execute. + * @param text Content to execute the RegEx on. + * @returns The captured string if matched; otherwise undefined. + */ +function matchFirst(regex, text) { + const match = regex.exec(text); + return match ? match[1] : undefined; +} + +/** Loads the macOS operating system context. */ +async function getDarwinInfo() { + // Default values that will be used in case no operating system information + // can be loaded. The default version is computed via heuristics from the + // kernel version, but the build ID is missing. + const darwinInfo = { + kernel_version: os.release(), + name: 'Mac OS X', + version: `10.${Number(os.release().split('.')[0]) - 4}`, + }; + + try { + // We try to load the actual macOS version by executing the `sw_vers` tool. + // This tool should be available on every standard macOS installation. In + // case this fails, we stick with the values computed above. + + const output = await new Promise((resolve, reject) => { + node_child_process.execFile('/usr/bin/sw_vers', (error, stdout) => { + if (error) { + reject(error); + return; + } + resolve(stdout); + }); + }); + + darwinInfo.name = matchFirst(/^ProductName:\s+(.*)$/m, output); + darwinInfo.version = matchFirst(/^ProductVersion:\s+(.*)$/m, output); + darwinInfo.build = matchFirst(/^BuildVersion:\s+(.*)$/m, output); + } catch (e) { + // ignore + } + + return darwinInfo; +} + +/** Returns a distribution identifier to look up version callbacks. */ +function getLinuxDistroId(name) { + return (name.split(' ') )[0].toLowerCase(); +} + +/** Loads the Linux operating system context. */ +async function getLinuxInfo() { + // By default, we cannot assume anything about the distribution or Linux + // version. `os.release()` returns the kernel version and we assume a generic + // "Linux" name, which will be replaced down below. + const linuxInfo = { + kernel_version: os.release(), + name: 'Linux', + }; + + try { + // We start guessing the distribution by listing files in the /etc + // directory. This is were most Linux distributions (except Knoppix) store + // release files with certain distribution-dependent meta data. We search + // for exactly one known file defined in `LINUX_DISTROS` and exit if none + // are found. In case there are more than one file, we just stick with the + // first one. + const etcFiles = await readDirAsync('/etc'); + const distroFile = LINUX_DISTROS.find(file => etcFiles.includes(file.name)); + if (!distroFile) { + return linuxInfo; + } + + // Once that file is known, load its contents. To make searching in those + // files easier, we lowercase the file contents. Since these files are + // usually quite small, this should not allocate too much memory and we only + // hold on to it for a very short amount of time. + const distroPath = node_path.join('/etc', distroFile.name); + const contents = ((await readFileAsync(distroPath, { encoding: 'utf-8' })) ).toLowerCase(); + + // Some Linux distributions store their release information in the same file + // (e.g. RHEL and Centos). In those cases, we scan the file for an + // identifier, that basically consists of the first word of the linux + // distribution name (e.g. "red" for Red Hat). In case there is no match, we + // just assume the first distribution in our list. + const { distros } = distroFile; + linuxInfo.name = distros.find(d => contents.indexOf(getLinuxDistroId(d)) >= 0) || distros[0]; + + // Based on the found distribution, we can now compute the actual version + // number. This is different for every distribution, so several strategies + // are computed in `LINUX_VERSIONS`. + const id = getLinuxDistroId(linuxInfo.name); + linuxInfo.version = _optionalChain([LINUX_VERSIONS, 'access', _21 => _21[id], 'optionalCall', _22 => _22(contents)]); + } catch (e) { + // ignore + } + + return linuxInfo; +} + +/** + * Grabs some information about hosting provider based on best effort. + */ +function getCloudResourceContext() { + if (process.env.VERCEL) { + // https://vercel.com/docs/concepts/projects/environment-variables/system-environment-variables#system-environment-variables + return { + 'cloud.provider': 'vercel', + 'cloud.region': process.env.VERCEL_REGION, + }; + } else if (process.env.AWS_REGION) { + // https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html + return { + 'cloud.provider': 'aws', + 'cloud.region': process.env.AWS_REGION, + 'cloud.platform': process.env.AWS_EXECUTION_ENV, + }; + } else if (process.env.GCP_PROJECT) { + // https://cloud.google.com/composer/docs/how-to/managing/environment-variables#reserved_variables + return { + 'cloud.provider': 'gcp', + }; + } else if (process.env.ALIYUN_REGION_ID) { + // TODO: find where I found these environment variables - at least gc.github.com returns something + return { + 'cloud.provider': 'alibaba_cloud', + 'cloud.region': process.env.ALIYUN_REGION_ID, + }; + } else if (process.env.WEBSITE_SITE_NAME && process.env.REGION_NAME) { + // https://learn.microsoft.com/en-us/azure/app-service/reference-app-settings?tabs=kudu%2Cdotnet#app-environment + return { + 'cloud.provider': 'azure', + 'cloud.region': process.env.REGION_NAME, + }; + } else if (process.env.IBM_CLOUD_REGION) { + // TODO: find where I found these environment variables - at least gc.github.com returns something + return { + 'cloud.provider': 'ibm_cloud', + 'cloud.region': process.env.IBM_CLOUD_REGION, + }; + } else if (process.env.TENCENTCLOUD_REGION) { + // https://www.tencentcloud.com/document/product/583/32748 + return { + 'cloud.provider': 'tencent_cloud', + 'cloud.region': process.env.TENCENTCLOUD_REGION, + 'cloud.account.id': process.env.TENCENTCLOUD_APPID, + 'cloud.availability_zone': process.env.TENCENTCLOUD_ZONE, + }; + } else if (process.env.NETLIFY) { + // https://docs.netlify.com/configure-builds/environment-variables/#read-only-variables + return { + 'cloud.provider': 'netlify', + }; + } else if (process.env.FLY_REGION) { + // https://fly.io/docs/reference/runtime-environment/ + return { + 'cloud.provider': 'fly.io', + 'cloud.region': process.env.FLY_REGION, + }; + } else if (process.env.DYNO) { + // https://devcenter.heroku.com/articles/dynos#local-environment-variables + return { + 'cloud.provider': 'heroku', + }; + } else { + return undefined; + } +} + +exports.getAppContext = getAppContext; +exports.getDeviceContext = getDeviceContext; +exports.nodeContextIntegration = nodeContextIntegration; +exports.readDirAsync = readDirAsync; +exports.readFileAsync = readFileAsync; +//# sourceMappingURL=context.js.map + + +/***/ }), + +/***/ 57582: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const node_fs = __nccwpck_require__(87561); +const node_readline = __nccwpck_require__(51747); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(8421); + +const LRU_FILE_CONTENTS_CACHE = new core.LRUMap(10); +const LRU_FILE_CONTENTS_FS_READ_FAILED = new core.LRUMap(20); +const DEFAULT_LINES_OF_CONTEXT = 7; +const INTEGRATION_NAME = 'ContextLines'; +// Determines the upper bound of lineno/colno that we will attempt to read. Large colno values are likely to be +// minified code while large lineno values are likely to be bundled code. +// Exported for testing purposes. +const MAX_CONTEXTLINES_COLNO = 1000; +const MAX_CONTEXTLINES_LINENO = 10000; + +/** + * Get or init map value + */ +function emplace(map, key, contents) { + const value = map.get(key); + + if (value === undefined) { + map.set(key, contents); + return contents; + } + + return value; +} + +/** + * Determines if context lines should be skipped for a file. + * - .min.(mjs|cjs|js) files are and not useful since they dont point to the original source + * - node: prefixed modules are part of the runtime and cannot be resolved to a file + * - data: skip json, wasm and inline js https://nodejs.org/api/esm.html#data-imports + */ +function shouldSkipContextLinesForFile(path) { + // Test the most common prefix and extension first. These are the ones we + // are most likely to see in user applications and are the ones we can break out of first. + if (path.startsWith('node:')) return true; + if (path.endsWith('.min.js')) return true; + if (path.endsWith('.min.cjs')) return true; + if (path.endsWith('.min.mjs')) return true; + if (path.startsWith('data:')) return true; + return false; +} + +/** + * Determines if we should skip contextlines based off the max lineno and colno values. + */ +function shouldSkipContextLinesForFrame(frame) { + if (frame.lineno !== undefined && frame.lineno > MAX_CONTEXTLINES_LINENO) return true; + if (frame.colno !== undefined && frame.colno > MAX_CONTEXTLINES_COLNO) return true; + return false; +} +/** + * Checks if we have all the contents that we need in the cache. + */ +function rangeExistsInContentCache(file, range) { + const contents = LRU_FILE_CONTENTS_CACHE.get(file); + if (contents === undefined) return false; + + for (let i = range[0]; i <= range[1]; i++) { + if (contents[i] === undefined) { + return false; + } + } + + return true; +} + +/** + * Creates contiguous ranges of lines to read from a file. In the case where context lines overlap, + * the ranges are merged to create a single range. + */ +function makeLineReaderRanges(lines, linecontext) { + if (!lines.length) { + return []; + } + + let i = 0; + const line = lines[0]; + + if (typeof line !== 'number') { + return []; + } + + let current = makeContextRange(line, linecontext); + const out = []; + // eslint-disable-next-line no-constant-condition + while (true) { + if (i === lines.length - 1) { + out.push(current); + break; + } + + // If the next line falls into the current range, extend the current range to lineno + linecontext. + const next = lines[i + 1]; + if (typeof next !== 'number') { + break; + } + if (next <= current[1]) { + current[1] = next + linecontext; + } else { + out.push(current); + current = makeContextRange(next, linecontext); + } + + i++; + } + + return out; +} + +/** + * Extracts lines from a file and stores them in a cache. + */ +function getContextLinesFromFile(path, ranges, output) { + return new Promise((resolve, _reject) => { + // It is important *not* to have any async code between createInterface and the 'line' event listener + // as it will cause the 'line' event to + // be emitted before the listener is attached. + const stream = node_fs.createReadStream(path); + const lineReaded = node_readline.createInterface({ + input: stream, + }); + + // We need to explicitly destroy the stream to prevent memory leaks, + // removing the listeners on the readline interface is not enough. + // See: https://github.com/nodejs/node/issues/9002 and https://github.com/getsentry/sentry-javascript/issues/14892 + function destroyStreamAndResolve() { + stream.destroy(); + resolve(); + } + + // Init at zero and increment at the start of the loop because lines are 1 indexed. + let lineNumber = 0; + let currentRangeIndex = 0; + const range = ranges[currentRangeIndex]; + if (range === undefined) { + // We should never reach this point, but if we do, we should resolve the promise to prevent it from hanging. + destroyStreamAndResolve(); + return; + } + let rangeStart = range[0]; + let rangeEnd = range[1]; + + // We use this inside Promise.all, so we need to resolve the promise even if there is an error + // to prevent Promise.all from short circuiting the rest. + function onStreamError(e) { + // Mark file path as failed to read and prevent multiple read attempts. + LRU_FILE_CONTENTS_FS_READ_FAILED.set(path, 1); + debugBuild.DEBUG_BUILD && core.logger.error(`Failed to read file: ${path}. Error: ${e}`); + lineReaded.close(); + lineReaded.removeAllListeners(); + destroyStreamAndResolve(); + } + + // We need to handle the error event to prevent the process from crashing in < Node 16 + // https://github.com/nodejs/node/pull/31603 + stream.on('error', onStreamError); + lineReaded.on('error', onStreamError); + lineReaded.on('close', destroyStreamAndResolve); + + lineReaded.on('line', line => { + lineNumber++; + if (lineNumber < rangeStart) return; + + // !Warning: This mutates the cache by storing the snipped line into the cache. + output[lineNumber] = core.snipLine(line, 0); + + if (lineNumber >= rangeEnd) { + if (currentRangeIndex === ranges.length - 1) { + // We need to close the file stream and remove listeners, else the reader will continue to run our listener; + lineReaded.close(); + lineReaded.removeAllListeners(); + return; + } + currentRangeIndex++; + const range = ranges[currentRangeIndex]; + if (range === undefined) { + // This should never happen as it means we have a bug in the context. + lineReaded.close(); + lineReaded.removeAllListeners(); + return; + } + rangeStart = range[0]; + rangeEnd = range[1]; + } + }); + }); +} + +/** + * Adds surrounding (context) lines of the line that an exception occurred on to the event. + * This is done by reading the file line by line and extracting the lines. The extracted lines are stored in + * a cache to prevent multiple reads of the same file. Failures to read a file are similarly cached to prevent multiple + * failing reads from happening. + */ +/* eslint-disable complexity */ +async function addSourceContext(event, contextLines) { + // keep a lookup map of which files we've already enqueued to read, + // so we don't enqueue the same file multiple times which would cause multiple i/o reads + const filesToLines = {}; + + if (contextLines > 0 && _optionalChain([event, 'access', _ => _.exception, 'optionalAccess', _2 => _2.values])) { + for (const exception of event.exception.values) { + if (!_optionalChain([exception, 'access', _3 => _3.stacktrace, 'optionalAccess', _4 => _4.frames, 'optionalAccess', _5 => _5.length])) { + continue; + } + + // Maps preserve insertion order, so we iterate in reverse, starting at the + // outermost frame and closer to where the exception has occurred (poor mans priority) + for (let i = exception.stacktrace.frames.length - 1; i >= 0; i--) { + const frame = exception.stacktrace.frames[i]; + const filename = _optionalChain([frame, 'optionalAccess', _6 => _6.filename]); + + if ( + !frame || + typeof filename !== 'string' || + typeof frame.lineno !== 'number' || + shouldSkipContextLinesForFile(filename) || + shouldSkipContextLinesForFrame(frame) + ) { + continue; + } + + const filesToLinesOutput = filesToLines[filename]; + if (!filesToLinesOutput) filesToLines[filename] = []; + // @ts-expect-error this is defined above + filesToLines[filename].push(frame.lineno); + } + } + } + + const files = Object.keys(filesToLines); + if (files.length == 0) { + return event; + } + + const readlinePromises = []; + for (const file of files) { + // If we failed to read this before, dont try reading it again. + if (LRU_FILE_CONTENTS_FS_READ_FAILED.get(file)) { + continue; + } + + const filesToLineRanges = filesToLines[file]; + if (!filesToLineRanges) { + continue; + } + + // Sort ranges so that they are sorted by line increasing order and match how the file is read. + filesToLineRanges.sort((a, b) => a - b); + // Check if the contents are already in the cache and if we can avoid reading the file again. + const ranges = makeLineReaderRanges(filesToLineRanges, contextLines); + if (ranges.every(r => rangeExistsInContentCache(file, r))) { + continue; + } + + const cache = emplace(LRU_FILE_CONTENTS_CACHE, file, {}); + readlinePromises.push(getContextLinesFromFile(file, ranges, cache)); + } + + // The promise rejections are caught in order to prevent them from short circuiting Promise.all + await Promise.all(readlinePromises).catch(() => { + debugBuild.DEBUG_BUILD && core.logger.log('Failed to read one or more source files and resolve context lines'); + }); + + // Perform the same loop as above, but this time we can assume all files are in the cache + // and attempt to add source context to frames. + if (contextLines > 0 && _optionalChain([event, 'access', _7 => _7.exception, 'optionalAccess', _8 => _8.values])) { + for (const exception of event.exception.values) { + if (exception.stacktrace && exception.stacktrace.frames && exception.stacktrace.frames.length > 0) { + addSourceContextToFrames(exception.stacktrace.frames, contextLines, LRU_FILE_CONTENTS_CACHE); + } + } + } + + return event; +} +/* eslint-enable complexity */ + +/** Adds context lines to frames */ +function addSourceContextToFrames( + frames, + contextLines, + cache, +) { + for (const frame of frames) { + // Only add context if we have a filename and it hasn't already been added + if (frame.filename && frame.context_line === undefined && typeof frame.lineno === 'number') { + const contents = cache.get(frame.filename); + if (contents === undefined) { + continue; + } + + addContextToFrame(frame.lineno, frame, contextLines, contents); + } + } +} + +/** + * Clears the context lines from a frame, used to reset a frame to its original state + * if we fail to resolve all context lines for it. + */ +function clearLineContext(frame) { + delete frame.pre_context; + delete frame.context_line; + delete frame.post_context; +} + +/** + * Resolves context lines before and after the given line number and appends them to the frame; + */ +function addContextToFrame( + lineno, + frame, + contextLines, + contents, +) { + // When there is no line number in the frame, attaching context is nonsensical and will even break grouping. + // We already check for lineno before calling this, but since StackFrame lineno ism optional, we check it again. + if (frame.lineno === undefined || contents === undefined) { + debugBuild.DEBUG_BUILD && core.logger.error('Cannot resolve context for frame with no lineno or file contents'); + return; + } + + frame.pre_context = []; + for (let i = makeRangeStart(lineno, contextLines); i < lineno; i++) { + // We always expect the start context as line numbers cannot be negative. If we dont find a line, then + // something went wrong somewhere. Clear the context and return without adding any linecontext. + const line = contents[i]; + if (line === undefined) { + clearLineContext(frame); + debugBuild.DEBUG_BUILD && core.logger.error(`Could not find line ${i} in file ${frame.filename}`); + return; + } + + frame.pre_context.push(line); + } + + // We should always have the context line. If we dont, something went wrong, so we clear the context and return + // without adding any linecontext. + if (contents[lineno] === undefined) { + clearLineContext(frame); + debugBuild.DEBUG_BUILD && core.logger.error(`Could not find line ${lineno} in file ${frame.filename}`); + return; + } + + frame.context_line = contents[lineno]; + + const end = makeRangeEnd(lineno, contextLines); + frame.post_context = []; + for (let i = lineno + 1; i <= end; i++) { + // Since we dont track when the file ends, we cant clear the context if we dont find a line as it could + // just be that we reached the end of the file. + const line = contents[i]; + if (line === undefined) { + break; + } + frame.post_context.push(line); + } +} + +// Helper functions for generating line context ranges. They take a line number and the number of lines of context to +// include before and after the line and generate an inclusive range of indices. + +// Compute inclusive end context range +function makeRangeStart(line, linecontext) { + return Math.max(1, line - linecontext); +} +// Compute inclusive start context range +function makeRangeEnd(line, linecontext) { + return line + linecontext; +} +// Determine start and end indices for context range (inclusive); +function makeContextRange(line, linecontext) { + return [makeRangeStart(line, linecontext), makeRangeEnd(line, linecontext)]; +} + +/** Exported only for tests, as a type-safe variant. */ +const _contextLinesIntegration = ((options = {}) => { + const contextLines = options.frameContextLines !== undefined ? options.frameContextLines : DEFAULT_LINES_OF_CONTEXT; + + return { + name: INTEGRATION_NAME, + processEvent(event) { + return addSourceContext(event, contextLines); + }, + }; +}) ; + +/** + * Capture the lines before and after the frame's context. + */ +const contextLinesIntegration = core.defineIntegration(_contextLinesIntegration); + +exports.MAX_CONTEXTLINES_COLNO = MAX_CONTEXTLINES_COLNO; +exports.MAX_CONTEXTLINES_LINENO = MAX_CONTEXTLINES_LINENO; +exports._contextLinesIntegration = _contextLinesIntegration; +exports.addContextToFrame = addContextToFrame; +exports.contextLinesIntegration = contextLinesIntegration; +//# sourceMappingURL=contextlines.js.map + + +/***/ }), + +/***/ 91776: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationFs = __nccwpck_require__(99833); +const core = __nccwpck_require__(84466); +const instrument = __nccwpck_require__(64074); + +const INTEGRATION_NAME = 'FileSystem'; + +/** + * This integration will create spans for `fs` API operations, like reading and writing files. + * + * **WARNING:** This integration may add significant overhead to your application. Especially in scenarios with a lot of + * file I/O, like for example when running a framework dev server, including this integration can massively slow down + * your application. + * + * @param options Configuration for this integration. + */ +const fsIntegration = core.defineIntegration( + ( + options + + = {}, + ) => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrument.generateInstrumentOnce( + INTEGRATION_NAME, + () => + new instrumentationFs.FsInstrumentation({ + requireParentSpan: true, + endHook(functionName, { args, span, error }) { + span.updateName(`fs.${functionName}`); + + span.setAttributes({ + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'file', + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.file.fs', + }); + + if (options.recordErrorMessagesAsSpanAttributes) { + if (typeof args[0] === 'string' && FS_OPERATIONS_WITH_PATH_ARG.includes(functionName)) { + span.setAttribute('path_argument', args[0]); + } else if ( + typeof args[0] === 'string' && + typeof args[1] === 'string' && + FS_OPERATIONS_WITH_TARGET_PATH.includes(functionName) + ) { + span.setAttribute('target_argument', args[0]); + span.setAttribute('path_argument', args[1]); + } else if (typeof args[0] === 'string' && FS_OPERATIONS_WITH_PREFIX.includes(functionName)) { + span.setAttribute('prefix_argument', args[0]); + } else if ( + typeof args[0] === 'string' && + typeof args[1] === 'string' && + FS_OPERATIONS_WITH_EXISTING_PATH_NEW_PATH.includes(functionName) + ) { + span.setAttribute('existing_path_argument', args[0]); + span.setAttribute('new_path_argument', args[1]); + } else if ( + typeof args[0] === 'string' && + typeof args[1] === 'string' && + FS_OPERATIONS_WITH_SRC_DEST.includes(functionName) + ) { + span.setAttribute('src_argument', args[0]); + span.setAttribute('dest_argument', args[1]); + } else if ( + typeof args[0] === 'string' && + typeof args[1] === 'string' && + FS_OPERATIONS_WITH_OLD_PATH_NEW_PATH.includes(functionName) + ) { + span.setAttribute('old_path_argument', args[0]); + span.setAttribute('new_path_argument', args[1]); + } + } + + if (error && options.recordErrorMessagesAsSpanAttributes) { + span.setAttribute('fs_error', error.message); + } + }, + }), + )(); + }, + }; + }, +); + +const FS_OPERATIONS_WITH_OLD_PATH_NEW_PATH = ['rename', 'renameSync']; +const FS_OPERATIONS_WITH_SRC_DEST = ['copyFile', 'cp', 'copyFileSync', 'cpSync']; +const FS_OPERATIONS_WITH_EXISTING_PATH_NEW_PATH = ['link', 'linkSync']; +const FS_OPERATIONS_WITH_PREFIX = ['mkdtemp', 'mkdtempSync']; +const FS_OPERATIONS_WITH_TARGET_PATH = ['symlink', 'symlinkSync']; +const FS_OPERATIONS_WITH_PATH_ARG = [ + 'access', + 'appendFile', + 'chmod', + 'chown', + 'exists', + 'mkdir', + 'lchown', + 'lstat', + 'lutimes', + 'open', + 'opendir', + 'readdir', + 'readFile', + 'readlink', + 'realpath', + 'realpath.native', + 'rm', + 'rmdir', + 'stat', + 'truncate', + 'unlink', + 'utimes', + 'writeFile', + 'accessSync', + 'appendFileSync', + 'chmodSync', + 'chownSync', + 'existsSync', + 'lchownSync', + 'lstatSync', + 'lutimesSync', + 'opendirSync', + 'mkdirSync', + 'openSync', + 'readdirSync', + 'readFileSync', + 'readlinkSync', + 'realpathSync', + 'realpathSync.native', + 'rmdirSync', + 'rmSync', + 'statSync', + 'truncateSync', + 'unlinkSync', + 'utimesSync', + 'writeFileSync', +]; + +exports.fsIntegration = fsIntegration; +//# sourceMappingURL=fs.js.map + + +/***/ }), + +/***/ 59079: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const core = __nccwpck_require__(46033); +const instrumentation = __nccwpck_require__(65584); +const core$1 = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(8421); +const getRequestUrl = __nccwpck_require__(35126); +const getRequestInfo = __nccwpck_require__(48232); + +// We only want to capture request bodies up to 1mb. +const MAX_BODY_BYTE_LENGTH = 1024 * 1024; + +/** + * This custom HTTP instrumentation is used to isolate incoming requests and annotate them with additional information. + * It does not emit any spans. + * + * The reason this is isolated from the OpenTelemetry instrumentation is that users may overwrite this, + * which would lead to Sentry not working as expected. + * + * Important note: Contrary to other OTEL instrumentation, this one cannot be unwrapped. + * It only does minimal things though and does not emit any spans. + * + * This is heavily inspired & adapted from: + * https://github.com/open-telemetry/opentelemetry-js/blob/f8ab5592ddea5cba0a3b33bf8d74f27872c0367f/experimental/packages/opentelemetry-instrumentation-http/src/http.ts + */ +class SentryHttpInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super('@sentry/instrumentation-http', core.VERSION, config); + } + + /** @inheritdoc */ + init() { + return [this._getHttpsInstrumentation(), this._getHttpInstrumentation()]; + } + + /** Get the instrumentation for the http module. */ + _getHttpInstrumentation() { + return new instrumentation.InstrumentationNodeModuleDefinition( + 'http', + ['*'], + (moduleExports) => { + // Patch incoming requests for request isolation + stealthWrap(moduleExports.Server.prototype, 'emit', this._getPatchIncomingRequestFunction()); + + // Patch outgoing requests for breadcrumbs + const patchedRequest = stealthWrap(moduleExports, 'request', this._getPatchOutgoingRequestFunction()); + stealthWrap(moduleExports, 'get', this._getPatchOutgoingGetFunction(patchedRequest)); + + return moduleExports; + }, + () => { + // no unwrap here + }, + ); + } + + /** Get the instrumentation for the https module. */ + _getHttpsInstrumentation() { + return new instrumentation.InstrumentationNodeModuleDefinition( + 'https', + ['*'], + (moduleExports) => { + // Patch incoming requests for request isolation + stealthWrap(moduleExports.Server.prototype, 'emit', this._getPatchIncomingRequestFunction()); + + // Patch outgoing requests for breadcrumbs + const patchedRequest = stealthWrap(moduleExports, 'request', this._getPatchOutgoingRequestFunction()); + stealthWrap(moduleExports, 'get', this._getPatchOutgoingGetFunction(patchedRequest)); + + return moduleExports; + }, + () => { + // no unwrap here + }, + ); + } + + /** + * Patch the incoming request function for request isolation. + */ + _getPatchIncomingRequestFunction() + + { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const instrumentation = this; + + return ( + original, + ) => { + return function incomingRequest( event, ...args) { + // Only traces request events + if (event !== 'request') { + return original.apply(this, [event, ...args]); + } + + instrumentation._diag.debug('http instrumentation for incoming request'); + + const isolationScope = core$1.getIsolationScope().clone(); + const request = args[0] ; + + const normalizedRequest = core$1.httpRequestToRequestData(request); + + patchRequestToCaptureBody(request, isolationScope); + + // Update the isolation scope, isolate this request + // TODO(v9): Stop setting `request`, we only rely on normalizedRequest anymore + isolationScope.setSDKProcessingMetadata({ + request, + normalizedRequest, + }); + + const client = core$1.getClient(); + // eslint-disable-next-line deprecation/deprecation + if (client && client.getOptions().autoSessionTracking) { + // eslint-disable-next-line deprecation/deprecation + isolationScope.setRequestSession({ status: 'ok' }); + } + + // attempt to update the scope's `transactionName` based on the request URL + // Ideally, framework instrumentations coming after the HttpInstrumentation + // update the transactionName once we get a parameterized route. + const httpMethod = (request.method || 'GET').toUpperCase(); + const httpTarget = core$1.stripUrlQueryAndFragment(request.url || '/'); + + const bestEffortTransactionName = `${httpMethod} ${httpTarget}`; + + isolationScope.setTransactionName(bestEffortTransactionName); + + return core$1.withIsolationScope(isolationScope, () => { + return original.apply(this, [event, ...args]); + }); + }; + }; + } + + /** + * Patch the outgoing request function for breadcrumbs. + */ + _getPatchOutgoingRequestFunction() + + { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const instrumentation = this; + + return (original) => { + return function outgoingRequest( ...args) { + instrumentation._diag.debug('http instrumentation for outgoing requests'); + + // Making a copy to avoid mutating the original args array + // We need to access and reconstruct the request options object passed to `ignoreOutgoingRequests` + // so that it matches what Otel instrumentation passes to `ignoreOutgoingRequestHook`. + // @see https://github.com/open-telemetry/opentelemetry-js/blob/7293e69c1e55ca62e15d0724d22605e61bd58952/experimental/packages/opentelemetry-instrumentation-http/src/http.ts#L756-L789 + const argsCopy = [...args]; + + const options = argsCopy.shift() ; + + const extraOptions = + typeof argsCopy[0] === 'object' && (typeof options === 'string' || options instanceof URL) + ? (argsCopy.shift() ) + : undefined; + + const { optionsParsed } = getRequestInfo.getRequestInfo(instrumentation._diag, options, extraOptions); + + const request = original.apply(this, args) ; + + request.prependListener('response', (response) => { + const _breadcrumbs = instrumentation.getConfig().breadcrumbs; + const breadCrumbsEnabled = typeof _breadcrumbs === 'undefined' ? true : _breadcrumbs; + + const _ignoreOutgoingRequests = instrumentation.getConfig().ignoreOutgoingRequests; + const shouldCreateBreadcrumb = + typeof _ignoreOutgoingRequests === 'function' + ? !_ignoreOutgoingRequests(getRequestUrl.getRequestUrl(request), optionsParsed) + : true; + + if (breadCrumbsEnabled && shouldCreateBreadcrumb) { + addRequestBreadcrumb(request, response); + } + }); + + return request; + }; + }; + } + + /** Path the outgoing get function for breadcrumbs. */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + _getPatchOutgoingGetFunction(clientRequest) { + return (_original) => { + // Re-implement http.get. This needs to be done (instead of using + // getPatchOutgoingRequestFunction to patch it) because we need to + // set the trace context header before the returned http.ClientRequest is + // ended. The Node.js docs state that the only differences between + // request and get are that (1) get defaults to the HTTP GET method and + // (2) the returned request object is ended immediately. The former is + // already true (at least in supported Node versions up to v10), so we + // simply follow the latter. Ref: + // https://nodejs.org/dist/latest/docs/api/http.html#http_http_get_options_callback + // https://github.com/googleapis/cloud-trace-nodejs/blob/master/src/instrumentations/instrumentation-http.ts#L198 + return function outgoingGetRequest(...args) { + const req = clientRequest(...args); + req.end(); + return req; + }; + }; + } +} + +/** + * This is a minimal version of `wrap` from shimmer: + * https://github.com/othiym23/shimmer/blob/master/index.js + * + * In contrast to the original implementation, this version does not allow to unwrap, + * and does not make it clear that the method is wrapped. + * This is necessary because we want to wrap the http module with our own code, + * while still allowing to use the HttpInstrumentation from OTEL. + * + * Without this, if we'd just use `wrap` from shimmer, the OTEL instrumentation would remove our wrapping, + * because it only allows any module to be wrapped a single time. + */ +function stealthWrap( + nodule, + name, + wrapper, +) { + const original = nodule[name]; + const wrapped = wrapper(original); + + defineProperty(nodule, name, wrapped); + return wrapped; +} + +// Sets a property on an object, preserving its enumerability. +function defineProperty( + obj, + name, + value, +) { + const enumerable = !!obj[name] && Object.prototype.propertyIsEnumerable.call(obj, name); + + Object.defineProperty(obj, name, { + configurable: true, + enumerable: enumerable, + writable: true, + value: value, + }); +} + +/** Add a breadcrumb for outgoing requests. */ +function addRequestBreadcrumb(request, response) { + const data = getBreadcrumbData(request); + + const statusCode = response.statusCode; + const level = core$1.getBreadcrumbLogLevelFromHttpStatusCode(statusCode); + + core$1.addBreadcrumb( + { + category: 'http', + data: { + status_code: statusCode, + ...data, + }, + type: 'http', + level, + }, + { + event: 'response', + request, + response, + }, + ); +} + +function getBreadcrumbData(request) { + try { + // `request.host` does not contain the port, but the host header does + const host = request.getHeader('host') || request.host; + const url = new URL(request.path, `${request.protocol}//${host}`); + const parsedUrl = core$1.parseUrl(url.toString()); + + const data = { + url: core$1.getSanitizedUrlString(parsedUrl), + 'http.method': request.method || 'GET', + }; + + if (parsedUrl.search) { + data['http.query'] = parsedUrl.search; + } + if (parsedUrl.hash) { + data['http.fragment'] = parsedUrl.hash; + } + + return data; + } catch (e) { + return {}; + } +} + +/** + * This method patches the request object to capture the body. + * Instead of actually consuming the streamed body ourselves, which has potential side effects, + * we monkey patch `req.on('data')` to intercept the body chunks. + * This way, we only read the body if the user also consumes the body, ensuring we do not change any behavior in unexpected ways. + */ +function patchRequestToCaptureBody(req, isolationScope) { + const chunks = []; + + function getChunksSize() { + return chunks.reduce((acc, chunk) => acc + chunk.byteLength, 0); + } + + /** + * We need to keep track of the original callbacks, in order to be able to remove listeners again. + * Since `off` depends on having the exact same function reference passed in, we need to be able to map + * original listeners to our wrapped ones. + */ + const callbackMap = new WeakMap(); + + try { + // eslint-disable-next-line @typescript-eslint/unbound-method + req.on = new Proxy(req.on, { + apply: (target, thisArg, args) => { + const [event, listener, ...restArgs] = args; + + if (event === 'data') { + const callback = new Proxy(listener, { + apply: (target, thisArg, args) => { + // If we have already read more than the max body length, we stop addiing chunks + // To avoid growing the memory indefinitely if a respons is e.g. streamed + if (getChunksSize() < MAX_BODY_BYTE_LENGTH) { + const chunk = args[0] ; + chunks.push(chunk); + } else if (debugBuild.DEBUG_BUILD) { + core$1.logger.log( + `Dropping request body chunk because it maximum body length of ${MAX_BODY_BYTE_LENGTH}b is exceeded.`, + ); + } + + return Reflect.apply(target, thisArg, args); + }, + }); + + callbackMap.set(listener, callback); + + return Reflect.apply(target, thisArg, [event, callback, ...restArgs]); + } + + if (event === 'end') { + const callback = new Proxy(listener, { + apply: (target, thisArg, args) => { + try { + const body = Buffer.concat(chunks).toString('utf-8'); + + if (body) { + const normalizedRequest = { data: body } ; + isolationScope.setSDKProcessingMetadata({ normalizedRequest }); + } + } catch (e2) { + // ignore errors here + } + + return Reflect.apply(target, thisArg, args); + }, + }); + + callbackMap.set(listener, callback); + + return Reflect.apply(target, thisArg, [event, callback, ...restArgs]); + } + + return Reflect.apply(target, thisArg, args); + }, + }); + + // Ensure we also remove callbacks correctly + // eslint-disable-next-line @typescript-eslint/unbound-method + req.off = new Proxy(req.off, { + apply: (target, thisArg, args) => { + const [, listener] = args; + + const callback = callbackMap.get(listener); + if (callback) { + callbackMap.delete(listener); + + const modifiedArgs = args.slice(); + modifiedArgs[1] = callback; + return Reflect.apply(target, thisArg, modifiedArgs); + } + + return Reflect.apply(target, thisArg, args); + }, + }); + } catch (e3) { + // ignore errors if we can't patch stuff + } +} + +exports.SentryHttpInstrumentation = SentryHttpInstrumentation; +//# sourceMappingURL=SentryHttpInstrumentation.js.map + + +/***/ }), + +/***/ 50289: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const api = __nccwpck_require__(65163); +const instrumentationHttp = __nccwpck_require__(50611); +const core = __nccwpck_require__(84466); +const opentelemetry = __nccwpck_require__(78369); +const instrument = __nccwpck_require__(64074); +const addOriginToSpan = __nccwpck_require__(37980); +const getRequestUrl = __nccwpck_require__(35126); +const SentryHttpInstrumentation = __nccwpck_require__(59079); + +const INTEGRATION_NAME = 'Http'; + +const INSTRUMENTATION_NAME = '@opentelemetry_sentry-patched/instrumentation-http'; + +const instrumentSentryHttp = instrument.generateInstrumentOnce + +(`${INTEGRATION_NAME}.sentry`, options => { + return new SentryHttpInstrumentation.SentryHttpInstrumentation({ + breadcrumbs: _optionalChain([options, 'optionalAccess', _ => _.breadcrumbs]), + ignoreOutgoingRequests: _optionalChain([options, 'optionalAccess', _2 => _2.ignoreOutgoingRequests]), + }); +}); + +const instrumentOtelHttp = instrument.generateInstrumentOnce(INTEGRATION_NAME, config => { + const instrumentation = new instrumentationHttp.HttpInstrumentation(config); + + // We want to update the logger namespace so we can better identify what is happening here + try { + instrumentation['_diag'] = api.diag.createComponentLogger({ + namespace: INSTRUMENTATION_NAME, + }); + // @ts-expect-error We are writing a read-only property here... + instrumentation.instrumentationName = INSTRUMENTATION_NAME; + } catch (e) { + // ignore errors here... + } + + return instrumentation; +}); + +/** + * Instrument the HTTP and HTTPS modules. + */ +const instrumentHttp = (options = {}) => { + // This is the "regular" OTEL instrumentation that emits spans + if (options.spans !== false) { + const instrumentationConfig = getConfigWithDefaults(options); + instrumentOtelHttp(instrumentationConfig); + } + + // This is the Sentry-specific instrumentation that isolates requests & creates breadcrumbs + // Note that this _has_ to be wrapped after the OTEL instrumentation, + // otherwise the isolation will not work correctly + instrumentSentryHttp(options); +}; + +/** + * The http integration instruments Node's internal http and https modules. + * It creates breadcrumbs and spans for outgoing HTTP requests which will be attached to the currently active span. + */ +const httpIntegration = core.defineIntegration((options = {}) => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentHttp(options); + }, + }; +}); + +/** + * Determines if @param req is a ClientRequest, meaning the request was created within the express app + * and it's an outgoing request. + * Checking for properties instead of using `instanceOf` to avoid importing the request classes. + */ +function _isClientRequest(req) { + return 'outputData' in req && 'outputSize' in req && !('client' in req) && !('statusCode' in req); +} + +/** + * Detects if an incoming request is a prefetch request. + */ +function isKnownPrefetchRequest(req) { + // Currently only handles Next.js prefetch requests but may check other frameworks in the future. + return req.headers['next-router-prefetch'] === '1'; +} + +function getConfigWithDefaults(options = {}) { + const instrumentationConfig = { + ..._optionalChain([options, 'access', _3 => _3.instrumentation, 'optionalAccess', _4 => _4._experimentalConfig]), + + disableIncomingRequestInstrumentation: options.disableIncomingRequestSpans, + + ignoreOutgoingRequestHook: request => { + const url = getRequestUrl.getRequestUrl(request); + + if (!url) { + return false; + } + + const _ignoreOutgoingRequests = options.ignoreOutgoingRequests; + if (_ignoreOutgoingRequests && _ignoreOutgoingRequests(url, request)) { + return true; + } + + return false; + }, + + ignoreIncomingRequestHook: request => { + // request.url is the only property that holds any information about the url + // it only consists of the URL path and query string (if any) + const urlPath = request.url; + + const method = _optionalChain([request, 'access', _5 => _5.method, 'optionalAccess', _6 => _6.toUpperCase, 'call', _7 => _7()]); + // We do not capture OPTIONS/HEAD requests as transactions + if (method === 'OPTIONS' || method === 'HEAD') { + return true; + } + + const _ignoreIncomingRequests = options.ignoreIncomingRequests; + if (urlPath && _ignoreIncomingRequests && _ignoreIncomingRequests(urlPath, request)) { + return true; + } + + return false; + }, + + requireParentforOutgoingSpans: false, + requireParentforIncomingSpans: false, + requestHook: (span, req) => { + addOriginToSpan.addOriginToSpan(span, 'auto.http.otel.http'); + if (!_isClientRequest(req) && isKnownPrefetchRequest(req)) { + span.setAttribute('sentry.http.prefetch', true); + } + + _optionalChain([options, 'access', _8 => _8.instrumentation, 'optionalAccess', _9 => _9.requestHook, 'optionalCall', _10 => _10(span, req)]); + }, + responseHook: (span, res) => { + const client = opentelemetry.getClient(); + + if ( + client && + // eslint-disable-next-line deprecation/deprecation + client.getOptions().autoSessionTracking !== false && + options.trackIncomingRequestsAsSessions !== false + ) { + setImmediate(() => { + client['_captureRequestSession'](); + }); + } + + _optionalChain([options, 'access', _11 => _11.instrumentation, 'optionalAccess', _12 => _12.responseHook, 'optionalCall', _13 => _13(span, res)]); + }, + applyCustomAttributesOnSpan: ( + span, + request, + response, + ) => { + _optionalChain([options, 'access', _14 => _14.instrumentation, 'optionalAccess', _15 => _15.applyCustomAttributesOnSpan, 'optionalCall', _16 => _16(span, request, response)]); + }, + } ; + + return instrumentationConfig; +} + +exports.httpIntegration = httpIntegration; +exports.instrumentOtelHttp = instrumentOtelHttp; +exports.instrumentSentryHttp = instrumentSentryHttp; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 48232: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const url = __nccwpck_require__(57310); + +/** + * Makes sure options is an url object + * return an object with default value and parsed options + * @param logger component logger + * @param options original options for the request + * @param [extraOptions] additional options for the request + */ +const getRequestInfo = ( + logger, + options, + extraOptions, + +) => { + let pathname; + let origin; + let optionsParsed; + let invalidUrl = false; + if (typeof options === 'string') { + try { + const convertedOptions = stringUrlToHttpOptions(options); + optionsParsed = convertedOptions; + pathname = convertedOptions.pathname || '/'; + } catch (e) { + invalidUrl = true; + logger.verbose( + 'Unable to parse URL provided to HTTP request, using fallback to determine path. Original error:', + e, + ); + // for backward compatibility with how url.parse() behaved. + optionsParsed = { + path: options, + }; + pathname = optionsParsed.path || '/'; + } + + origin = `${optionsParsed.protocol || 'http:'}//${optionsParsed.host}`; + if (extraOptions !== undefined) { + Object.assign(optionsParsed, extraOptions); + } + } else if (options instanceof url.URL) { + optionsParsed = { + protocol: options.protocol, + hostname: + typeof options.hostname === 'string' && options.hostname.startsWith('[') + ? options.hostname.slice(1, -1) + : options.hostname, + path: `${options.pathname || ''}${options.search || ''}`, + }; + if (options.port !== '') { + optionsParsed.port = Number(options.port); + } + if (options.username || options.password) { + optionsParsed.auth = `${options.username}:${options.password}`; + } + pathname = options.pathname; + origin = options.origin; + if (extraOptions !== undefined) { + Object.assign(optionsParsed, extraOptions); + } + } else { + optionsParsed = Object.assign({ protocol: options.host ? 'http:' : undefined }, options); + + const hostname = + optionsParsed.host || + (optionsParsed.port != null ? `${optionsParsed.hostname}${optionsParsed.port}` : optionsParsed.hostname); + origin = `${optionsParsed.protocol || 'http:'}//${hostname}`; + + pathname = (options ).pathname; + if (!pathname && optionsParsed.path) { + try { + const parsedUrl = new URL(optionsParsed.path, origin); + pathname = parsedUrl.pathname || '/'; + } catch (e) { + pathname = '/'; + } + } + } + + // some packages return method in lowercase.. + // ensure upperCase for consistency + const method = optionsParsed.method ? optionsParsed.method.toUpperCase() : 'GET'; + + return { origin, pathname, method, optionsParsed, invalidUrl }; +}; + +/** + * Mimics Node.js conversion of URL strings to RequestOptions expected by + * `http.request` and `https.request` APIs. + * + * See https://github.com/nodejs/node/blob/2505e217bba05fc581b572c685c5cf280a16c5a3/lib/internal/url.js#L1415-L1437 + * + * @param stringUrl + * @throws TypeError if the URL is not valid. + */ +function stringUrlToHttpOptions(stringUrl) { + // This is heavily inspired by Node.js handling of the same situation, trying + // to follow it as closely as possible while keeping in mind that we only + // deal with string URLs, not URL objects. + const { hostname, pathname, port, username, password, search, protocol, hash, href, origin, host } = new URL( + stringUrl, + ); + + const options + + = { + protocol: protocol, + hostname: hostname && hostname[0] === '[' ? hostname.slice(1, -1) : hostname, + hash: hash, + search: search, + pathname: pathname, + path: `${pathname || ''}${search || ''}`, + href: href, + origin: origin, + host: host, + }; + if (port !== '') { + options.port = Number(port); + } + if (username || password) { + options.auth = `${decodeURIComponent(username)}:${decodeURIComponent(password)}`; + } + return options; +} + +exports.getRequestInfo = getRequestInfo; +//# sourceMappingURL=getRequestInfo.js.map + + +/***/ }), + +/***/ 58108: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/** + * The key used to store the local variables on the error object. + */ +const LOCAL_VARIABLES_KEY = '__SENTRY_ERROR_LOCAL_VARIABLES__'; + +/** + * Creates a rate limiter that will call the disable callback when the rate limit is reached and the enable callback + * when a timeout has occurred. + * @param maxPerSecond Maximum number of calls per second + * @param enable Callback to enable capture + * @param disable Callback to disable capture + * @returns A function to call to increment the rate limiter count + */ +function createRateLimiter( + maxPerSecond, + enable, + disable, +) { + let count = 0; + let retrySeconds = 5; + let disabledTimeout = 0; + + setInterval(() => { + if (disabledTimeout === 0) { + if (count > maxPerSecond) { + retrySeconds *= 2; + disable(retrySeconds); + + // Cap at one day + if (retrySeconds > 86400) { + retrySeconds = 86400; + } + disabledTimeout = retrySeconds; + } + } else { + disabledTimeout -= 1; + + if (disabledTimeout === 0) { + enable(); + } + } + + count = 0; + }, 1000).unref(); + + return () => { + count += 1; + }; +} + +// Add types for the exception event data + +/** Could this be an anonymous function? */ +function isAnonymous(name) { + return name !== undefined && (name.length === 0 || name === '?' || name === ''); +} + +/** Do the function names appear to match? */ +function functionNamesMatch(a, b) { + return a === b || (isAnonymous(a) && isAnonymous(b)); +} + +exports.LOCAL_VARIABLES_KEY = LOCAL_VARIABLES_KEY; +exports.createRateLimiter = createRateLimiter; +exports.functionNamesMatch = functionNamesMatch; +exports.isAnonymous = isAnonymous; +//# sourceMappingURL=common.js.map + + +/***/ }), + +/***/ 4530: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const nodeVersion = __nccwpck_require__(88196); +const localVariablesAsync = __nccwpck_require__(92596); +const localVariablesSync = __nccwpck_require__(58079); + +const localVariablesIntegration = (options = {}) => { + return nodeVersion.NODE_VERSION.major < 19 ? localVariablesSync.localVariablesSyncIntegration(options) : localVariablesAsync.localVariablesAsyncIntegration(options); +}; + +exports.localVariablesIntegration = localVariablesIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 92596: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const node_worker_threads = __nccwpck_require__(24086); +const core = __nccwpck_require__(84466); +const debug = __nccwpck_require__(75915); +const common = __nccwpck_require__(58108); + +// This string is a placeholder that gets overwritten with the worker code. +const base64WorkerScript = 'LyohIEBzZW50cnkvbm9kZSA4LjU0LjAgKGU5YTQ1ZmUpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIHR9ZnJvbSJub2RlOndvcmtlcl90aHJlYWRzIjtjb25zdCBuPSI4LjU0LjAiLG89Z2xvYmFsVGhpcztjb25zdCBpPSJ1bmRlZmluZWQiPT10eXBlb2YgX19TRU5UUllfREVCVUdfX3x8X19TRU5UUllfREVCVUdfXyxhPVsiZGVidWciLCJpbmZvIiwid2FybiIsImVycm9yIiwibG9nIiwiYXNzZXJ0IiwidHJhY2UiXSxzPXt9O2Z1bmN0aW9uIGMoZSl7aWYoISgiY29uc29sZSJpbiBvKSlyZXR1cm4gZSgpO2NvbnN0IHQ9by5jb25zb2xlLG49e30saT1PYmplY3Qua2V5cyhzKTtpLmZvckVhY2goKGU9Pntjb25zdCBvPXNbZV07bltlXT10W2VdLHRbZV09b30pKTt0cnl7cmV0dXJuIGUoKX1maW5hbGx5e2kuZm9yRWFjaCgoZT0+e3RbZV09bltlXX0pKX19IWZ1bmN0aW9uKGUsdCxpKXtjb25zdCBhPW8scz1hLl9fU0VOVFJZX189YS5fX1NFTlRSWV9ffHx7fSxjPXNbbl09c1tuXXx8e307Y1tlXXx8KGNbZV09dCgpKX0oImxvZ2dlciIsKGZ1bmN0aW9uKCl7bGV0IGU9ITE7Y29uc3QgdD17ZW5hYmxlOigpPT57ZT0hMH0sZGlzYWJsZTooKT0+e2U9ITF9LGlzRW5hYmxlZDooKT0+ZX07cmV0dXJuIGk/YS5mb3JFYWNoKChuPT57dFtuXT0oLi4udCk9PntlJiZjKCgoKT0+e28uY29uc29sZVtuXShgU2VudHJ5IExvZ2dlciBbJHtufV06YCwuLi50KX0pKX19KSk6YS5mb3JFYWNoKChlPT57dFtlXT0oKT0+e319KSksdH0pKTtjb25zdCByPSJfX1NFTlRSWV9FUlJPUl9MT0NBTF9WQVJJQUJMRVNfXyI7Y29uc3QgdT10O2Z1bmN0aW9uIGwoLi4uZSl7dS5kZWJ1ZyYmYygoKCk9PmNvbnNvbGUubG9nKCJbTG9jYWxWYXJpYWJsZXMgV29ya2VyXSIsLi4uZSkpKX1hc3luYyBmdW5jdGlvbiBmKGUsdCxuLG8pe2NvbnN0IGk9YXdhaXQgZS5wb3N0KCJSdW50aW1lLmdldFByb3BlcnRpZXMiLHtvYmplY3RJZDp0LG93blByb3BlcnRpZXM6ITB9KTtvW25dPWkucmVzdWx0LmZpbHRlcigoZT0+Imxlbmd0aCIhPT1lLm5hbWUmJiFpc05hTihwYXJzZUludChlLm5hbWUsMTApKSkpLnNvcnQoKChlLHQpPT5wYXJzZUludChlLm5hbWUsMTApLXBhcnNlSW50KHQubmFtZSwxMCkpKS5tYXAoKGU9PmUudmFsdWU/LnZhbHVlKSl9YXN5bmMgZnVuY3Rpb24gZyhlLHQsbixvKXtjb25zdCBpPWF3YWl0IGUucG9zdCgiUnVudGltZS5nZXRQcm9wZXJ0aWVzIix7b2JqZWN0SWQ6dCxvd25Qcm9wZXJ0aWVzOiEwfSk7b1tuXT1pLnJlc3VsdC5tYXAoKGU9PltlLm5hbWUsZS52YWx1ZT8udmFsdWVdKSkucmVkdWNlKCgoZSxbdCxuXSk9PihlW3RdPW4sZSkpLHt9KX1mdW5jdGlvbiBkKGUsdCl7ZS52YWx1ZSYmKCJ2YWx1ZSJpbiBlLnZhbHVlP3ZvaWQgMD09PWUudmFsdWUudmFsdWV8fG51bGw9PT1lLnZhbHVlLnZhbHVlP3RbZS5uYW1lXT1gPCR7ZS52YWx1ZS52YWx1ZX0+YDp0W2UubmFtZV09ZS52YWx1ZS52YWx1ZToiZGVzY3JpcHRpb24iaW4gZS52YWx1ZSYmImZ1bmN0aW9uIiE9PWUudmFsdWUudHlwZT90W2UubmFtZV09YDwke2UudmFsdWUuZGVzY3JpcHRpb259PmA6InVuZGVmaW5lZCI9PT1lLnZhbHVlLnR5cGUmJih0W2UubmFtZV09Ijx1bmRlZmluZWQ+IikpfWFzeW5jIGZ1bmN0aW9uIGIoZSx0KXtjb25zdCBuPWF3YWl0IGUucG9zdCgiUnVudGltZS5nZXRQcm9wZXJ0aWVzIix7b2JqZWN0SWQ6dCxvd25Qcm9wZXJ0aWVzOiEwfSksbz17fTtmb3IoY29uc3QgdCBvZiBuLnJlc3VsdClpZih0Py52YWx1ZT8ub2JqZWN0SWQmJiJBcnJheSI9PT10Py52YWx1ZS5jbGFzc05hbWUpe2NvbnN0IG49dC52YWx1ZS5vYmplY3RJZDthd2FpdCBmKGUsbix0Lm5hbWUsbyl9ZWxzZSBpZih0Py52YWx1ZT8ub2JqZWN0SWQmJiJPYmplY3QiPT09dD8udmFsdWU/LmNsYXNzTmFtZSl7Y29uc3Qgbj10LnZhbHVlLm9iamVjdElkO2F3YWl0IGcoZSxuLHQubmFtZSxvKX1lbHNlIHQ/LnZhbHVlJiZkKHQsbyk7cmV0dXJuIG99bGV0IHA7KGFzeW5jIGZ1bmN0aW9uKCl7Y29uc3QgdD1uZXcgZTt0LmNvbm5lY3RUb01haW5UaHJlYWQoKSxsKCJDb25uZWN0ZWQgdG8gbWFpbiB0aHJlYWQiKTtsZXQgbj0hMTt0Lm9uKCJEZWJ1Z2dlci5yZXN1bWVkIiwoKCk9PntuPSExfSkpLHQub24oIkRlYnVnZ2VyLnBhdXNlZCIsKGU9PntuPSEwLGFzeW5jIGZ1bmN0aW9uKGUse3JlYXNvbjp0LGRhdGE6e29iamVjdElkOm59LGNhbGxGcmFtZXM6b30pe2lmKCJleGNlcHRpb24iIT09dCYmInByb21pc2VSZWplY3Rpb24iIT09dClyZXR1cm47aWYocD8uKCksbnVsbD09bilyZXR1cm47Y29uc3QgaT1bXTtmb3IobGV0IHQ9MDt0PG8ubGVuZ3RoO3QrKyl7Y29uc3R7c2NvcGVDaGFpbjpuLGZ1bmN0aW9uTmFtZTphLHRoaXM6c309b1t0XSxjPW4uZmluZCgoZT0+ImxvY2FsIj09PWUudHlwZSkpLHI9Imdsb2JhbCIhPT1zLmNsYXNzTmFtZSYmcy5jbGFzc05hbWU/YCR7cy5jbGFzc05hbWV9LiR7YX1gOmE7aWYodm9pZCAwPT09Yz8ub2JqZWN0Lm9iamVjdElkKWlbdF09e2Z1bmN0aW9uOnJ9O2Vsc2V7Y29uc3Qgbj1hd2FpdCBiKGUsYy5vYmplY3Qub2JqZWN0SWQpO2lbdF09e2Z1bmN0aW9uOnIsdmFyczpufX19YXdhaXQgZS5wb3N0KCJSdW50aW1lLmNhbGxGdW5jdGlvbk9uIix7ZnVuY3Rpb25EZWNsYXJhdGlvbjpgZnVuY3Rpb24oKSB7IHRoaXMuJHtyfSA9IHRoaXMuJHtyfSB8fCAke0pTT04uc3RyaW5naWZ5KGkpfTsgfWAsc2lsZW50OiEwLG9iamVjdElkOm59KSxhd2FpdCBlLnBvc3QoIlJ1bnRpbWUucmVsZWFzZU9iamVjdCIse29iamVjdElkOm59KX0odCxlLnBhcmFtcykudGhlbigoYXN5bmMoKT0+e24mJmF3YWl0IHQucG9zdCgiRGVidWdnZXIucmVzdW1lIil9KSwoYXN5bmMgZT0+e24mJmF3YWl0IHQucG9zdCgiRGVidWdnZXIucmVzdW1lIil9KSl9KSksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5lbmFibGUiKTtjb25zdCBvPSExIT09dS5jYXB0dXJlQWxsRXhjZXB0aW9ucztpZihhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6bz8iYWxsIjoidW5jYXVnaHQifSksbyl7Y29uc3QgZT11Lm1heEV4Y2VwdGlvbnNQZXJTZWNvbmR8fDUwO3A9ZnVuY3Rpb24oZSx0LG4pe2xldCBvPTAsaT01LGE9MDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCgpPT57MD09PWE/bz5lJiYoaSo9MixuKGkpLGk+ODY0MDAmJihpPTg2NDAwKSxhPWkpOihhLT0xLDA9PT1hJiZ0KCkpLG89MH0pLDFlMykudW5yZWYoKSwoKT0+e28rPTF9fShlLChhc3luYygpPT57bCgiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9KSwoYXN5bmMgZT0+e2woYFJhdGUtbGltaXQgZXhjZWVkZWQuIERpc2FibGluZyBjYXB0dXJpbmcgb2YgY2F1Z2h0IGV4Y2VwdGlvbnMgZm9yICR7ZX0gc2Vjb25kcy5gKSxhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6InVuY2F1Z2h0In0pfSkpfX0pKCkuY2F0Y2goKGU9PntsKCJGYWlsZWQgdG8gc3RhcnQgZGVidWdnZXIiLGUpfSkpLHNldEludGVydmFsKCgoKT0+e30pLDFlNCk7'; + +function log(...args) { + core.logger.log('[LocalVariables]', ...args); +} + +/** + * Adds local variables to exception frames + */ +const localVariablesAsyncIntegration = core.defineIntegration((( + integrationOptions = {}, +) => { + function addLocalVariablesToException(exception, localVariables) { + // Filter out frames where the function name is `new Promise` since these are in the error.stack frames + // but do not appear in the debugger call frames + const frames = (_optionalChain([exception, 'access', _ => _.stacktrace, 'optionalAccess', _2 => _2.frames]) || []).filter(frame => frame.function !== 'new Promise'); + + for (let i = 0; i < frames.length; i++) { + // Sentry frames are in reverse order + const frameIndex = frames.length - i - 1; + + const frameLocalVariables = localVariables[i]; + const frame = frames[frameIndex]; + + if (!frame || !frameLocalVariables) { + // Drop out if we run out of frames to match up + break; + } + + if ( + // We need to have vars to add + frameLocalVariables.vars === undefined || + // We're not interested in frames that are not in_app because the vars are not relevant + frame.in_app === false || + // The function names need to match + !common.functionNamesMatch(frame.function, frameLocalVariables.function) + ) { + continue; + } + + frame.vars = frameLocalVariables.vars; + } + } + + function addLocalVariablesToEvent(event, hint) { + if ( + hint.originalException && + typeof hint.originalException === 'object' && + common.LOCAL_VARIABLES_KEY in hint.originalException && + Array.isArray(hint.originalException[common.LOCAL_VARIABLES_KEY]) + ) { + for (const exception of _optionalChain([event, 'access', _3 => _3.exception, 'optionalAccess', _4 => _4.values]) || []) { + addLocalVariablesToException(exception, hint.originalException[common.LOCAL_VARIABLES_KEY]); + } + + hint.originalException[common.LOCAL_VARIABLES_KEY] = undefined; + } + + return event; + } + + async function startInspector() { + // We load inspector dynamically because on some platforms Node is built without inspector support + const inspector = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 85690, 23)); + if (!inspector.url()) { + inspector.open(0); + } + } + + function startWorker(options) { + const worker = new node_worker_threads.Worker(new URL(`data:application/javascript;base64,${base64WorkerScript}`), { + workerData: options, + // We don't want any Node args to be passed to the worker + execArgv: [], + env: { ...process.env, NODE_OPTIONS: undefined }, + }); + + process.on('exit', () => { + // eslint-disable-next-line @typescript-eslint/no-floating-promises + worker.terminate(); + }); + + worker.once('error', (err) => { + log('Worker error', err); + }); + + worker.once('exit', (code) => { + log('Worker exit', code); + }); + + // Ensure this thread can't block app exit + worker.unref(); + } + + return { + name: 'LocalVariablesAsync', + async setup(client) { + const clientOptions = client.getOptions(); + + if (!clientOptions.includeLocalVariables) { + return; + } + + if (await debug.isDebuggerEnabled()) { + core.logger.warn('Local variables capture has been disabled because the debugger was already enabled'); + return; + } + + const options = { + ...integrationOptions, + debug: core.logger.isEnabled(), + }; + + startInspector().then( + () => { + try { + startWorker(options); + } catch (e) { + core.logger.error('Failed to start worker', e); + } + }, + e => { + core.logger.error('Failed to start inspector', e); + }, + ); + }, + processEvent(event, hint) { + return addLocalVariablesToEvent(event, hint); + }, + }; +}) ); + +exports.base64WorkerScript = base64WorkerScript; +exports.localVariablesAsyncIntegration = localVariablesAsyncIntegration; +//# sourceMappingURL=local-variables-async.js.map + + +/***/ }), + +/***/ 58079: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const core = __nccwpck_require__(84466); +const nodeVersion = __nccwpck_require__(88196); +const debug = __nccwpck_require__(75915); +const common = __nccwpck_require__(58108); + +/** Creates a unique hash from stack frames */ +function hashFrames(frames) { + if (frames === undefined) { + return; + } + + // Only hash the 10 most recent frames (ie. the last 10) + return frames.slice(-10).reduce((acc, frame) => `${acc},${frame.function},${frame.lineno},${frame.colno}`, ''); +} + +/** + * We use the stack parser to create a unique hash from the exception stack trace + * This is used to lookup vars when the exception passes through the event processor + */ +function hashFromStack(stackParser, stack) { + if (stack === undefined) { + return undefined; + } + + return hashFrames(stackParser(stack, 1)); +} + +/** Creates a container for callbacks to be called sequentially */ +function createCallbackList(complete) { + // A collection of callbacks to be executed last to first + let callbacks = []; + + let completedCalled = false; + function checkedComplete(result) { + callbacks = []; + if (completedCalled) { + return; + } + completedCalled = true; + complete(result); + } + + // complete should be called last + callbacks.push(checkedComplete); + + function add(fn) { + callbacks.push(fn); + } + + function next(result) { + const popped = callbacks.pop() || checkedComplete; + + try { + popped(result); + } catch (_) { + // If there is an error, we still want to call the complete callback + checkedComplete(result); + } + } + + return { add, next }; +} + +/** + * Promise API is available as `Experimental` and in Node 19 only. + * + * Callback-based API is `Stable` since v14 and `Experimental` since v8. + * Because of that, we are creating our own `AsyncSession` class. + * + * https://nodejs.org/docs/latest-v19.x/api/inspector.html#promises-api + * https://nodejs.org/docs/latest-v14.x/api/inspector.html + */ +class AsyncSession { + /** Throws if inspector API is not available */ + constructor( _session) {this._session = _session; + // + } + + static async create(orDefault) { + if (orDefault) { + return orDefault; + } + + const inspector = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 85690, 23)); + return new AsyncSession(new inspector.Session()); + } + + /** @inheritdoc */ + configureAndConnect(onPause, captureAll) { + this._session.connect(); + + this._session.on('Debugger.paused', event => { + onPause(event, () => { + // After the pause work is complete, resume execution or the exception context memory is leaked + this._session.post('Debugger.resume'); + }); + }); + + this._session.post('Debugger.enable'); + this._session.post('Debugger.setPauseOnExceptions', { state: captureAll ? 'all' : 'uncaught' }); + } + + setPauseOnExceptions(captureAll) { + this._session.post('Debugger.setPauseOnExceptions', { state: captureAll ? 'all' : 'uncaught' }); + } + + /** @inheritdoc */ + getLocalVariables(objectId, complete) { + this._getProperties(objectId, props => { + const { add, next } = createCallbackList(complete); + + for (const prop of props) { + if (_optionalChain([prop, 'optionalAccess', _2 => _2.value, 'optionalAccess', _3 => _3.objectId]) && _optionalChain([prop, 'optionalAccess', _4 => _4.value, 'access', _5 => _5.className]) === 'Array') { + const id = prop.value.objectId; + add(vars => this._unrollArray(id, prop.name, vars, next)); + } else if (_optionalChain([prop, 'optionalAccess', _6 => _6.value, 'optionalAccess', _7 => _7.objectId]) && _optionalChain([prop, 'optionalAccess', _8 => _8.value, 'optionalAccess', _9 => _9.className]) === 'Object') { + const id = prop.value.objectId; + add(vars => this._unrollObject(id, prop.name, vars, next)); + } else if (_optionalChain([prop, 'optionalAccess', _10 => _10.value])) { + add(vars => this._unrollOther(prop, vars, next)); + } + } + + next({}); + }); + } + + /** + * Gets all the PropertyDescriptors of an object + */ + _getProperties(objectId, next) { + this._session.post( + 'Runtime.getProperties', + { + objectId, + ownProperties: true, + }, + (err, params) => { + if (err) { + next([]); + } else { + next(params.result); + } + }, + ); + } + + /** + * Unrolls an array property + */ + _unrollArray(objectId, name, vars, next) { + this._getProperties(objectId, props => { + vars[name] = props + .filter(v => v.name !== 'length' && !isNaN(parseInt(v.name, 10))) + .sort((a, b) => parseInt(a.name, 10) - parseInt(b.name, 10)) + .map(v => _optionalChain([v, 'optionalAccess', _11 => _11.value, 'optionalAccess', _12 => _12.value])); + + next(vars); + }); + } + + /** + * Unrolls an object property + */ + _unrollObject(objectId, name, vars, next) { + this._getProperties(objectId, props => { + vars[name] = props + .map(v => [v.name, _optionalChain([v, 'optionalAccess', _13 => _13.value, 'optionalAccess', _14 => _14.value])]) + .reduce((obj, [key, val]) => { + obj[key] = val; + return obj; + }, {} ); + + next(vars); + }); + } + + /** + * Unrolls other properties + */ + _unrollOther(prop, vars, next) { + if (prop.value) { + if ('value' in prop.value) { + if (prop.value.value === undefined || prop.value.value === null) { + vars[prop.name] = `<${prop.value.value}>`; + } else { + vars[prop.name] = prop.value.value; + } + } else if ('description' in prop.value && prop.value.type !== 'function') { + vars[prop.name] = `<${prop.value.description}>`; + } else if (prop.value.type === 'undefined') { + vars[prop.name] = ''; + } + } + + next(vars); + } +} + +const INTEGRATION_NAME = 'LocalVariables'; + +/** + * Adds local variables to exception frames + */ +const _localVariablesSyncIntegration = (( + options = {}, + sessionOverride, +) => { + const cachedFrames = new core.LRUMap(20); + let rateLimiter; + let shouldProcessEvent = false; + + function addLocalVariablesToException(exception) { + const hash = hashFrames(_optionalChain([exception, 'optionalAccess', _15 => _15.stacktrace, 'optionalAccess', _16 => _16.frames])); + + if (hash === undefined) { + return; + } + + // Check if we have local variables for an exception that matches the hash + // remove is identical to get but also removes the entry from the cache + const cachedFrame = cachedFrames.remove(hash); + + if (cachedFrame === undefined) { + return; + } + + // Filter out frames where the function name is `new Promise` since these are in the error.stack frames + // but do not appear in the debugger call frames + const frames = (_optionalChain([exception, 'access', _17 => _17.stacktrace, 'optionalAccess', _18 => _18.frames]) || []).filter(frame => frame.function !== 'new Promise'); + + for (let i = 0; i < frames.length; i++) { + // Sentry frames are in reverse order + const frameIndex = frames.length - i - 1; + + const cachedFrameVariable = cachedFrame[i]; + const frameVariable = frames[frameIndex]; + + // Drop out if we run out of frames to match up + if (!frameVariable || !cachedFrameVariable) { + break; + } + + if ( + // We need to have vars to add + cachedFrameVariable.vars === undefined || + // We're not interested in frames that are not in_app because the vars are not relevant + frameVariable.in_app === false || + // The function names need to match + !common.functionNamesMatch(frameVariable.function, cachedFrameVariable.function) + ) { + continue; + } + + frameVariable.vars = cachedFrameVariable.vars; + } + } + + function addLocalVariablesToEvent(event) { + for (const exception of _optionalChain([event, 'optionalAccess', _19 => _19.exception, 'optionalAccess', _20 => _20.values]) || []) { + addLocalVariablesToException(exception); + } + + return event; + } + + return { + name: INTEGRATION_NAME, + async setupOnce() { + const client = core.getClient(); + const clientOptions = _optionalChain([client, 'optionalAccess', _21 => _21.getOptions, 'call', _22 => _22()]); + + if (!_optionalChain([clientOptions, 'optionalAccess', _23 => _23.includeLocalVariables])) { + return; + } + + // Only setup this integration if the Node version is >= v18 + // https://github.com/getsentry/sentry-javascript/issues/7697 + const unsupportedNodeVersion = nodeVersion.NODE_MAJOR < 18; + + if (unsupportedNodeVersion) { + core.logger.log('The `LocalVariables` integration is only supported on Node >= v18.'); + return; + } + + if (await debug.isDebuggerEnabled()) { + core.logger.warn('Local variables capture has been disabled because the debugger was already enabled'); + return; + } + + AsyncSession.create(sessionOverride).then( + session => { + function handlePaused( + stackParser, + { params: { reason, data, callFrames } }, + complete, + ) { + if (reason !== 'exception' && reason !== 'promiseRejection') { + complete(); + return; + } + + _optionalChain([rateLimiter, 'optionalCall', _24 => _24()]); + + // data.description contains the original error.stack + const exceptionHash = hashFromStack(stackParser, _optionalChain([data, 'optionalAccess', _25 => _25.description])); + + if (exceptionHash == undefined) { + complete(); + return; + } + + const { add, next } = createCallbackList(frames => { + cachedFrames.set(exceptionHash, frames); + complete(); + }); + + // Because we're queuing up and making all these calls synchronously, we can potentially overflow the stack + // For this reason we only attempt to get local variables for the first 5 frames + for (let i = 0; i < Math.min(callFrames.length, 5); i++) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const { scopeChain, functionName, this: obj } = callFrames[i]; + + const localScope = scopeChain.find(scope => scope.type === 'local'); + + // obj.className is undefined in ESM modules + const fn = + obj.className === 'global' || !obj.className ? functionName : `${obj.className}.${functionName}`; + + if (_optionalChain([localScope, 'optionalAccess', _26 => _26.object, 'access', _27 => _27.objectId]) === undefined) { + add(frames => { + frames[i] = { function: fn }; + next(frames); + }); + } else { + const id = localScope.object.objectId; + add(frames => + _optionalChain([session, 'optionalAccess', _28 => _28.getLocalVariables, 'call', _29 => _29(id, vars => { + frames[i] = { function: fn, vars }; + next(frames); + })]), + ); + } + } + + next([]); + } + + const captureAll = options.captureAllExceptions !== false; + + session.configureAndConnect( + (ev, complete) => + handlePaused(clientOptions.stackParser, ev , complete), + captureAll, + ); + + if (captureAll) { + const max = options.maxExceptionsPerSecond || 50; + + rateLimiter = common.createRateLimiter( + max, + () => { + core.logger.log('Local variables rate-limit lifted.'); + _optionalChain([session, 'optionalAccess', _30 => _30.setPauseOnExceptions, 'call', _31 => _31(true)]); + }, + seconds => { + core.logger.log( + `Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${seconds} seconds.`, + ); + _optionalChain([session, 'optionalAccess', _32 => _32.setPauseOnExceptions, 'call', _33 => _33(false)]); + }, + ); + } + + shouldProcessEvent = true; + }, + error => { + core.logger.log('The `LocalVariables` integration failed to start.', error); + }, + ); + }, + processEvent(event) { + if (shouldProcessEvent) { + return addLocalVariablesToEvent(event); + } + + return event; + }, + // These are entirely for testing + _getCachedFramesCount() { + return cachedFrames.size; + }, + _getFirstCachedFrame() { + return cachedFrames.values()[0]; + }, + }; +}) ; + +/** + * Adds local variables to exception frames. + */ +const localVariablesSyncIntegration = core.defineIntegration(_localVariablesSyncIntegration); + +exports.createCallbackList = createCallbackList; +exports.hashFrames = hashFrames; +exports.hashFromStack = hashFromStack; +exports.localVariablesSyncIntegration = localVariablesSyncIntegration; +//# sourceMappingURL=local-variables-sync.js.map + + +/***/ }), + +/***/ 43791: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const node_fs = __nccwpck_require__(87561); +const node_path = __nccwpck_require__(49411); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(8421); +const commonjs = __nccwpck_require__(38743); + +let moduleCache; + +const INTEGRATION_NAME = 'Modules'; + +const _modulesIntegration = (() => { + // This integration only works in CJS contexts + if (!commonjs.isCjs()) { + debugBuild.DEBUG_BUILD && + core.logger.warn( + 'modulesIntegration only works in CommonJS (CJS) environments. Remove this integration if you are using ESM.', + ); + return { + name: INTEGRATION_NAME, + }; + } + + return { + name: INTEGRATION_NAME, + processEvent(event) { + event.modules = { + ...event.modules, + ..._getModules(), + }; + + return event; + }, + }; +}) ; + +/** + * Add node modules / packages to the event. + * + * Only works in CommonJS (CJS) environments. + */ +const modulesIntegration = core.defineIntegration(_modulesIntegration); + +/** Extract information about paths */ +function getPaths() { + try { + return require.cache ? Object.keys(require.cache ) : []; + } catch (e) { + return []; + } +} + +/** Extract information about package.json modules */ +function collectModules() + + { + const mainPaths = (require.main && require.main.paths) || []; + const paths = getPaths(); + const infos + + = {}; + const seen + + = {}; + + paths.forEach(path => { + let dir = path; + + /** Traverse directories upward in the search of package.json file */ + const updir = () => { + const orig = dir; + dir = node_path.dirname(orig); + + if (!dir || orig === dir || seen[orig]) { + return undefined; + } + if (mainPaths.indexOf(dir) < 0) { + return updir(); + } + + const pkgfile = node_path.join(orig, 'package.json'); + seen[orig] = true; + + if (!node_fs.existsSync(pkgfile)) { + return updir(); + } + + try { + const info = JSON.parse(node_fs.readFileSync(pkgfile, 'utf8')) + +; + infos[info.name] = info.version; + } catch (_oO) { + // no-empty + } + }; + + updir(); + }); + + return infos; +} + +/** Fetches the list of modules and the versions loaded by the entry file for your node.js app. */ +function _getModules() { + if (!moduleCache) { + moduleCache = collectModules(); + } + return moduleCache; +} + +exports.modulesIntegration = modulesIntegration; +//# sourceMappingURL=modules.js.map + + +/***/ }), + +/***/ 40839: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentation = __nccwpck_require__(65584); +const instrumentationUndici = __nccwpck_require__(8076); +const core = __nccwpck_require__(84466); +const opentelemetry = __nccwpck_require__(78369); + +const _nativeNodeFetchIntegration = ((options = {}) => { + const _breadcrumbs = typeof options.breadcrumbs === 'undefined' ? true : options.breadcrumbs; + const _ignoreOutgoingRequests = options.ignoreOutgoingRequests; + + return { + name: 'NodeFetch', + setupOnce() { + const propagationDecisionMap = new core.LRUMap(100); + + const instrumentation$1 = new instrumentationUndici.UndiciInstrumentation({ + requireParentforSpans: false, + ignoreRequestHook: request => { + const url = getAbsoluteUrl(request.origin, request.path); + const shouldIgnore = _ignoreOutgoingRequests && url && _ignoreOutgoingRequests(url); + + if (shouldIgnore) { + return true; + } + + // If tracing is disabled, we still want to propagate traces + // So we do that manually here, matching what the instrumentation does otherwise + if (!core.hasTracingEnabled()) { + const tracePropagationTargets = _optionalChain([core.getClient, 'call', _2 => _2(), 'optionalAccess', _3 => _3.getOptions, 'call', _4 => _4(), 'access', _5 => _5.tracePropagationTargets]); + const addedHeaders = opentelemetry.shouldPropagateTraceForUrl(url, tracePropagationTargets, propagationDecisionMap) + ? core.getTraceData() + : {}; + + const requestHeaders = request.headers; + if (Array.isArray(requestHeaders)) { + Object.entries(addedHeaders).forEach(headers => requestHeaders.push(...headers)); + } else { + request.headers += Object.entries(addedHeaders) + .map(([k, v]) => `${k}: ${v}\r\n`) + .join(''); + } + + // Prevent starting a span for this request + return true; + } + + return false; + }, + startSpanHook: () => { + return { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.node_fetch', + }; + }, + responseHook: (_, { request, response }) => { + if (_breadcrumbs) { + addRequestBreadcrumb(request, response); + } + }, + }); + + instrumentation.registerInstrumentations({ instrumentations: [instrumentation$1] }); + }, + }; +}) ; + +const nativeNodeFetchIntegration = core.defineIntegration(_nativeNodeFetchIntegration); + +/** Add a breadcrumb for outgoing requests. */ +function addRequestBreadcrumb(request, response) { + const data = getBreadcrumbData(request); + const statusCode = response.statusCode; + const level = core.getBreadcrumbLogLevelFromHttpStatusCode(statusCode); + + core.addBreadcrumb( + { + category: 'http', + data: { + status_code: statusCode, + ...data, + }, + type: 'http', + level, + }, + { + event: 'response', + request, + response, + }, + ); +} + +function getBreadcrumbData(request) { + try { + const url = new URL(request.path, request.origin); + const parsedUrl = core.parseUrl(url.toString()); + + const data = { + url: core.getSanitizedUrlString(parsedUrl), + 'http.method': request.method || 'GET', + }; + + if (parsedUrl.search) { + data['http.query'] = parsedUrl.search; + } + if (parsedUrl.hash) { + data['http.fragment'] = parsedUrl.hash; + } + + return data; + } catch (e) { + return {}; + } +} + +// Matching the behavior of the base instrumentation +function getAbsoluteUrl(origin, path = '/') { + const url = `${origin}`; + + if (url.endsWith('/') && path.startsWith('/')) { + return `${url}${path.slice(1)}`; + } + + if (!url.endsWith('/') && !path.startsWith('/')) { + return `${url}/${path.slice(1)}`; + } + + return `${url}${path}`; +} + +exports.nativeNodeFetchIntegration = nativeNodeFetchIntegration; +//# sourceMappingURL=node-fetch.js.map + + +/***/ }), + +/***/ 79100: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(8421); +const errorhandling = __nccwpck_require__(73380); + +const INTEGRATION_NAME = 'OnUncaughtException'; + +/** + * Add a global exception handler. + */ +const onUncaughtExceptionIntegration = core.defineIntegration((options = {}) => { + const optionsWithDefaults = { + exitEvenIfOtherHandlersAreRegistered: false, + ...options, + }; + + return { + name: INTEGRATION_NAME, + setup(client) { + global.process.on('uncaughtException', makeErrorHandler(client, optionsWithDefaults)); + }, + }; +}); + +/** Exported only for tests */ +function makeErrorHandler(client, options) { + const timeout = 2000; + let caughtFirstError = false; + let caughtSecondError = false; + let calledFatalError = false; + let firstError; + + const clientOptions = client.getOptions(); + + return Object.assign( + (error) => { + let onFatalError = errorhandling.logAndExitProcess; + + if (options.onFatalError) { + onFatalError = options.onFatalError; + } else if (clientOptions.onFatalError) { + onFatalError = clientOptions.onFatalError ; + } + + // Attaching a listener to `uncaughtException` will prevent the node process from exiting. We generally do not + // want to alter this behaviour so we check for other listeners that users may have attached themselves and adjust + // exit behaviour of the SDK accordingly: + // - If other listeners are attached, do not exit. + // - If the only listener attached is ours, exit. + const userProvidedListenersCount = (global.process.listeners('uncaughtException') ).filter( + listener => { + // There are 3 listeners we ignore: + return ( + // as soon as we're using domains this listener is attached by node itself + listener.name !== 'domainUncaughtExceptionClear' && + // the handler we register for tracing + listener.tag !== 'sentry_tracingErrorCallback' && + // the handler we register in this integration + (listener )._errorHandler !== true + ); + }, + ).length; + + const processWouldExit = userProvidedListenersCount === 0; + const shouldApplyFatalHandlingLogic = options.exitEvenIfOtherHandlersAreRegistered || processWouldExit; + + if (!caughtFirstError) { + // this is the first uncaught error and the ultimate reason for shutting down + // we want to do absolutely everything possible to ensure it gets captured + // also we want to make sure we don't go recursion crazy if more errors happen after this one + firstError = error; + caughtFirstError = true; + + if (core.getClient() === client) { + core.captureException(error, { + originalException: error, + captureContext: { + level: 'fatal', + }, + mechanism: { + handled: false, + type: 'onuncaughtexception', + }, + }); + } + + if (!calledFatalError && shouldApplyFatalHandlingLogic) { + calledFatalError = true; + onFatalError(error); + } + } else { + if (shouldApplyFatalHandlingLogic) { + if (calledFatalError) { + // we hit an error *after* calling onFatalError - pretty boned at this point, just shut it down + debugBuild.DEBUG_BUILD && + core.logger.warn( + 'uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown', + ); + errorhandling.logAndExitProcess(error); + } else if (!caughtSecondError) { + // two cases for how we can hit this branch: + // - capturing of first error blew up and we just caught the exception from that + // - quit trying to capture, proceed with shutdown + // - a second independent error happened while waiting for first error to capture + // - want to avoid causing premature shutdown before first error capture finishes + // it's hard to immediately tell case 1 from case 2 without doing some fancy/questionable domain stuff + // so let's instead just delay a bit before we proceed with our action here + // in case 1, we just wait a bit unnecessarily but ultimately do the same thing + // in case 2, the delay hopefully made us wait long enough for the capture to finish + // two potential nonideal outcomes: + // nonideal case 1: capturing fails fast, we sit around for a few seconds unnecessarily before proceeding correctly by calling onFatalError + // nonideal case 2: case 2 happens, 1st error is captured but slowly, timeout completes before capture and we treat second error as the sendErr of (nonexistent) failure from trying to capture first error + // note that after hitting this branch, we might catch more errors where (caughtSecondError && !calledFatalError) + // we ignore them - they don't matter to us, we're just waiting for the second error timeout to finish + caughtSecondError = true; + setTimeout(() => { + if (!calledFatalError) { + // it was probably case 1, let's treat err as the sendErr and call onFatalError + calledFatalError = true; + onFatalError(firstError, error); + } + }, timeout); // capturing could take at least sendTimeout to fail, plus an arbitrary second for how long it takes to collect surrounding source etc + } + } + } + }, + { _errorHandler: true }, + ); +} + +exports.makeErrorHandler = makeErrorHandler; +exports.onUncaughtExceptionIntegration = onUncaughtExceptionIntegration; +//# sourceMappingURL=onuncaughtexception.js.map + + +/***/ }), + +/***/ 70694: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const core = __nccwpck_require__(84466); +const errorhandling = __nccwpck_require__(73380); + +const INTEGRATION_NAME = 'OnUnhandledRejection'; + +const _onUnhandledRejectionIntegration = ((options = {}) => { + const mode = options.mode || 'warn'; + + return { + name: INTEGRATION_NAME, + setup(client) { + global.process.on('unhandledRejection', makeUnhandledPromiseHandler(client, { mode })); + }, + }; +}) ; + +/** + * Add a global promise rejection handler. + */ +const onUnhandledRejectionIntegration = core.defineIntegration(_onUnhandledRejectionIntegration); + +/** + * Send an exception with reason + * @param reason string + * @param promise promise + * + * Exported only for tests. + */ +function makeUnhandledPromiseHandler( + client, + options, +) { + return function sendUnhandledPromise(reason, promise) { + if (core.getClient() !== client) { + return; + } + + core.captureException(reason, { + originalException: promise, + captureContext: { + extra: { unhandledPromiseRejection: true }, + }, + mechanism: { + handled: false, + type: 'onunhandledrejection', + }, + }); + + handleRejection(reason, options); + }; +} + +/** + * Handler for `mode` option + */ +function handleRejection(reason, options) { + // https://github.com/nodejs/node/blob/7cf6f9e964aa00772965391c23acda6d71972a9a/lib/internal/process/promises.js#L234-L240 + const rejectionWarning = + 'This error originated either by ' + + 'throwing inside of an async function without a catch block, ' + + 'or by rejecting a promise which was not handled with .catch().' + + ' The promise rejected with the reason:'; + + /* eslint-disable no-console */ + if (options.mode === 'warn') { + core.consoleSandbox(() => { + console.warn(rejectionWarning); + console.error(reason && typeof reason === 'object' && 'stack' in reason ? reason.stack : reason); + }); + } else if (options.mode === 'strict') { + core.consoleSandbox(() => { + console.warn(rejectionWarning); + }); + errorhandling.logAndExitProcess(reason); + } + /* eslint-enable no-console */ +} + +exports.makeUnhandledPromiseHandler = makeUnhandledPromiseHandler; +exports.onUnhandledRejectionIntegration = onUnhandledRejectionIntegration; +//# sourceMappingURL=onunhandledrejection.js.map + + +/***/ }), + +/***/ 23284: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const http = __nccwpck_require__(88849); +const core = __nccwpck_require__(84466); + +const INTEGRATION_NAME = 'Spotlight'; + +const _spotlightIntegration = ((options = {}) => { + const _options = { + sidecarUrl: options.sidecarUrl || 'http://localhost:8969/stream', + }; + + return { + name: INTEGRATION_NAME, + setup(client) { + if (typeof process === 'object' && process.env && process.env.NODE_ENV !== 'development') { + core.logger.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?"); + } + connectToSpotlight(client, _options); + }, + }; +}) ; + +/** + * Use this integration to send errors and transactions to Spotlight. + * + * Learn more about spotlight at https://spotlightjs.com + * + * Important: This integration only works with Node 18 or newer. + */ +const spotlightIntegration = core.defineIntegration(_spotlightIntegration); + +function connectToSpotlight(client, options) { + const spotlightUrl = parseSidecarUrl(options.sidecarUrl); + if (!spotlightUrl) { + return; + } + + let failedRequests = 0; + + client.on('beforeEnvelope', (envelope) => { + if (failedRequests > 3) { + core.logger.warn('[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests'); + return; + } + + const serializedEnvelope = core.serializeEnvelope(envelope); + + const request = getNativeHttpRequest(); + const req = request( + { + method: 'POST', + path: spotlightUrl.pathname, + hostname: spotlightUrl.hostname, + port: spotlightUrl.port, + headers: { + 'Content-Type': 'application/x-sentry-envelope', + }, + }, + res => { + if (res.statusCode && res.statusCode >= 200 && res.statusCode < 400) { + // Reset failed requests counter on success + failedRequests = 0; + } + res.on('data', () => { + // Drain socket + }); + + res.on('end', () => { + // Drain socket + }); + res.setEncoding('utf8'); + }, + ); + + req.on('error', () => { + failedRequests++; + core.logger.warn('[Spotlight] Failed to send envelope to Spotlight Sidecar'); + }); + req.write(serializedEnvelope); + req.end(); + }); +} + +function parseSidecarUrl(url) { + try { + return new URL(`${url}`); + } catch (e) { + core.logger.warn(`[Spotlight] Invalid sidecar URL: ${url}`); + return undefined; + } +} + +/** + * We want to get an unpatched http request implementation to avoid capturing our own calls. + */ +function getNativeHttpRequest() { + const { request } = http; + if (isWrapped(request)) { + return request.__sentry_original__; + } + + return request; +} + +function isWrapped(impl) { + return '__sentry_original__' in impl; +} + +exports.INTEGRATION_NAME = INTEGRATION_NAME; +exports.getNativeHttpRequest = getNativeHttpRequest; +exports.spotlightIntegration = spotlightIntegration; +//# sourceMappingURL=spotlight.js.map + + +/***/ }), + +/***/ 40782: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationAmqplib = __nccwpck_require__(46524); +const core = __nccwpck_require__(84466); +const instrument = __nccwpck_require__(64074); +const addOriginToSpan = __nccwpck_require__(37980); + +const INTEGRATION_NAME = 'Amqplib'; + +const config = { + consumeEndHook: (span) => { + addOriginToSpan.addOriginToSpan(span, 'auto.amqplib.otel.consumer'); + }, + publishHook: (span) => { + addOriginToSpan.addOriginToSpan(span, 'auto.amqplib.otel.publisher'); + }, +}; + +const instrumentAmqplib = instrument.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationAmqplib.AmqplibInstrumentation(config)); + +const _amqplibIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentAmqplib(); + }, + }; +}) ; + +/** + * Adds Sentry tracing instrumentation for the [amqplib](https://www.npmjs.com/package/amqplib) library. + * + * For more information, see the [`amqplibIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/amqplib/). + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * + * Sentry.init({ + * integrations: [Sentry.amqplibIntegration()], + * }); + * ``` + */ +const amqplibIntegration = core.defineIntegration(_amqplibIntegration); + +exports.amqplibIntegration = amqplibIntegration; +exports.instrumentAmqplib = instrumentAmqplib; +//# sourceMappingURL=amqplib.js.map + + +/***/ }), + +/***/ 56711: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationConnect = __nccwpck_require__(20575); +const core = __nccwpck_require__(84466); +const instrument = __nccwpck_require__(64074); +const ensureIsWrapped = __nccwpck_require__(90556); + +const INTEGRATION_NAME = 'Connect'; + +const instrumentConnect = instrument.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationConnect.ConnectInstrumentation()); + +const _connectIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentConnect(); + }, + }; +}) ; + +/** + * Adds Sentry tracing instrumentation for [Connect](https://github.com/senchalabs/connect/). + * + * If you also want to capture errors, you need to call `setupConnectErrorHandler(app)` after you initialize your connect app. + * + * For more information, see the [connect documentation](https://docs.sentry.io/platforms/javascript/guides/connect/). + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * + * Sentry.init({ + * integrations: [Sentry.connectIntegration()], + * }) + * ``` + */ +const connectIntegration = core.defineIntegration(_connectIntegration); + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function connectErrorMiddleware(err, req, res, next) { + core.captureException(err); + next(err); +} + +/** + * Add a Connect middleware to capture errors to Sentry. + * + * @param app The Connect app to attach the error handler to + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * const connect = require("connect"); + * + * const app = connect(); + * + * Sentry.setupConnectErrorHandler(app); + * + * // Add you connect routes here + * + * app.listen(3000); + * ``` + */ +const setupConnectErrorHandler = (app) => { + app.use(connectErrorMiddleware); + + // Sadly, ConnectInstrumentation has no requestHook, so we need to add the attributes here + // We register this hook in this method, because if we register it in the integration `setup`, + // it would always run even for users that are not even using connect + const client = core.getClient(); + if (client) { + client.on('spanStart', span => { + addConnectSpanAttributes(span); + }); + } + + ensureIsWrapped.ensureIsWrapped(app.use, 'connect'); +}; + +function addConnectSpanAttributes(span) { + const attributes = core.spanToJSON(span).data || {}; + + // this is one of: middleware, request_handler + const type = attributes['connect.type']; + + // If this is already set, or we have no connect span, no need to process again... + if (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) { + return; + } + + span.setAttributes({ + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.connect', + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.connect`, + }); + + // Also update the name, we don't need to "middleware - " prefix + const name = attributes['connect.name']; + if (typeof name === 'string') { + span.updateName(name); + } +} + +exports.connectIntegration = connectIntegration; +exports.instrumentConnect = instrumentConnect; +exports.setupConnectErrorHandler = setupConnectErrorHandler; +//# sourceMappingURL=connect.js.map + + +/***/ }), + +/***/ 83491: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationDataloader = __nccwpck_require__(20698); +const core = __nccwpck_require__(84466); +const instrument = __nccwpck_require__(64074); + +const INTEGRATION_NAME = 'Dataloader'; + +const instrumentDataloader = instrument.generateInstrumentOnce( + INTEGRATION_NAME, + () => + new instrumentationDataloader.DataloaderInstrumentation({ + requireParentSpan: true, + }), +); + +const _dataloaderIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentDataloader(); + }, + + setup(client) { + client.on('spanStart', span => { + const spanJSON = core.spanToJSON(span); + if (_optionalChain([spanJSON, 'access', _ => _.description, 'optionalAccess', _2 => _2.startsWith, 'call', _3 => _3('dataloader')])) { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.dataloader'); + } + + // These are all possible dataloader span descriptions + // Still checking for the future versions + // in case they add support for `clear` and `prime` + if ( + spanJSON.description === 'dataloader.load' || + spanJSON.description === 'dataloader.loadMany' || + spanJSON.description === 'dataloader.batch' + ) { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'cache.get'); + // TODO: We can try adding `key` to the `data` attribute upstream. + // Or alternatively, we can add `requestHook` to the dataloader instrumentation. + } + }); + }, + }; +}) ; + +/** + * Adds Sentry tracing instrumentation for the [dataloader](https://www.npmjs.com/package/dataloader) library. + * + * For more information, see the [`dataloaderIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/dataloader/). + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * + * Sentry.init({ + * integrations: [Sentry.dataloaderIntegration()], + * }); + * ``` + */ +const dataloaderIntegration = core.defineIntegration(_dataloaderIntegration); + +exports.dataloaderIntegration = dataloaderIntegration; +exports.instrumentDataloader = instrumentDataloader; +//# sourceMappingURL=dataloader.js.map + + +/***/ }), + +/***/ 89660: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationExpress = __nccwpck_require__(82267); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(8421); +const instrument = __nccwpck_require__(64074); +const addOriginToSpan = __nccwpck_require__(37980); +const ensureIsWrapped = __nccwpck_require__(90556); + +const INTEGRATION_NAME = 'Express'; + +const instrumentExpress = instrument.generateInstrumentOnce( + INTEGRATION_NAME, + () => + new instrumentationExpress.ExpressInstrumentation({ + requestHook(span) { + addOriginToSpan.addOriginToSpan(span, 'auto.http.otel.express'); + + const attributes = core.spanToJSON(span).data || {}; + // this is one of: middleware, request_handler, router + const type = attributes['express.type']; + + if (type) { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, `${type}.express`); + } + + // Also update the name, we don't need to "middleware - " prefix + const name = attributes['express.name']; + if (typeof name === 'string') { + span.updateName(name); + } + }, + spanNameHook(info, defaultName) { + if (core.getIsolationScope() === core.getDefaultIsolationScope()) { + debugBuild.DEBUG_BUILD && + core.logger.warn('Isolation scope is still default isolation scope - skipping setting transactionName'); + return defaultName; + } + if (info.layerType === 'request_handler') { + // type cast b/c Otel unfortunately types info.request as any :( + const req = info.request ; + const method = req.method ? req.method.toUpperCase() : 'GET'; + core.getIsolationScope().setTransactionName(`${method} ${info.route}`); + } + return defaultName; + }, + }), +); + +const _expressIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentExpress(); + }, + }; +}) ; + +/** + * Adds Sentry tracing instrumentation for [Express](https://expressjs.com/). + * + * If you also want to capture errors, you need to call `setupExpressErrorHandler(app)` after you set up your Express server. + * + * For more information, see the [express documentation](https://docs.sentry.io/platforms/javascript/guides/express/). + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * + * Sentry.init({ + * integrations: [Sentry.expressIntegration()], + * }) + * ``` + */ +const expressIntegration = core.defineIntegration(_expressIntegration); + +/** + * An Express-compatible error handler. + */ +function expressErrorHandler(options) { + return function sentryErrorMiddleware( + error, + request, + res, + next, + ) { + // Ensure we use the express-enhanced request here, instead of the plain HTTP one + // When an error happens, the `expressRequestHandler` middleware does not run, so we set it here too + core.getIsolationScope().setSDKProcessingMetadata({ request }); + + const shouldHandleError = _optionalChain([options, 'optionalAccess', _ => _.shouldHandleError]) || defaultShouldHandleError; + + if (shouldHandleError(error)) { + const client = core.getClient(); + // eslint-disable-next-line deprecation/deprecation + if (client && client.getOptions().autoSessionTracking) { + // Check if the `SessionFlusher` is instantiated on the client to go into this branch that marks the + // `requestSession.status` as `Crashed`, and this check is necessary because the `SessionFlusher` is only + // instantiated when the the`requestHandler` middleware is initialised, which indicates that we should be + // running in SessionAggregates mode + const isSessionAggregatesMode = client['_sessionFlusher'] !== undefined; + if (isSessionAggregatesMode) { + // eslint-disable-next-line deprecation/deprecation + const requestSession = core.getIsolationScope().getRequestSession(); + // If an error bubbles to the `errorHandler`, then this is an unhandled error, and should be reported as a + // Crashed session. The `_requestSession.status` is checked to ensure that this error is happening within + // the bounds of a request, and if so the status is updated + if (requestSession && requestSession.status !== undefined) { + requestSession.status = 'crashed'; + } + } + } + + const eventId = core.captureException(error, { mechanism: { type: 'middleware', handled: false } }); + (res ).sentry = eventId; + next(error); + + return; + } + + next(error); + }; +} + +function expressRequestHandler() { + return function sentryRequestMiddleware( + request, + _res, + next, + ) { + // Ensure we use the express-enhanced request here, instead of the plain HTTP one + core.getIsolationScope().setSDKProcessingMetadata({ request }); + + next(); + }; +} + +/** + * Add an Express error handler to capture errors to Sentry. + * + * The error handler must be before any other middleware and after all controllers. + * + * @param app The Express instances + * @param options {ExpressHandlerOptions} Configuration options for the handler + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * const express = require("express"); + * + * const app = express(); + * + * // Add your routes, etc. + * + * // Add this after all routes, + * // but before any and other error-handling middlewares are defined + * Sentry.setupExpressErrorHandler(app); + * + * app.listen(3000); + * ``` + */ +function setupExpressErrorHandler( + app, + options, +) { + app.use(expressRequestHandler()); + app.use(expressErrorHandler(options)); + ensureIsWrapped.ensureIsWrapped(app.use, 'express'); +} + +function getStatusCodeFromResponse(error) { + const statusCode = error.status || error.statusCode || error.status_code || (error.output && error.output.statusCode); + return statusCode ? parseInt(statusCode , 10) : 500; +} + +/** Returns true if response code is internal server error */ +function defaultShouldHandleError(error) { + const status = getStatusCodeFromResponse(error); + return status >= 500; +} + +exports.expressErrorHandler = expressErrorHandler; +exports.expressIntegration = expressIntegration; +exports.instrumentExpress = instrumentExpress; +exports.setupExpressErrorHandler = setupExpressErrorHandler; +//# sourceMappingURL=express.js.map + + +/***/ }), + +/***/ 3372: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationFastify = __nccwpck_require__(62344); +const core = __nccwpck_require__(84466); +const instrument = __nccwpck_require__(64074); +const ensureIsWrapped = __nccwpck_require__(90556); + +// We inline the types we care about here + +const INTEGRATION_NAME = 'Fastify'; + +const instrumentFastify = instrument.generateInstrumentOnce( + INTEGRATION_NAME, + () => + new instrumentationFastify.FastifyInstrumentation({ + requestHook(span) { + addFastifySpanAttributes(span); + }, + }), +); + +const _fastifyIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentFastify(); + }, + }; +}) ; + +/** + * Adds Sentry tracing instrumentation for [Fastify](https://fastify.dev/). + * + * If you also want to capture errors, you need to call `setupFastifyErrorHandler(app)` after you set up your Fastify server. + * + * For more information, see the [fastify documentation](https://docs.sentry.io/platforms/javascript/guides/fastify/). + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * + * Sentry.init({ + * integrations: [Sentry.fastifyIntegration()], + * }) + * ``` + */ +const fastifyIntegration = core.defineIntegration(_fastifyIntegration); + +/** + * Add an Fastify error handler to capture errors to Sentry. + * + * @param fastify The Fastify instance to which to add the error handler + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * const Fastify = require("fastify"); + * + * const app = Fastify(); + * + * Sentry.setupFastifyErrorHandler(app); + * + * // Add your routes, etc. + * + * app.listen({ port: 3000 }); + * ``` + */ +function setupFastifyErrorHandler(fastify) { + const plugin = Object.assign( + function (fastify, _options, done) { + fastify.addHook('onError', async (_request, _reply, error) => { + core.captureException(error); + }); + + // registering `onRequest` hook here instead of using Otel `onRequest` callback b/c `onRequest` hook + // is ironically called in the fastify `preHandler` hook which is called later in the lifecycle: + // https://fastify.dev/docs/latest/Reference/Lifecycle/ + fastify.addHook('onRequest', async (request, _reply) => { + const reqWithRouteInfo = request ; + + // Taken from Otel Fastify instrumentation: + // https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts#L94-L96 + const routeName = _optionalChain([reqWithRouteInfo, 'access', _ => _.routeOptions, 'optionalAccess', _2 => _2.url]) || reqWithRouteInfo.routerPath; + const method = reqWithRouteInfo.method || 'GET'; + + core.getIsolationScope().setTransactionName(`${method} ${routeName}`); + }); + + done(); + }, + { + [Symbol.for('skip-override')]: true, + [Symbol.for('fastify.display-name')]: 'sentry-fastify-error-handler', + }, + ); + + fastify.register(plugin); + + // Sadly, middleware spans do not go through `requestHook`, so we handle those here + // We register this hook in this method, because if we register it in the integration `setup`, + // it would always run even for users that are not even using fastify + const client = core.getClient(); + if (client) { + client.on('spanStart', span => { + addFastifySpanAttributes(span); + }); + } + + ensureIsWrapped.ensureIsWrapped(fastify.addHook, 'fastify'); +} + +function addFastifySpanAttributes(span) { + const attributes = core.spanToJSON(span).data || {}; + + // this is one of: middleware, request_handler + const type = attributes['fastify.type']; + + // If this is already set, or we have no fastify span, no need to process again... + if (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) { + return; + } + + span.setAttributes({ + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.fastify', + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.fastify`, + }); + + // Also update the name, we don't need to "middleware - " prefix + const name = attributes['fastify.name'] || attributes['plugin.name'] || attributes['hook.name']; + if (typeof name === 'string') { + // Also remove `fastify -> ` prefix + span.updateName(name.replace(/^fastify -> /, '')); + } +} + +exports.fastifyIntegration = fastifyIntegration; +exports.instrumentFastify = instrumentFastify; +exports.setupFastifyErrorHandler = setupFastifyErrorHandler; +//# sourceMappingURL=fastify.js.map + + +/***/ }), + +/***/ 78505: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationGenericPool = __nccwpck_require__(36933); +const core = __nccwpck_require__(84466); +const instrument = __nccwpck_require__(64074); + +const INTEGRATION_NAME = 'GenericPool'; + +const instrumentGenericPool = instrument.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationGenericPool.GenericPoolInstrumentation({})); + +const _genericPoolIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentGenericPool(); + }, + + setup(client) { + client.on('spanStart', span => { + const spanJSON = core.spanToJSON(span); + + const spanDescription = spanJSON.description; + + // typo in emitted span for version <= 0.38.0 of @opentelemetry/instrumentation-generic-pool + const isGenericPoolSpan = + spanDescription === 'generic-pool.aquire' || spanDescription === 'generic-pool.acquire'; + + if (isGenericPoolSpan) { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.generic_pool'); + } + }); + }, + }; +}) ; + +/** + * Adds Sentry tracing instrumentation for the [generic-pool](https://www.npmjs.com/package/generic-pool) library. + * + * For more information, see the [`genericPoolIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/genericpool/). + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * + * Sentry.init({ + * integrations: [Sentry.genericPoolIntegration()], + * }); + * ``` + */ +const genericPoolIntegration = core.defineIntegration(_genericPoolIntegration); + +exports.genericPoolIntegration = genericPoolIntegration; +exports.instrumentGenericPool = instrumentGenericPool; +//# sourceMappingURL=genericPool.js.map + + +/***/ }), + +/***/ 64448: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationGraphql = __nccwpck_require__(96794); +const core = __nccwpck_require__(84466); +const opentelemetry = __nccwpck_require__(78369); +const instrument = __nccwpck_require__(64074); +const addOriginToSpan = __nccwpck_require__(37980); + +const INTEGRATION_NAME = 'Graphql'; + +const instrumentGraphql = instrument.generateInstrumentOnce( + INTEGRATION_NAME, + (_options = {}) => { + const options = getOptionsWithDefaults(_options); + + return new instrumentationGraphql.GraphQLInstrumentation({ + ...options, + responseHook(span) { + addOriginToSpan.addOriginToSpan(span, 'auto.graphql.otel.graphql'); + + const attributes = core.spanToJSON(span).data || {}; + + // If operation.name is not set, we fall back to use operation.type only + const operationType = attributes['graphql.operation.type']; + const operationName = attributes['graphql.operation.name']; + + if (options.useOperationNameForRootSpan && operationType) { + const rootSpan = core.getRootSpan(span); + + // We guard to only do this on http.server spans + + const rootSpanAttributes = core.spanToJSON(rootSpan).data || {}; + + const existingOperations = rootSpanAttributes[opentelemetry.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION] || []; + + const newOperation = operationName ? `${operationType} ${operationName}` : `${operationType}`; + + // We keep track of each operation on the root span + // This can either be a string, or an array of strings (if there are multiple operations) + if (Array.isArray(existingOperations)) { + existingOperations.push(newOperation); + rootSpan.setAttribute(opentelemetry.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION, existingOperations); + } else if (existingOperations) { + rootSpan.setAttribute(opentelemetry.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION, [existingOperations, newOperation]); + } else { + rootSpan.setAttribute(opentelemetry.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION, newOperation); + } + } + }, + }); + }, +); + +const _graphqlIntegration = ((options = {}) => { + return { + name: INTEGRATION_NAME, + setupOnce() { + // We set defaults here, too, because otherwise we'd update the instrumentation config + // to the config without defaults, as `generateInstrumentOnce` automatically calls `setConfig(options)` + // when being called the second time + instrumentGraphql(getOptionsWithDefaults(options)); + }, + }; +}) ; + +/** + * Adds Sentry tracing instrumentation for the [graphql](https://www.npmjs.com/package/graphql) library. + * + * For more information, see the [`graphqlIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/graphql/). + * + * @param {GraphqlOptions} options Configuration options for the GraphQL integration. + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * + * Sentry.init({ + * integrations: [Sentry.graphqlIntegration()], + * }); + */ +const graphqlIntegration = core.defineIntegration(_graphqlIntegration); + +function getOptionsWithDefaults(options) { + return { + ignoreResolveSpans: true, + ignoreTrivialResolveSpans: true, + useOperationNameForRootSpan: true, + ...options, + }; +} + +exports.graphqlIntegration = graphqlIntegration; +exports.instrumentGraphql = instrumentGraphql; +//# sourceMappingURL=graphql.js.map + + +/***/ }), + +/***/ 69741: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationHapi = __nccwpck_require__(25435); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(8421); +const instrument = __nccwpck_require__(64074); +const ensureIsWrapped = __nccwpck_require__(90556); + +const INTEGRATION_NAME = 'Hapi'; + +const instrumentHapi = instrument.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationHapi.HapiInstrumentation()); + +const _hapiIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentHapi(); + }, + }; +}) ; + +/** + * Adds Sentry tracing instrumentation for [Hapi](https://hapi.dev/). + * + * If you also want to capture errors, you need to call `setupHapiErrorHandler(server)` after you set up your server. + * + * For more information, see the [hapi documentation](https://docs.sentry.io/platforms/javascript/guides/hapi/). + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * + * Sentry.init({ + * integrations: [Sentry.hapiIntegration()], + * }) + * ``` + */ +const hapiIntegration = core.defineIntegration(_hapiIntegration); + +function isErrorEvent(event) { + return event && (event ).error !== undefined; +} + +function sendErrorToSentry(errorData) { + core.captureException(errorData, { + mechanism: { + type: 'hapi', + handled: false, + data: { + function: 'hapiErrorPlugin', + }, + }, + }); +} + +const hapiErrorPlugin = { + name: 'SentryHapiErrorPlugin', + version: core.SDK_VERSION, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + register: async function (serverArg) { + const server = serverArg ; + + server.events.on({ name: 'request', channels: ['error'] }, (request, event) => { + if (core.getIsolationScope() !== core.getDefaultIsolationScope()) { + const route = request.route; + if (route && route.path) { + core.getIsolationScope().setTransactionName(`${_optionalChain([route, 'access', _ => _.method, 'optionalAccess', _2 => _2.toUpperCase, 'call', _3 => _3()]) || 'GET'} ${route.path}`); + } + } else { + debugBuild.DEBUG_BUILD && + core.logger.warn('Isolation scope is still the default isolation scope - skipping setting transactionName'); + } + + if (isErrorEvent(event)) { + sendErrorToSentry(event.error); + } + }); + }, +}; + +/** + * Add a Hapi plugin to capture errors to Sentry. + * + * @param server The Hapi server to attach the error handler to + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * const Hapi = require('@hapi/hapi'); + * + * const init = async () => { + * const server = Hapi.server(); + * + * // all your routes here + * + * await Sentry.setupHapiErrorHandler(server); + * + * await server.start(); + * }; + * ``` + */ +async function setupHapiErrorHandler(server) { + await server.register(hapiErrorPlugin); + + // Sadly, middleware spans do not go through `requestHook`, so we handle those here + // We register this hook in this method, because if we register it in the integration `setup`, + // it would always run even for users that are not even using hapi + const client = core.getClient(); + if (client) { + client.on('spanStart', span => { + addHapiSpanAttributes(span); + }); + } + + // eslint-disable-next-line @typescript-eslint/unbound-method + ensureIsWrapped.ensureIsWrapped(server.register, 'hapi'); +} + +function addHapiSpanAttributes(span) { + const attributes = core.spanToJSON(span).data || {}; + + // this is one of: router, plugin, server.ext + const type = attributes['hapi.type']; + + // If this is already set, or we have no Hapi span, no need to process again... + if (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) { + return; + } + + span.setAttributes({ + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.hapi', + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.hapi`, + }); +} + +exports.hapiErrorPlugin = hapiErrorPlugin; +exports.hapiIntegration = hapiIntegration; +exports.instrumentHapi = instrumentHapi; +exports.setupHapiErrorHandler = setupHapiErrorHandler; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 59020: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const index$2 = __nccwpck_require__(50289); +const amqplib = __nccwpck_require__(40782); +const connect = __nccwpck_require__(56711); +const express = __nccwpck_require__(89660); +const fastify = __nccwpck_require__(3372); +const genericPool = __nccwpck_require__(78505); +const graphql = __nccwpck_require__(64448); +const index = __nccwpck_require__(69741); +const kafka = __nccwpck_require__(8430); +const koa = __nccwpck_require__(57910); +const lrumemoizer = __nccwpck_require__(47006); +const mongo = __nccwpck_require__(57036); +const mongoose = __nccwpck_require__(28975); +const mysql = __nccwpck_require__(5432); +const mysql2 = __nccwpck_require__(56910); +const nest = __nccwpck_require__(60876); +const postgres = __nccwpck_require__(96003); +const redis = __nccwpck_require__(87260); +const tedious = __nccwpck_require__(78622); +const index$1 = __nccwpck_require__(65595); + +/** + * With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required. + */ +function getAutoPerformanceIntegrations() { + return [ + express.expressIntegration(), + fastify.fastifyIntegration(), + graphql.graphqlIntegration(), + mongo.mongoIntegration(), + mongoose.mongooseIntegration(), + mysql.mysqlIntegration(), + mysql2.mysql2Integration(), + redis.redisIntegration(), + postgres.postgresIntegration(), + // For now, we do not include prisma by default because it has ESM issues + // See https://github.com/prisma/prisma/issues/23410 + // TODO v8: Figure out a better solution for this, maybe only disable in ESM mode? + // prismaIntegration(), + // eslint-disable-next-line deprecation/deprecation + nest.nestIntegration(), + index.hapiIntegration(), + koa.koaIntegration(), + connect.connectIntegration(), + tedious.tediousIntegration(), + genericPool.genericPoolIntegration(), + kafka.kafkaIntegration(), + amqplib.amqplibIntegration(), + lrumemoizer.lruMemoizerIntegration(), + index$1.vercelAIIntegration(), + ]; +} + +/** + * Get a list of methods to instrument OTEL, when preload instrumentation. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function getOpenTelemetryInstrumentationToPreload() { + return [ + index$2.instrumentOtelHttp, + express.instrumentExpress, + connect.instrumentConnect, + fastify.instrumentFastify, + index.instrumentHapi, + kafka.instrumentKafka, + koa.instrumentKoa, + lrumemoizer.instrumentLruMemoizer, + // eslint-disable-next-line deprecation/deprecation + nest.instrumentNest, + mongo.instrumentMongo, + mongoose.instrumentMongoose, + mysql.instrumentMysql, + mysql2.instrumentMysql2, + postgres.instrumentPostgres, + index.instrumentHapi, + graphql.instrumentGraphql, + redis.instrumentRedis, + tedious.instrumentTedious, + genericPool.instrumentGenericPool, + amqplib.instrumentAmqplib, + index$1.instrumentVercelAi, + ]; +} + +exports.getAutoPerformanceIntegrations = getAutoPerformanceIntegrations; +exports.getOpenTelemetryInstrumentationToPreload = getOpenTelemetryInstrumentationToPreload; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 8430: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationKafkajs = __nccwpck_require__(82331); +const core = __nccwpck_require__(84466); +const instrument = __nccwpck_require__(64074); +const addOriginToSpan = __nccwpck_require__(37980); + +const INTEGRATION_NAME = 'Kafka'; + +const instrumentKafka = instrument.generateInstrumentOnce( + INTEGRATION_NAME, + () => + new instrumentationKafkajs.KafkaJsInstrumentation({ + consumerHook(span) { + addOriginToSpan.addOriginToSpan(span, 'auto.kafkajs.otel.consumer'); + }, + producerHook(span) { + addOriginToSpan.addOriginToSpan(span, 'auto.kafkajs.otel.producer'); + }, + }), +); + +const _kafkaIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentKafka(); + }, + }; +}) ; + +/** + * Adds Sentry tracing instrumentation for the [kafkajs](https://www.npmjs.com/package/kafkajs) library. + * + * For more information, see the [`kafkaIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/kafka/). + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * + * Sentry.init({ + * integrations: [Sentry.kafkaIntegration()], + * }); + */ +const kafkaIntegration = core.defineIntegration(_kafkaIntegration); + +exports.instrumentKafka = instrumentKafka; +exports.kafkaIntegration = kafkaIntegration; +//# sourceMappingURL=kafka.js.map + + +/***/ }), + +/***/ 46350: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationKnex = __nccwpck_require__(12083); +const core = __nccwpck_require__(84466); +const instrument = __nccwpck_require__(64074); + +const INTEGRATION_NAME = 'Knex'; + +const instrumentKnex = instrument.generateInstrumentOnce( + INTEGRATION_NAME, + () => new instrumentationKnex.KnexInstrumentation({ requireParentSpan: true }), +); + +const _knexIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentKnex(); + }, + + setup(client) { + client.on('spanStart', span => { + const { data } = core.spanToJSON(span); + // knex.version is always set in the span data + // https://github.com/open-telemetry/opentelemetry-js-contrib/blob/0309caeafc44ac9cb13a3345b790b01b76d0497d/plugins/node/opentelemetry-instrumentation-knex/src/instrumentation.ts#L138 + if (data && 'knex.version' in data) { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.knex'); + } + }); + }, + }; +}) ; + +/** + * Knex integration + * + * Capture tracing data for [Knex](https://knexjs.org/). + * + * @example + * ```javascript + * import * as Sentry from '@sentry/node'; + * + * Sentry.init({ + * integrations: [Sentry.knexIntegration()], + * }); + * ``` + */ +const knexIntegration = core.defineIntegration(_knexIntegration); + +exports.instrumentKnex = instrumentKnex; +exports.knexIntegration = knexIntegration; +//# sourceMappingURL=knex.js.map + + +/***/ }), + +/***/ 57910: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationKoa = __nccwpck_require__(68168); +const semanticConventions = __nccwpck_require__(67275); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(8421); +const instrument = __nccwpck_require__(64074); +const ensureIsWrapped = __nccwpck_require__(90556); + +const INTEGRATION_NAME = 'Koa'; + +const instrumentKoa = instrument.generateInstrumentOnce( + INTEGRATION_NAME, + () => + new instrumentationKoa.KoaInstrumentation({ + requestHook(span, info) { + addKoaSpanAttributes(span); + + if (core.getIsolationScope() === core.getDefaultIsolationScope()) { + debugBuild.DEBUG_BUILD && core.logger.warn('Isolation scope is default isolation scope - skipping setting transactionName'); + return; + } + const attributes = core.spanToJSON(span).data; + const route = attributes && attributes[semanticConventions.ATTR_HTTP_ROUTE]; + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + const method = _optionalChain([info, 'optionalAccess', _ => _.context, 'optionalAccess', _2 => _2.request, 'optionalAccess', _3 => _3.method, 'optionalAccess', _4 => _4.toUpperCase, 'call', _5 => _5()]) || 'GET'; + if (route) { + core.getIsolationScope().setTransactionName(`${method} ${route}`); + } + }, + }), +); + +const _koaIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentKoa(); + }, + }; +}) ; + +/** + * Adds Sentry tracing instrumentation for [Koa](https://koajs.com/). + * + * If you also want to capture errors, you need to call `setupKoaErrorHandler(app)` after you set up your Koa server. + * + * For more information, see the [koa documentation](https://docs.sentry.io/platforms/javascript/guides/koa/). + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * + * Sentry.init({ + * integrations: [Sentry.koaIntegration()], + * }) + * ``` + */ +const koaIntegration = core.defineIntegration(_koaIntegration); + +/** + * Add an Koa error handler to capture errors to Sentry. + * + * The error handler must be before any other middleware and after all controllers. + * + * @param app The Express instances + * @param options {ExpressHandlerOptions} Configuration options for the handler + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * const Koa = require("koa"); + * + * const app = new Koa(); + * + * Sentry.setupKoaErrorHandler(app); + * + * // Add your routes, etc. + * + * app.listen(3000); + * ``` + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const setupKoaErrorHandler = (app) => { + app.use(async (ctx, next) => { + try { + await next(); + } catch (error) { + core.captureException(error); + throw error; + } + }); + + ensureIsWrapped.ensureIsWrapped(app.use, 'koa'); +}; + +function addKoaSpanAttributes(span) { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.http.otel.koa'); + + const attributes = core.spanToJSON(span).data || {}; + + // this is one of: middleware, router + const type = attributes['koa.type']; + + if (type) { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, `${type}.koa`); + } + + // Also update the name + const name = attributes['koa.name']; + if (typeof name === 'string') { + // Somehow, name is sometimes `''` for middleware spans + // See: https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2220 + span.updateName(name || '< unknown >'); + } +} + +exports.instrumentKoa = instrumentKoa; +exports.koaIntegration = koaIntegration; +exports.setupKoaErrorHandler = setupKoaErrorHandler; +//# sourceMappingURL=koa.js.map + + +/***/ }), + +/***/ 47006: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationLruMemoizer = __nccwpck_require__(7362); +const core = __nccwpck_require__(84466); +const instrument = __nccwpck_require__(64074); + +const INTEGRATION_NAME = 'LruMemoizer'; + +const instrumentLruMemoizer = instrument.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationLruMemoizer.LruMemoizerInstrumentation()); + +const _lruMemoizerIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentLruMemoizer(); + }, + }; +}) ; + +/** + * Adds Sentry tracing instrumentation for the [lru-memoizer](https://www.npmjs.com/package/lru-memoizer) library. + * + * For more information, see the [`lruMemoizerIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/lrumemoizer/). + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * + * Sentry.init({ + * integrations: [Sentry.lruMemoizerIntegration()], + * }); + */ +const lruMemoizerIntegration = core.defineIntegration(_lruMemoizerIntegration); + +exports.instrumentLruMemoizer = instrumentLruMemoizer; +exports.lruMemoizerIntegration = lruMemoizerIntegration; +//# sourceMappingURL=lrumemoizer.js.map + + +/***/ }), + +/***/ 57036: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationMongodb = __nccwpck_require__(25625); +const core = __nccwpck_require__(84466); +const instrument = __nccwpck_require__(64074); +const addOriginToSpan = __nccwpck_require__(37980); + +const INTEGRATION_NAME = 'Mongo'; + +const instrumentMongo = instrument.generateInstrumentOnce( + INTEGRATION_NAME, + () => + new instrumentationMongodb.MongoDBInstrumentation({ + dbStatementSerializer: _defaultDbStatementSerializer, + responseHook(span) { + addOriginToSpan.addOriginToSpan(span, 'auto.db.otel.mongo'); + }, + }), +); + +/** + * Replaces values in document with '?', hiding PII and helping grouping. + */ +function _defaultDbStatementSerializer(commandObj) { + const resultObj = _scrubStatement(commandObj); + return JSON.stringify(resultObj); +} + +function _scrubStatement(value) { + if (Array.isArray(value)) { + return value.map(element => _scrubStatement(element)); + } + + if (isCommandObj(value)) { + const initial = {}; + return Object.entries(value) + .map(([key, element]) => [key, _scrubStatement(element)]) + .reduce((prev, current) => { + if (isCommandEntry(current)) { + prev[current[0]] = current[1]; + } + return prev; + }, initial); + } + + // A value like string or number, possible contains PII, scrub it + return '?'; +} + +function isCommandObj(value) { + return typeof value === 'object' && value !== null && !isBuffer(value); +} + +function isBuffer(value) { + let isBuffer = false; + if (typeof Buffer !== 'undefined') { + isBuffer = Buffer.isBuffer(value); + } + return isBuffer; +} + +function isCommandEntry(value) { + return Array.isArray(value); +} + +const _mongoIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentMongo(); + }, + }; +}) ; + +/** + * Adds Sentry tracing instrumentation for the [mongodb](https://www.npmjs.com/package/mongodb) library. + * + * For more information, see the [`mongoIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mongo/). + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * + * Sentry.init({ + * integrations: [Sentry.mongoIntegration()], + * }); + * ``` + */ +const mongoIntegration = core.defineIntegration(_mongoIntegration); + +exports._defaultDbStatementSerializer = _defaultDbStatementSerializer; +exports.instrumentMongo = instrumentMongo; +exports.mongoIntegration = mongoIntegration; +//# sourceMappingURL=mongo.js.map + + +/***/ }), + +/***/ 28975: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationMongoose = __nccwpck_require__(17168); +const core = __nccwpck_require__(84466); +const instrument = __nccwpck_require__(64074); +const addOriginToSpan = __nccwpck_require__(37980); + +const INTEGRATION_NAME = 'Mongoose'; + +const instrumentMongoose = instrument.generateInstrumentOnce( + INTEGRATION_NAME, + () => + new instrumentationMongoose.MongooseInstrumentation({ + responseHook(span) { + addOriginToSpan.addOriginToSpan(span, 'auto.db.otel.mongoose'); + }, + }), +); + +const _mongooseIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentMongoose(); + }, + }; +}) ; + +/** + * Adds Sentry tracing instrumentation for the [mongoose](https://www.npmjs.com/package/mongoose) library. + * + * For more information, see the [`mongooseIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mongoose/). + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * + * Sentry.init({ + * integrations: [Sentry.mongooseIntegration()], + * }); + * ``` + */ +const mongooseIntegration = core.defineIntegration(_mongooseIntegration); + +exports.instrumentMongoose = instrumentMongoose; +exports.mongooseIntegration = mongooseIntegration; +//# sourceMappingURL=mongoose.js.map + + +/***/ }), + +/***/ 5432: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationMysql = __nccwpck_require__(80144); +const core = __nccwpck_require__(84466); +const instrument = __nccwpck_require__(64074); + +const INTEGRATION_NAME = 'Mysql'; + +const instrumentMysql = instrument.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationMysql.MySQLInstrumentation({})); + +const _mysqlIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentMysql(); + }, + }; +}) ; + +/** + * Adds Sentry tracing instrumentation for the [mysql](https://www.npmjs.com/package/mysql) library. + * + * For more information, see the [`mysqlIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mysql/). + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * + * Sentry.init({ + * integrations: [Sentry.mysqlIntegration()], + * }); + * ``` + */ +const mysqlIntegration = core.defineIntegration(_mysqlIntegration); + +exports.instrumentMysql = instrumentMysql; +exports.mysqlIntegration = mysqlIntegration; +//# sourceMappingURL=mysql.js.map + + +/***/ }), + +/***/ 56910: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationMysql2 = __nccwpck_require__(79651); +const core = __nccwpck_require__(84466); +const instrument = __nccwpck_require__(64074); +const addOriginToSpan = __nccwpck_require__(37980); + +const INTEGRATION_NAME = 'Mysql2'; + +const instrumentMysql2 = instrument.generateInstrumentOnce( + INTEGRATION_NAME, + () => + new instrumentationMysql2.MySQL2Instrumentation({ + responseHook(span) { + addOriginToSpan.addOriginToSpan(span, 'auto.db.otel.mysql2'); + }, + }), +); + +const _mysql2Integration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentMysql2(); + }, + }; +}) ; + +/** + * Adds Sentry tracing instrumentation for the [mysql2](https://www.npmjs.com/package/mysql2) library. + * + * For more information, see the [`mysql2Integration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mysql2/). + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * + * Sentry.init({ + * integrations: [Sentry.mysqlIntegration()], + * }); + * ``` + */ +const mysql2Integration = core.defineIntegration(_mysql2Integration); + +exports.instrumentMysql2 = instrumentMysql2; +exports.mysql2Integration = mysql2Integration; +//# sourceMappingURL=mysql2.js.map + + +/***/ }), + +/***/ 34445: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _nullishCoalesce +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const core = __nccwpck_require__(84466); + +const sentryPatched = 'sentryPatched'; + +/** + * Helper checking if a concrete target class is already patched. + * + * We already guard duplicate patching with isWrapped. However, isWrapped checks whether a file has been patched, whereas we use this check for concrete target classes. + * This check might not be necessary, but better to play it safe. + */ +function isPatched(target) { + if (target.sentryPatched) { + return true; + } + + core.addNonEnumerableProperty(target, sentryPatched, true); + return false; +} + +/** + * Returns span options for nest middleware spans. + */ +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type +function getMiddlewareSpanOptions(target, name = undefined) { + const span_name = _nullishCoalesce(name, () => ( target.name)); // fallback to class name if no name is provided + + return { + name: span_name, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'middleware.nestjs', + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.middleware.nestjs', + }, + }; +} + +/** + * Returns span options for nest event spans. + */ +function getEventSpanOptions(event) + + { + return { + name: `event ${event}`, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'event.nestjs', + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.event.nestjs', + }, + forceTransaction: true, + }; +} + +/** + * Adds instrumentation to a js observable and attaches the span to an active parent span. + */ +function instrumentObservable(observable, activeSpan) { + if (activeSpan) { + // eslint-disable-next-line @typescript-eslint/unbound-method + observable.subscribe = new Proxy(observable.subscribe, { + apply: (originalSubscribe, thisArgSubscribe, argsSubscribe) => { + return core.withActiveSpan(activeSpan, () => { + const subscription = originalSubscribe.apply(thisArgSubscribe, argsSubscribe); + subscription.add(() => activeSpan.end()); + return subscription; + }); + }, + }); + } +} + +/** + * Proxies the next() call in a nestjs middleware to end the span when it is called. + */ +function getNextProxy(next, span, prevSpan) { + return new Proxy(next, { + apply: (originalNext, thisArgNext, argsNext) => { + span.end(); + + if (prevSpan) { + return core.withActiveSpan(prevSpan, () => { + return Reflect.apply(originalNext, thisArgNext, argsNext); + }); + } else { + return Reflect.apply(originalNext, thisArgNext, argsNext); + } + }, + }); +} + +exports.getEventSpanOptions = getEventSpanOptions; +exports.getMiddlewareSpanOptions = getMiddlewareSpanOptions; +exports.getNextProxy = getNextProxy; +exports.instrumentObservable = instrumentObservable; +exports.isPatched = isPatched; +//# sourceMappingURL=helpers.js.map + + +/***/ }), + +/***/ 60876: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationNestjsCore = __nccwpck_require__(81551); +const core = __nccwpck_require__(84466); +const instrument = __nccwpck_require__(64074); +const sentryNestEventInstrumentation = __nccwpck_require__(41018); +const sentryNestInstrumentation = __nccwpck_require__(57786); + +const INTEGRATION_NAME = 'Nest'; + +const instrumentNestCore = instrument.generateInstrumentOnce('Nest-Core', () => { + return new instrumentationNestjsCore.NestInstrumentation(); +}); + +const instrumentNestCommon = instrument.generateInstrumentOnce('Nest-Common', () => { + return new sentryNestInstrumentation.SentryNestInstrumentation(); +}); + +const instrumentNestEvent = instrument.generateInstrumentOnce('Nest-Event', () => { + return new sentryNestEventInstrumentation.SentryNestEventInstrumentation(); +}); + +const instrumentNest = Object.assign( + () => { + instrumentNestCore(); + instrumentNestCommon(); + instrumentNestEvent(); + }, + { id: INTEGRATION_NAME }, +); + +/** + * Integration capturing tracing data for NestJS. + * + * @deprecated The `nestIntegration` is deprecated. Instead, use the NestJS SDK directly (`@sentry/nestjs`), or use the `nestIntegration` export from `@sentry/nestjs`. + */ +const nestIntegration = core.defineIntegration(() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentNest(); + }, + }; +}); + +/** + * Setup an error handler for Nest. + * + * @deprecated `setupNestErrorHandler` is deprecated. + * Instead use the `@sentry/nestjs` package, which has more functional APIs for capturing errors. + * See the [`@sentry/nestjs` Setup Guide](https://docs.sentry.io/platforms/javascript/guides/nestjs/) for how to set up the Sentry NestJS SDK. + */ +function setupNestErrorHandler(app, baseFilter) { + core.consoleSandbox(() => { + // eslint-disable-next-line no-console + console.warn( + '[Sentry] Warning: You used the `setupNestErrorHandler()` method to set up Sentry error monitoring. This function is deprecated and will be removed in the next major version. Instead, it is recommended to use the `@sentry/nestjs` package. To set up the NestJS SDK see: https://docs.sentry.io/platforms/javascript/guides/nestjs/', + ); + }); + + // Sadly, NestInstrumentation has no requestHook, so we need to add the attributes here + // We register this hook in this method, because if we register it in the integration `setup`, + // it would always run even for users that are not even using Nest.js + const client = core.getClient(); + if (client) { + client.on('spanStart', span => { + addNestSpanAttributes(span); + }); + } + + app.useGlobalInterceptors({ + intercept(context, next) { + if (core.getIsolationScope() === core.getDefaultIsolationScope()) { + core.logger.warn('Isolation scope is still the default isolation scope, skipping setting transactionName.'); + return next.handle(); + } + + if (context.getType() === 'http') { + // getRequest() returns either a FastifyRequest or ExpressRequest, depending on the used adapter + const req = context.switchToHttp().getRequest(); + if ('routeOptions' in req && req.routeOptions && req.routeOptions.url) { + // fastify case + core.getIsolationScope().setTransactionName(`${_optionalChain([req, 'access', _ => _.method, 'optionalAccess', _2 => _2.toUpperCase, 'call', _3 => _3()]) || 'GET'} ${req.routeOptions.url}`); + } else if ('route' in req && req.route && req.route.path) { + // express case + core.getIsolationScope().setTransactionName(`${_optionalChain([req, 'access', _4 => _4.method, 'optionalAccess', _5 => _5.toUpperCase, 'call', _6 => _6()]) || 'GET'} ${req.route.path}`); + } + } + + return next.handle(); + }, + }); + + const wrappedFilter = new Proxy(baseFilter, { + get(target, prop, receiver) { + if (prop === 'catch') { + const originalCatch = Reflect.get(target, prop, receiver); + + return (exception, host) => { + const exceptionIsObject = typeof exception === 'object' && exception !== null; + const exceptionStatusCode = exceptionIsObject && 'status' in exception ? exception.status : null; + const exceptionErrorProperty = exceptionIsObject && 'error' in exception ? exception.error : null; + + /* + Don't report expected NestJS control flow errors + - `HttpException` errors will have a `status` property + - `RpcException` errors will have an `error` property + */ + if (exceptionStatusCode !== null || exceptionErrorProperty !== null) { + return originalCatch.apply(target, [exception, host]); + } + + core.captureException(exception); + return originalCatch.apply(target, [exception, host]); + }; + } + return Reflect.get(target, prop, receiver); + }, + }); + + app.useGlobalFilters(wrappedFilter); +} + +function addNestSpanAttributes(span) { + const attributes = core.spanToJSON(span).data || {}; + + // this is one of: app_creation, request_context, handler + const type = attributes['nestjs.type']; + + // If this is already set, or we have no nest.js span, no need to process again... + if (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) { + return; + } + + span.setAttributes({ + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.nestjs', + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.nestjs`, + }); +} + +exports.instrumentNest = instrumentNest; +exports.nestIntegration = nestIntegration; +exports.setupNestErrorHandler = setupNestErrorHandler; +//# sourceMappingURL=nest.js.map + + +/***/ }), + +/***/ 41018: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const core$1 = __nccwpck_require__(46033); +const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); +const helpers = __nccwpck_require__(34445); + +const supportedVersions = ['>=2.0.0']; + +/** + * Custom instrumentation for nestjs event-emitter + * + * This hooks into the `OnEvent` decorator, which is applied on event handlers. + */ +class SentryNestEventInstrumentation extends instrumentation.InstrumentationBase { + static __initStatic() {this.COMPONENT = '@nestjs/event-emitter';} + static __initStatic2() {this.COMMON_ATTRIBUTES = { + component: SentryNestEventInstrumentation.COMPONENT, + };} + + constructor(config = {}) { + super('sentry-nestjs-event', core.SDK_VERSION, config); + } + + /** + * Initializes the instrumentation by defining the modules to be patched. + */ + init() { + const moduleDef = new instrumentation.InstrumentationNodeModuleDefinition( + SentryNestEventInstrumentation.COMPONENT, + supportedVersions, + ); + + moduleDef.files.push(this._getOnEventFileInstrumentation(supportedVersions)); + return moduleDef; + } + + /** + * Wraps the @OnEvent decorator. + */ + _getOnEventFileInstrumentation(versions) { + return new instrumentation.InstrumentationNodeModuleFile( + '@nestjs/event-emitter/dist/decorators/on-event.decorator.js', + versions, + (moduleExports) => { + if (core$1.isWrapped(moduleExports.OnEvent)) { + this._unwrap(moduleExports, 'OnEvent'); + } + this._wrap(moduleExports, 'OnEvent', this._createWrapOnEvent()); + return moduleExports; + }, + (moduleExports) => { + this._unwrap(moduleExports, 'OnEvent'); + }, + ); + } + + /** + * Creates a wrapper function for the @OnEvent decorator. + */ + _createWrapOnEvent() { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return function wrapOnEvent(original) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return function wrappedOnEvent(event, options) { + const eventName = Array.isArray(event) + ? event.join(',') + : typeof event === 'string' || typeof event === 'symbol' + ? event.toString() + : ''; + + // Get the original decorator result + const decoratorResult = original(event, options); + + // Return a new decorator function that wraps the handler + return function (target, propertyKey, descriptor) { + if (!descriptor.value || typeof descriptor.value !== 'function' || target.__SENTRY_INTERNAL__) { + return decoratorResult(target, propertyKey, descriptor); + } + + // Get the original handler + const originalHandler = descriptor.value; + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + const handlerName = originalHandler.name || propertyKey; + + // Instrument the handler + // eslint-disable-next-line @typescript-eslint/no-explicit-any + descriptor.value = async function (...args) { + return core.startSpan(helpers.getEventSpanOptions(eventName), async () => { + try { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + const result = await originalHandler.apply(this, args); + return result; + } catch (error) { + // exceptions from event handlers are not caught by global error filter + core.captureException(error); + throw error; + } + }); + }; + + // Preserve the original function name + Object.defineProperty(descriptor.value, 'name', { + value: handlerName, + configurable: true, + }); + + // Apply the original decorator + return decoratorResult(target, propertyKey, descriptor); + }; + }; + }; + } +} SentryNestEventInstrumentation.__initStatic(); SentryNestEventInstrumentation.__initStatic2(); + +exports.SentryNestEventInstrumentation = SentryNestEventInstrumentation; +//# sourceMappingURL=sentry-nest-event-instrumentation.js.map + + +/***/ }), + +/***/ 57786: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _nullishCoalesce, + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const core$1 = __nccwpck_require__(46033); +const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); +const helpers = __nccwpck_require__(34445); + +const supportedVersions = ['>=8.0.0 <11']; + +/** + * Custom instrumentation for nestjs. + * + * This hooks into + * 1. @Injectable decorator, which is applied on class middleware, interceptors and guards. + * 2. @Catch decorator, which is applied on exception filters. + */ +class SentryNestInstrumentation extends instrumentation.InstrumentationBase { + static __initStatic() {this.COMPONENT = '@nestjs/common';} + static __initStatic2() {this.COMMON_ATTRIBUTES = { + component: SentryNestInstrumentation.COMPONENT, + };} + + constructor(config = {}) { + super('sentry-nestjs', core.SDK_VERSION, config); + } + + /** + * Initializes the instrumentation by defining the modules to be patched. + */ + init() { + const moduleDef = new instrumentation.InstrumentationNodeModuleDefinition(SentryNestInstrumentation.COMPONENT, supportedVersions); + + moduleDef.files.push( + this._getInjectableFileInstrumentation(supportedVersions), + this._getCatchFileInstrumentation(supportedVersions), + ); + return moduleDef; + } + + /** + * Wraps the @Injectable decorator. + */ + _getInjectableFileInstrumentation(versions) { + return new instrumentation.InstrumentationNodeModuleFile( + '@nestjs/common/decorators/core/injectable.decorator.js', + versions, + (moduleExports) => { + if (core$1.isWrapped(moduleExports.Injectable)) { + this._unwrap(moduleExports, 'Injectable'); + } + this._wrap(moduleExports, 'Injectable', this._createWrapInjectable()); + return moduleExports; + }, + (moduleExports) => { + this._unwrap(moduleExports, 'Injectable'); + }, + ); + } + + /** + * Wraps the @Catch decorator. + */ + _getCatchFileInstrumentation(versions) { + return new instrumentation.InstrumentationNodeModuleFile( + '@nestjs/common/decorators/core/catch.decorator.js', + versions, + (moduleExports) => { + if (core$1.isWrapped(moduleExports.Catch)) { + this._unwrap(moduleExports, 'Catch'); + } + this._wrap(moduleExports, 'Catch', this._createWrapCatch()); + return moduleExports; + }, + (moduleExports) => { + this._unwrap(moduleExports, 'Catch'); + }, + ); + } + + /** + * Creates a wrapper function for the @Injectable decorator. + */ + _createWrapInjectable() { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return function wrapInjectable(original) { + return function wrappedInjectable(options) { + return function (target) { + // patch middleware + if (typeof target.prototype.use === 'function' && !target.__SENTRY_INTERNAL__) { + // patch only once + if (helpers.isPatched(target)) { + return original(options)(target); + } + + target.prototype.use = new Proxy(target.prototype.use, { + apply: (originalUse, thisArgUse, argsUse) => { + const [req, res, next, ...args] = argsUse; + + // Check that we can reasonably assume that the target is a middleware. + // Without these guards, instrumentation will fail if a function named 'use' on a service, which is + // decorated with @Injectable, is called. + if (!req || !res || !next || typeof next !== 'function') { + return originalUse.apply(thisArgUse, argsUse); + } + + const prevSpan = core.getActiveSpan(); + + return core.startSpanManual(helpers.getMiddlewareSpanOptions(target), (span) => { + // proxy next to end span on call + const nextProxy = helpers.getNextProxy(next, span, prevSpan); + return originalUse.apply(thisArgUse, [req, res, nextProxy, args]); + }); + }, + }); + } + + // patch guards + if (typeof target.prototype.canActivate === 'function' && !target.__SENTRY_INTERNAL__) { + // patch only once + if (helpers.isPatched(target)) { + return original(options)(target); + } + + target.prototype.canActivate = new Proxy(target.prototype.canActivate, { + apply: (originalCanActivate, thisArgCanActivate, argsCanActivate) => { + const context = argsCanActivate[0]; + + if (!context) { + return originalCanActivate.apply(thisArgCanActivate, argsCanActivate); + } + + return core.startSpan(helpers.getMiddlewareSpanOptions(target), () => { + return originalCanActivate.apply(thisArgCanActivate, argsCanActivate); + }); + }, + }); + } + + // patch pipes + if (typeof target.prototype.transform === 'function' && !target.__SENTRY_INTERNAL__) { + if (helpers.isPatched(target)) { + return original(options)(target); + } + + target.prototype.transform = new Proxy(target.prototype.transform, { + apply: (originalTransform, thisArgTransform, argsTransform) => { + const value = argsTransform[0]; + const metadata = argsTransform[1]; + + if (!value || !metadata) { + return originalTransform.apply(thisArgTransform, argsTransform); + } + + return core.startSpan(helpers.getMiddlewareSpanOptions(target), () => { + return originalTransform.apply(thisArgTransform, argsTransform); + }); + }, + }); + } + + // patch interceptors + if (typeof target.prototype.intercept === 'function' && !target.__SENTRY_INTERNAL__) { + if (helpers.isPatched(target)) { + return original(options)(target); + } + + target.prototype.intercept = new Proxy(target.prototype.intercept, { + apply: (originalIntercept, thisArgIntercept, argsIntercept) => { + const context = argsIntercept[0]; + const next = argsIntercept[1]; + + const parentSpan = core.getActiveSpan(); + let afterSpan; + + // Check that we can reasonably assume that the target is an interceptor. + if (!context || !next || typeof next.handle !== 'function') { + return originalIntercept.apply(thisArgIntercept, argsIntercept); + } + + return core.startSpanManual(helpers.getMiddlewareSpanOptions(target), (beforeSpan) => { + // eslint-disable-next-line @typescript-eslint/unbound-method + next.handle = new Proxy(next.handle, { + apply: (originalHandle, thisArgHandle, argsHandle) => { + beforeSpan.end(); + + if (parentSpan) { + return core.withActiveSpan(parentSpan, () => { + const handleReturnObservable = Reflect.apply(originalHandle, thisArgHandle, argsHandle); + + if (!context._sentryInterceptorInstrumented) { + core.addNonEnumerableProperty(context, '_sentryInterceptorInstrumented', true); + afterSpan = core.startInactiveSpan( + helpers.getMiddlewareSpanOptions(target, 'Interceptors - After Route'), + ); + } + + return handleReturnObservable; + }); + } else { + const handleReturnObservable = Reflect.apply(originalHandle, thisArgHandle, argsHandle); + + if (!context._sentryInterceptorInstrumented) { + core.addNonEnumerableProperty(context, '_sentryInterceptorInstrumented', true); + afterSpan = core.startInactiveSpan(helpers.getMiddlewareSpanOptions(target, 'Interceptors - After Route')); + } + + return handleReturnObservable; + } + }, + }); + + let returnedObservableInterceptMaybePromise; + + try { + returnedObservableInterceptMaybePromise = originalIntercept.apply(thisArgIntercept, argsIntercept); + } catch (e) { + _optionalChain([beforeSpan, 'optionalAccess', _ => _.end, 'call', _2 => _2()]); + _optionalChain([afterSpan, 'optionalAccess', _3 => _3.end, 'call', _4 => _4()]); + throw e; + } + + if (!afterSpan) { + return returnedObservableInterceptMaybePromise; + } + + // handle async interceptor + if (core.isThenable(returnedObservableInterceptMaybePromise)) { + return returnedObservableInterceptMaybePromise.then( + observable => { + helpers.instrumentObservable(observable, _nullishCoalesce(afterSpan, () => ( parentSpan))); + return observable; + }, + e => { + _optionalChain([beforeSpan, 'optionalAccess', _5 => _5.end, 'call', _6 => _6()]); + _optionalChain([afterSpan, 'optionalAccess', _7 => _7.end, 'call', _8 => _8()]); + throw e; + }, + ); + } + + // handle sync interceptor + if (typeof returnedObservableInterceptMaybePromise.subscribe === 'function') { + helpers.instrumentObservable(returnedObservableInterceptMaybePromise, _nullishCoalesce(afterSpan, () => ( parentSpan))); + } + + return returnedObservableInterceptMaybePromise; + }); + }, + }); + } + + return original(options)(target); + }; + }; + }; + } + + /** + * Creates a wrapper function for the @Catch decorator. Used to instrument exception filters. + */ + _createWrapCatch() { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return function wrapCatch(original) { + return function wrappedCatch(...exceptions) { + return function (target) { + if (typeof target.prototype.catch === 'function' && !target.__SENTRY_INTERNAL__) { + // patch only once + if (helpers.isPatched(target)) { + return original(...exceptions)(target); + } + + target.prototype.catch = new Proxy(target.prototype.catch, { + apply: (originalCatch, thisArgCatch, argsCatch) => { + const exception = argsCatch[0]; + const host = argsCatch[1]; + + if (!exception || !host) { + return originalCatch.apply(thisArgCatch, argsCatch); + } + + return core.startSpan(helpers.getMiddlewareSpanOptions(target), () => { + return originalCatch.apply(thisArgCatch, argsCatch); + }); + }, + }); + } + + return original(...exceptions)(target); + }; + }; + }; + } +}SentryNestInstrumentation.__initStatic();SentryNestInstrumentation.__initStatic2(); + +exports.SentryNestInstrumentation = SentryNestInstrumentation; +//# sourceMappingURL=sentry-nest-instrumentation.js.map + + +/***/ }), + +/***/ 96003: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationPg = __nccwpck_require__(31758); +const core = __nccwpck_require__(84466); +const instrument = __nccwpck_require__(64074); +const addOriginToSpan = __nccwpck_require__(37980); + +const INTEGRATION_NAME = 'Postgres'; + +const instrumentPostgres = instrument.generateInstrumentOnce( + INTEGRATION_NAME, + () => + new instrumentationPg.PgInstrumentation({ + requireParentSpan: true, + requestHook(span) { + addOriginToSpan.addOriginToSpan(span, 'auto.db.otel.postgres'); + }, + }), +); + +const _postgresIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentPostgres(); + }, + }; +}) ; + +/** + * Adds Sentry tracing instrumentation for the [pg](https://www.npmjs.com/package/pg) library. + * + * For more information, see the [`postgresIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/postgres/). + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * + * Sentry.init({ + * integrations: [Sentry.postgresIntegration()], + * }); + * ``` + */ +const postgresIntegration = core.defineIntegration(_postgresIntegration); + +exports.instrumentPostgres = instrumentPostgres; +exports.postgresIntegration = postgresIntegration; +//# sourceMappingURL=postgres.js.map + + +/***/ }), + +/***/ 53769: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const prismaInstrumentation = __nccwpck_require__(50976); +const core = __nccwpck_require__(84466); +const instrument = __nccwpck_require__(64074); + +const INTEGRATION_NAME = 'Prisma'; + +const EsmInteropPrismaInstrumentation = + // @ts-expect-error We need to do the following for interop reasons + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + _optionalChain([prismaInstrumentation, 'access', _ => _.default, 'optionalAccess', _2 => _2.PrismaInstrumentation]) || prismaInstrumentation.PrismaInstrumentation; + +function isPrismaV5TracingHelper(helper) { + return !!helper && typeof helper === 'object' && 'createEngineSpan' in helper; +} + +class SentryPrismaInteropInstrumentation extends EsmInteropPrismaInstrumentation { + constructor() { + super(); + } + + enable() { + super.enable(); + + // The PrismaIntegration (super class) defines a global variable `global["PRISMA_INSTRUMENTATION"]` when `enable()` is called. This global variable holds a "TracingHelper" which Prisma uses internally to create tracing data. It's their way of not depending on OTEL with their main package. The sucky thing is, prisma broke the interface of the tracing helper with the v6 major update. This means that if you use Prisma 6 with the v5 instrumentation (or vice versa) Prisma just blows up, because tries to call methods on the helper that no longer exist. + // Because we actually want to use the v6 instrumentation and not blow up in Prisma 5 user's faces, what we're doing here is backfilling the v5 method (`createEngineSpan`) with a noop so that no longer crashes when it attempts to call that function. + // We still won't fully emit all the spans, but this could potentially be implemented in the future. + const prismaInstrumentationObject = (globalThis ).PRISMA_INSTRUMENTATION; + const prismaTracingHelper = + prismaInstrumentationObject && + typeof prismaInstrumentationObject === 'object' && + 'helper' in prismaInstrumentationObject + ? prismaInstrumentationObject.helper + : undefined; + + let emittedWarning = false; + + if (isPrismaV5TracingHelper(prismaTracingHelper)) { + (prismaTracingHelper ).dispatchEngineSpans = () => { + core.consoleSandbox(() => { + if (!emittedWarning) { + emittedWarning = true; + // eslint-disable-next-line no-console + console.warn( + '[Sentry] This version (v8) of the Sentry SDK does not support tracing with Prisma version 6 out of the box. To trace Prisma version 6, pass a `prismaInstrumentation` for version 6 to the Sentry `prismaIntegration`. Read more: https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/prisma/', + ); + } + }); + }; + } + } +} + +const instrumentPrisma = instrument.generateInstrumentOnce( + INTEGRATION_NAME, + options => { + // Use a passed instrumentation instance to support older Prisma versions + if (_optionalChain([options, 'optionalAccess', _3 => _3.prismaInstrumentation])) { + return options.prismaInstrumentation; + } + + return new SentryPrismaInteropInstrumentation(); + }, +); + +/** + * Adds Sentry tracing instrumentation for the [Prisma](https://www.npmjs.com/package/prisma) ORM. + * For more information, see the [`prismaIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/prisma/). + * + * Make sure `previewFeatures = ["tracing"]` is added to the generator block in your Prisma schema. + * + * ```prisma + * generator client { + * provider = "prisma-client-js" + * previewFeatures = ["tracing"] + * } + * ``` + * + * NOTE: By default, this integration works with Prisma version 5. + * To get performance instrumentation for other Prisma versions, + * 1. Install the `@prisma/instrumentation` package with the desired version. + * 1. Pass a `new PrismaInstrumentation()` instance as exported from `@prisma/instrumentation` to the `prismaInstrumentation` option of this integration: + * + * ```js + * import { PrismaInstrumentation } from '@prisma/instrumentation' + * + * Sentry.init({ + * integrations: [ + * prismaIntegration({ + * // Override the default instrumentation that Sentry uses + * prismaInstrumentation: new PrismaInstrumentation() + * }) + * ] + * }) + * ``` + * + * The passed instrumentation instance will override the default instrumentation instance the integration would use, while the `prismaIntegration` will still ensure data compatibility for the various Prisma versions. + */ +const prismaIntegration = core.defineIntegration( + ({ + prismaInstrumentation, + } + + = {}) => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentPrisma({ prismaInstrumentation }); + }, + setup(client) { + client.on('spanStart', span => { + const spanJSON = core.spanToJSON(span); + if (_optionalChain([spanJSON, 'access', _4 => _4.description, 'optionalAccess', _5 => _5.startsWith, 'call', _6 => _6('prisma:')])) { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.prisma'); + } + + // Make sure we use the query text as the span name, for ex. SELECT * FROM "User" WHERE "id" = $1 + if (spanJSON.description === 'prisma:engine:db_query' && _optionalChain([spanJSON, 'access', _7 => _7.data, 'optionalAccess', _8 => _8['db.query.text']])) { + span.updateName(spanJSON.data['db.query.text'] ); + } + + // In Prisma v5.22+, the `db.system` attribute is automatically set + // On older versions, this is missing, so we add it here + if (spanJSON.description === 'prisma:engine:db_query' && !_optionalChain([spanJSON, 'access', _9 => _9.data, 'optionalAccess', _10 => _10['db.system']])) { + span.setAttribute('db.system', 'prisma'); + } + }); + }, + }; + }, +); + +exports.instrumentPrisma = instrumentPrisma; +exports.prismaIntegration = prismaIntegration; +//# sourceMappingURL=prisma.js.map + + +/***/ }), + +/***/ 87260: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationIoredis = __nccwpck_require__(45038); +const instrumentationRedis4 = __nccwpck_require__(53291); +const core = __nccwpck_require__(84466); +const instrument = __nccwpck_require__(64074); +const redisCache = __nccwpck_require__(94795); + +const INTEGRATION_NAME = 'Redis'; + +let _redisOptions = {}; + +const cacheResponseHook = (span, redisCommand, cmdArgs, response) => { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.redis'); + + const safeKey = redisCache.getCacheKeySafely(redisCommand, cmdArgs); + const cacheOperation = redisCache.getCacheOperation(redisCommand); + + if ( + !safeKey || + !cacheOperation || + !_optionalChain([_redisOptions, 'optionalAccess', _ => _.cachePrefixes]) || + !redisCache.shouldConsiderForCache(redisCommand, safeKey, _redisOptions.cachePrefixes) + ) { + // not relevant for cache + return; + } + + // otel/ioredis seems to be using the old standard, as there was a change to those params: https://github.com/open-telemetry/opentelemetry-specification/issues/3199 + // We are using params based on the docs: https://opentelemetry.io/docs/specs/semconv/attributes-registry/network/ + const networkPeerAddress = _optionalChain([core.spanToJSON, 'call', _2 => _2(span), 'access', _3 => _3.data, 'optionalAccess', _4 => _4['net.peer.name']]); + const networkPeerPort = _optionalChain([core.spanToJSON, 'call', _5 => _5(span), 'access', _6 => _6.data, 'optionalAccess', _7 => _7['net.peer.port']]); + if (networkPeerPort && networkPeerAddress) { + span.setAttributes({ 'network.peer.address': networkPeerAddress, 'network.peer.port': networkPeerPort }); + } + + const cacheItemSize = redisCache.calculateCacheItemSize(response); + + if (cacheItemSize) { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, cacheItemSize); + } + + if (redisCache.isInCommands(redisCache.GET_COMMANDS, redisCommand) && cacheItemSize !== undefined) { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_CACHE_HIT, cacheItemSize > 0); + } + + span.setAttributes({ + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: cacheOperation, + [core.SEMANTIC_ATTRIBUTE_CACHE_KEY]: safeKey, + }); + + const spanDescription = safeKey.join(', '); + + span.updateName(core.truncate(spanDescription, 1024)); +}; + +const instrumentIORedis = instrument.generateInstrumentOnce('IORedis', () => { + return new instrumentationIoredis.IORedisInstrumentation({ + responseHook: cacheResponseHook, + }); +}); + +const instrumentRedis4 = instrument.generateInstrumentOnce('Redis-4', () => { + return new instrumentationRedis4.RedisInstrumentation({ + responseHook: cacheResponseHook, + }); +}); + +/** To be able to preload all Redis OTel instrumentations with just one ID ("Redis"), all the instrumentations are generated in this one function */ +const instrumentRedis = Object.assign( + () => { + instrumentIORedis(); + instrumentRedis4(); + + // todo: implement them gradually + // new LegacyRedisInstrumentation({}), + }, + { id: INTEGRATION_NAME }, +); + +const _redisIntegration = ((options = {}) => { + return { + name: INTEGRATION_NAME, + setupOnce() { + _redisOptions = options; + instrumentRedis(); + }, + }; +}) ; + +/** + * Adds Sentry tracing instrumentation for the [redis](https://www.npmjs.com/package/redis) and + * [ioredis](https://www.npmjs.com/package/ioredis) libraries. + * + * For more information, see the [`redisIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/redis/). + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * + * Sentry.init({ + * integrations: [Sentry.redisIntegration()], + * }); + * ``` + */ +const redisIntegration = core.defineIntegration(_redisIntegration); + +exports.instrumentRedis = instrumentRedis; +exports.redisIntegration = redisIntegration; +//# sourceMappingURL=redis.js.map + + +/***/ }), + +/***/ 78622: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentationTedious = __nccwpck_require__(70450); +const core = __nccwpck_require__(84466); +const instrument = __nccwpck_require__(64074); + +const TEDIUS_INSTRUMENTED_METHODS = new Set([ + 'callProcedure', + 'execSql', + 'execSqlBatch', + 'execBulkLoad', + 'prepare', + 'execute', +]); + +const INTEGRATION_NAME = 'Tedious'; + +const instrumentTedious = instrument.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationTedious.TediousInstrumentation({})); + +const _tediousIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentTedious(); + }, + + setup(client) { + client.on('spanStart', span => { + const { description, data } = core.spanToJSON(span); + // Tedius integration always set a span name and `db.system` attribute to `mssql`. + if (!description || _optionalChain([data, 'optionalAccess', _ => _['db.system']]) !== 'mssql') { + return; + } + + const operation = _optionalChain([description, 'optionalAccess', _2 => _2.split, 'call', _3 => _3(' '), 'access', _4 => _4[0]]) || ''; + if (TEDIUS_INSTRUMENTED_METHODS.has(operation)) { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.tedious'); + } + }); + }, + }; +}) ; + +/** + * Adds Sentry tracing instrumentation for the [tedious](https://www.npmjs.com/package/tedious) library. + * + * For more information, see the [`tediousIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/tedious/). + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * + * Sentry.init({ + * integrations: [Sentry.tediousIntegration()], + * }); + * ``` + */ +const tediousIntegration = core.defineIntegration(_tediousIntegration); + +exports.instrumentTedious = instrumentTedious; +exports.tediousIntegration = tediousIntegration; +//# sourceMappingURL=tedious.js.map + + +/***/ }), + +/***/ 65595: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const core = __nccwpck_require__(84466); +const instrument = __nccwpck_require__(64074); +const addOriginToSpan = __nccwpck_require__(37980); +const instrumentation = __nccwpck_require__(15477); + +/* eslint-disable complexity */ + +const instrumentVercelAi = instrument.generateInstrumentOnce('vercelAI', () => new instrumentation.SentryVercelAiInstrumentation({})); + +const _vercelAIIntegration = (() => { + return { + name: 'vercelAI', + setupOnce() { + instrumentVercelAi(); + }, + processEvent(event) { + if (event.type === 'transaction' && _optionalChain([event, 'access', _ => _.spans, 'optionalAccess', _2 => _2.length])) { + for (const span of event.spans) { + const { data: attributes, description: name } = span; + + if (!attributes || !name || span.origin !== 'auto.vercelai.otel') { + continue; + } + + // attributes around token usage can only be set on span finish + span.data = span.data || {}; + + if (attributes['ai.usage.completionTokens'] != undefined) { + span.data['ai.completion_tokens.used'] = attributes['ai.usage.completionTokens']; + } + if (attributes['ai.usage.promptTokens'] != undefined) { + span.data['ai.prompt_tokens.used'] = attributes['ai.usage.promptTokens']; + } + if ( + attributes['ai.usage.completionTokens'] != undefined && + attributes['ai.usage.promptTokens'] != undefined + ) { + span.data['ai.total_tokens.used'] = + attributes['ai.usage.completionTokens'] + attributes['ai.usage.promptTokens']; + } + } + } + + return event; + }, + setup(client) { + client.on('spanStart', span => { + if (!instrumentation.sentryVercelAiPatched) { + return; + } + + const { data: attributes, description: name } = core.spanToJSON(span); + + if (!attributes || !name) { + return; + } + + // The id of the model + const aiModelId = attributes['ai.model.id']; + + // the provider of the model + const aiModelProvider = attributes['ai.model.provider']; + + // both of these must be defined for the integration to work + if (!aiModelId || !aiModelProvider) { + return; + } + + let isPipelineSpan = false; + + switch (name) { + case 'ai.generateText': { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.generateText'); + isPipelineSpan = true; + break; + } + case 'ai.generateText.doGenerate': { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.run.doGenerate'); + break; + } + case 'ai.streamText': { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.streamText'); + isPipelineSpan = true; + break; + } + case 'ai.streamText.doStream': { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.run.doStream'); + break; + } + case 'ai.generateObject': { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.generateObject'); + isPipelineSpan = true; + break; + } + case 'ai.generateObject.doGenerate': { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.run.doGenerate'); + break; + } + case 'ai.streamObject': { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.streamObject'); + isPipelineSpan = true; + break; + } + case 'ai.streamObject.doStream': { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.run.doStream'); + break; + } + case 'ai.embed': { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.embed'); + isPipelineSpan = true; + break; + } + case 'ai.embed.doEmbed': { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.embeddings'); + break; + } + case 'ai.embedMany': { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.embedMany'); + isPipelineSpan = true; + break; + } + case 'ai.embedMany.doEmbed': { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.embeddings'); + break; + } + case 'ai.toolCall': + case 'ai.stream.firstChunk': + case 'ai.stream.finish': + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.run'); + break; + } + + addOriginToSpan.addOriginToSpan(span, 'auto.vercelai.otel'); + + const nameWthoutAi = name.replace('ai.', ''); + span.setAttribute('ai.pipeline.name', nameWthoutAi); + span.updateName(nameWthoutAi); + + // If a Telemetry name is set and it is a pipeline span, use that as the operation name + if (attributes['ai.telemetry.functionId'] && isPipelineSpan) { + span.updateName(attributes['ai.telemetry.functionId']); + span.setAttribute('ai.pipeline.name', attributes['ai.telemetry.functionId']); + } + + if (attributes['ai.prompt']) { + span.setAttribute('ai.input_messages', attributes['ai.prompt']); + } + if (attributes['ai.model.id']) { + span.setAttribute('ai.model_id', attributes['ai.model.id']); + } + span.setAttribute('ai.streaming', name.includes('stream')); + }); + }, + }; +}) ; + +/** + * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library. + * + * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry). + * + * @example + * ```javascript + * const Sentry = require('@sentry/node'); + * + * Sentry.init({ + * integrations: [Sentry.vercelAIIntegration()], + * }); + * ``` + * + * By default this integration adds tracing support to all `ai` function calls. If you need to disable + * collecting spans for a specific call, you can do so by setting `experimental_telemetry.isEnabled` to + * `false` in the first argument of the function call. + * + * ```javascript + * const result = await generateText({ + * model: openai('gpt-4-turbo'), + * experimental_telemetry: { isEnabled: false }, + * }); + * ``` + * + * If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each + * function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs` + * to `true`. + * + * ```javascript + * const result = await generateText({ + * model: openai('gpt-4-turbo'), + * experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true }, + * }); + */ +const vercelAIIntegration = core.defineIntegration(_vercelAIIntegration); + +exports.instrumentVercelAi = instrumentVercelAi; +exports.vercelAIIntegration = vercelAIIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 15477: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); + +// List of patched methods +// From: https://sdk.vercel.ai/docs/ai-sdk-core/telemetry#collected-data +const INSTRUMENTED_METHODS = [ + 'generateText', + 'streamText', + 'generateObject', + 'streamObject', + 'embed', + 'embedMany', +] ; + +exports.sentryVercelAiPatched = false; + +/** + * This detects is added by the Sentry Vercel AI Integration to detect if the integration should + * be enabled. + * + * It also patches the `ai` module to enable Vercel AI telemetry automatically for all methods. + */ +class SentryVercelAiInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super('@sentry/instrumentation-vercel-ai', core.SDK_VERSION, config); + } + + /** + * Initializes the instrumentation by defining the modules to be patched. + */ + init() { + const module = new instrumentation.InstrumentationNodeModuleDefinition('ai', ['>=3.0.0 <5'], this._patch.bind(this)); + return module; + } + + /** + * Patches module exports to enable Vercel AI telemetry. + */ + _patch(moduleExports) { + exports.sentryVercelAiPatched = true; + + function generatePatch(name) { + return (...args) => { + const existingExperimentalTelemetry = args[0].experimental_telemetry || {}; + const isEnabled = existingExperimentalTelemetry.isEnabled; + + // if `isEnabled` is not explicitly set to `true` or `false`, enable telemetry + // but disable capturing inputs and outputs by default + if (isEnabled === undefined) { + args[0].experimental_telemetry = { + isEnabled: true, + recordInputs: false, + recordOutputs: false, + ...existingExperimentalTelemetry, + }; + } + + // @ts-expect-error we know that the method exists + return moduleExports[name].apply(this, args); + }; + } + + const patchedModuleExports = INSTRUMENTED_METHODS.reduce((acc, curr) => { + acc[curr] = generatePatch(curr); + return acc; + }, {} ); + + return { ...moduleExports, ...patchedModuleExports }; + } +} + +exports.SentryVercelAiInstrumentation = SentryVercelAiInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 88196: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const core = __nccwpck_require__(84466); + +const NODE_VERSION = core.parseSemver(process.versions.node) ; +const NODE_MAJOR = NODE_VERSION.major; + +exports.NODE_MAJOR = NODE_MAJOR; +exports.NODE_VERSION = NODE_VERSION; +//# sourceMappingURL=nodeVersion.js.map + + +/***/ }), + +/***/ 37859: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const contextAsyncHooks = __nccwpck_require__(81616); +const opentelemetry = __nccwpck_require__(78369); + +/** + * This is a custom ContextManager for OpenTelemetry, which extends the default AsyncLocalStorageContextManager. + * It ensures that we create a new hub per context, so that the OTEL Context & the Sentry Hub are always in sync. + * + * Note that we currently only support AsyncHooks with this, + * but since this should work for Node 14+ anyhow that should be good enough. + */ +const SentryContextManager = opentelemetry.wrapContextManagerClass(contextAsyncHooks.AsyncLocalStorageContextManager); + +exports.SentryContextManager = SentryContextManager; +//# sourceMappingURL=contextManager.js.map + + +/***/ }), + +/***/ 64074: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const instrumentation = __nccwpck_require__(65584); + +/** Exported only for tests. */ +const INSTRUMENTED = {}; + +/** + * Instrument an OpenTelemetry instrumentation once. + * This will skip running instrumentation again if it was already instrumented. + */ +function generateInstrumentOnce( + name, + creator, +) { + return Object.assign( + (options) => { + const instrumented = INSTRUMENTED[name]; + if (instrumented) { + // If options are provided, ensure we update them + if (options) { + instrumented.setConfig(options); + } + return; + } + + const instrumentation$1 = creator(options); + INSTRUMENTED[name] = instrumentation$1; + + instrumentation.registerInstrumentations({ + instrumentations: [instrumentation$1], + }); + }, + { id: name }, + ); +} + +exports.INSTRUMENTED = INSTRUMENTED; +exports.generateInstrumentOnce = generateInstrumentOnce; +//# sourceMappingURL=instrument.js.map + + +/***/ }), + +/***/ 88503: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _nullishCoalesce +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const http = __nccwpck_require__(88849); +__nccwpck_require__(22286); + +/** +* This code was originally forked from https://github.com/TooTallNate/proxy-agents/tree/b133295fd16f6475578b6b15bd9b4e33ecb0d0b7 +* With the following LICENSE: +* +* (The MIT License) +* +* Copyright (c) 2013 Nathan Rajlich * +* +* Permission is hereby granted, free of charge, to any person obtaining +* a copy of this software and associated documentation files (the +* 'Software'), to deal in the Software without restriction, including +* without limitation the rights to use, copy, modify, merge, publish, +* distribute, sublicense, and/or sell copies of the Software, and to +* permit persons to whom the Software is furnished to do so, subject to +* the following conditions:* +* +* The above copyright notice and this permission notice shall be +* included in all copies or substantial portions of the Software.* +* +* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +const INTERNAL = Symbol('AgentBaseInternalState'); + +class Agent extends http.Agent { + + // Set by `http.Agent` - missing from `@types/node` + + constructor(opts) { + super(opts); + this[INTERNAL] = {}; + } + + /** + * Determine whether this is an `http` or `https` request. + */ + isSecureEndpoint(options) { + if (options) { + // First check the `secureEndpoint` property explicitly, since this + // means that a parent `Agent` is "passing through" to this instance. + if (typeof (options ).secureEndpoint === 'boolean') { + return options.secureEndpoint; + } + + // If no explicit `secure` endpoint, check if `protocol` property is + // set. This will usually be the case since using a full string URL + // or `URL` instance should be the most common usage. + if (typeof options.protocol === 'string') { + return options.protocol === 'https:'; + } + } + + // Finally, if no `protocol` property was set, then fall back to + // checking the stack trace of the current call stack, and try to + // detect the "https" module. + const { stack } = new Error(); + if (typeof stack !== 'string') return false; + return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1); + } + + createSocket(req, options, cb) { + const connectOpts = { + ...options, + secureEndpoint: this.isSecureEndpoint(options), + }; + Promise.resolve() + .then(() => this.connect(req, connectOpts)) + .then(socket => { + if (socket instanceof http.Agent) { + // @ts-expect-error `addRequest()` isn't defined in `@types/node` + return socket.addRequest(req, connectOpts); + } + this[INTERNAL].currentSocket = socket; + // @ts-expect-error `createSocket()` isn't defined in `@types/node` + super.createSocket(req, options, cb); + }, cb); + } + + createConnection() { + const socket = this[INTERNAL].currentSocket; + this[INTERNAL].currentSocket = undefined; + if (!socket) { + throw new Error('No socket was returned in the `connect()` function'); + } + return socket; + } + + get defaultPort() { + return _nullishCoalesce(this[INTERNAL].defaultPort, () => ( (this.protocol === 'https:' ? 443 : 80))); + } + + set defaultPort(v) { + if (this[INTERNAL]) { + this[INTERNAL].defaultPort = v; + } + } + + get protocol() { + return _nullishCoalesce(this[INTERNAL].protocol, () => ( (this.isSecureEndpoint() ? 'https:' : 'http:'))); + } + + set protocol(v) { + if (this[INTERNAL]) { + this[INTERNAL].protocol = v; + } + } +} + +exports.Agent = Agent; +//# sourceMappingURL=base.js.map + + +/***/ }), + +/***/ 62941: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _nullishCoalesce, + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const net = __nccwpck_require__(87503); +const tls = __nccwpck_require__(31764); +const core = __nccwpck_require__(84466); +const base = __nccwpck_require__(88503); +const parseProxyResponse = __nccwpck_require__(13317); + +function debug(...args) { + core.logger.log('[https-proxy-agent]', ...args); +} + +/** + * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to + * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests. + * + * Outgoing HTTP requests are first tunneled through the proxy server using the + * `CONNECT` HTTP request method to establish a connection to the proxy server, + * and then the proxy server connects to the destination target and issues the + * HTTP request from the proxy server. + * + * `https:` requests have their socket connection upgraded to TLS once + * the connection to the proxy server has been established. + */ +class HttpsProxyAgent extends base.Agent { + static __initStatic() {this.protocols = ['http', 'https']; } + + constructor(proxy, opts) { + super(opts); + this.options = {}; + this.proxy = typeof proxy === 'string' ? new URL(proxy) : proxy; + this.proxyHeaders = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _2 => _2.headers]), () => ( {})); + debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href); + + // Trim off the brackets from IPv6 addresses + const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, ''); + const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === 'https:' ? 443 : 80; + this.connectOpts = { + // Attempt to negotiate http/1.1 for proxy servers that support http/2 + ALPNProtocols: ['http/1.1'], + ...(opts ? omit(opts, 'headers') : null), + host, + port, + }; + } + + /** + * Called when the node-core HTTP client library is creating a + * new HTTP request. + */ + async connect(req, opts) { + const { proxy } = this; + + if (!opts.host) { + throw new TypeError('No "host" provided'); + } + + // Create a socket connection to the proxy server. + let socket; + if (proxy.protocol === 'https:') { + debug('Creating `tls.Socket`: %o', this.connectOpts); + const servername = this.connectOpts.servername || this.connectOpts.host; + socket = tls.connect({ + ...this.connectOpts, + servername: servername && net.isIP(servername) ? undefined : servername, + }); + } else { + debug('Creating `net.Socket`: %o', this.connectOpts); + socket = net.connect(this.connectOpts); + } + + const headers = + typeof this.proxyHeaders === 'function' ? this.proxyHeaders() : { ...this.proxyHeaders }; + const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host; + let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r\n`; + + // Inject the `Proxy-Authorization` header if necessary. + if (proxy.username || proxy.password) { + const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers['Proxy-Authorization'] = `Basic ${Buffer.from(auth).toString('base64')}`; + } + + headers.Host = `${host}:${opts.port}`; + + if (!headers['Proxy-Connection']) { + headers['Proxy-Connection'] = this.keepAlive ? 'Keep-Alive' : 'close'; + } + for (const name of Object.keys(headers)) { + payload += `${name}: ${headers[name]}\r\n`; + } + + const proxyResponsePromise = parseProxyResponse.parseProxyResponse(socket); + + socket.write(`${payload}\r\n`); + + const { connect, buffered } = await proxyResponsePromise; + req.emit('proxyConnect', connect); + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore Not EventEmitter in Node types + this.emit('proxyConnect', connect, req); + + if (connect.statusCode === 200) { + req.once('socket', resume); + + if (opts.secureEndpoint) { + // The proxy is connecting to a TLS server, so upgrade + // this socket connection to a TLS connection. + debug('Upgrading socket connection to TLS'); + const servername = opts.servername || opts.host; + return tls.connect({ + ...omit(opts, 'host', 'path', 'port'), + socket, + servername: net.isIP(servername) ? undefined : servername, + }); + } + + return socket; + } + + // Some other status code that's not 200... need to re-play the HTTP + // header "data" events onto the socket once the HTTP machinery is + // attached so that the node core `http` can parse and handle the + // error status code. + + // Close the original socket, and a new "fake" socket is returned + // instead, so that the proxy doesn't get the HTTP request + // written to it (which may contain `Authorization` headers or other + // sensitive data). + // + // See: https://hackerone.com/reports/541502 + socket.destroy(); + + const fakeSocket = new net.Socket({ writable: false }); + fakeSocket.readable = true; + + // Need to wait for the "socket" event to re-play the "data" events. + req.once('socket', (s) => { + debug('Replaying proxy buffer for failed request'); + // Replay the "buffered" Buffer onto the fake `socket`, since at + // this point the HTTP module machinery has been hooked up for + // the user. + s.push(buffered); + s.push(null); + }); + + return fakeSocket; + } +}HttpsProxyAgent.__initStatic(); + +function resume(socket) { + socket.resume(); +} + +function omit( + obj, + ...keys +) + + { + const ret = {} + +; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; + } + } + return ret; +} + +exports.HttpsProxyAgent = HttpsProxyAgent; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 13317: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const core = __nccwpck_require__(84466); + +function debug(...args) { + core.logger.log('[https-proxy-agent:parse-proxy-response]', ...args); +} + +function parseProxyResponse(socket) { + return new Promise((resolve, reject) => { + // we need to buffer any HTTP traffic that happens with the proxy before we get + // the CONNECT response, so that if the response is anything other than an "200" + // response code, then we can re-play the "data" events on the socket once the + // HTTP parser is hooked up... + let buffersLength = 0; + const buffers = []; + + function read() { + const b = socket.read(); + if (b) ondata(b); + else socket.once('readable', read); + } + + function cleanup() { + socket.removeListener('end', onend); + socket.removeListener('error', onerror); + socket.removeListener('readable', read); + } + + function onend() { + cleanup(); + debug('onend'); + reject(new Error('Proxy connection ended before receiving CONNECT response')); + } + + function onerror(err) { + cleanup(); + debug('onerror %o', err); + reject(err); + } + + function ondata(b) { + buffers.push(b); + buffersLength += b.length; + + const buffered = Buffer.concat(buffers, buffersLength); + const endOfHeaders = buffered.indexOf('\r\n\r\n'); + + if (endOfHeaders === -1) { + // keep buffering + debug('have not received end of HTTP headers yet...'); + read(); + return; + } + + const headerParts = buffered.slice(0, endOfHeaders).toString('ascii').split('\r\n'); + const firstLine = headerParts.shift(); + if (!firstLine) { + socket.destroy(); + return reject(new Error('No header received from proxy CONNECT response')); + } + const firstLineParts = firstLine.split(' '); + const statusCode = +(firstLineParts[1] || 0); + const statusText = firstLineParts.slice(2).join(' '); + const headers = {}; + for (const header of headerParts) { + if (!header) continue; + const firstColon = header.indexOf(':'); + if (firstColon === -1) { + socket.destroy(); + return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`)); + } + const key = header.slice(0, firstColon).toLowerCase(); + const value = header.slice(firstColon + 1).trimStart(); + const current = headers[key]; + if (typeof current === 'string') { + headers[key] = [current, value]; + } else if (Array.isArray(current)) { + current.push(value); + } else { + headers[key] = value; + } + } + debug('got proxy server response: %o %o', firstLine, headers); + cleanup(); + resolve({ + connect: { + statusCode, + statusText, + headers, + }, + buffered, + }); + } + + socket.on('error', onerror); + socket.on('end', onend); + + read(); + }); +} + +exports.parseProxyResponse = parseProxyResponse; +//# sourceMappingURL=parse-proxy-response.js.map + + +/***/ }), + +/***/ 75168: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const core = __nccwpck_require__(84466); +const module$1 = __nccwpck_require__(64177); + +/** + * Returns a release dynamically from environment variables. + */ +// eslint-disable-next-line complexity +function getSentryRelease(fallback) { + // Always read first as Sentry takes this as precedence + if (process.env.SENTRY_RELEASE) { + return process.env.SENTRY_RELEASE; + } + + // This supports the variable that sentry-webpack-plugin injects + if (core.GLOBAL_OBJ.SENTRY_RELEASE && core.GLOBAL_OBJ.SENTRY_RELEASE.id) { + return core.GLOBAL_OBJ.SENTRY_RELEASE.id; + } + + // This list is in approximate alpha order, separated into 3 categories: + // 1. Git providers + // 2. CI providers with specific environment variables (has the provider name in the variable name) + // 3. CI providers with generic environment variables (checked for last to prevent possible false positives) + + const possibleReleaseNameOfGitProvider = + // GitHub Actions - https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables + process.env['GITHUB_SHA'] || + // GitLab CI - https://docs.gitlab.com/ee/ci/variables/predefined_variables.html + process.env['CI_MERGE_REQUEST_SOURCE_BRANCH_SHA'] || + process.env['CI_BUILD_REF'] || + process.env['CI_COMMIT_SHA'] || + // Bitbucket - https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/ + process.env['BITBUCKET_COMMIT']; + + const possibleReleaseNameOfCiProvidersWithSpecificEnvVar = + // AppVeyor - https://www.appveyor.com/docs/environment-variables/ + process.env['APPVEYOR_PULL_REQUEST_HEAD_COMMIT'] || + process.env['APPVEYOR_REPO_COMMIT'] || + // AWS CodeBuild - https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html + process.env['CODEBUILD_RESOLVED_SOURCE_VERSION'] || + // AWS Amplify - https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html + process.env['AWS_COMMIT_ID'] || + // Azure Pipelines - https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml + process.env['BUILD_SOURCEVERSION'] || + // Bitrise - https://devcenter.bitrise.io/builds/available-environment-variables/ + process.env['GIT_CLONE_COMMIT_HASH'] || + // Buddy CI - https://buddy.works/docs/pipelines/environment-variables#default-environment-variables + process.env['BUDDY_EXECUTION_REVISION'] || + // Builtkite - https://buildkite.com/docs/pipelines/environment-variables + process.env['BUILDKITE_COMMIT'] || + // CircleCI - https://circleci.com/docs/variables/ + process.env['CIRCLE_SHA1'] || + // Cirrus CI - https://cirrus-ci.org/guide/writing-tasks/#environment-variables + process.env['CIRRUS_CHANGE_IN_REPO'] || + // Codefresh - https://codefresh.io/docs/docs/codefresh-yaml/variables/ + process.env['CF_REVISION'] || + // Codemagic - https://docs.codemagic.io/yaml-basic-configuration/environment-variables/ + process.env['CM_COMMIT'] || + // Cloudflare Pages - https://developers.cloudflare.com/pages/platform/build-configuration/#environment-variables + process.env['CF_PAGES_COMMIT_SHA'] || + // Drone - https://docs.drone.io/pipeline/environment/reference/ + process.env['DRONE_COMMIT_SHA'] || + // Flightcontrol - https://www.flightcontrol.dev/docs/guides/flightcontrol/environment-variables#built-in-environment-variables + process.env['FC_GIT_COMMIT_SHA'] || + // Heroku #1 https://devcenter.heroku.com/articles/heroku-ci + process.env['HEROKU_TEST_RUN_COMMIT_VERSION'] || + // Heroku #2 https://docs.sentry.io/product/integrations/deployment/heroku/#configure-releases + process.env['HEROKU_SLUG_COMMIT'] || + // Railway - https://docs.railway.app/reference/variables#git-variables + process.env['RAILWAY_GIT_COMMIT_SHA'] || + // Render - https://render.com/docs/environment-variables + process.env['RENDER_GIT_COMMIT'] || + // Semaphore CI - https://docs.semaphoreci.com/ci-cd-environment/environment-variables + process.env['SEMAPHORE_GIT_SHA'] || + // TravisCI - https://docs.travis-ci.com/user/environment-variables/#default-environment-variables + process.env['TRAVIS_PULL_REQUEST_SHA'] || + // Vercel - https://vercel.com/docs/v2/build-step#system-environment-variables + process.env['VERCEL_GIT_COMMIT_SHA'] || + process.env['VERCEL_GITHUB_COMMIT_SHA'] || + process.env['VERCEL_GITLAB_COMMIT_SHA'] || + process.env['VERCEL_BITBUCKET_COMMIT_SHA'] || + // Zeit (now known as Vercel) + process.env['ZEIT_GITHUB_COMMIT_SHA'] || + process.env['ZEIT_GITLAB_COMMIT_SHA'] || + process.env['ZEIT_BITBUCKET_COMMIT_SHA']; + + const possibleReleaseNameOfCiProvidersWithGenericEnvVar = + // CloudBees CodeShip - https://docs.cloudbees.com/docs/cloudbees-codeship/latest/pro-builds-and-configuration/environment-variables + process.env['CI_COMMIT_ID'] || + // Coolify - https://coolify.io/docs/knowledge-base/environment-variables + process.env['SOURCE_COMMIT'] || + // Heroku #3 https://devcenter.heroku.com/changelog-items/630 + process.env['SOURCE_VERSION'] || + // Jenkins - https://plugins.jenkins.io/git/#environment-variables + process.env['GIT_COMMIT'] || + // Netlify - https://docs.netlify.com/configure-builds/environment-variables/#build-metadata + process.env['COMMIT_REF'] || + // TeamCity - https://www.jetbrains.com/help/teamcity/predefined-build-parameters.html + process.env['BUILD_VCS_NUMBER'] || + // Woodpecker CI - https://woodpecker-ci.org/docs/usage/environment + process.env['CI_COMMIT_SHA']; + + return ( + possibleReleaseNameOfGitProvider || + possibleReleaseNameOfCiProvidersWithSpecificEnvVar || + possibleReleaseNameOfCiProvidersWithGenericEnvVar || + fallback + ); +} + +/** Node.js stack parser */ +const defaultStackParser = core.createStackParser(core.nodeStackLineParser(module$1.createGetModuleFromFilename())); + +exports.defaultStackParser = defaultStackParser; +exports.getSentryRelease = getSentryRelease; +//# sourceMappingURL=api.js.map + + +/***/ }), + +/***/ 49951: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _nullishCoalesce, + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const os = __nccwpck_require__(70612); +const api = __nccwpck_require__(65163); +const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); +const opentelemetry = __nccwpck_require__(78369); +const worker_threads = __nccwpck_require__(71267); +const debugBuild = __nccwpck_require__(8421); + +const DEFAULT_CLIENT_REPORT_FLUSH_INTERVAL_MS = 60000; // 60s was chosen arbitrarily + +/** A client for using Sentry with Node & OpenTelemetry. */ +class NodeClient extends core.ServerRuntimeClient { + + constructor(options) { + const clientOptions = { + ...options, + platform: 'node', + runtime: { name: 'node', version: global.process.version }, + serverName: options.serverName || global.process.env.SENTRY_NAME || os.hostname(), + }; + + if (options.openTelemetryInstrumentations) { + instrumentation.registerInstrumentations({ + instrumentations: options.openTelemetryInstrumentations, + }); + } + + core.applySdkMetadata(clientOptions, 'node'); + + core.logger.log( + `Initializing Sentry: process: ${process.pid}, thread: ${worker_threads.isMainThread ? 'main' : `worker-${worker_threads.threadId}`}.`, + ); + + super(clientOptions); + } + + /** Get the OTEL tracer. */ + get tracer() { + if (this._tracer) { + return this._tracer; + } + + const name = '@sentry/node'; + const version = core.SDK_VERSION; + const tracer = api.trace.getTracer(name, version); + this._tracer = tracer; + + return tracer; + } + + // Eslint ignore explanation: This is already documented in super. + // eslint-disable-next-line jsdoc/require-jsdoc + async flush(timeout) { + const provider = this.traceProvider; + const spanProcessor = _optionalChain([provider, 'optionalAccess', _ => _.activeSpanProcessor]); + + if (spanProcessor) { + await spanProcessor.forceFlush(); + } + + if (this.getOptions().sendClientReports) { + this._flushOutcomes(); + } + + return super.flush(timeout); + } + + // Eslint ignore explanation: This is already documented in super. + // eslint-disable-next-line jsdoc/require-jsdoc + close(timeout) { + if (this._clientReportInterval) { + clearInterval(this._clientReportInterval); + } + + if (this._clientReportOnExitFlushListener) { + process.off('beforeExit', this._clientReportOnExitFlushListener); + } + + return super.close(timeout); + } + + /** + * Will start tracking client reports for this client. + * + * NOTICE: This method will create an interval that is periodically called and attach a `process.on('beforeExit')` + * hook. To clean up these resources, call `.close()` when you no longer intend to use the client. Not doing so will + * result in a memory leak. + */ + // The reason client reports need to be manually activated with this method instead of just enabling them in a + // constructor, is that if users periodically and unboundedly create new clients, we will create more and more + // intervals and beforeExit listeners, thus leaking memory. In these situations, users are required to call + // `client.close()` in order to dispose of the acquired resources. + // We assume that calling this method in Sentry.init() is a sensible default, because calling Sentry.init() over and + // over again would also result in memory leaks. + // Note: We have experimented with using `FinalizationRegisty` to clear the interval when the client is garbage + // collected, but it did not work, because the cleanup function never got called. + startClientReportTracking() { + const clientOptions = this.getOptions(); + if (clientOptions.sendClientReports) { + this._clientReportOnExitFlushListener = () => { + this._flushOutcomes(); + }; + + this._clientReportInterval = setInterval(() => { + debugBuild.DEBUG_BUILD && core.logger.log('Flushing client reports based on interval.'); + this._flushOutcomes(); + }, _nullishCoalesce(clientOptions.clientReportFlushInterval, () => ( DEFAULT_CLIENT_REPORT_FLUSH_INTERVAL_MS))) + // Unref is critical for not preventing the process from exiting because the interval is active. + .unref(); + + process.on('beforeExit', this._clientReportOnExitFlushListener); + } + } + + /** Custom implementation for OTEL, so we can handle scope-span linking. */ + _getTraceInfoFromScope( + scope, + ) { + if (!scope) { + return [undefined, undefined]; + } + + return opentelemetry.getTraceContextForScope(this, scope); + } +} + +exports.NodeClient = NodeClient; +//# sourceMappingURL=client.js.map + + +/***/ }), + +/***/ 59198: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const core = __nccwpck_require__(84466); +const opentelemetry = __nccwpck_require__(78369); +const debugBuild = __nccwpck_require__(8421); +const childProcess = __nccwpck_require__(13557); +const console$1 = __nccwpck_require__(61139); +const context = __nccwpck_require__(15834); +const contextlines = __nccwpck_require__(57582); +const index = __nccwpck_require__(50289); +const index$1 = __nccwpck_require__(4530); +const modules = __nccwpck_require__(43791); +const nodeFetch = __nccwpck_require__(40839); +const onuncaughtexception = __nccwpck_require__(79100); +const onunhandledrejection = __nccwpck_require__(70694); +const spotlight = __nccwpck_require__(23284); +const index$2 = __nccwpck_require__(59020); +const http = __nccwpck_require__(73009); +const commonjs = __nccwpck_require__(38743); +const envToBool = __nccwpck_require__(5606); +const api = __nccwpck_require__(75168); +const client = __nccwpck_require__(49951); +const initOtel = __nccwpck_require__(16049); + +function getCjsOnlyIntegrations() { + return commonjs.isCjs() ? [modules.modulesIntegration()] : []; +} + +/** + * Get default integrations, excluding performance. + */ +function getDefaultIntegrationsWithoutPerformance() { + return [ + // Common + core.inboundFiltersIntegration(), + core.functionToStringIntegration(), + core.linkedErrorsIntegration(), + core.requestDataIntegration(), + // Native Wrappers + console$1.consoleIntegration(), + index.httpIntegration(), + nodeFetch.nativeNodeFetchIntegration(), + // Global Handlers + onuncaughtexception.onUncaughtExceptionIntegration(), + onunhandledrejection.onUnhandledRejectionIntegration(), + // Event Info + contextlines.contextLinesIntegration(), + index$1.localVariablesIntegration(), + context.nodeContextIntegration(), + childProcess.childProcessIntegration(), + ...getCjsOnlyIntegrations(), + ]; +} + +/** Get the default integrations for the Node SDK. */ +function getDefaultIntegrations(options) { + return [ + ...getDefaultIntegrationsWithoutPerformance(), + // We only add performance integrations if tracing is enabled + // Note that this means that without tracing enabled, e.g. `expressIntegration()` will not be added + // This means that generally request isolation will work (because that is done by httpIntegration) + // But `transactionName` will not be set automatically + ...(shouldAddPerformanceIntegrations(options) ? index$2.getAutoPerformanceIntegrations() : []), + ]; +} + +function shouldAddPerformanceIntegrations(options) { + if (!core.hasTracingEnabled(options)) { + return false; + } + + // We want to ensure `tracesSampleRate` is not just undefined/null here + // eslint-disable-next-line deprecation/deprecation + return options.enableTracing || options.tracesSampleRate != null || 'tracesSampler' in options; +} + +/** + * Initialize Sentry for Node. + */ +function init(options = {}) { + return _init(options, getDefaultIntegrations); +} + +/** + * Initialize Sentry for Node, without any integrations added by default. + */ +function initWithoutDefaultIntegrations(options = {}) { + return _init(options, () => []); +} + +/** + * Initialize Sentry for Node, without performance instrumentation. + */ +function _init( + _options = {}, + getDefaultIntegrationsImpl, +) { + const options = getClientOptions(_options, getDefaultIntegrationsImpl); + + if (options.debug === true) { + if (debugBuild.DEBUG_BUILD) { + core.logger.enable(); + } else { + // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped + core.consoleSandbox(() => { + // eslint-disable-next-line no-console + console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.'); + }); + } + } + + if (!commonjs.isCjs() && options.registerEsmLoaderHooks !== false) { + initOtel.maybeInitializeEsmLoader(options.registerEsmLoaderHooks === true ? undefined : options.registerEsmLoaderHooks); + } + + opentelemetry.setOpenTelemetryContextAsyncContextStrategy(); + + const scope = core.getCurrentScope(); + scope.update(options.initialScope); + + if (options.spotlight && !options.integrations.some(({ name }) => name === spotlight.INTEGRATION_NAME)) { + options.integrations.push( + spotlight.spotlightIntegration({ + sidecarUrl: typeof options.spotlight === 'string' ? options.spotlight : undefined, + }), + ); + } + + const client$1 = new client.NodeClient(options); + // The client is on the current scope, from where it generally is inherited + core.getCurrentScope().setClient(client$1); + + client$1.init(); + + core.logger.log(`Running in ${commonjs.isCjs() ? 'CommonJS' : 'ESM'} mode.`); + + // TODO(V9): Remove this code since all of the logic should be in an integration + // eslint-disable-next-line deprecation/deprecation + if (options.autoSessionTracking) { + startSessionTracking(); + } + + client$1.startClientReportTracking(); + + updateScopeFromEnvVariables(); + + // If users opt-out of this, they _have_ to set up OpenTelemetry themselves + // There is no way to use this SDK without OpenTelemetry! + if (!options.skipOpenTelemetrySetup) { + initOtel.initOpenTelemetry(client$1, { + spanProcessors: options.openTelemetrySpanProcessors, + }); + validateOpenTelemetrySetup(); + } + + opentelemetry.enhanceDscWithOpenTelemetryRootSpanName(client$1); + opentelemetry.setupEventContextTrace(client$1); + + return client$1; +} + +/** + * Validate that your OpenTelemetry setup is correct. + */ +function validateOpenTelemetrySetup() { + if (!debugBuild.DEBUG_BUILD) { + return; + } + + const setup = opentelemetry.openTelemetrySetupCheck(); + + const required = ['SentryContextManager', 'SentryPropagator']; + + if (core.hasTracingEnabled()) { + required.push('SentrySpanProcessor'); + } + + for (const k of required) { + if (!setup.includes(k)) { + core.logger.error( + `You have to set up the ${k}. Without this, the OpenTelemetry & Sentry integration will not work properly.`, + ); + } + } + + if (!setup.includes('SentrySampler')) { + core.logger.warn( + 'You have to set up the SentrySampler. Without this, the OpenTelemetry & Sentry integration may still work, but sample rates set for the Sentry SDK will not be respected. If you use a custom sampler, make sure to use `wrapSamplingDecision`.', + ); + } +} + +function getClientOptions( + options, + getDefaultIntegrationsImpl, +) { + const release = getRelease(options.release); + + const autoSessionTracking = + typeof release !== 'string' + ? false + : // eslint-disable-next-line deprecation/deprecation + options.autoSessionTracking === undefined + ? true + : // eslint-disable-next-line deprecation/deprecation + options.autoSessionTracking; + + if (options.spotlight == null) { + const spotlightEnv = envToBool.envToBool(process.env.SENTRY_SPOTLIGHT, { strict: true }); + if (spotlightEnv == null) { + options.spotlight = process.env.SENTRY_SPOTLIGHT; + } else { + options.spotlight = spotlightEnv; + } + } + + const tracesSampleRate = getTracesSampleRate(options.tracesSampleRate); + + const baseOptions = core.dropUndefinedKeys({ + transport: http.makeNodeTransport, + dsn: process.env.SENTRY_DSN, + environment: process.env.SENTRY_ENVIRONMENT, + sendClientReports: true, + }); + + const overwriteOptions = core.dropUndefinedKeys({ + release, + autoSessionTracking, + tracesSampleRate, + }); + + const mergedOptions = { + ...baseOptions, + ...options, + ...overwriteOptions, + }; + + if (options.defaultIntegrations === undefined) { + options.defaultIntegrations = getDefaultIntegrationsImpl(mergedOptions); + } + + const clientOptions = { + ...mergedOptions, + stackParser: core.stackParserFromStackParserOptions(options.stackParser || api.defaultStackParser), + integrations: core.getIntegrationsToSetup({ + defaultIntegrations: options.defaultIntegrations, + integrations: options.integrations, + }), + }; + + return clientOptions; +} + +function getRelease(release) { + if (release !== undefined) { + return release; + } + + const detectedRelease = api.getSentryRelease(); + if (detectedRelease !== undefined) { + return detectedRelease; + } + + return undefined; +} + +function getTracesSampleRate(tracesSampleRate) { + if (tracesSampleRate !== undefined) { + return tracesSampleRate; + } + + const sampleRateFromEnv = process.env.SENTRY_TRACES_SAMPLE_RATE; + if (!sampleRateFromEnv) { + return undefined; + } + + const parsed = parseFloat(sampleRateFromEnv); + return isFinite(parsed) ? parsed : undefined; +} + +/** + * Update scope and propagation context based on environmental variables. + * + * See https://github.com/getsentry/rfcs/blob/main/text/0071-continue-trace-over-process-boundaries.md + * for more details. + */ +function updateScopeFromEnvVariables() { + if (envToBool.envToBool(process.env.SENTRY_USE_ENVIRONMENT) !== false) { + const sentryTraceEnv = process.env.SENTRY_TRACE; + const baggageEnv = process.env.SENTRY_BAGGAGE; + const propagationContext = core.propagationContextFromHeaders(sentryTraceEnv, baggageEnv); + core.getCurrentScope().setPropagationContext(propagationContext); + } +} + +/** + * Enable automatic Session Tracking for the node process. + */ +function startSessionTracking() { + const client = core.getClient(); + // eslint-disable-next-line deprecation/deprecation + if (client && client.getOptions().autoSessionTracking) { + client.initSessionFlusher(); + } + + core.startSession(); + + // Emitted in the case of healthy sessions, error of `mechanism.handled: true` and unhandledrejections because + // The 'beforeExit' event is not emitted for conditions causing explicit termination, + // such as calling process.exit() or uncaught exceptions. + // Ref: https://nodejs.org/api/process.html#process_event_beforeexit + process.on('beforeExit', () => { + const session = core.getIsolationScope().getSession(); + + // Only call endSession, if the Session exists on Scope and SessionStatus is not a + // Terminal Status i.e. Exited or Crashed because + // "When a session is moved away from ok it must not be updated anymore." + // Ref: https://develop.sentry.dev/sdk/sessions/ + if (session && session.status !== 'ok') { + core.endSession(); + } + }); +} + +exports.getDefaultIntegrations = getDefaultIntegrations; +exports.getDefaultIntegrationsWithoutPerformance = getDefaultIntegrationsWithoutPerformance; +exports.init = init; +exports.initWithoutDefaultIntegrations = initWithoutDefaultIntegrations; +exports.validateOpenTelemetrySetup = validateOpenTelemetrySetup; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 16049: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const moduleModule = __nccwpck_require__(98188); +const api = __nccwpck_require__(65163); +const resources = __nccwpck_require__(3871); +const sdkTraceBase = __nccwpck_require__(29253); +const semanticConventions = __nccwpck_require__(67275); +const core = __nccwpck_require__(84466); +const opentelemetry = __nccwpck_require__(78369); +const importInTheMiddle = __nccwpck_require__(36151); +const debugBuild = __nccwpck_require__(8421); +const index = __nccwpck_require__(59020); +const contextManager = __nccwpck_require__(37859); +const commonjs = __nccwpck_require__(38743); + +var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; +// About 277h - this must fit into new Array(len)! +const MAX_MAX_SPAN_WAIT_DURATION = 1000000; + +/** + * Initialize OpenTelemetry for Node. + */ +function initOpenTelemetry(client, options = {}) { + if (client.getOptions().debug) { + setupOpenTelemetryLogger(); + } + + const provider = setupOtel(client, options); + client.traceProvider = provider; +} + +function getRegisterOptions(esmHookConfig) { + // TODO(v9): Make onlyIncludeInstrumentedModules: true the default behavior. + if (_optionalChain([esmHookConfig, 'optionalAccess', _ => _.onlyIncludeInstrumentedModules])) { + const { addHookMessagePort } = importInTheMiddle.createAddHookMessageChannel(); + // If the user supplied include, we need to use that as a starting point or use an empty array to ensure no modules + // are wrapped if they are not hooked + // eslint-disable-next-line deprecation/deprecation + return { data: { addHookMessagePort, include: esmHookConfig.include || [] }, transferList: [addHookMessagePort] }; + } + + return { data: esmHookConfig }; +} + +/** Initialize the ESM loader. */ +function maybeInitializeEsmLoader(esmHookConfig) { + const [nodeMajor = 0, nodeMinor = 0] = process.versions.node.split('.').map(Number); + + // Register hook was added in v20.6.0 and v18.19.0 + if (nodeMajor >= 22 || (nodeMajor === 20 && nodeMinor >= 6) || (nodeMajor === 18 && nodeMinor >= 19)) { + // We need to work around using import.meta.url directly because jest complains about it. + const importMetaUrl = + typeof (typeof document === 'undefined' ? (__nccwpck_require__(57310).pathToFileURL)(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('sdk/initOtel.js', document.baseURI).href)) !== 'undefined' ? (typeof document === 'undefined' ? (__nccwpck_require__(57310).pathToFileURL)(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('sdk/initOtel.js', document.baseURI).href)) : undefined; + + if (!core.GLOBAL_OBJ._sentryEsmLoaderHookRegistered && importMetaUrl) { + try { + // @ts-expect-error register is available in these versions + moduleModule.default.register('import-in-the-middle/hook.mjs', importMetaUrl, getRegisterOptions(esmHookConfig)); + core.GLOBAL_OBJ._sentryEsmLoaderHookRegistered = true; + } catch (error) { + core.logger.warn('Failed to register ESM hook', error); + } + } + } else { + core.consoleSandbox(() => { + // eslint-disable-next-line no-console + console.warn( + '[Sentry] You are using Node.js in ESM mode ("import syntax"). The Sentry Node.js SDK is not compatible with ESM in Node.js versions before 18.19.0 or before 20.6.0. Please either build your application with CommonJS ("require() syntax"), or upgrade your Node.js version.', + ); + }); + } +} + +/** + * Preload OpenTelemetry for Node. + * This can be used to preload instrumentation early, but set up Sentry later. + * By preloading the OTEL instrumentation wrapping still happens early enough that everything works. + */ +function preloadOpenTelemetry(options = {}) { + const { debug } = options; + + if (debug) { + core.logger.enable(); + setupOpenTelemetryLogger(); + } + + if (!commonjs.isCjs()) { + maybeInitializeEsmLoader(options.registerEsmLoaderHooks); + } + + // These are all integrations that we need to pre-load to ensure they are set up before any other code runs + getPreloadMethods(options.integrations).forEach(fn => { + fn(); + + if (debug) { + core.logger.log(`[Sentry] Preloaded ${fn.id} instrumentation`); + } + }); +} + +function getPreloadMethods(integrationNames) { + const instruments = index.getOpenTelemetryInstrumentationToPreload(); + + if (!integrationNames) { + return instruments; + } + + return instruments.filter(instrumentation => integrationNames.includes(instrumentation.id)); +} + +/** Just exported for tests. */ +function setupOtel(client, options = {}) { + // Create and configure NodeTracerProvider + const provider = new sdkTraceBase.BasicTracerProvider({ + sampler: new opentelemetry.SentrySampler(client), + resource: new resources.Resource({ + [semanticConventions.ATTR_SERVICE_NAME]: 'node', + // eslint-disable-next-line deprecation/deprecation + [semanticConventions.SEMRESATTRS_SERVICE_NAMESPACE]: 'sentry', + [semanticConventions.ATTR_SERVICE_VERSION]: core.SDK_VERSION, + }), + forceFlushTimeoutMillis: 500, + spanProcessors: [ + new opentelemetry.SentrySpanProcessor({ + timeout: _clampSpanProcessorTimeout(client.getOptions().maxSpanWaitDuration), + }), + ...(options.spanProcessors || []), + ], + }); + + // Initialize the provider + provider.register({ + propagator: new opentelemetry.SentryPropagator(), + contextManager: new contextManager.SentryContextManager(), + }); + + return provider; +} + +/** Just exported for tests. */ +function _clampSpanProcessorTimeout(maxSpanWaitDuration) { + if (maxSpanWaitDuration == null) { + return undefined; + } + + // We guard for a max. value here, because we create an array with this length + // So if this value is too large, this would fail + if (maxSpanWaitDuration > MAX_MAX_SPAN_WAIT_DURATION) { + debugBuild.DEBUG_BUILD && + core.logger.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${MAX_MAX_SPAN_WAIT_DURATION}`); + return MAX_MAX_SPAN_WAIT_DURATION; + } else if (maxSpanWaitDuration <= 0 || Number.isNaN(maxSpanWaitDuration)) { + debugBuild.DEBUG_BUILD && core.logger.warn('`maxSpanWaitDuration` must be a positive number, using default value instead.'); + return undefined; + } + + return maxSpanWaitDuration; +} + +/** + * Setup the OTEL logger to use our own logger. + */ +function setupOpenTelemetryLogger() { + const otelLogger = new Proxy(core.logger , { + get(target, prop, receiver) { + const actualProp = prop === 'verbose' ? 'debug' : prop; + return Reflect.get(target, actualProp, receiver); + }, + }); + + // Disable diag, to ensure this works even if called multiple times + api.diag.disable(); + api.diag.setLogger(otelLogger, api.DiagLogLevel.DEBUG); +} + +exports._clampSpanProcessorTimeout = _clampSpanProcessorTimeout; +exports.initOpenTelemetry = initOpenTelemetry; +exports.maybeInitializeEsmLoader = maybeInitializeEsmLoader; +exports.preloadOpenTelemetry = preloadOpenTelemetry; +exports.setupOtel = setupOtel; +//# sourceMappingURL=initOtel.js.map + + +/***/ }), + +/***/ 73009: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _nullishCoalesce +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const http = __nccwpck_require__(88849); +const https = __nccwpck_require__(22286); +const node_stream = __nccwpck_require__(84492); +const node_zlib = __nccwpck_require__(65628); +const core = __nccwpck_require__(84466); +const index = __nccwpck_require__(62941); + +// Estimated maximum size for reasonable standalone event +const GZIP_THRESHOLD = 1024 * 32; + +/** + * Gets a stream from a Uint8Array or string + * Readable.from is ideal but was added in node.js v12.3.0 and v10.17.0 + */ +function streamFromBody(body) { + return new node_stream.Readable({ + read() { + this.push(body); + this.push(null); + }, + }); +} + +/** + * Creates a Transport that uses native the native 'http' and 'https' modules to send events to Sentry. + */ +function makeNodeTransport(options) { + let urlSegments; + + try { + urlSegments = new URL(options.url); + } catch (e) { + core.consoleSandbox(() => { + // eslint-disable-next-line no-console + console.warn( + '[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.', + ); + }); + return core.createTransport(options, () => Promise.resolve({})); + } + + const isHttps = urlSegments.protocol === 'https:'; + + // Proxy prioritization: http => `options.proxy` | `process.env.http_proxy` + // Proxy prioritization: https => `options.proxy` | `process.env.https_proxy` | `process.env.http_proxy` + const proxy = applyNoProxyOption( + urlSegments, + options.proxy || (isHttps ? process.env.https_proxy : undefined) || process.env.http_proxy, + ); + + const nativeHttpModule = isHttps ? https : http; + const keepAlive = options.keepAlive === undefined ? false : options.keepAlive; + + // TODO(v9): Evaluate if we can set keepAlive to true. This would involve testing for memory leaks in older node + // versions(>= 8) as they had memory leaks when using it: #2555 + const agent = proxy + ? (new index.HttpsProxyAgent(proxy) ) + : new nativeHttpModule.Agent({ keepAlive, maxSockets: 30, timeout: 2000 }); + + const requestExecutor = createRequestExecutor(options, _nullishCoalesce(options.httpModule, () => ( nativeHttpModule)), agent); + return core.createTransport(options, requestExecutor); +} + +/** + * Honors the `no_proxy` env variable with the highest priority to allow for hosts exclusion. + * + * @param transportUrl The URL the transport intends to send events to. + * @param proxy The client configured proxy. + * @returns A proxy the transport should use. + */ +function applyNoProxyOption(transportUrlSegments, proxy) { + const { no_proxy } = process.env; + + const urlIsExemptFromProxy = + no_proxy && + no_proxy + .split(',') + .some( + exemption => transportUrlSegments.host.endsWith(exemption) || transportUrlSegments.hostname.endsWith(exemption), + ); + + if (urlIsExemptFromProxy) { + return undefined; + } else { + return proxy; + } +} + +/** + * Creates a RequestExecutor to be used with `createTransport`. + */ +function createRequestExecutor( + options, + httpModule, + agent, +) { + const { hostname, pathname, port, protocol, search } = new URL(options.url); + return function makeRequest(request) { + return new Promise((resolve, reject) => { + // This ensures we do not generate any spans in OpenTelemetry for the transport + core.suppressTracing(() => { + let body = streamFromBody(request.body); + + const headers = { ...options.headers }; + + if (request.body.length > GZIP_THRESHOLD) { + headers['content-encoding'] = 'gzip'; + body = body.pipe(node_zlib.createGzip()); + } + + const req = httpModule.request( + { + method: 'POST', + agent, + headers, + hostname, + path: `${pathname}${search}`, + port, + protocol, + ca: options.caCerts, + }, + res => { + res.on('data', () => { + // Drain socket + }); + + res.on('end', () => { + // Drain socket + }); + + res.setEncoding('utf8'); + + // "Key-value pairs of header names and values. Header names are lower-cased." + // https://nodejs.org/api/http.html#http_message_headers + const retryAfterHeader = _nullishCoalesce(res.headers['retry-after'], () => ( null)); + const rateLimitsHeader = _nullishCoalesce(res.headers['x-sentry-rate-limits'], () => ( null)); + + resolve({ + statusCode: res.statusCode, + headers: { + 'retry-after': retryAfterHeader, + 'x-sentry-rate-limits': Array.isArray(rateLimitsHeader) + ? rateLimitsHeader[0] || null + : rateLimitsHeader, + }, + }); + }, + ); + + req.on('error', reject); + body.pipe(req); + }); + }); + }; +} + +exports.makeNodeTransport = makeNodeTransport; +//# sourceMappingURL=http.js.map + + +/***/ }), + +/***/ 37980: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const core = __nccwpck_require__(84466); + +/** Adds an origin to an OTEL Span. */ +function addOriginToSpan(span, origin) { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, origin); +} + +exports.addOriginToSpan = addOriginToSpan; +//# sourceMappingURL=addOriginToSpan.js.map + + +/***/ }), + +/***/ 38743: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/** Detect CommonJS. */ +function isCjs() { + return "function" !== 'undefined'; +} + +exports.isCjs = isCjs; +//# sourceMappingURL=commonjs.js.map + + +/***/ }), + +/***/ 60309: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const commonjs = __nccwpck_require__(38743); + +const createMissingInstrumentationContext = (pkg) => ({ + package: pkg, + 'javascript.is_cjs': commonjs.isCjs(), +}); + +exports.createMissingInstrumentationContext = createMissingInstrumentationContext; +//# sourceMappingURL=createMissingInstrumentationContext.js.map + + +/***/ }), + +/***/ 75915: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +let cachedDebuggerEnabled; + +/** + * Was the debugger enabled when this function was first called? + */ +async function isDebuggerEnabled() { + if (cachedDebuggerEnabled === undefined) { + try { + // Node can be built without inspector support + const inspector = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 85690, 23)); + cachedDebuggerEnabled = !!inspector.url(); + } catch (_) { + cachedDebuggerEnabled = false; + } + } + + return cachedDebuggerEnabled; +} + +exports.isDebuggerEnabled = isDebuggerEnabled; +//# sourceMappingURL=debug.js.map + + +/***/ }), + +/***/ 90556: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const core$1 = __nccwpck_require__(46033); +const core = __nccwpck_require__(84466); +const commonjs = __nccwpck_require__(38743); +const createMissingInstrumentationContext = __nccwpck_require__(60309); + +/** + * Checks and warns if a framework isn't wrapped by opentelemetry. + */ +function ensureIsWrapped( + maybeWrappedFunction, + name, +) { + const client = core.getClient(); + if ( + !_optionalChain([client, 'optionalAccess', _ => _.getOptions, 'call', _2 => _2(), 'access', _3 => _3.disableInstrumentationWarnings]) && + !core$1.isWrapped(maybeWrappedFunction) && + core.isEnabled() && + core.hasTracingEnabled() + ) { + core.consoleSandbox(() => { + if (commonjs.isCjs()) { + // eslint-disable-next-line no-console + console.warn( + `[Sentry] ${name} is not instrumented. This is likely because you required/imported ${name} before calling \`Sentry.init()\`.`, + ); + } else { + // eslint-disable-next-line no-console + console.warn( + `[Sentry] ${name} is not instrumented. Please make sure to initialize Sentry in a separate file that you \`--import\` when running node, see: https://docs.sentry.io/platforms/javascript/guides/${name}/install/esm/.`, + ); + } + }); + + core.getGlobalScope().setContext('missing_instrumentation', createMissingInstrumentationContext.createMissingInstrumentationContext(name)); + } +} + +exports.ensureIsWrapped = ensureIsWrapped; +//# sourceMappingURL=ensureIsWrapped.js.map + + +/***/ }), + +/***/ 5606: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const FALSY_ENV_VALUES = new Set(['false', 'f', 'n', 'no', 'off', '0']); +const TRUTHY_ENV_VALUES = new Set(['true', 't', 'y', 'yes', 'on', '1']); + +/** + * A helper function which casts an ENV variable value to `true` or `false` using the constants defined above. + * In strict mode, it may return `null` if the value doesn't match any of the predefined values. + * + * @param value The value of the env variable + * @param options -- Only has `strict` key for now, which requires a strict match for `true` in TRUTHY_ENV_VALUES + * @returns true/false if the lowercase value matches the predefined values above. If not, null in strict mode, + * and Boolean(value) in loose mode. + */ +function envToBool(value, options) { + const normalized = String(value).toLowerCase(); + + if (FALSY_ENV_VALUES.has(normalized)) { + return false; + } + + if (TRUTHY_ENV_VALUES.has(normalized)) { + return true; + } + + return options && options.strict ? null : Boolean(value); +} + +exports.FALSY_ENV_VALUES = FALSY_ENV_VALUES; +exports.TRUTHY_ENV_VALUES = TRUTHY_ENV_VALUES; +exports.envToBool = envToBool; +//# sourceMappingURL=envToBool.js.map + + +/***/ }), + +/***/ 73380: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(8421); + +const DEFAULT_SHUTDOWN_TIMEOUT = 2000; + +/** + * @hidden + */ +function logAndExitProcess(error) { + core.consoleSandbox(() => { + // eslint-disable-next-line no-console + console.error(error); + }); + + const client = core.getClient(); + + if (client === undefined) { + debugBuild.DEBUG_BUILD && core.logger.warn('No NodeClient was defined, we are exiting the process now.'); + global.process.exit(1); + return; + } + + const options = client.getOptions(); + const timeout = + (options && options.shutdownTimeout && options.shutdownTimeout > 0 && options.shutdownTimeout) || + DEFAULT_SHUTDOWN_TIMEOUT; + client.close(timeout).then( + (result) => { + if (!result) { + debugBuild.DEBUG_BUILD && core.logger.warn('We reached the timeout for emptying the request buffer, still exiting now!'); + } + global.process.exit(1); + }, + error => { + debugBuild.DEBUG_BUILD && core.logger.error(error); + }, + ); +} + +exports.logAndExitProcess = logAndExitProcess; +//# sourceMappingURL=errorhandling.js.map + + +/***/ }), + +/***/ 35126: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/** Build a full URL from request options. */ +function getRequestUrl(requestOptions) { + const protocol = requestOptions.protocol || ''; + const hostname = requestOptions.hostname || requestOptions.host || ''; + // Don't log standard :80 (http) and :443 (https) ports to reduce the noise + // Also don't add port if the hostname already includes a port + const port = + !requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 || /^(.*):(\d+)$/.test(hostname) + ? '' + : `:${requestOptions.port}`; + const path = requestOptions.path ? requestOptions.path : '/'; + return `${protocol}//${hostname}${port}${path}`; +} + +exports.getRequestUrl = getRequestUrl; +//# sourceMappingURL=getRequestUrl.js.map + + +/***/ }), + +/***/ 64177: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const node_path = __nccwpck_require__(49411); +const core = __nccwpck_require__(84466); + +/** normalizes Windows paths */ +function normalizeWindowsPath(path) { + return path + .replace(/^[A-Z]:/, '') // remove Windows-style prefix + .replace(/\\/g, '/'); // replace all `\` instances with `/` +} + +/** Creates a function that gets the module name from a filename */ +function createGetModuleFromFilename( + basePath = process.argv[1] ? core.dirname(process.argv[1]) : process.cwd(), + isWindows = node_path.sep === '\\', +) { + const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath; + + return (filename) => { + if (!filename) { + return; + } + + const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename; + + // eslint-disable-next-line prefer-const + let { dir, base: file, ext } = node_path.posix.parse(normalizedFilename); + + if (ext === '.js' || ext === '.mjs' || ext === '.cjs') { + file = file.slice(0, ext.length * -1); + } + + // The file name might be URI-encoded which we want to decode to + // the original file name. + const decodedFile = decodeURIComponent(file); + + if (!dir) { + // No dirname whatsoever + dir = '.'; + } + + const n = dir.lastIndexOf('/node_modules'); + if (n > -1) { + return `${dir.slice(n + 14).replace(/\//g, '.')}:${decodedFile}`; + } + + // Let's see if it's a part of the main module + // To be a part of main module, it has to share the same base + if (dir.startsWith(normalizedBase)) { + const moduleName = dir.slice(normalizedBase.length + 1).replace(/\//g, '.'); + return moduleName ? `${moduleName}:${decodedFile}` : decodedFile; + } + + return decodedFile; + }; +} + +exports.createGetModuleFromFilename = createGetModuleFromFilename; +//# sourceMappingURL=module.js.map + + +/***/ }), + +/***/ 94795: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const SINGLE_ARG_COMMANDS = ['get', 'set', 'setex']; + +const GET_COMMANDS = ['get', 'mget']; +const SET_COMMANDS = ['set', 'setex']; +// todo: del, expire + +/** Checks if a given command is in the list of redis commands. + * Useful because commands can come in lowercase or uppercase (depending on the library). */ +function isInCommands(redisCommands, command) { + return redisCommands.includes(command.toLowerCase()); +} + +/** Determine cache operation based on redis statement */ +function getCacheOperation( + command, +) { + if (isInCommands(GET_COMMANDS, command)) { + return 'cache.get'; + } else if (isInCommands(SET_COMMANDS, command)) { + return 'cache.put'; + } else { + return undefined; + } +} + +function keyHasPrefix(key, prefixes) { + return prefixes.some(prefix => key.startsWith(prefix)); +} + +/** Safely converts a redis key to a string (comma-separated if there are multiple keys) */ +function getCacheKeySafely(redisCommand, cmdArgs) { + try { + if (cmdArgs.length === 0) { + return undefined; + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const processArg = (arg) => { + if (typeof arg === 'string' || typeof arg === 'number' || Buffer.isBuffer(arg)) { + return [arg.toString()]; + } else if (Array.isArray(arg)) { + return flatten(arg.map(arg => processArg(arg))); + } else { + return ['']; + } + }; + + const firstArg = cmdArgs[0]; + if (isInCommands(SINGLE_ARG_COMMANDS, redisCommand) && firstArg != null) { + return processArg(firstArg); + } + + return flatten(cmdArgs.map(arg => processArg(arg))); + } catch (e) { + return undefined; + } +} + +/** Determines whether a redis operation should be considered as "cache operation" by checking if a key is prefixed. + * We only support certain commands (such as 'set', 'get', 'mget'). */ +function shouldConsiderForCache(redisCommand, keys, prefixes) { + if (!getCacheOperation(redisCommand)) { + return false; + } + + for (const key of keys) { + if (keyHasPrefix(key, prefixes)) { + return true; + } + } + return false; +} + +/** Calculates size based on the cache response value */ +function calculateCacheItemSize(response) { + const getSize = (value) => { + try { + if (Buffer.isBuffer(value)) return value.byteLength; + else if (typeof value === 'string') return value.length; + else if (typeof value === 'number') return value.toString().length; + else if (value === null || value === undefined) return 0; + return JSON.stringify(value).length; + } catch (e) { + return undefined; + } + }; + + return Array.isArray(response) + ? response.reduce((acc, curr) => { + const size = getSize(curr); + return typeof size === 'number' ? (acc !== undefined ? acc + size : size) : acc; + }, 0) + : getSize(response); +} + +// TODO(v9): This is inlined from core so we can deprecate `flatten`. +// It's usage can be replaced with `Array.flat` in v9. + +function flatten(input) { + const result = []; + + const flattenHelper = (input) => { + input.forEach((el) => { + if (Array.isArray(el)) { + flattenHelper(el ); + } else { + result.push(el ); + } + }); + }; + + flattenHelper(input); + return result; +} + +exports.GET_COMMANDS = GET_COMMANDS; +exports.SET_COMMANDS = SET_COMMANDS; +exports.calculateCacheItemSize = calculateCacheItemSize; +exports.getCacheKeySafely = getCacheKeySafely; +exports.getCacheOperation = getCacheOperation; +exports.isInCommands = isInCommands; +exports.shouldConsiderForCache = shouldConsiderForCache; +//# sourceMappingURL=redisCache.js.map + + +/***/ }), + +/***/ 59084: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ExportResultCode = void 0; +var ExportResultCode; +(function (ExportResultCode) { + ExportResultCode[ExportResultCode["SUCCESS"] = 0] = "SUCCESS"; + ExportResultCode[ExportResultCode["FAILED"] = 1] = "FAILED"; +})(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {})); +//# sourceMappingURL=ExportResult.js.map + +/***/ }), + +/***/ 52356: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = void 0; +exports.BAGGAGE_KEY_PAIR_SEPARATOR = '='; +exports.BAGGAGE_PROPERTIES_SEPARATOR = ';'; +exports.BAGGAGE_ITEMS_SEPARATOR = ','; +// Name of the http header used to propagate the baggage +exports.BAGGAGE_HEADER = 'baggage'; +// Maximum number of name-value pairs allowed by w3c spec +exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; +// Maximum number of bytes per a single name-value pair allowed by w3c spec +exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; +// Maximum total length of all name-value pairs allowed by w3c spec +exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; +//# sourceMappingURL=constants.js.map + +/***/ }), + +/***/ 73116: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.W3CBaggagePropagator = void 0; +const api_1 = __nccwpck_require__(65163); +const suppress_tracing_1 = __nccwpck_require__(65489); +const constants_1 = __nccwpck_require__(52356); +const utils_1 = __nccwpck_require__(96634); +/** + * Propagates {@link Baggage} through Context format propagation. + * + * Based on the Baggage specification: + * https://w3c.github.io/baggage/ + */ +class W3CBaggagePropagator { + inject(context, carrier, setter) { + const baggage = api_1.propagation.getBaggage(context); + if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context)) + return; + const keyPairs = (0, utils_1.getKeyPairs)(baggage) + .filter((pair) => { + return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; + }) + .slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); + const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); + if (headerValue.length > 0) { + setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); + } + } + extract(context, carrier, getter) { + const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); + const baggageString = Array.isArray(headerValue) + ? headerValue.join(constants_1.BAGGAGE_ITEMS_SEPARATOR) + : headerValue; + if (!baggageString) + return context; + const baggage = {}; + if (baggageString.length === 0) { + return context; + } + const pairs = baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR); + pairs.forEach(entry => { + const keyPair = (0, utils_1.parsePairKeyValue)(entry); + if (keyPair) { + const baggageEntry = { value: keyPair.value }; + if (keyPair.metadata) { + baggageEntry.metadata = keyPair.metadata; + } + baggage[keyPair.key] = baggageEntry; + } + }); + if (Object.entries(baggage).length === 0) { + return context; + } + return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage)); + } + fields() { + return [constants_1.BAGGAGE_HEADER]; + } +} +exports.W3CBaggagePropagator = W3CBaggagePropagator; +//# sourceMappingURL=W3CBaggagePropagator.js.map + +/***/ }), + +/***/ 96634: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const api_1 = __nccwpck_require__(65163); +const constants_1 = __nccwpck_require__(52356); +function serializeKeyPairs(keyPairs) { + return keyPairs.reduce((hValue, current) => { + const value = `${hValue}${hValue !== '' ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ''}${current}`; + return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value; + }, ''); +} +exports.serializeKeyPairs = serializeKeyPairs; +function getKeyPairs(baggage) { + return baggage.getAllEntries().map(([key, value]) => { + let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`; + // include opaque metadata if provided + // NOTE: we intentionally don't URI-encode the metadata - that responsibility falls on the metadata implementation + if (value.metadata !== undefined) { + entry += constants_1.BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString(); + } + return entry; + }); +} +exports.getKeyPairs = getKeyPairs; +function parsePairKeyValue(entry) { + const valueProps = entry.split(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); + if (valueProps.length <= 0) + return; + const keyPairPart = valueProps.shift(); + if (!keyPairPart) + return; + const separatorIndex = keyPairPart.indexOf(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); + if (separatorIndex <= 0) + return; + const key = decodeURIComponent(keyPairPart.substring(0, separatorIndex).trim()); + const value = decodeURIComponent(keyPairPart.substring(separatorIndex + 1).trim()); + let metadata; + if (valueProps.length > 0) { + metadata = (0, api_1.baggageEntryMetadataFromString)(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR)); + } + return { key, value, metadata }; +} +exports.parsePairKeyValue = parsePairKeyValue; +/** + * Parse a string serialized in the baggage HTTP Format (without metadata): + * https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT.md + */ +function parseKeyPairsIntoRecord(value) { + if (typeof value !== 'string' || value.length === 0) + return {}; + return value + .split(constants_1.BAGGAGE_ITEMS_SEPARATOR) + .map(entry => { + return parsePairKeyValue(entry); + }) + .filter(keyPair => keyPair !== undefined && keyPair.value.length > 0) + .reduce((headers, keyPair) => { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + headers[keyPair.key] = keyPair.value; + return headers; + }, {}); +} +exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 14164: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AnchoredClock = void 0; +/** + * A utility for returning wall times anchored to a given point in time. Wall time measurements will + * not be taken from the system, but instead are computed by adding a monotonic clock time + * to the anchor point. + * + * This is needed because the system time can change and result in unexpected situations like + * spans ending before they are started. Creating an anchored clock for each local root span + * ensures that span timings and durations are accurate while preventing span times from drifting + * too far from the system clock. + * + * Only creating an anchored clock once per local trace ensures span times are correct relative + * to each other. For example, a child span will never have a start time before its parent even + * if the system clock is corrected during the local trace. + * + * Heavily inspired by the OTel Java anchored clock + * https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/AnchoredClock.java + */ +class AnchoredClock { + /** + * Create a new AnchoredClock anchored to the current time returned by systemClock. + * + * @param systemClock should be a clock that returns the number of milliseconds since January 1 1970 such as Date + * @param monotonicClock should be a clock that counts milliseconds monotonically such as window.performance or perf_hooks.performance + */ + constructor(systemClock, monotonicClock) { + this._monotonicClock = monotonicClock; + this._epochMillis = systemClock.now(); + this._performanceMillis = monotonicClock.now(); + } + /** + * Returns the current time by adding the number of milliseconds since the + * AnchoredClock was created to the creation epoch time + */ + now() { + const delta = this._monotonicClock.now() - this._performanceMillis; + return this._epochMillis + delta; + } +} +exports.AnchoredClock = AnchoredClock; +//# sourceMappingURL=anchored-clock.js.map + +/***/ }), + +/***/ 44414: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = void 0; +const api_1 = __nccwpck_require__(65163); +function sanitizeAttributes(attributes) { + const out = {}; + if (typeof attributes !== 'object' || attributes == null) { + return out; + } + for (const [key, val] of Object.entries(attributes)) { + if (!isAttributeKey(key)) { + api_1.diag.warn(`Invalid attribute key: ${key}`); + continue; + } + if (!isAttributeValue(val)) { + api_1.diag.warn(`Invalid attribute value set for key: ${key}`); + continue; + } + if (Array.isArray(val)) { + out[key] = val.slice(); + } + else { + out[key] = val; + } + } + return out; +} +exports.sanitizeAttributes = sanitizeAttributes; +function isAttributeKey(key) { + return typeof key === 'string' && key.length > 0; +} +exports.isAttributeKey = isAttributeKey; +function isAttributeValue(val) { + if (val == null) { + return true; + } + if (Array.isArray(val)) { + return isHomogeneousAttributeValueArray(val); + } + return isValidPrimitiveAttributeValue(val); +} +exports.isAttributeValue = isAttributeValue; +function isHomogeneousAttributeValueArray(arr) { + let type; + for (const element of arr) { + // null/undefined elements are allowed + if (element == null) + continue; + if (!type) { + if (isValidPrimitiveAttributeValue(element)) { + type = typeof element; + continue; + } + // encountered an invalid primitive + return false; + } + if (typeof element === type) { + continue; + } + return false; + } + return true; +} +function isValidPrimitiveAttributeValue(val) { + switch (typeof val) { + case 'number': + case 'boolean': + case 'string': + return true; + } + return false; +} +//# sourceMappingURL=attributes.js.map + +/***/ }), + +/***/ 82498: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.globalErrorHandler = exports.setGlobalErrorHandler = void 0; +const logging_error_handler_1 = __nccwpck_require__(22191); +/** The global error handler delegate */ +let delegateHandler = (0, logging_error_handler_1.loggingErrorHandler)(); +/** + * Set the global error handler + * @param {ErrorHandler} handler + */ +function setGlobalErrorHandler(handler) { + delegateHandler = handler; +} +exports.setGlobalErrorHandler = setGlobalErrorHandler; +/** + * Return the global error handler + * @param {Exception} ex + */ +function globalErrorHandler(ex) { + try { + delegateHandler(ex); + } + catch (_a) { } // eslint-disable-line no-empty +} +exports.globalErrorHandler = globalErrorHandler; +//# sourceMappingURL=global-error-handler.js.map + +/***/ }), + +/***/ 12409: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.hexToBinary = void 0; +function intValue(charCode) { + // 0-9 + if (charCode >= 48 && charCode <= 57) { + return charCode - 48; + } + // a-f + if (charCode >= 97 && charCode <= 102) { + return charCode - 87; + } + // A-F + return charCode - 55; +} +function hexToBinary(hexStr) { + const buf = new Uint8Array(hexStr.length / 2); + let offset = 0; + for (let i = 0; i < hexStr.length; i += 2) { + const hi = intValue(hexStr.charCodeAt(i)); + const lo = intValue(hexStr.charCodeAt(i + 1)); + buf[offset++] = (hi << 4) | lo; + } + return buf; +} +exports.hexToBinary = hexToBinary; +//# sourceMappingURL=hex-to-binary.js.map + +/***/ }), + +/***/ 22191: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.loggingErrorHandler = void 0; +const api_1 = __nccwpck_require__(65163); +/** + * Returns a function that logs an error using the provided logger, or a + * console logger if one was not provided. + */ +function loggingErrorHandler() { + return (ex) => { + api_1.diag.error(stringifyException(ex)); + }; +} +exports.loggingErrorHandler = loggingErrorHandler; +/** + * Converts an exception into a string representation + * @param {Exception} ex + */ +function stringifyException(ex) { + if (typeof ex === 'string') { + return ex; + } + else { + return JSON.stringify(flattenException(ex)); + } +} +/** + * Flattens an exception into key-value pairs by traversing the prototype chain + * and coercing values to strings. Duplicate properties will not be overwritten; + * the first insert wins. + */ +function flattenException(ex) { + const result = {}; + let current = ex; + while (current !== null) { + Object.getOwnPropertyNames(current).forEach(propertyName => { + if (result[propertyName]) + return; + const value = current[propertyName]; + if (value) { + result[propertyName] = String(value); + } + }); + current = Object.getPrototypeOf(current); + } + return result; +} +//# sourceMappingURL=logging-error-handler.js.map + +/***/ }), + +/***/ 15699: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.addHrTimes = exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = exports.getTimeOrigin = exports.millisToHrTime = void 0; +const platform_1 = __nccwpck_require__(64237); +const NANOSECOND_DIGITS = 9; +const NANOSECOND_DIGITS_IN_MILLIS = 6; +const MILLISECONDS_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS); +const SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); +/** + * Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]). + * @param epochMillis + */ +function millisToHrTime(epochMillis) { + const epochSeconds = epochMillis / 1000; + // Decimals only. + const seconds = Math.trunc(epochSeconds); + // Round sub-nanosecond accuracy to nanosecond. + const nanos = Math.round((epochMillis % 1000) * MILLISECONDS_TO_NANOSECONDS); + return [seconds, nanos]; +} +exports.millisToHrTime = millisToHrTime; +function getTimeOrigin() { + let timeOrigin = platform_1.otperformance.timeOrigin; + if (typeof timeOrigin !== 'number') { + const perf = platform_1.otperformance; + timeOrigin = perf.timing && perf.timing.fetchStart; + } + return timeOrigin; +} +exports.getTimeOrigin = getTimeOrigin; +/** + * Returns an hrtime calculated via performance component. + * @param performanceNow + */ +function hrTime(performanceNow) { + const timeOrigin = millisToHrTime(getTimeOrigin()); + const now = millisToHrTime(typeof performanceNow === 'number' ? performanceNow : platform_1.otperformance.now()); + return addHrTimes(timeOrigin, now); +} +exports.hrTime = hrTime; +/** + * + * Converts a TimeInput to an HrTime, defaults to _hrtime(). + * @param time + */ +function timeInputToHrTime(time) { + // process.hrtime + if (isTimeInputHrTime(time)) { + return time; + } + else if (typeof time === 'number') { + // Must be a performance.now() if it's smaller than process start time. + if (time < getTimeOrigin()) { + return hrTime(time); + } + else { + // epoch milliseconds or performance.timeOrigin + return millisToHrTime(time); + } + } + else if (time instanceof Date) { + return millisToHrTime(time.getTime()); + } + else { + throw TypeError('Invalid input type'); + } +} +exports.timeInputToHrTime = timeInputToHrTime; +/** + * Returns a duration of two hrTime. + * @param startTime + * @param endTime + */ +function hrTimeDuration(startTime, endTime) { + let seconds = endTime[0] - startTime[0]; + let nanos = endTime[1] - startTime[1]; + // overflow + if (nanos < 0) { + seconds -= 1; + // negate + nanos += SECOND_TO_NANOSECONDS; + } + return [seconds, nanos]; +} +exports.hrTimeDuration = hrTimeDuration; +/** + * Convert hrTime to timestamp, for example "2019-05-14T17:00:00.000123456Z" + * @param time + */ +function hrTimeToTimeStamp(time) { + const precision = NANOSECOND_DIGITS; + const tmp = `${'0'.repeat(precision)}${time[1]}Z`; + const nanoString = tmp.substring(tmp.length - precision - 1); + const date = new Date(time[0] * 1000).toISOString(); + return date.replace('000Z', nanoString); +} +exports.hrTimeToTimeStamp = hrTimeToTimeStamp; +/** + * Convert hrTime to nanoseconds. + * @param time + */ +function hrTimeToNanoseconds(time) { + return time[0] * SECOND_TO_NANOSECONDS + time[1]; +} +exports.hrTimeToNanoseconds = hrTimeToNanoseconds; +/** + * Convert hrTime to milliseconds. + * @param time + */ +function hrTimeToMilliseconds(time) { + return time[0] * 1e3 + time[1] / 1e6; +} +exports.hrTimeToMilliseconds = hrTimeToMilliseconds; +/** + * Convert hrTime to microseconds. + * @param time + */ +function hrTimeToMicroseconds(time) { + return time[0] * 1e6 + time[1] / 1e3; +} +exports.hrTimeToMicroseconds = hrTimeToMicroseconds; +/** + * check if time is HrTime + * @param value + */ +function isTimeInputHrTime(value) { + return (Array.isArray(value) && + value.length === 2 && + typeof value[0] === 'number' && + typeof value[1] === 'number'); +} +exports.isTimeInputHrTime = isTimeInputHrTime; +/** + * check if input value is a correct types.TimeInput + * @param value + */ +function isTimeInput(value) { + return (isTimeInputHrTime(value) || + typeof value === 'number' || + value instanceof Date); +} +exports.isTimeInput = isTimeInput; +/** + * Given 2 HrTime formatted times, return their sum as an HrTime. + */ +function addHrTimes(time1, time2) { + const out = [time1[0] + time2[0], time1[1] + time2[1]]; + // Nanoseconds + if (out[1] >= SECOND_TO_NANOSECONDS) { + out[1] -= SECOND_TO_NANOSECONDS; + out[0] += 1; + } + return out; +} +exports.addHrTimes = addHrTimes; +//# sourceMappingURL=time.js.map + +/***/ }), + +/***/ 46033: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.unrefTimer = exports.otperformance = exports.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = exports.baggageUtils = exports.ExportResultCode = exports.hexToBinary = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.isAttributeKey = exports.AnchoredClock = exports.W3CBaggagePropagator = void 0; +exports.internal = exports.VERSION = exports.BindOnceFuture = exports.isWrapped = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.TracesSamplerValues = exports.merge = exports.parseEnvironment = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ENVIRONMENT = void 0; +var W3CBaggagePropagator_1 = __nccwpck_require__(73116); +Object.defineProperty(exports, "W3CBaggagePropagator", ({ enumerable: true, get: function () { return W3CBaggagePropagator_1.W3CBaggagePropagator; } })); +var anchored_clock_1 = __nccwpck_require__(14164); +Object.defineProperty(exports, "AnchoredClock", ({ enumerable: true, get: function () { return anchored_clock_1.AnchoredClock; } })); +var attributes_1 = __nccwpck_require__(44414); +Object.defineProperty(exports, "isAttributeKey", ({ enumerable: true, get: function () { return attributes_1.isAttributeKey; } })); +Object.defineProperty(exports, "isAttributeValue", ({ enumerable: true, get: function () { return attributes_1.isAttributeValue; } })); +Object.defineProperty(exports, "sanitizeAttributes", ({ enumerable: true, get: function () { return attributes_1.sanitizeAttributes; } })); +var global_error_handler_1 = __nccwpck_require__(82498); +Object.defineProperty(exports, "globalErrorHandler", ({ enumerable: true, get: function () { return global_error_handler_1.globalErrorHandler; } })); +Object.defineProperty(exports, "setGlobalErrorHandler", ({ enumerable: true, get: function () { return global_error_handler_1.setGlobalErrorHandler; } })); +var logging_error_handler_1 = __nccwpck_require__(22191); +Object.defineProperty(exports, "loggingErrorHandler", ({ enumerable: true, get: function () { return logging_error_handler_1.loggingErrorHandler; } })); +var time_1 = __nccwpck_require__(15699); +Object.defineProperty(exports, "addHrTimes", ({ enumerable: true, get: function () { return time_1.addHrTimes; } })); +Object.defineProperty(exports, "getTimeOrigin", ({ enumerable: true, get: function () { return time_1.getTimeOrigin; } })); +Object.defineProperty(exports, "hrTime", ({ enumerable: true, get: function () { return time_1.hrTime; } })); +Object.defineProperty(exports, "hrTimeDuration", ({ enumerable: true, get: function () { return time_1.hrTimeDuration; } })); +Object.defineProperty(exports, "hrTimeToMicroseconds", ({ enumerable: true, get: function () { return time_1.hrTimeToMicroseconds; } })); +Object.defineProperty(exports, "hrTimeToMilliseconds", ({ enumerable: true, get: function () { return time_1.hrTimeToMilliseconds; } })); +Object.defineProperty(exports, "hrTimeToNanoseconds", ({ enumerable: true, get: function () { return time_1.hrTimeToNanoseconds; } })); +Object.defineProperty(exports, "hrTimeToTimeStamp", ({ enumerable: true, get: function () { return time_1.hrTimeToTimeStamp; } })); +Object.defineProperty(exports, "isTimeInput", ({ enumerable: true, get: function () { return time_1.isTimeInput; } })); +Object.defineProperty(exports, "isTimeInputHrTime", ({ enumerable: true, get: function () { return time_1.isTimeInputHrTime; } })); +Object.defineProperty(exports, "millisToHrTime", ({ enumerable: true, get: function () { return time_1.millisToHrTime; } })); +Object.defineProperty(exports, "timeInputToHrTime", ({ enumerable: true, get: function () { return time_1.timeInputToHrTime; } })); +var hex_to_binary_1 = __nccwpck_require__(12409); +Object.defineProperty(exports, "hexToBinary", ({ enumerable: true, get: function () { return hex_to_binary_1.hexToBinary; } })); +var ExportResult_1 = __nccwpck_require__(59084); +Object.defineProperty(exports, "ExportResultCode", ({ enumerable: true, get: function () { return ExportResult_1.ExportResultCode; } })); +const utils_1 = __nccwpck_require__(96634); +exports.baggageUtils = { + getKeyPairs: utils_1.getKeyPairs, + serializeKeyPairs: utils_1.serializeKeyPairs, + parseKeyPairsIntoRecord: utils_1.parseKeyPairsIntoRecord, + parsePairKeyValue: utils_1.parsePairKeyValue, +}; +var platform_1 = __nccwpck_require__(64237); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return platform_1.RandomIdGenerator; } })); +Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return platform_1.SDK_INFO; } })); +Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return platform_1._globalThis; } })); +Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return platform_1.getEnv; } })); +Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return platform_1.getEnvWithoutDefaults; } })); +Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return platform_1.hexToBase64; } })); +Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return platform_1.otperformance; } })); +Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return platform_1.unrefTimer; } })); +var composite_1 = __nccwpck_require__(27514); +Object.defineProperty(exports, "CompositePropagator", ({ enumerable: true, get: function () { return composite_1.CompositePropagator; } })); +var W3CTraceContextPropagator_1 = __nccwpck_require__(45146); +Object.defineProperty(exports, "TRACE_PARENT_HEADER", ({ enumerable: true, get: function () { return W3CTraceContextPropagator_1.TRACE_PARENT_HEADER; } })); +Object.defineProperty(exports, "TRACE_STATE_HEADER", ({ enumerable: true, get: function () { return W3CTraceContextPropagator_1.TRACE_STATE_HEADER; } })); +Object.defineProperty(exports, "W3CTraceContextPropagator", ({ enumerable: true, get: function () { return W3CTraceContextPropagator_1.W3CTraceContextPropagator; } })); +Object.defineProperty(exports, "parseTraceParent", ({ enumerable: true, get: function () { return W3CTraceContextPropagator_1.parseTraceParent; } })); +var rpc_metadata_1 = __nccwpck_require__(28981); +Object.defineProperty(exports, "RPCType", ({ enumerable: true, get: function () { return rpc_metadata_1.RPCType; } })); +Object.defineProperty(exports, "deleteRPCMetadata", ({ enumerable: true, get: function () { return rpc_metadata_1.deleteRPCMetadata; } })); +Object.defineProperty(exports, "getRPCMetadata", ({ enumerable: true, get: function () { return rpc_metadata_1.getRPCMetadata; } })); +Object.defineProperty(exports, "setRPCMetadata", ({ enumerable: true, get: function () { return rpc_metadata_1.setRPCMetadata; } })); +var AlwaysOffSampler_1 = __nccwpck_require__(70416); +Object.defineProperty(exports, "AlwaysOffSampler", ({ enumerable: true, get: function () { return AlwaysOffSampler_1.AlwaysOffSampler; } })); +var AlwaysOnSampler_1 = __nccwpck_require__(58338); +Object.defineProperty(exports, "AlwaysOnSampler", ({ enumerable: true, get: function () { return AlwaysOnSampler_1.AlwaysOnSampler; } })); +var ParentBasedSampler_1 = __nccwpck_require__(96631); +Object.defineProperty(exports, "ParentBasedSampler", ({ enumerable: true, get: function () { return ParentBasedSampler_1.ParentBasedSampler; } })); +var TraceIdRatioBasedSampler_1 = __nccwpck_require__(68339); +Object.defineProperty(exports, "TraceIdRatioBasedSampler", ({ enumerable: true, get: function () { return TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler; } })); +var suppress_tracing_1 = __nccwpck_require__(65489); +Object.defineProperty(exports, "isTracingSuppressed", ({ enumerable: true, get: function () { return suppress_tracing_1.isTracingSuppressed; } })); +Object.defineProperty(exports, "suppressTracing", ({ enumerable: true, get: function () { return suppress_tracing_1.suppressTracing; } })); +Object.defineProperty(exports, "unsuppressTracing", ({ enumerable: true, get: function () { return suppress_tracing_1.unsuppressTracing; } })); +var TraceState_1 = __nccwpck_require__(97990); +Object.defineProperty(exports, "TraceState", ({ enumerable: true, get: function () { return TraceState_1.TraceState; } })); +var environment_1 = __nccwpck_require__(51763); +Object.defineProperty(exports, "DEFAULT_ATTRIBUTE_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ATTRIBUTE_COUNT_LIMIT; } })); +Object.defineProperty(exports, "DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; } })); +Object.defineProperty(exports, "DEFAULT_ENVIRONMENT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ENVIRONMENT; } })); +Object.defineProperty(exports, "DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT; } })); +Object.defineProperty(exports, "DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT; } })); +Object.defineProperty(exports, "parseEnvironment", ({ enumerable: true, get: function () { return environment_1.parseEnvironment; } })); +var merge_1 = __nccwpck_require__(5715); +Object.defineProperty(exports, "merge", ({ enumerable: true, get: function () { return merge_1.merge; } })); +var sampling_1 = __nccwpck_require__(60343); +Object.defineProperty(exports, "TracesSamplerValues", ({ enumerable: true, get: function () { return sampling_1.TracesSamplerValues; } })); +var timeout_1 = __nccwpck_require__(86560); +Object.defineProperty(exports, "TimeoutError", ({ enumerable: true, get: function () { return timeout_1.TimeoutError; } })); +Object.defineProperty(exports, "callWithTimeout", ({ enumerable: true, get: function () { return timeout_1.callWithTimeout; } })); +var url_1 = __nccwpck_require__(28561); +Object.defineProperty(exports, "isUrlIgnored", ({ enumerable: true, get: function () { return url_1.isUrlIgnored; } })); +Object.defineProperty(exports, "urlMatches", ({ enumerable: true, get: function () { return url_1.urlMatches; } })); +var wrap_1 = __nccwpck_require__(94858); +Object.defineProperty(exports, "isWrapped", ({ enumerable: true, get: function () { return wrap_1.isWrapped; } })); +var callback_1 = __nccwpck_require__(17166); +Object.defineProperty(exports, "BindOnceFuture", ({ enumerable: true, get: function () { return callback_1.BindOnceFuture; } })); +var version_1 = __nccwpck_require__(41187); +Object.defineProperty(exports, "VERSION", ({ enumerable: true, get: function () { return version_1.VERSION; } })); +const exporter_1 = __nccwpck_require__(40459); +exports.internal = { + _export: exporter_1._export, +}; +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 40459: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._export = void 0; +const api_1 = __nccwpck_require__(65163); +const suppress_tracing_1 = __nccwpck_require__(65489); +/** + * @internal + * Shared functionality used by Exporters while exporting data, including suppression of Traces. + */ +function _export(exporter, arg) { + return new Promise(resolve => { + // prevent downstream exporter calls from generating spans + api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { + exporter.export(arg, (result) => { + resolve(result); + }); + }); + }); +} +exports._export = _export; +//# sourceMappingURL=exporter.js.map + +/***/ }), + +/***/ 73125: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.validateValue = exports.validateKey = void 0; +const VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]'; +const VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; +const VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; +const VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); +const VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; +const INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; +/** + * Key is opaque string up to 256 characters printable. It MUST begin with a + * lowercase letter, and can only contain lowercase letters a-z, digits 0-9, + * underscores _, dashes -, asterisks *, and forward slashes /. + * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the + * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key. + * see https://www.w3.org/TR/trace-context/#key + */ +function validateKey(key) { + return VALID_KEY_REGEX.test(key); +} +exports.validateKey = validateKey; +/** + * Value is opaque string up to 256 characters printable ASCII RFC0020 + * characters (i.e., the range 0x20 to 0x7E) except comma , and =. + */ +function validateValue(value) { + return (VALID_VALUE_BASE_REGEX.test(value) && + !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value)); +} +exports.validateValue = validateValue; +//# sourceMappingURL=validators.js.map + +/***/ }), + +/***/ 64237: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.unrefTimer = exports.otperformance = exports.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var node_1 = __nccwpck_require__(89061); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return node_1.RandomIdGenerator; } })); +Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return node_1.SDK_INFO; } })); +Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return node_1._globalThis; } })); +Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return node_1.getEnv; } })); +Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return node_1.getEnvWithoutDefaults; } })); +Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return node_1.hexToBase64; } })); +Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return node_1.otperformance; } })); +Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return node_1.unrefTimer; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 31399: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RandomIdGenerator = void 0; +const SPAN_ID_BYTES = 8; +const TRACE_ID_BYTES = 16; +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + */ +class RandomIdGenerator { + constructor() { + /** + * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex + * characters corresponding to 128 bits. + */ + this.generateTraceId = getIdGenerator(TRACE_ID_BYTES); + /** + * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex + * characters corresponding to 64 bits. + */ + this.generateSpanId = getIdGenerator(SPAN_ID_BYTES); + } +} +exports.RandomIdGenerator = RandomIdGenerator; +const SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES); +function getIdGenerator(bytes) { + return function generateId() { + for (let i = 0; i < bytes / 4; i++) { + // unsigned right shift drops decimal part of the number + // it is required because if a number between 2**32 and 2**32 - 1 is generated, an out of range error is thrown by writeUInt32BE + SHARED_BUFFER.writeUInt32BE((Math.random() * 2 ** 32) >>> 0, i * 4); + } + // If buffer is all 0, set the last byte to 1 to guarantee a valid w3c id is generated + for (let i = 0; i < bytes; i++) { + if (SHARED_BUFFER[i] > 0) { + break; + } + else if (i === bytes - 1) { + SHARED_BUFFER[bytes - 1] = 1; + } + } + return SHARED_BUFFER.toString('hex', 0, bytes); + }; +} +//# sourceMappingURL=RandomIdGenerator.js.map + +/***/ }), + +/***/ 43901: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getEnvWithoutDefaults = exports.getEnv = void 0; +const environment_1 = __nccwpck_require__(51763); +/** + * Gets the environment variables + */ +function getEnv() { + const processEnv = (0, environment_1.parseEnvironment)(process.env); + return Object.assign({}, environment_1.DEFAULT_ENVIRONMENT, processEnv); +} +exports.getEnv = getEnv; +function getEnvWithoutDefaults() { + return (0, environment_1.parseEnvironment)(process.env); +} +exports.getEnvWithoutDefaults = getEnvWithoutDefaults; +//# sourceMappingURL=environment.js.map + +/***/ }), + +/***/ 15351: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._globalThis = void 0; +/** only globals that common to node and browsers are allowed */ +// eslint-disable-next-line node/no-unsupported-features/es-builtins +exports._globalThis = typeof globalThis === 'object' ? globalThis : global; +//# sourceMappingURL=globalThis.js.map + +/***/ }), + +/***/ 55759: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.hexToBase64 = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const hex_to_binary_1 = __nccwpck_require__(12409); +function hexToBase64(hexStr) { + return Buffer.from((0, hex_to_binary_1.hexToBinary)(hexStr)).toString('base64'); +} +exports.hexToBase64 = hexToBase64; +//# sourceMappingURL=hex-to-base64.js.map + +/***/ }), + +/***/ 89061: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.unrefTimer = exports.SDK_INFO = exports.otperformance = exports.RandomIdGenerator = exports.hexToBase64 = exports._globalThis = exports.getEnv = exports.getEnvWithoutDefaults = void 0; +var environment_1 = __nccwpck_require__(43901); +Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return environment_1.getEnvWithoutDefaults; } })); +Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return environment_1.getEnv; } })); +var globalThis_1 = __nccwpck_require__(15351); +Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return globalThis_1._globalThis; } })); +var hex_to_base64_1 = __nccwpck_require__(55759); +Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return hex_to_base64_1.hexToBase64; } })); +var RandomIdGenerator_1 = __nccwpck_require__(31399); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return RandomIdGenerator_1.RandomIdGenerator; } })); +var performance_1 = __nccwpck_require__(72076); +Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return performance_1.otperformance; } })); +var sdk_info_1 = __nccwpck_require__(16237); +Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return sdk_info_1.SDK_INFO; } })); +var timer_util_1 = __nccwpck_require__(25003); +Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return timer_util_1.unrefTimer; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 72076: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.otperformance = void 0; +const perf_hooks_1 = __nccwpck_require__(4074); +exports.otperformance = perf_hooks_1.performance; +//# sourceMappingURL=performance.js.map + +/***/ }), + +/***/ 16237: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SDK_INFO = void 0; +const version_1 = __nccwpck_require__(41187); +const semantic_conventions_1 = __nccwpck_require__(67275); +/** Constants describing the SDK in use */ +exports.SDK_INFO = { + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME]: 'opentelemetry', + [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'node', + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRYSDKLANGUAGEVALUES_NODEJS, + [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_VERSION]: version_1.VERSION, +}; +//# sourceMappingURL=sdk-info.js.map + +/***/ }), + +/***/ 25003: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.unrefTimer = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +function unrefTimer(timer) { + timer.unref(); +} +exports.unrefTimer = unrefTimer; +//# sourceMappingURL=timer-util.js.map + +/***/ }), + +/***/ 27514: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.CompositePropagator = void 0; +const api_1 = __nccwpck_require__(65163); +/** Combines multiple propagators into a single propagator. */ +class CompositePropagator { + /** + * Construct a composite propagator from a list of propagators. + * + * @param [config] Configuration object for composite propagator + */ + constructor(config = {}) { + var _a; + this._propagators = (_a = config.propagators) !== null && _a !== void 0 ? _a : []; + this._fields = Array.from(new Set(this._propagators + // older propagators may not have fields function, null check to be sure + .map(p => (typeof p.fields === 'function' ? p.fields() : [])) + .reduce((x, y) => x.concat(y), []))); + } + /** + * Run each of the configured propagators with the given context and carrier. + * Propagators are run in the order they are configured, so if multiple + * propagators write the same carrier key, the propagator later in the list + * will "win". + * + * @param context Context to inject + * @param carrier Carrier into which context will be injected + */ + inject(context, carrier, setter) { + for (const propagator of this._propagators) { + try { + propagator.inject(context, carrier, setter); + } + catch (err) { + api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); + } + } + } + /** + * Run each of the configured propagators with the given context and carrier. + * Propagators are run in the order they are configured, so if multiple + * propagators write the same context key, the propagator later in the list + * will "win". + * + * @param context Context to add values to + * @param carrier Carrier from which to extract context + */ + extract(context, carrier, getter) { + return this._propagators.reduce((ctx, propagator) => { + try { + return propagator.extract(ctx, carrier, getter); + } + catch (err) { + api_1.diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`); + } + return ctx; + }, context); + } + fields() { + // return a new array so our fields cannot be modified + return this._fields.slice(); + } +} +exports.CompositePropagator = CompositePropagator; +//# sourceMappingURL=composite.js.map + +/***/ }), + +/***/ 97990: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TraceState = void 0; +const validators_1 = __nccwpck_require__(73125); +const MAX_TRACE_STATE_ITEMS = 32; +const MAX_TRACE_STATE_LEN = 512; +const LIST_MEMBERS_SEPARATOR = ','; +const LIST_MEMBER_KEY_VALUE_SPLITTER = '='; +/** + * TraceState must be a class and not a simple object type because of the spec + * requirement (https://www.w3.org/TR/trace-context/#tracestate-field). + * + * Here is the list of allowed mutations: + * - New key-value pair should be added into the beginning of the list + * - The value of any key can be updated. Modified keys MUST be moved to the + * beginning of the list. + */ +class TraceState { + constructor(rawTraceState) { + this._internalState = new Map(); + if (rawTraceState) + this._parse(rawTraceState); + } + set(key, value) { + // TODO: Benchmark the different approaches(map vs list) and + // use the faster one. + const traceState = this._clone(); + if (traceState._internalState.has(key)) { + traceState._internalState.delete(key); + } + traceState._internalState.set(key, value); + return traceState; + } + unset(key) { + const traceState = this._clone(); + traceState._internalState.delete(key); + return traceState; + } + get(key) { + return this._internalState.get(key); + } + serialize() { + return this._keys() + .reduce((agg, key) => { + agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key)); + return agg; + }, []) + .join(LIST_MEMBERS_SEPARATOR); + } + _parse(rawTraceState) { + if (rawTraceState.length > MAX_TRACE_STATE_LEN) + return; + this._internalState = rawTraceState + .split(LIST_MEMBERS_SEPARATOR) + .reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning + .reduce((agg, part) => { + const listMember = part.trim(); // Optional Whitespace (OWS) handling + const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); + if (i !== -1) { + const key = listMember.slice(0, i); + const value = listMember.slice(i + 1, part.length); + if ((0, validators_1.validateKey)(key) && (0, validators_1.validateValue)(value)) { + agg.set(key, value); + } + else { + // TODO: Consider to add warning log + } + } + return agg; + }, new Map()); + // Because of the reverse() requirement, trunc must be done after map is created + if (this._internalState.size > MAX_TRACE_STATE_ITEMS) { + this._internalState = new Map(Array.from(this._internalState.entries()) + .reverse() // Use reverse same as original tracestate parse chain + .slice(0, MAX_TRACE_STATE_ITEMS)); + } + } + _keys() { + return Array.from(this._internalState.keys()).reverse(); + } + _clone() { + const traceState = new TraceState(); + traceState._internalState = new Map(this._internalState); + return traceState; + } +} +exports.TraceState = TraceState; +//# sourceMappingURL=TraceState.js.map + +/***/ }), + +/***/ 45146: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0; +const api_1 = __nccwpck_require__(65163); +const suppress_tracing_1 = __nccwpck_require__(65489); +const TraceState_1 = __nccwpck_require__(97990); +exports.TRACE_PARENT_HEADER = 'traceparent'; +exports.TRACE_STATE_HEADER = 'tracestate'; +const VERSION = '00'; +const VERSION_PART = '(?!ff)[\\da-f]{2}'; +const TRACE_ID_PART = '(?![0]{32})[\\da-f]{32}'; +const PARENT_ID_PART = '(?![0]{16})[\\da-f]{16}'; +const FLAGS_PART = '[\\da-f]{2}'; +const TRACE_PARENT_REGEX = new RegExp(`^\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\s?$`); +/** + * Parses information from the [traceparent] span tag and converts it into {@link SpanContext} + * @param traceParent - A meta property that comes from server. + * It should be dynamically generated server side to have the server's request trace Id, + * a parent span Id that was set on the server's request span, + * and the trace flags to indicate the server's sampling decision + * (01 = sampled, 00 = not sampled). + * for example: '{version}-{traceId}-{spanId}-{sampleDecision}' + * For more information see {@link https://www.w3.org/TR/trace-context/} + */ +function parseTraceParent(traceParent) { + const match = TRACE_PARENT_REGEX.exec(traceParent); + if (!match) + return null; + // According to the specification the implementation should be compatible + // with future versions. If there are more parts, we only reject it if it's using version 00 + // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent + if (match[1] === '00' && match[5]) + return null; + return { + traceId: match[2], + spanId: match[3], + traceFlags: parseInt(match[4], 16), + }; +} +exports.parseTraceParent = parseTraceParent; +/** + * Propagates {@link SpanContext} through Trace Context format propagation. + * + * Based on the Trace Context specification: + * https://www.w3.org/TR/trace-context/ + */ +class W3CTraceContextPropagator { + inject(context, carrier, setter) { + const spanContext = api_1.trace.getSpanContext(context); + if (!spanContext || + (0, suppress_tracing_1.isTracingSuppressed)(context) || + !(0, api_1.isSpanContextValid)(spanContext)) + return; + const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; + setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); + if (spanContext.traceState) { + setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); + } + } + extract(context, carrier, getter) { + const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); + if (!traceParentHeader) + return context; + const traceParent = Array.isArray(traceParentHeader) + ? traceParentHeader[0] + : traceParentHeader; + if (typeof traceParent !== 'string') + return context; + const spanContext = parseTraceParent(traceParent); + if (!spanContext) + return context; + spanContext.isRemote = true; + const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); + if (traceStateHeader) { + // If more than one `tracestate` header is found, we merge them into a + // single header. + const state = Array.isArray(traceStateHeader) + ? traceStateHeader.join(',') + : traceStateHeader; + spanContext.traceState = new TraceState_1.TraceState(typeof state === 'string' ? state : undefined); + } + return api_1.trace.setSpanContext(context, spanContext); + } + fields() { + return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; + } +} +exports.W3CTraceContextPropagator = W3CTraceContextPropagator; +//# sourceMappingURL=W3CTraceContextPropagator.js.map + +/***/ }), + +/***/ 28981: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0; +const api_1 = __nccwpck_require__(65163); +const RPC_METADATA_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key RPC_METADATA'); +var RPCType; +(function (RPCType) { + RPCType["HTTP"] = "http"; +})(RPCType = exports.RPCType || (exports.RPCType = {})); +function setRPCMetadata(context, meta) { + return context.setValue(RPC_METADATA_KEY, meta); +} +exports.setRPCMetadata = setRPCMetadata; +function deleteRPCMetadata(context) { + return context.deleteValue(RPC_METADATA_KEY); +} +exports.deleteRPCMetadata = deleteRPCMetadata; +function getRPCMetadata(context) { + return context.getValue(RPC_METADATA_KEY); +} +exports.getRPCMetadata = getRPCMetadata; +//# sourceMappingURL=rpc-metadata.js.map + +/***/ }), + +/***/ 70416: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AlwaysOffSampler = void 0; +const api_1 = __nccwpck_require__(65163); +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + * Sampler that samples no traces. + */ +class AlwaysOffSampler { + shouldSample() { + return { + decision: api_1.SamplingDecision.NOT_RECORD, + }; + } + toString() { + return 'AlwaysOffSampler'; + } +} +exports.AlwaysOffSampler = AlwaysOffSampler; +//# sourceMappingURL=AlwaysOffSampler.js.map + +/***/ }), + +/***/ 58338: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AlwaysOnSampler = void 0; +const api_1 = __nccwpck_require__(65163); +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + * Sampler that samples all traces. + */ +class AlwaysOnSampler { + shouldSample() { + return { + decision: api_1.SamplingDecision.RECORD_AND_SAMPLED, + }; + } + toString() { + return 'AlwaysOnSampler'; + } +} +exports.AlwaysOnSampler = AlwaysOnSampler; +//# sourceMappingURL=AlwaysOnSampler.js.map + +/***/ }), + +/***/ 96631: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ParentBasedSampler = void 0; +const api_1 = __nccwpck_require__(65163); +const global_error_handler_1 = __nccwpck_require__(82498); +const AlwaysOffSampler_1 = __nccwpck_require__(70416); +const AlwaysOnSampler_1 = __nccwpck_require__(58338); +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + * A composite sampler that either respects the parent span's sampling decision + * or delegates to `delegateSampler` for root spans. + */ +class ParentBasedSampler { + constructor(config) { + var _a, _b, _c, _d; + this._root = config.root; + if (!this._root) { + (0, global_error_handler_1.globalErrorHandler)(new Error('ParentBasedSampler must have a root sampler configured')); + this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); + } + this._remoteParentSampled = + (_a = config.remoteParentSampled) !== null && _a !== void 0 ? _a : new AlwaysOnSampler_1.AlwaysOnSampler(); + this._remoteParentNotSampled = + (_b = config.remoteParentNotSampled) !== null && _b !== void 0 ? _b : new AlwaysOffSampler_1.AlwaysOffSampler(); + this._localParentSampled = + (_c = config.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler_1.AlwaysOnSampler(); + this._localParentNotSampled = + (_d = config.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler_1.AlwaysOffSampler(); + } + shouldSample(context, traceId, spanName, spanKind, attributes, links) { + const parentContext = api_1.trace.getSpanContext(context); + if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) { + return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.isRemote) { + if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { + return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { + return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + toString() { + return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; + } +} +exports.ParentBasedSampler = ParentBasedSampler; +//# sourceMappingURL=ParentBasedSampler.js.map + +/***/ }), + +/***/ 68339: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TraceIdRatioBasedSampler = void 0; +const api_1 = __nccwpck_require__(65163); +/** + * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. + * Sampler that samples a given fraction of traces based of trace id deterministically. + */ +class TraceIdRatioBasedSampler { + constructor(_ratio = 0) { + this._ratio = _ratio; + this._ratio = this._normalize(_ratio); + this._upperBound = Math.floor(this._ratio * 0xffffffff); + } + shouldSample(context, traceId) { + return { + decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound + ? api_1.SamplingDecision.RECORD_AND_SAMPLED + : api_1.SamplingDecision.NOT_RECORD, + }; + } + toString() { + return `TraceIdRatioBased{${this._ratio}}`; + } + _normalize(ratio) { + if (typeof ratio !== 'number' || isNaN(ratio)) + return 0; + return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio; + } + _accumulate(traceId) { + let accumulation = 0; + for (let i = 0; i < traceId.length / 8; i++) { + const pos = i * 8; + const part = parseInt(traceId.slice(pos, pos + 8), 16); + accumulation = (accumulation ^ part) >>> 0; + } + return accumulation; + } +} +exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; +//# sourceMappingURL=TraceIdRatioBasedSampler.js.map + +/***/ }), + +/***/ 65489: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0; +const api_1 = __nccwpck_require__(65163); +const SUPPRESS_TRACING_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key SUPPRESS_TRACING'); +function suppressTracing(context) { + return context.setValue(SUPPRESS_TRACING_KEY, true); +} +exports.suppressTracing = suppressTracing; +function unsuppressTracing(context) { + return context.deleteValue(SUPPRESS_TRACING_KEY); +} +exports.unsuppressTracing = unsuppressTracing; +function isTracingSuppressed(context) { + return context.getValue(SUPPRESS_TRACING_KEY) === true; +} +exports.isTracingSuppressed = isTracingSuppressed; +//# sourceMappingURL=suppress-tracing.js.map + +/***/ }), + +/***/ 17166: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BindOnceFuture = void 0; +const promise_1 = __nccwpck_require__(30380); +/** + * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked. + */ +class BindOnceFuture { + constructor(_callback, _that) { + this._callback = _callback; + this._that = _that; + this._isCalled = false; + this._deferred = new promise_1.Deferred(); + } + get isCalled() { + return this._isCalled; + } + get promise() { + return this._deferred.promise; + } + call(...args) { + if (!this._isCalled) { + this._isCalled = true; + try { + Promise.resolve(this._callback.call(this._that, ...args)).then(val => this._deferred.resolve(val), err => this._deferred.reject(err)); + } + catch (err) { + this._deferred.reject(err); + } + } + return this._deferred.promise; + } +} +exports.BindOnceFuture = BindOnceFuture; +//# sourceMappingURL=callback.js.map + +/***/ }), + +/***/ 51763: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseEnvironment = exports.DEFAULT_ENVIRONMENT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = void 0; +const api_1 = __nccwpck_require__(65163); +const sampling_1 = __nccwpck_require__(60343); +const DEFAULT_LIST_SEPARATOR = ','; +/** + * Environment interface to define all names + */ +const ENVIRONMENT_BOOLEAN_KEYS = ['OTEL_SDK_DISABLED']; +function isEnvVarABoolean(key) { + return (ENVIRONMENT_BOOLEAN_KEYS.indexOf(key) > -1); +} +const ENVIRONMENT_NUMBERS_KEYS = [ + 'OTEL_BSP_EXPORT_TIMEOUT', + 'OTEL_BSP_MAX_EXPORT_BATCH_SIZE', + 'OTEL_BSP_MAX_QUEUE_SIZE', + 'OTEL_BSP_SCHEDULE_DELAY', + 'OTEL_BLRP_EXPORT_TIMEOUT', + 'OTEL_BLRP_MAX_EXPORT_BATCH_SIZE', + 'OTEL_BLRP_MAX_QUEUE_SIZE', + 'OTEL_BLRP_SCHEDULE_DELAY', + 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT', + 'OTEL_ATTRIBUTE_COUNT_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT', + 'OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT', + 'OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT', + 'OTEL_SPAN_EVENT_COUNT_LIMIT', + 'OTEL_SPAN_LINK_COUNT_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT', + 'OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT', + 'OTEL_EXPORTER_OTLP_TIMEOUT', + 'OTEL_EXPORTER_OTLP_TRACES_TIMEOUT', + 'OTEL_EXPORTER_OTLP_METRICS_TIMEOUT', + 'OTEL_EXPORTER_OTLP_LOGS_TIMEOUT', + 'OTEL_EXPORTER_JAEGER_AGENT_PORT', +]; +function isEnvVarANumber(key) { + return (ENVIRONMENT_NUMBERS_KEYS.indexOf(key) > -1); +} +const ENVIRONMENT_LISTS_KEYS = [ + 'OTEL_NO_PATCH_MODULES', + 'OTEL_PROPAGATORS', + 'OTEL_SEMCONV_STABILITY_OPT_IN', +]; +function isEnvVarAList(key) { + return ENVIRONMENT_LISTS_KEYS.indexOf(key) > -1; +} +exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity; +exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128; +exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = 128; +exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = 128; +/** + * Default environment variables + */ +exports.DEFAULT_ENVIRONMENT = { + OTEL_SDK_DISABLED: false, + CONTAINER_NAME: '', + ECS_CONTAINER_METADATA_URI_V4: '', + ECS_CONTAINER_METADATA_URI: '', + HOSTNAME: '', + KUBERNETES_SERVICE_HOST: '', + NAMESPACE: '', + OTEL_BSP_EXPORT_TIMEOUT: 30000, + OTEL_BSP_MAX_EXPORT_BATCH_SIZE: 512, + OTEL_BSP_MAX_QUEUE_SIZE: 2048, + OTEL_BSP_SCHEDULE_DELAY: 5000, + OTEL_BLRP_EXPORT_TIMEOUT: 30000, + OTEL_BLRP_MAX_EXPORT_BATCH_SIZE: 512, + OTEL_BLRP_MAX_QUEUE_SIZE: 2048, + OTEL_BLRP_SCHEDULE_DELAY: 5000, + OTEL_EXPORTER_JAEGER_AGENT_HOST: '', + OTEL_EXPORTER_JAEGER_AGENT_PORT: 6832, + OTEL_EXPORTER_JAEGER_ENDPOINT: '', + OTEL_EXPORTER_JAEGER_PASSWORD: '', + OTEL_EXPORTER_JAEGER_USER: '', + OTEL_EXPORTER_OTLP_ENDPOINT: '', + OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: '', + OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '', + OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: '', + OTEL_EXPORTER_OTLP_HEADERS: '', + OTEL_EXPORTER_OTLP_TRACES_HEADERS: '', + OTEL_EXPORTER_OTLP_METRICS_HEADERS: '', + OTEL_EXPORTER_OTLP_LOGS_HEADERS: '', + OTEL_EXPORTER_OTLP_TIMEOUT: 10000, + OTEL_EXPORTER_OTLP_TRACES_TIMEOUT: 10000, + OTEL_EXPORTER_OTLP_METRICS_TIMEOUT: 10000, + OTEL_EXPORTER_OTLP_LOGS_TIMEOUT: 10000, + OTEL_EXPORTER_ZIPKIN_ENDPOINT: 'http://localhost:9411/api/v2/spans', + OTEL_LOG_LEVEL: api_1.DiagLogLevel.INFO, + OTEL_NO_PATCH_MODULES: [], + OTEL_PROPAGATORS: ['tracecontext', 'baggage'], + OTEL_RESOURCE_ATTRIBUTES: '', + OTEL_SERVICE_NAME: '', + OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, + OTEL_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, + OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, + OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, + OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, + OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, + OTEL_SPAN_EVENT_COUNT_LIMIT: 128, + OTEL_SPAN_LINK_COUNT_LIMIT: 128, + OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT: exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, + OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT: exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT, + OTEL_TRACES_EXPORTER: '', + OTEL_TRACES_SAMPLER: sampling_1.TracesSamplerValues.ParentBasedAlwaysOn, + OTEL_TRACES_SAMPLER_ARG: '', + OTEL_LOGS_EXPORTER: '', + OTEL_EXPORTER_OTLP_INSECURE: '', + OTEL_EXPORTER_OTLP_TRACES_INSECURE: '', + OTEL_EXPORTER_OTLP_METRICS_INSECURE: '', + OTEL_EXPORTER_OTLP_LOGS_INSECURE: '', + OTEL_EXPORTER_OTLP_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_COMPRESSION: '', + OTEL_EXPORTER_OTLP_TRACES_COMPRESSION: '', + OTEL_EXPORTER_OTLP_METRICS_COMPRESSION: '', + OTEL_EXPORTER_OTLP_LOGS_COMPRESSION: '', + OTEL_EXPORTER_OTLP_CLIENT_KEY: '', + OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY: '', + OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY: '', + OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY: '', + OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE: '', + OTEL_EXPORTER_OTLP_PROTOCOL: 'http/protobuf', + OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: 'http/protobuf', + OTEL_EXPORTER_OTLP_METRICS_PROTOCOL: 'http/protobuf', + OTEL_EXPORTER_OTLP_LOGS_PROTOCOL: 'http/protobuf', + OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE: 'cumulative', + OTEL_SEMCONV_STABILITY_OPT_IN: [], +}; +/** + * @param key + * @param environment + * @param values + */ +function parseBoolean(key, environment, values) { + if (typeof values[key] === 'undefined') { + return; + } + const value = String(values[key]); + // support case-insensitive "true" + environment[key] = value.toLowerCase() === 'true'; +} +/** + * Parses a variable as number with number validation + * @param name + * @param environment + * @param values + * @param min + * @param max + */ +function parseNumber(name, environment, values, min = -Infinity, max = Infinity) { + if (typeof values[name] !== 'undefined') { + const value = Number(values[name]); + if (!isNaN(value)) { + if (value < min) { + environment[name] = min; + } + else if (value > max) { + environment[name] = max; + } + else { + environment[name] = value; + } + } + } +} +/** + * Parses list-like strings from input into output. + * @param name + * @param environment + * @param values + * @param separator + */ +function parseStringList(name, output, input, separator = DEFAULT_LIST_SEPARATOR) { + const givenValue = input[name]; + if (typeof givenValue === 'string') { + output[name] = givenValue.split(separator).map(v => v.trim()); + } +} +// The support string -> DiagLogLevel mappings +const logLevelMap = { + ALL: api_1.DiagLogLevel.ALL, + VERBOSE: api_1.DiagLogLevel.VERBOSE, + DEBUG: api_1.DiagLogLevel.DEBUG, + INFO: api_1.DiagLogLevel.INFO, + WARN: api_1.DiagLogLevel.WARN, + ERROR: api_1.DiagLogLevel.ERROR, + NONE: api_1.DiagLogLevel.NONE, +}; +/** + * Environmentally sets log level if valid log level string is provided + * @param key + * @param environment + * @param values + */ +function setLogLevelFromEnv(key, environment, values) { + const value = values[key]; + if (typeof value === 'string') { + const theLevel = logLevelMap[value.toUpperCase()]; + if (theLevel != null) { + environment[key] = theLevel; + } + } +} +/** + * Parses environment values + * @param values + */ +function parseEnvironment(values) { + const environment = {}; + for (const env in exports.DEFAULT_ENVIRONMENT) { + const key = env; + switch (key) { + case 'OTEL_LOG_LEVEL': + setLogLevelFromEnv(key, environment, values); + break; + default: + if (isEnvVarABoolean(key)) { + parseBoolean(key, environment, values); + } + else if (isEnvVarANumber(key)) { + parseNumber(key, environment, values); + } + else if (isEnvVarAList(key)) { + parseStringList(key, environment, values); + } + else { + const value = values[key]; + if (typeof value !== 'undefined' && value !== null) { + environment[key] = String(value); + } + } + } + } + return environment; +} +exports.parseEnvironment = parseEnvironment; +//# sourceMappingURL=environment.js.map + +/***/ }), + +/***/ 20253: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isPlainObject = void 0; +/* eslint-disable @typescript-eslint/no-explicit-any */ +/** + * based on lodash in order to support esm builds without esModuleInterop. + * lodash is using MIT License. + **/ +const objectTag = '[object Object]'; +const nullTag = '[object Null]'; +const undefinedTag = '[object Undefined]'; +const funcProto = Function.prototype; +const funcToString = funcProto.toString; +const objectCtorString = funcToString.call(Object); +const getPrototype = overArg(Object.getPrototypeOf, Object); +const objectProto = Object.prototype; +const hasOwnProperty = objectProto.hasOwnProperty; +const symToStringTag = Symbol ? Symbol.toStringTag : undefined; +const nativeObjectToString = objectProto.toString; +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function (arg) { + return func(transform(arg)); + }; +} +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) !== objectTag) { + return false; + } + const proto = getPrototype(value); + if (proto === null) { + return true; + } + const Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return (typeof Ctor == 'function' && + Ctor instanceof Ctor && + funcToString.call(Ctor) === objectCtorString); +} +exports.isPlainObject = isPlainObject; +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return symToStringTag && symToStringTag in Object(value) + ? getRawTag(value) + : objectToString(value); +} +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; + let unmasked = false; + try { + value[symToStringTag] = undefined; + unmasked = true; + } + catch (e) { + // silence + } + const result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } + else { + delete value[symToStringTag]; + } + } + return result; +} +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} +//# sourceMappingURL=lodash.merge.js.map + +/***/ }), + +/***/ 5715: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.merge = void 0; +/* eslint-disable @typescript-eslint/no-explicit-any */ +const lodash_merge_1 = __nccwpck_require__(20253); +const MAX_LEVEL = 20; +/** + * Merges objects together + * @param args - objects / values to be merged + */ +function merge(...args) { + let result = args.shift(); + const objects = new WeakMap(); + while (args.length > 0) { + result = mergeTwoObjects(result, args.shift(), 0, objects); + } + return result; +} +exports.merge = merge; +function takeValue(value) { + if (isArray(value)) { + return value.slice(); + } + return value; +} +/** + * Merges two objects + * @param one - first object + * @param two - second object + * @param level - current deep level + * @param objects - objects holder that has been already referenced - to prevent + * cyclic dependency + */ +function mergeTwoObjects(one, two, level = 0, objects) { + let result; + if (level > MAX_LEVEL) { + return undefined; + } + level++; + if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) { + result = takeValue(two); + } + else if (isArray(one)) { + result = one.slice(); + if (isArray(two)) { + for (let i = 0, j = two.length; i < j; i++) { + result.push(takeValue(two[i])); + } + } + else if (isObject(two)) { + const keys = Object.keys(two); + for (let i = 0, j = keys.length; i < j; i++) { + const key = keys[i]; + result[key] = takeValue(two[key]); + } + } + } + else if (isObject(one)) { + if (isObject(two)) { + if (!shouldMerge(one, two)) { + return two; + } + result = Object.assign({}, one); + const keys = Object.keys(two); + for (let i = 0, j = keys.length; i < j; i++) { + const key = keys[i]; + const twoValue = two[key]; + if (isPrimitive(twoValue)) { + if (typeof twoValue === 'undefined') { + delete result[key]; + } + else { + // result[key] = takeValue(twoValue); + result[key] = twoValue; + } + } + else { + const obj1 = result[key]; + const obj2 = twoValue; + if (wasObjectReferenced(one, key, objects) || + wasObjectReferenced(two, key, objects)) { + delete result[key]; + } + else { + if (isObject(obj1) && isObject(obj2)) { + const arr1 = objects.get(obj1) || []; + const arr2 = objects.get(obj2) || []; + arr1.push({ obj: one, key }); + arr2.push({ obj: two, key }); + objects.set(obj1, arr1); + objects.set(obj2, arr2); + } + result[key] = mergeTwoObjects(result[key], twoValue, level, objects); + } + } + } + } + else { + result = two; + } + } + return result; +} +/** + * Function to check if object has been already reference + * @param obj + * @param key + * @param objects + */ +function wasObjectReferenced(obj, key, objects) { + const arr = objects.get(obj[key]) || []; + for (let i = 0, j = arr.length; i < j; i++) { + const info = arr[i]; + if (info.key === key && info.obj === obj) { + return true; + } + } + return false; +} +function isArray(value) { + return Array.isArray(value); +} +function isFunction(value) { + return typeof value === 'function'; +} +function isObject(value) { + return (!isPrimitive(value) && + !isArray(value) && + !isFunction(value) && + typeof value === 'object'); +} +function isPrimitive(value) { + return (typeof value === 'string' || + typeof value === 'number' || + typeof value === 'boolean' || + typeof value === 'undefined' || + value instanceof Date || + value instanceof RegExp || + value === null); +} +function shouldMerge(one, two) { + if (!(0, lodash_merge_1.isPlainObject)(one) || !(0, lodash_merge_1.isPlainObject)(two)) { + return false; + } + return true; +} +//# sourceMappingURL=merge.js.map + +/***/ }), + +/***/ 30380: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Deferred = void 0; +class Deferred { + constructor() { + this._promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + }); + } + get promise() { + return this._promise; + } + resolve(val) { + this._resolve(val); + } + reject(err) { + this._reject(err); + } +} +exports.Deferred = Deferred; +//# sourceMappingURL=promise.js.map + +/***/ }), + +/***/ 60343: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TracesSamplerValues = void 0; +var TracesSamplerValues; +(function (TracesSamplerValues) { + TracesSamplerValues["AlwaysOff"] = "always_off"; + TracesSamplerValues["AlwaysOn"] = "always_on"; + TracesSamplerValues["ParentBasedAlwaysOff"] = "parentbased_always_off"; + TracesSamplerValues["ParentBasedAlwaysOn"] = "parentbased_always_on"; + TracesSamplerValues["ParentBasedTraceIdRatio"] = "parentbased_traceidratio"; + TracesSamplerValues["TraceIdRatio"] = "traceidratio"; +})(TracesSamplerValues = exports.TracesSamplerValues || (exports.TracesSamplerValues = {})); +//# sourceMappingURL=sampling.js.map + +/***/ }), + +/***/ 86560: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.callWithTimeout = exports.TimeoutError = void 0; +/** + * Error that is thrown on timeouts. + */ +class TimeoutError extends Error { + constructor(message) { + super(message); + // manually adjust prototype to retain `instanceof` functionality when targeting ES5, see: + // https://github.com/Microsoft/TypeScript-wiki/blob/main/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work + Object.setPrototypeOf(this, TimeoutError.prototype); + } +} +exports.TimeoutError = TimeoutError; +/** + * Adds a timeout to a promise and rejects if the specified timeout has elapsed. Also rejects if the specified promise + * rejects, and resolves if the specified promise resolves. + * + *

NOTE: this operation will continue even after it throws a {@link TimeoutError}. + * + * @param promise promise to use with timeout. + * @param timeout the timeout in milliseconds until the returned promise is rejected. + */ +function callWithTimeout(promise, timeout) { + let timeoutHandle; + const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { + timeoutHandle = setTimeout(function timeoutHandler() { + reject(new TimeoutError('Operation timed out.')); + }, timeout); + }); + return Promise.race([promise, timeoutPromise]).then(result => { + clearTimeout(timeoutHandle); + return result; + }, reason => { + clearTimeout(timeoutHandle); + throw reason; + }); +} +exports.callWithTimeout = callWithTimeout; +//# sourceMappingURL=timeout.js.map + +/***/ }), + +/***/ 28561: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isUrlIgnored = exports.urlMatches = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +function urlMatches(url, urlToMatch) { + if (typeof urlToMatch === 'string') { + return url === urlToMatch; + } + else { + return !!url.match(urlToMatch); + } +} +exports.urlMatches = urlMatches; +/** + * Check if {@param url} should be ignored when comparing against {@param ignoredUrls} + * @param url + * @param ignoredUrls + */ +function isUrlIgnored(url, ignoredUrls) { + if (!ignoredUrls) { + return false; + } + for (const ignoreUrl of ignoredUrls) { + if (urlMatches(url, ignoreUrl)) { + return true; + } + } + return false; +} +exports.isUrlIgnored = isUrlIgnored; +//# sourceMappingURL=url.js.map + +/***/ }), + +/***/ 94858: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isWrapped = void 0; +/** + * Checks if certain function has been already wrapped + * @param func + */ +function isWrapped(func) { + return (typeof func === 'function' && + typeof func.__original === 'function' && + typeof func.__unwrap === 'function' && + func.__wrapped === true); +} +exports.isWrapped = isWrapped; +//# sourceMappingURL=wrap.js.map + +/***/ }), + +/***/ 41187: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.VERSION = '1.30.1'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ 78369: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var { + _optionalChain +} = __nccwpck_require__(84466); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const semanticConventions = __nccwpck_require__(67275); +const core = __nccwpck_require__(84466); +const api = __nccwpck_require__(65163); +const core$1 = __nccwpck_require__(46033); +const sdkTraceBase = __nccwpck_require__(29253); +const instrumentation = __nccwpck_require__(65584); + +/** If this attribute is true, it means that the parent is a remote span. */ +const SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE = 'sentry.parentIsRemote'; + +// These are not standardized yet, but used by the graphql instrumentation +const SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION = 'sentry.graphql.operation'; + +/** + * Check if a given span has attributes. + * This is necessary because the base `Span` type does not have attributes, + * so in places where we are passed a generic span, we need to check if we want to access them. + */ +function spanHasAttributes( + span, +) { + const castSpan = span ; + return !!castSpan.attributes && typeof castSpan.attributes === 'object'; +} + +/** + * Check if a given span has a kind. + * This is necessary because the base `Span` type does not have a kind, + * so in places where we are passed a generic span, we need to check if we want to access it. + */ +function spanHasKind(span) { + const castSpan = span ; + return typeof castSpan.kind === 'number'; +} + +/** + * Check if a given span has a status. + * This is necessary because the base `Span` type does not have a status, + * so in places where we are passed a generic span, we need to check if we want to access it. + */ +function spanHasStatus( + span, +) { + const castSpan = span ; + return !!castSpan.status; +} + +/** + * Check if a given span has a name. + * This is necessary because the base `Span` type does not have a name, + * so in places where we are passed a generic span, we need to check if we want to access it. + */ +function spanHasName(span) { + const castSpan = span ; + return !!castSpan.name; +} + +/** + * Check if a given span has a kind. + * This is necessary because the base `Span` type does not have a kind, + * so in places where we are passed a generic span, we need to check if we want to access it. + */ +function spanHasParentId( + span, +) { + const castSpan = span ; + return !!castSpan.parentSpanId; +} + +/** + * Check if a given span has events. + * This is necessary because the base `Span` type does not have events, + * so in places where we are passed a generic span, we need to check if we want to access it. + */ +function spanHasEvents( + span, +) { + const castSpan = span ; + return Array.isArray(castSpan.events); +} + +/** + * Get sanitizied request data from an OTEL span. + */ +function getRequestSpanData(span) { + // The base `Span` type has no `attributes`, so we need to guard here against that + if (!spanHasAttributes(span)) { + return {}; + } + + // eslint-disable-next-line deprecation/deprecation + const maybeUrlAttribute = (span.attributes[semanticConventions.ATTR_URL_FULL] || span.attributes[semanticConventions.SEMATTRS_HTTP_URL]) + +; + + const data = { + url: maybeUrlAttribute, + // eslint-disable-next-line deprecation/deprecation + 'http.method': (span.attributes[semanticConventions.ATTR_HTTP_REQUEST_METHOD] || span.attributes[semanticConventions.SEMATTRS_HTTP_METHOD]) + +, + }; + + // Default to GET if URL is set but method is not + if (!data['http.method'] && data.url) { + data['http.method'] = 'GET'; + } + + try { + if (typeof maybeUrlAttribute === 'string') { + const url = core.parseUrl(maybeUrlAttribute); + + data.url = core.getSanitizedUrlString(url); + + if (url.search) { + data['http.query'] = url.search; + } + if (url.hash) { + data['http.fragment'] = url.hash; + } + } + } catch (e) { + // ignore + } + + return data; +} + +function _optionalChain$6(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } + +// Typescript complains if we do not use `...args: any[]` for the mixin, with: +// A mixin class must have a constructor with a single rest parameter of type 'any[]'.ts(2545) +/* eslint-disable @typescript-eslint/no-explicit-any */ + +/** + * Wrap an Client with things we need for OpenTelemetry support. + * + * Usage: + * const OpenTelemetryClient = getWrappedClientClass(NodeClient); + * const client = new OpenTelemetryClient(options); + */ +function wrapClientClass + +(ClientClass) { + class OpenTelemetryClient extends ClientClass { + + constructor(...args) { + super(...args); + } + + /** Get the OTEL tracer. */ + get tracer() { + if (this._tracer) { + return this._tracer; + } + + const name = '@sentry/opentelemetry'; + const version = core.SDK_VERSION; + const tracer = api.trace.getTracer(name, version); + this._tracer = tracer; + + return tracer; + } + + /** + * @inheritDoc + */ + async flush(timeout) { + const provider = this.traceProvider; + const spanProcessor = _optionalChain$6([provider, 'optionalAccess', _ => _.activeSpanProcessor]); + + if (spanProcessor) { + await spanProcessor.forceFlush(); + } + + return super.flush(timeout); + } + } + + return OpenTelemetryClient ; +} +/* eslint-enable @typescript-eslint/no-explicit-any */ + +/** + * Get the span kind from a span. + * For whatever reason, this is not public API on the generic "Span" type, + * so we need to check if we actually have a `SDKTraceBaseSpan` where we can fetch this from. + * Otherwise, we fall back to `SpanKind.INTERNAL`. + */ +function getSpanKind(span) { + if (spanHasKind(span)) { + return span.kind; + } + + return api.SpanKind.INTERNAL; +} + +const SENTRY_TRACE_HEADER = 'sentry-trace'; +const SENTRY_BAGGAGE_HEADER = 'baggage'; + +const SENTRY_TRACE_STATE_DSC = 'sentry.dsc'; +const SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING = 'sentry.sampled_not_recording'; +const SENTRY_TRACE_STATE_URL = 'sentry.url'; + +const SENTRY_SCOPES_CONTEXT_KEY = api.createContextKey('sentry_scopes'); + +const SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY = api.createContextKey('sentry_fork_isolation_scope'); + +const SENTRY_FORK_SET_SCOPE_CONTEXT_KEY = api.createContextKey('sentry_fork_set_scope'); + +const SENTRY_FORK_SET_ISOLATION_SCOPE_CONTEXT_KEY = api.createContextKey('sentry_fork_set_isolation_scope'); + +const SCOPE_CONTEXT_FIELD = '_scopeContext'; + +/** + * Try to get the current scopes from the given OTEL context. + * This requires a Context Manager that was wrapped with getWrappedContextManager. + */ +function getScopesFromContext(context) { + return context.getValue(SENTRY_SCOPES_CONTEXT_KEY) ; +} + +/** + * Set the current scopes on an OTEL context. + * This will return a forked context with the Propagation Context set. + */ +function setScopesOnContext(context, scopes) { + return context.setValue(SENTRY_SCOPES_CONTEXT_KEY, scopes); +} + +/** + * Set the context on the scope so we can later look it up. + * We need this to get the context from the scope in the `trace` functions. + */ +function setContextOnScope(scope, context) { + core.addNonEnumerableProperty(scope, SCOPE_CONTEXT_FIELD, context); +} + +/** + * Get the context related to a scope. + * TODO v8: Use this for the `trace` functions. + * */ +function getContextFromScope(scope) { + return (scope )[SCOPE_CONTEXT_FIELD]; +} + +/** + * + * @param otelSpan Checks whether a given OTEL Span is an http request to sentry. + * @returns boolean + */ +function isSentryRequestSpan(span) { + if (!spanHasAttributes(span)) { + return false; + } + + const { attributes } = span; + + // `ATTR_URL_FULL` is the new attribute, but we still support the old one, `ATTR_HTTP_URL`, for now. + // eslint-disable-next-line deprecation/deprecation + const httpUrl = attributes[semanticConventions.SEMATTRS_HTTP_URL] || attributes[semanticConventions.ATTR_URL_FULL]; + + if (!httpUrl) { + return false; + } + + return core.isSentryRequestUrl(httpUrl.toString(), core.getClient()); +} + +function _optionalChain$5(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } + +/** + * OpenTelemetry only knows about SAMPLED or NONE decision, + * but for us it is important to differentiate between unset and unsampled. + * + * Both of these are identified as `traceFlags === TracegFlags.NONE`, + * but we additionally look at a special trace state to differentiate between them. + */ +function getSamplingDecision(spanContext) { + const { traceFlags, traceState } = spanContext; + + const sampledNotRecording = traceState ? traceState.get(SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING) === '1' : false; + + // If trace flag is `SAMPLED`, we interpret this as sampled + // If it is `NONE`, it could mean either it was sampled to be not recorder, or that it was not sampled at all + // For us this is an important difference, sow e look at the SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING + // to identify which it is + if (traceFlags === api.TraceFlags.SAMPLED) { + return true; + } + + if (sampledNotRecording) { + return false; + } + + // Fall back to DSC as a last resort, that may also contain `sampled`... + const dscString = traceState ? traceState.get(SENTRY_TRACE_STATE_DSC) : undefined; + const dsc = dscString ? core.baggageHeaderToDynamicSamplingContext(dscString) : undefined; + + if (_optionalChain$5([dsc, 'optionalAccess', _ => _.sampled]) === 'true') { + return true; + } + if (_optionalChain$5([dsc, 'optionalAccess', _2 => _2.sampled]) === 'false') { + return false; + } + + return undefined; +} + +/** + * Infer the op & description for a set of name, attributes and kind of a span. + */ +function inferSpanData(spanName, attributes, kind) { + // if http.method exists, this is an http request span + // eslint-disable-next-line deprecation/deprecation + const httpMethod = attributes[semanticConventions.ATTR_HTTP_REQUEST_METHOD] || attributes[semanticConventions.SEMATTRS_HTTP_METHOD]; + if (httpMethod) { + return descriptionForHttpMethod({ attributes, name: spanName, kind }, httpMethod); + } + + // eslint-disable-next-line deprecation/deprecation + const dbSystem = attributes[semanticConventions.SEMATTRS_DB_SYSTEM]; + const opIsCache = + typeof attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] === 'string' && + attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP].startsWith('cache.'); + + // If db.type exists then this is a database call span + // If the Redis DB is used as a cache, the span description should not be changed + if (dbSystem && !opIsCache) { + return descriptionForDbSystem({ attributes, name: spanName }); + } + + const customSourceOrRoute = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === 'custom' ? 'custom' : 'route'; + + // If rpc.service exists then this is a rpc call span. + // eslint-disable-next-line deprecation/deprecation + const rpcService = attributes[semanticConventions.SEMATTRS_RPC_SERVICE]; + if (rpcService) { + return { + ...getUserUpdatedNameAndSource(spanName, attributes, 'route'), + op: 'rpc', + }; + } + + // If messaging.system exists then this is a messaging system span. + // eslint-disable-next-line deprecation/deprecation + const messagingSystem = attributes[semanticConventions.SEMATTRS_MESSAGING_SYSTEM]; + if (messagingSystem) { + return { + ...getUserUpdatedNameAndSource(spanName, attributes, customSourceOrRoute), + op: 'message', + }; + } + + // If faas.trigger exists then this is a function as a service span. + // eslint-disable-next-line deprecation/deprecation + const faasTrigger = attributes[semanticConventions.SEMATTRS_FAAS_TRIGGER]; + if (faasTrigger) { + return { + ...getUserUpdatedNameAndSource(spanName, attributes, customSourceOrRoute), + op: faasTrigger.toString(), + }; + } + + return { op: undefined, description: spanName, source: 'custom' }; +} + +/** + * Extract better op/description from an otel span. + * + * Does not overwrite the span name if the source is already set to custom to ensure + * that user-updated span names are preserved. In this case, we only adjust the op but + * leave span description and source unchanged. + * + * Based on https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/7422ce2a06337f68a59b552b8c5a2ac125d6bae5/exporter/sentryexporter/sentry_exporter.go#L306 + */ +function parseSpanDescription(span) { + const attributes = spanHasAttributes(span) ? span.attributes : {}; + const name = spanHasName(span) ? span.name : ''; + const kind = getSpanKind(span); + + return inferSpanData(name, attributes, kind); +} + +function descriptionForDbSystem({ attributes, name }) { + // if we already have a custom name, we don't overwrite it but only set the op + const userDefinedName = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; + if (typeof userDefinedName === 'string') { + return { + op: 'db', + description: userDefinedName, + source: (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] ) || 'custom', + }; + } + + // if we already have the source set to custom, we don't overwrite the span description but only set the op + if (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === 'custom') { + return { op: 'db', description: name, source: 'custom' }; + } + + // Use DB statement (Ex "SELECT * FROM table") if possible as description. + // eslint-disable-next-line deprecation/deprecation + const statement = attributes[semanticConventions.SEMATTRS_DB_STATEMENT]; + + const description = statement ? statement.toString() : name; + + return { op: 'db', description, source: 'task' }; +} + +/** Only exported for tests. */ +function descriptionForHttpMethod( + { name, kind, attributes }, + httpMethod, +) { + const opParts = ['http']; + + switch (kind) { + case api.SpanKind.CLIENT: + opParts.push('client'); + break; + case api.SpanKind.SERVER: + opParts.push('server'); + break; + } + + // Spans for HTTP requests we have determined to be prefetch requests will have a `.prefetch` postfix in the op + if (attributes['sentry.http.prefetch']) { + opParts.push('prefetch'); + } + + const { urlPath, url, query, fragment, hasRoute } = getSanitizedUrl(attributes, kind); + + if (!urlPath) { + return { ...getUserUpdatedNameAndSource(name, attributes), op: opParts.join('.') }; + } + + const graphqlOperationsAttribute = attributes[SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION]; + + // Ex. GET /api/users + const baseDescription = `${httpMethod} ${urlPath}`; + + // When the http span has a graphql operation, append it to the description + // We add these in the graphqlIntegration + const inferredDescription = graphqlOperationsAttribute + ? `${baseDescription} (${getGraphqlOperationNamesFromAttribute(graphqlOperationsAttribute)})` + : baseDescription; + + // If `httpPath` is a root path, then we can categorize the transaction source as route. + const inferredSource = hasRoute || urlPath === '/' ? 'route' : 'url'; + + const data = {}; + + if (url) { + data.url = url; + } + if (query) { + data['http.query'] = query; + } + if (fragment) { + data['http.fragment'] = fragment; + } + + // If the span kind is neither client nor server, we use the original name + // this infers that somebody manually started this span, in which case we don't want to overwrite the name + const isClientOrServerKind = kind === api.SpanKind.CLIENT || kind === api.SpanKind.SERVER; + + // If the span is an auto-span (=it comes from one of our instrumentations), + // we always want to infer the name + // this is necessary because some of the auto-instrumentation we use uses kind=INTERNAL + const origin = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] || 'manual'; + const isManualSpan = !`${origin}`.startsWith('auto'); + + // If users (or in very rare occasions we) set the source to custom, we don't overwrite the name + const alreadyHasCustomSource = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === 'custom'; + const customSpanName = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; + + const useInferredDescription = + !alreadyHasCustomSource && customSpanName == null && (isClientOrServerKind || !isManualSpan); + + const { description, source } = useInferredDescription + ? { description: inferredDescription, source: inferredSource } + : getUserUpdatedNameAndSource(name, attributes); + + return { + op: opParts.join('.'), + description, + source, + data, + }; +} + +function getGraphqlOperationNamesFromAttribute(attr) { + if (Array.isArray(attr)) { + const sorted = attr.slice().sort(); + + // Up to 5 items, we just add all of them + if (sorted.length <= 5) { + return sorted.join(', '); + } else { + // Else, we add the first 5 and the diff of other operations + return `${sorted.slice(0, 5).join(', ')}, +${sorted.length - 5}`; + } + } + + return `${attr}`; +} + +/** Exported for tests only */ +function getSanitizedUrl( + attributes, + kind, +) + + { + // This is the relative path of the URL, e.g. /sub + // eslint-disable-next-line deprecation/deprecation + const httpTarget = attributes[semanticConventions.SEMATTRS_HTTP_TARGET]; + // This is the full URL, including host & query params etc., e.g. https://example.com/sub?foo=bar + // eslint-disable-next-line deprecation/deprecation + const httpUrl = attributes[semanticConventions.SEMATTRS_HTTP_URL] || attributes[semanticConventions.ATTR_URL_FULL]; + // This is the normalized route name - may not always be available! + const httpRoute = attributes[semanticConventions.ATTR_HTTP_ROUTE]; + + const parsedUrl = typeof httpUrl === 'string' ? core.parseUrl(httpUrl) : undefined; + const url = parsedUrl ? core.getSanitizedUrlString(parsedUrl) : undefined; + const query = parsedUrl && parsedUrl.search ? parsedUrl.search : undefined; + const fragment = parsedUrl && parsedUrl.hash ? parsedUrl.hash : undefined; + + if (typeof httpRoute === 'string') { + return { urlPath: httpRoute, url, query, fragment, hasRoute: true }; + } + + if (kind === api.SpanKind.SERVER && typeof httpTarget === 'string') { + return { urlPath: core.stripUrlQueryAndFragment(httpTarget), url, query, fragment, hasRoute: false }; + } + + if (parsedUrl) { + return { urlPath: url, url, query, fragment, hasRoute: false }; + } + + // fall back to target even for client spans, if no URL is present + if (typeof httpTarget === 'string') { + return { urlPath: core.stripUrlQueryAndFragment(httpTarget), url, query, fragment, hasRoute: false }; + } + + return { urlPath: undefined, url, query, fragment, hasRoute: false }; +} + +/** + * Because Otel instrumentation sometimes mutates span names via `span.updateName`, the only way + * to ensure that a user-set span name is preserved is to store it as a tmp attribute on the span. + * We delete this attribute once we're done with it when preparing the event envelope. + * + * This temp attribute always takes precedence over the original name. + * + * We also need to take care of setting the correct source. Users can always update the source + * after updating the name, so we need to respect that. + * + * @internal exported only for testing + */ +function getUserUpdatedNameAndSource( + originalName, + attributes, + fallbackSource = 'custom', +) + + { + const source = (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] ) || fallbackSource; + const description = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; + + if (description && typeof description === 'string') { + return { + description, + source, + }; + } + + return { description: originalName, source }; +} + +/** + * Setup a DSC handler on the passed client, + * ensuring that the transaction name is inferred from the span correctly. + */ +function enhanceDscWithOpenTelemetryRootSpanName(client) { + client.on('createDsc', (dsc, rootSpan) => { + if (!rootSpan) { + return; + } + + // We want to overwrite the transaction on the DSC that is created by default in core + // The reason for this is that we want to infer the span name, not use the initial one + // Otherwise, we'll get names like "GET" instead of e.g. "GET /foo" + // `parseSpanDescription` takes the attributes of the span into account for the name + // This mutates the passed-in DSC + + const jsonSpan = core.spanToJSON(rootSpan); + const attributes = jsonSpan.data || {}; + const source = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; + + const { description } = spanHasName(rootSpan) ? parseSpanDescription(rootSpan) : { description: undefined }; + if (source !== 'url' && description) { + dsc.transaction = description; + } + + // Also ensure sampling decision is correctly inferred + // In core, we use `spanIsSampled`, which just looks at the trace flags + // but in OTEL, we use a slightly more complex logic to be able to differntiate between unsampled and deferred sampling + if (core.hasTracingEnabled()) { + const sampled = getSamplingDecision(rootSpan.spanContext()); + dsc.sampled = sampled == undefined ? undefined : String(sampled); + } + }); +} + +/** + * Generate a TraceState for the given data. + */ +function makeTraceState({ + dsc, + sampled, +} + +) { + // We store the DSC as OTEL trace state on the span context + const dscString = dsc ? core.dynamicSamplingContextToSentryBaggageHeader(dsc) : undefined; + + const traceStateBase = new core$1.TraceState(); + + const traceStateWithDsc = dscString ? traceStateBase.set(SENTRY_TRACE_STATE_DSC, dscString) : traceStateBase; + + // We also specifically want to store if this is sampled to be not recording, + // or unsampled (=could be either sampled or not) + return sampled === false ? traceStateWithDsc.set(SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING, '1') : traceStateWithDsc; +} + +/** + * Generates a SpanContext that represents a PropagationContext. + * This can be set on a `context` to make this a (virtual) active span. + * + * @deprecated This function is deprecated and will be removed in the next major version. + */ +function generateSpanContextForPropagationContext(propagationContext) { + // We store the DSC as OTEL trace state on the span context + const traceState = makeTraceState({ + dsc: propagationContext.dsc, + sampled: propagationContext.sampled, + }); + + const spanContext = { + traceId: propagationContext.traceId, + // TODO: Do not create an invalid span context here + spanId: propagationContext.parentSpanId || '', + isRemote: true, + traceFlags: propagationContext.sampled ? api.TraceFlags.SAMPLED : api.TraceFlags.NONE, + traceState, + }; + + return spanContext; +} + +/** + * Returns the currently active span. + */ +function getActiveSpan() { + return api.trace.getActiveSpan(); +} + +/** + * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code. + * + * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking. + */ +const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__); + +const setupElements = new Set(); + +/** Get all the OpenTelemetry elements that have been set up. */ +function openTelemetrySetupCheck() { + return Array.from(setupElements); +} + +/** Mark an OpenTelemetry element as setup. */ +function setIsSetup(element) { + setupElements.add(element); +} + +function _optionalChain$4(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } + +/** Get the Sentry propagation context from a span context. */ +function getPropagationContextFromSpan(span) { + const spanContext = span.spanContext(); + const { traceId, spanId, traceState } = spanContext; + + // When we have a dsc trace state, it means this came from the incoming trace + // Then this takes presedence over the root span + const dscString = traceState ? traceState.get(SENTRY_TRACE_STATE_DSC) : undefined; + const traceStateDsc = dscString ? core.baggageHeaderToDynamicSamplingContext(dscString) : undefined; + + const parentSpanId = spanHasParentId(span) ? span.parentSpanId : undefined; + const sampled = getSamplingDecision(spanContext); + + // No trace state? --> Take DSC from root span + const dsc = traceStateDsc || core.getDynamicSamplingContextFromSpan(core.getRootSpan(span)); + + return { + traceId, + spanId, + sampled, + parentSpanId, + dsc, + }; +} + +/** + * Injects and extracts `sentry-trace` and `baggage` headers from carriers. + */ +class SentryPropagator extends core$1.W3CBaggagePropagator { + /** A map of URLs that have already been checked for if they match tracePropagationTargets. */ + + constructor() { + super(); + setIsSetup('SentryPropagator'); + + // We're caching results so we don't have to recompute regexp every time we create a request. + this._urlMatchesTargetsMap = new core.LRUMap(100); + } + + /** + * @inheritDoc + */ + inject(context, carrier, setter) { + if (core$1.isTracingSuppressed(context)) { + DEBUG_BUILD && core.logger.log('[Tracing] Not injecting trace data for url because tracing is suppressed.'); + return; + } + + const activeSpan = api.trace.getSpan(context); + const url = activeSpan && getCurrentURL(activeSpan); + + const tracePropagationTargets = _optionalChain$4([core.getClient, 'call', _ => _(), 'optionalAccess', _2 => _2.getOptions, 'call', _3 => _3(), 'optionalAccess', _4 => _4.tracePropagationTargets]); + if (!shouldPropagateTraceForUrl(url, tracePropagationTargets, this._urlMatchesTargetsMap)) { + DEBUG_BUILD && + core.logger.log( + '[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:', + url, + ); + return; + } + + const existingBaggageHeader = getExistingBaggage(carrier); + let baggage = api.propagation.getBaggage(context) || api.propagation.createBaggage({}); + + const { dynamicSamplingContext, traceId, spanId, sampled } = getInjectionData(context); + + if (existingBaggageHeader) { + const baggageEntries = core.parseBaggageHeader(existingBaggageHeader); + + if (baggageEntries) { + Object.entries(baggageEntries).forEach(([key, value]) => { + baggage = baggage.setEntry(key, { value }); + }); + } + } + + if (dynamicSamplingContext) { + baggage = Object.entries(dynamicSamplingContext).reduce((b, [dscKey, dscValue]) => { + if (dscValue) { + return b.setEntry(`${core.SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`, { value: dscValue }); + } + return b; + }, baggage); + } + + // We also want to avoid setting the default OTEL trace ID, if we get that for whatever reason + if (traceId && traceId !== api.INVALID_TRACEID) { + setter.set(carrier, SENTRY_TRACE_HEADER, core.generateSentryTraceHeader(traceId, spanId, sampled)); + } + + super.inject(api.propagation.setBaggage(context, baggage), carrier, setter); + } + + /** + * @inheritDoc + */ + extract(context, carrier, getter) { + const maybeSentryTraceHeader = getter.get(carrier, SENTRY_TRACE_HEADER); + const baggage = getter.get(carrier, SENTRY_BAGGAGE_HEADER); + + const sentryTrace = maybeSentryTraceHeader + ? Array.isArray(maybeSentryTraceHeader) + ? maybeSentryTraceHeader[0] + : maybeSentryTraceHeader + : undefined; + + // Add remote parent span context + // If there is no incoming trace, this will return the context as-is + return ensureScopesOnContext(getContextWithRemoteActiveSpan(context, { sentryTrace, baggage })); + } + + /** + * @inheritDoc + */ + fields() { + return [SENTRY_TRACE_HEADER, SENTRY_BAGGAGE_HEADER]; + } +} + +const NOT_PROPAGATED_MESSAGE = + '[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:'; + +/** + * Check if a given URL should be propagated to or not. + * If no url is defined, or no trace propagation targets are defined, this will always return `true`. + * You can also optionally provide a decision map, to cache decisions and avoid repeated regex lookups. + */ +function shouldPropagateTraceForUrl( + url, + tracePropagationTargets, + decisionMap, +) { + if (typeof url !== 'string' || !tracePropagationTargets) { + return true; + } + + const cachedDecision = _optionalChain$4([decisionMap, 'optionalAccess', _5 => _5.get, 'call', _6 => _6(url)]); + if (cachedDecision !== undefined) { + DEBUG_BUILD && !cachedDecision && core.logger.log(NOT_PROPAGATED_MESSAGE, url); + return cachedDecision; + } + + const decision = core.stringMatchesSomePattern(url, tracePropagationTargets); + _optionalChain$4([decisionMap, 'optionalAccess', _7 => _7.set, 'call', _8 => _8(url, decision)]); + + DEBUG_BUILD && !decision && core.logger.log(NOT_PROPAGATED_MESSAGE, url); + return decision; +} + +/** + * Get propagation injection data for the given context. + */ +function getInjectionData(context) + + { + const span = api.trace.getSpan(context); + + // If we have a remote span, the spanId should be considered as the parentSpanId, not spanId itself + // Instead, we use a virtual (generated) spanId for propagation + if (span && span.spanContext().isRemote) { + const spanContext = span.spanContext(); + const dynamicSamplingContext = core.getDynamicSamplingContextFromSpan(span); + + return { + dynamicSamplingContext, + traceId: spanContext.traceId, + // Because this is a remote span, we do not want to propagate this directly + // As otherwise things may be attached "directly" to an unrelated span + spanId: core.generateSpanId(), + sampled: getSamplingDecision(spanContext), + }; + } + + // If we have a local span, we just use this + if (span) { + const spanContext = span.spanContext(); + const dynamicSamplingContext = core.getDynamicSamplingContextFromSpan(span); + + return { + dynamicSamplingContext, + traceId: spanContext.traceId, + spanId: spanContext.spanId, + sampled: getSamplingDecision(spanContext), + }; + } + + // Else we try to use the propagation context from the scope + // The only scenario where this should happen is when we neither have a span, nor an incoming trace + const scope = _optionalChain$4([getScopesFromContext, 'call', _9 => _9(context), 'optionalAccess', _10 => _10.scope]) || core.getCurrentScope(); + const client = core.getClient(); + + const propagationContext = scope.getPropagationContext(); + const dynamicSamplingContext = client ? core.getDynamicSamplingContextFromScope(client, scope) : undefined; + return { + dynamicSamplingContext, + traceId: propagationContext.traceId, + // TODO(v9): Use generateSpanId() instead + // eslint-disable-next-line deprecation/deprecation + spanId: propagationContext.spanId, + sampled: propagationContext.sampled, + }; +} + +function getContextWithRemoteActiveSpan( + ctx, + { sentryTrace, baggage }, +) { + const propagationContext = core.propagationContextFromHeaders(sentryTrace, baggage); + + const { traceId, parentSpanId, sampled, dsc } = propagationContext; + + // We only want to set the virtual span if we are continuing a concrete trace + // Otherwise, we ignore the incoming trace here, e.g. if we have no trace headers + if (!parentSpanId) { + return ctx; + } + + const spanContext = generateRemoteSpanContext({ + traceId, + spanId: parentSpanId, + sampled, + dsc, + }); + + return api.trace.setSpanContext(ctx, spanContext); +} + +/** + * Takes trace strings and propagates them as a remote active span. + * This should be used in addition to `continueTrace` in OTEL-powered environments. + */ +function continueTraceAsRemoteSpan( + ctx, + options, + callback, +) { + const ctxWithSpanContext = ensureScopesOnContext(getContextWithRemoteActiveSpan(ctx, options)); + + return api.context.with(ctxWithSpanContext, callback); +} + +function ensureScopesOnContext(ctx) { + // If there are no scopes yet on the context, ensure we have them + const scopes = getScopesFromContext(ctx); + const newScopes = { + // If we have no scope here, this is most likely either the root context or a context manually derived from it + // In this case, we want to fork the current scope, to ensure we do not pollute the root scope + scope: scopes ? scopes.scope : core.getCurrentScope().clone(), + isolationScope: scopes ? scopes.isolationScope : core.getIsolationScope(), + }; + + return setScopesOnContext(ctx, newScopes); +} + +/** Try to get the existing baggage header so we can merge this in. */ +function getExistingBaggage(carrier) { + try { + const baggage = (carrier )[SENTRY_BAGGAGE_HEADER]; + return Array.isArray(baggage) ? baggage.join(',') : baggage; + } catch (e) { + return undefined; + } +} + +/** + * It is pretty tricky to get access to the outgoing request URL of a request in the propagator. + * As we only have access to the context of the span to be sent and the carrier (=headers), + * but the span may be unsampled and thus have no attributes. + * + * So we use the following logic: + * 1. If we have an active span, we check if it has a URL attribute. + * 2. Else, if the active span has no URL attribute (e.g. it is unsampled), we check a special trace state (which we set in our sampler). + */ +function getCurrentURL(span) { + const spanData = core.spanToJSON(span).data; + // `ATTR_URL_FULL` is the new attribute, but we still support the old one, `SEMATTRS_HTTP_URL`, for now. + // eslint-disable-next-line deprecation/deprecation + const urlAttribute = _optionalChain$4([spanData, 'optionalAccess', _11 => _11[semanticConventions.SEMATTRS_HTTP_URL]]) || _optionalChain$4([spanData, 'optionalAccess', _12 => _12[semanticConventions.ATTR_URL_FULL]]); + if (urlAttribute) { + return urlAttribute; + } + + // Also look at the traceState, which we may set in the sampler even for unsampled spans + const urlTraceState = _optionalChain$4([span, 'access', _13 => _13.spanContext, 'call', _14 => _14(), 'access', _15 => _15.traceState, 'optionalAccess', _16 => _16.get, 'call', _17 => _17(SENTRY_TRACE_STATE_URL)]); + if (urlTraceState) { + return urlTraceState; + } + + return undefined; +} + +function generateRemoteSpanContext({ + spanId, + traceId, + sampled, + dsc, +} + +) { + // We store the DSC as OTEL trace state on the span context + const traceState = makeTraceState({ + dsc, + sampled, + }); + + const spanContext = { + traceId, + spanId, + isRemote: true, + traceFlags: sampled ? api.TraceFlags.SAMPLED : api.TraceFlags.NONE, + traceState, + }; + + return spanContext; +} + +/** + * Wraps a function with a transaction/span and finishes the span after the function is done. + * The created span is the active span and will be used as parent by other spans created inside the function + * and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active. + * + * If you want to create a span that is not set as active, use {@link startInactiveSpan}. + * + * You'll always get a span passed to the callback, + * it may just be a non-recording span if the span is not sampled or if tracing is disabled. + */ +function startSpan(options, callback) { + const tracer = getTracer(); + + const { name, parentSpan: customParentSpan } = options; + + // If `options.parentSpan` is defined, we want to wrap the callback in `withActiveSpan` + const wrapper = getActiveSpanWrapper(customParentSpan); + + return wrapper(() => { + const activeCtx = getContext(options.scope, options.forceTransaction); + const shouldSkipSpan = options.onlyIfParent && !api.trace.getSpan(activeCtx); + const ctx = shouldSkipSpan ? core$1.suppressTracing(activeCtx) : activeCtx; + + const spanOptions = getSpanOptions(options); + + return tracer.startActiveSpan(name, spanOptions, ctx, span => { + return core.handleCallbackErrors( + () => callback(span), + () => { + // Only set the span status to ERROR when there wasn't any status set before, in order to avoid stomping useful span statuses + if (core.spanToJSON(span).status === undefined) { + span.setStatus({ code: api.SpanStatusCode.ERROR }); + } + }, + () => span.end(), + ); + }); + }); +} + +/** + * Similar to `Sentry.startSpan`. Wraps a function with a span, but does not finish the span + * after the function is done automatically. You'll have to call `span.end()` manually. + * + * The created span is the active span and will be used as parent by other spans created inside the function + * and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active. + * + * You'll always get a span passed to the callback, + * it may just be a non-recording span if the span is not sampled or if tracing is disabled. + */ +function startSpanManual( + options, + callback, +) { + const tracer = getTracer(); + + const { name, parentSpan: customParentSpan } = options; + + // If `options.parentSpan` is defined, we want to wrap the callback in `withActiveSpan` + const wrapper = getActiveSpanWrapper(customParentSpan); + + return wrapper(() => { + const activeCtx = getContext(options.scope, options.forceTransaction); + const shouldSkipSpan = options.onlyIfParent && !api.trace.getSpan(activeCtx); + const ctx = shouldSkipSpan ? core$1.suppressTracing(activeCtx) : activeCtx; + + const spanOptions = getSpanOptions(options); + + return tracer.startActiveSpan(name, spanOptions, ctx, span => { + return core.handleCallbackErrors( + () => callback(span, () => span.end()), + () => { + // Only set the span status to ERROR when there wasn't any status set before, in order to avoid stomping useful span statuses + if (core.spanToJSON(span).status === undefined) { + span.setStatus({ code: api.SpanStatusCode.ERROR }); + } + }, + ); + }); + }); +} + +/** + * Creates a span. This span is not set as active, so will not get automatic instrumentation spans + * as children or be able to be accessed via `Sentry.getActiveSpan()`. + * + * If you want to create a span that is set as active, use {@link startSpan}. + * + * This function will always return a span, + * it may just be a non-recording span if the span is not sampled or if tracing is disabled. + */ +function startInactiveSpan(options) { + const tracer = getTracer(); + + const { name, parentSpan: customParentSpan } = options; + + // If `options.parentSpan` is defined, we want to wrap the callback in `withActiveSpan` + const wrapper = getActiveSpanWrapper(customParentSpan); + + return wrapper(() => { + const activeCtx = getContext(options.scope, options.forceTransaction); + const shouldSkipSpan = options.onlyIfParent && !api.trace.getSpan(activeCtx); + const ctx = shouldSkipSpan ? core$1.suppressTracing(activeCtx) : activeCtx; + + const spanOptions = getSpanOptions(options); + + const span = tracer.startSpan(name, spanOptions, ctx); + + return span; + }); +} + +/** + * Forks the current scope and sets the provided span as active span in the context of the provided callback. Can be + * passed `null` to start an entirely new span tree. + * + * @param span Spans started in the context of the provided callback will be children of this span. If `null` is passed, + * spans started within the callback will be root spans. + * @param callback Execution context in which the provided span will be active. Is passed the newly forked scope. + * @returns the value returned from the provided callback function. + */ +function withActiveSpan(span, callback) { + const newContextWithActiveSpan = span ? api.trace.setSpan(api.context.active(), span) : api.trace.deleteSpan(api.context.active()); + return api.context.with(newContextWithActiveSpan, () => callback(core.getCurrentScope())); +} + +function getTracer() { + const client = core.getClient(); + return (client && client.tracer) || api.trace.getTracer('@sentry/opentelemetry', core.SDK_VERSION); +} + +function getSpanOptions(options) { + const { startTime, attributes, kind, op } = options; + + // OTEL expects timestamps in ms, not seconds + const fixedStartTime = typeof startTime === 'number' ? ensureTimestampInMilliseconds(startTime) : startTime; + + return { + attributes: op + ? { + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: op, + ...attributes, + } + : attributes, + kind, + startTime: fixedStartTime, + }; +} + +function ensureTimestampInMilliseconds(timestamp) { + const isMs = timestamp < 9999999999; + return isMs ? timestamp * 1000 : timestamp; +} + +function getContext(scope, forceTransaction) { + const ctx = getContextForScope(scope); + const parentSpan = api.trace.getSpan(ctx); + + // In the case that we have no parent span, we start a new trace + // Note that if we continue a trace, we'll always have a remote parent span here anyhow + if (!parentSpan) { + return ctx; + } + + // If we don't want to force a transaction, and we have a parent span, all good, we just return as-is! + if (!forceTransaction) { + return ctx; + } + + // Else, if we do have a parent span but want to force a transaction, we have to simulate a "root" context + + // Else, we need to do two things: + // 1. Unset the parent span from the context, so we'll create a new root span + // 2. Ensure the propagation context is correct, so we'll continue from the parent span + const ctxWithoutSpan = api.trace.deleteSpan(ctx); + + const { spanId, traceId } = parentSpan.spanContext(); + const sampled = getSamplingDecision(parentSpan.spanContext()); + + // In this case, when we are forcing a transaction, we want to treat this like continuing an incoming trace + // so we set the traceState according to the root span + const rootSpan = core.getRootSpan(parentSpan); + const dsc = core.getDynamicSamplingContextFromSpan(rootSpan); + + const traceState = makeTraceState({ + dsc, + sampled, + }); + + const spanOptions = { + traceId, + spanId, + isRemote: true, + traceFlags: sampled ? api.TraceFlags.SAMPLED : api.TraceFlags.NONE, + traceState, + }; + + const ctxWithSpanContext = api.trace.setSpanContext(ctxWithoutSpan, spanOptions); + + return ctxWithSpanContext; +} + +function getContextForScope(scope) { + if (scope) { + const ctx = getContextFromScope(scope); + if (ctx) { + return ctx; + } + } + + return api.context.active(); +} + +/** + * Continue a trace from `sentry-trace` and `baggage` values. + * These values can be obtained from incoming request headers, or in the browser from `` + * and `` HTML tags. + * + * Spans started with `startSpan`, `startSpanManual` and `startInactiveSpan`, within the callback will automatically + * be attached to the incoming trace. + * + * This is a custom version of `continueTrace` that is used in OTEL-powered environments. + * It propagates the trace as a remote span, in addition to setting it on the propagation context. + */ +function continueTrace(options, callback) { + return continueTraceAsRemoteSpan(api.context.active(), options, callback); +} + +/** + * Get the trace context for a given scope. + * We have a custom implemention here because we need an OTEL-specific way to get the span from a scope. + */ +function getTraceContextForScope( + client, + scope, +) { + const ctx = getContextFromScope(scope); + const span = ctx && api.trace.getSpan(ctx); + + const traceContext = span ? core.spanToTraceContext(span) : core.getTraceContextFromScope(scope); + + const dynamicSamplingContext = span + ? core.getDynamicSamplingContextFromSpan(span) + : core.getDynamicSamplingContextFromScope(client, scope); + return [dynamicSamplingContext, traceContext]; +} + +function getActiveSpanWrapper(parentSpan) { + return parentSpan !== undefined + ? (callback) => { + return withActiveSpan(parentSpan, callback); + } + : (callback) => callback(); +} + +/** Suppress tracing in the given callback, ensuring no spans are generated inside of it. */ +function suppressTracing(callback) { + const ctx = core$1.suppressTracing(api.context.active()); + return api.context.with(ctx, callback); +} + +/** Ensure the `trace` context is set on all events. */ +function setupEventContextTrace(client) { + client.on('preprocessEvent', event => { + const span = getActiveSpan(); + // For transaction events, this is handled separately + // Because the active span may not be the span that is actually the transaction event + if (!span || event.type === 'transaction') { + return; + } + + // If event has already set `trace` context, use that one. + event.contexts = { + trace: core.spanToTraceContext(span), + ...event.contexts, + }; + + const rootSpan = core.getRootSpan(span); + + event.sdkProcessingMetadata = { + dynamicSamplingContext: core.getDynamicSamplingContextFromSpan(rootSpan), + ...event.sdkProcessingMetadata, + }; + + return event; + }); +} + +/** + * Otel-specific implementation of `getTraceData`. + * @see `@sentry/core` version of `getTraceData` for more information + */ +function getTraceData({ span } = {}) { + let ctx = api.context.active(); + + if (span) { + const { scope } = core.getCapturedScopesOnSpan(span); + // fall back to current context if for whatever reason we can't find the one of the span + ctx = (scope && getContextFromScope(scope)) || api.trace.setSpan(api.context.active(), span); + } + + const { traceId, spanId, sampled, dynamicSamplingContext } = getInjectionData(ctx); + + return { + 'sentry-trace': core.generateSentryTraceHeader(traceId, spanId, sampled), + baggage: core.dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext), + }; +} + +/** + * Sets the async context strategy to use follow the OTEL context under the hood. + * We handle forking a hub inside of our custom OTEL Context Manager (./otelContextManager.ts) + */ +function setOpenTelemetryContextAsyncContextStrategy() { + function getScopes() { + const ctx = api.context.active(); + const scopes = getScopesFromContext(ctx); + + if (scopes) { + return scopes; + } + + // fallback behavior: + // if, for whatever reason, we can't find scopes on the context here, we have to fix this somehow + return { + scope: core.getDefaultCurrentScope(), + isolationScope: core.getDefaultIsolationScope(), + }; + } + + function withScope(callback) { + const ctx = api.context.active(); + + // We depend on the otelContextManager to handle the context/hub + // We set the `SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY` context value, which is picked up by + // the OTEL context manager, which uses the presence of this key to determine if it should + // fork the isolation scope, or not + // as by default, we don't want to fork this, unless triggered explicitly by `withScope` + return api.context.with(ctx, () => { + return callback(getCurrentScope()); + }); + } + + function withSetScope(scope, callback) { + const ctx = api.context.active(); + + // We depend on the otelContextManager to handle the context/hub + // We set the `SENTRY_FORK_SET_SCOPE_CONTEXT_KEY` context value, which is picked up by + // the OTEL context manager, which picks up this scope as the current scope + return api.context.with(ctx.setValue(SENTRY_FORK_SET_SCOPE_CONTEXT_KEY, scope), () => { + return callback(scope); + }); + } + + function withIsolationScope(callback) { + const ctx = api.context.active(); + + // We depend on the otelContextManager to handle the context/hub + // We set the `SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY` context value, which is picked up by + // the OTEL context manager, which uses the presence of this key to determine if it should + // fork the isolation scope, or not + return api.context.with(ctx.setValue(SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY, true), () => { + return callback(getIsolationScope()); + }); + } + + function withSetIsolationScope(isolationScope, callback) { + const ctx = api.context.active(); + + // We depend on the otelContextManager to handle the context/hub + // We set the `SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY` context value, which is picked up by + // the OTEL context manager, which uses the presence of this key to determine if it should + // fork the isolation scope, or not + return api.context.with(ctx.setValue(SENTRY_FORK_SET_ISOLATION_SCOPE_CONTEXT_KEY, isolationScope), () => { + return callback(getIsolationScope()); + }); + } + + function getCurrentScope() { + return getScopes().scope; + } + + function getIsolationScope() { + return getScopes().isolationScope; + } + + core.setAsyncContextStrategy({ + withScope, + withSetScope, + withSetIsolationScope, + withIsolationScope, + getCurrentScope, + getIsolationScope, + startSpan, + startSpanManual, + startInactiveSpan, + getActiveSpan, + suppressTracing, + getTraceData, + continueTrace, + // The types here don't fully align, because our own `Span` type is narrower + // than the OTEL one - but this is OK for here, as we now we'll only have OTEL spans passed around + withActiveSpan: withActiveSpan , + }); +} + +function _optionalChain$3(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } + +/** + * Wrap an OpenTelemetry ContextManager in a way that ensures the context is kept in sync with the Sentry Scope. + * + * Usage: + * import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks'; + * const SentryContextManager = wrapContextManagerClass(AsyncLocalStorageContextManager); + * const contextManager = new SentryContextManager(); + */ +function wrapContextManagerClass( + ContextManagerClass, +) { + /** + * This is a custom ContextManager for OpenTelemetry, which extends the default AsyncLocalStorageContextManager. + * It ensures that we create new scopes per context, so that the OTEL Context & the Sentry Scope are always in sync. + * + * Note that we currently only support AsyncHooks with this, + * but since this should work for Node 14+ anyhow that should be good enough. + */ + + // @ts-expect-error TS does not like this, but we know this is fine + class SentryContextManager extends ContextManagerClass { + constructor(...args) { + super(...args); + setIsSetup('SentryContextManager'); + } + /** + * Overwrite with() of the original AsyncLocalStorageContextManager + * to ensure we also create new scopes per context. + */ + with( + context, + fn, + thisArg, + ...args + ) { + const currentScopes = getScopesFromContext(context); + const currentScope = _optionalChain$3([currentScopes, 'optionalAccess', _ => _.scope]) || core.getCurrentScope(); + const currentIsolationScope = _optionalChain$3([currentScopes, 'optionalAccess', _2 => _2.isolationScope]) || core.getIsolationScope(); + + const shouldForkIsolationScope = context.getValue(SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY) === true; + const scope = context.getValue(SENTRY_FORK_SET_SCOPE_CONTEXT_KEY) ; + const isolationScope = context.getValue(SENTRY_FORK_SET_ISOLATION_SCOPE_CONTEXT_KEY) ; + + const newCurrentScope = scope || currentScope.clone(); + const newIsolationScope = + isolationScope || (shouldForkIsolationScope ? currentIsolationScope.clone() : currentIsolationScope); + const scopes = { scope: newCurrentScope, isolationScope: newIsolationScope }; + + const ctx1 = setScopesOnContext(context, scopes); + + // Remove the unneeded values again + const ctx2 = ctx1 + .deleteValue(SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY) + .deleteValue(SENTRY_FORK_SET_SCOPE_CONTEXT_KEY) + .deleteValue(SENTRY_FORK_SET_ISOLATION_SCOPE_CONTEXT_KEY); + + setContextOnScope(newCurrentScope, ctx2); + + return super.with(ctx2, fn, thisArg, ...args); + } + } + + return SentryContextManager ; +} + +/** + * This function runs through a list of OTEL Spans, and wraps them in an `SpanNode` + * where each node holds a reference to their parent node. + */ +function groupSpansWithParents(spans) { + const nodeMap = new Map(); + + for (const span of spans) { + createOrUpdateSpanNodeAndRefs(nodeMap, span); + } + + return Array.from(nodeMap, function ([_id, spanNode]) { + return spanNode; + }); +} + +/** + * This returns the _local_ parent ID - `parentId` on the span may point to a remote span. + */ +function getLocalParentId(span) { + const parentIsRemote = span.attributes[SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE] === true; + // If the parentId is the trace parent ID, we pretend it's undefined + // As this means the parent exists somewhere else + return !parentIsRemote ? span.parentSpanId : undefined; +} + +function createOrUpdateSpanNodeAndRefs(nodeMap, span) { + const id = span.spanContext().spanId; + const parentId = getLocalParentId(span); + + if (!parentId) { + createOrUpdateNode(nodeMap, { id, span, children: [] }); + return; + } + + // Else make sure to create parent node as well + // Note that the parent may not know it's parent _yet_, this may be updated in a later pass + const parentNode = createOrGetParentNode(nodeMap, parentId); + const node = createOrUpdateNode(nodeMap, { id, span, parentNode, children: [] }); + parentNode.children.push(node); +} + +function createOrGetParentNode(nodeMap, id) { + const existing = nodeMap.get(id); + + if (existing) { + return existing; + } + + return createOrUpdateNode(nodeMap, { id, children: [] }); +} + +function createOrUpdateNode(nodeMap, spanNode) { + const existing = nodeMap.get(spanNode.id); + + // If span is already set, nothing to do here + if (existing && existing.span) { + return existing; + } + + // If it exists but span is not set yet, we update it + if (existing && !existing.span) { + existing.span = spanNode.span; + existing.parentNode = spanNode.parentNode; + return existing; + } + + // Else, we create a new one... + nodeMap.set(spanNode.id, spanNode); + return spanNode; +} + +// canonicalCodesGrpcMap maps some GRPC codes to Sentry's span statuses. See description in grpc documentation. +const canonicalGrpcErrorCodesMap = { + '1': 'cancelled', + '2': 'unknown_error', + '3': 'invalid_argument', + '4': 'deadline_exceeded', + '5': 'not_found', + '6': 'already_exists', + '7': 'permission_denied', + '8': 'resource_exhausted', + '9': 'failed_precondition', + '10': 'aborted', + '11': 'out_of_range', + '12': 'unimplemented', + '13': 'internal_error', + '14': 'unavailable', + '15': 'data_loss', + '16': 'unauthenticated', +} ; + +const isStatusErrorMessageValid = (message) => { + return Object.values(canonicalGrpcErrorCodesMap).includes(message ); +}; + +/** + * Get a Sentry span status from an otel span. + */ +function mapStatus(span) { + const attributes = spanHasAttributes(span) ? span.attributes : {}; + const status = spanHasStatus(span) ? span.status : undefined; + + if (status) { + // Since span status OK is not set by default, we give it priority: https://opentelemetry.io/docs/concepts/signals/traces/#span-status + if (status.code === api.SpanStatusCode.OK) { + return { code: core.SPAN_STATUS_OK }; + // If the span is already marked as erroneous we return that exact status + } else if (status.code === api.SpanStatusCode.ERROR) { + if (typeof status.message === 'undefined') { + const inferredStatus = inferStatusFromAttributes(attributes); + if (inferredStatus) { + return inferredStatus; + } + } + + if (status.message && isStatusErrorMessageValid(status.message)) { + return { code: core.SPAN_STATUS_ERROR, message: status.message }; + } else { + return { code: core.SPAN_STATUS_ERROR, message: 'unknown_error' }; + } + } + } + + // If the span status is UNSET, we try to infer it from HTTP or GRPC status codes. + const inferredStatus = inferStatusFromAttributes(attributes); + + if (inferredStatus) { + return inferredStatus; + } + + // We default to setting the spans status to ok. + if (status && status.code === api.SpanStatusCode.UNSET) { + return { code: core.SPAN_STATUS_OK }; + } else { + return { code: core.SPAN_STATUS_ERROR, message: 'unknown_error' }; + } +} + +function inferStatusFromAttributes(attributes) { + // If the span status is UNSET, we try to infer it from HTTP or GRPC status codes. + + // eslint-disable-next-line deprecation/deprecation + const httpCodeAttribute = attributes[semanticConventions.ATTR_HTTP_RESPONSE_STATUS_CODE] || attributes[semanticConventions.SEMATTRS_HTTP_STATUS_CODE]; + // eslint-disable-next-line deprecation/deprecation + const grpcCodeAttribute = attributes[semanticConventions.SEMATTRS_RPC_GRPC_STATUS_CODE]; + + const numberHttpCode = + typeof httpCodeAttribute === 'number' + ? httpCodeAttribute + : typeof httpCodeAttribute === 'string' + ? parseInt(httpCodeAttribute) + : undefined; + + if (typeof numberHttpCode === 'number') { + return core.getSpanStatusFromHttpCode(numberHttpCode); + } + + if (typeof grpcCodeAttribute === 'string') { + return { code: core.SPAN_STATUS_ERROR, message: canonicalGrpcErrorCodesMap[grpcCodeAttribute] || 'unknown_error' }; + } + + return undefined; +} + +function _optionalChain$2(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } + +const MAX_SPAN_COUNT = 1000; +const DEFAULT_TIMEOUT = 300; // 5 min + +/** + * A Sentry-specific exporter that converts OpenTelemetry Spans to Sentry Spans & Transactions. + */ +class SentrySpanExporter { + + /* + * A quick explanation on the buckets: We do bucketing of finished spans for efficiency. This span exporter is + * accumulating spans until a root span is encountered and then it flushes all the spans that are descendants of that + * root span. Because it is totally in the realm of possibilities that root spans are never finished, and we don't + * want to accumulate spans indefinitely in memory, we need to periodically evacuate spans. Naively we could simply + * store the spans in an array and each time a new span comes in we could iterate through the entire array and + * evacuate all spans that have an end-timestamp that is older than our limit. This could get quite expensive because + * we would have to iterate a potentially large number of spans every time we evacuate. We want to avoid these large + * bursts of computation. + * + * Instead we go for a bucketing approach and put spans into buckets, based on what second + * (modulo the time limit) the span was put into the exporter. With buckets, when we decide to evacuate, we can + * iterate through the bucket entries instead, which have an upper bound of items, making the evacuation much more + * efficient. Cleaning up also becomes much more efficient since it simply involves de-referencing a bucket within the + * bucket array, and letting garbage collection take care of the rest. + */ + + constructor(options + +) { + this._finishedSpanBucketSize = _optionalChain$2([options, 'optionalAccess', _ => _.timeout]) || DEFAULT_TIMEOUT; + this._finishedSpanBuckets = new Array(this._finishedSpanBucketSize).fill(undefined); + this._lastCleanupTimestampInS = Math.floor(Date.now() / 1000); + this._spansToBucketEntry = new WeakMap(); + } + + /** Export a single span. */ + export(span) { + const currentTimestampInS = Math.floor(Date.now() / 1000); + + if (this._lastCleanupTimestampInS !== currentTimestampInS) { + let droppedSpanCount = 0; + this._finishedSpanBuckets.forEach((bucket, i) => { + if (bucket && bucket.timestampInS <= currentTimestampInS - this._finishedSpanBucketSize) { + droppedSpanCount += bucket.spans.size; + this._finishedSpanBuckets[i] = undefined; + } + }); + if (droppedSpanCount > 0) { + DEBUG_BUILD && + core.logger.log( + `SpanExporter dropped ${droppedSpanCount} spans because they were pending for more than ${this._finishedSpanBucketSize} seconds.`, + ); + } + this._lastCleanupTimestampInS = currentTimestampInS; + } + + const currentBucketIndex = currentTimestampInS % this._finishedSpanBucketSize; + const currentBucket = this._finishedSpanBuckets[currentBucketIndex] || { + timestampInS: currentTimestampInS, + spans: new Set(), + }; + this._finishedSpanBuckets[currentBucketIndex] = currentBucket; + currentBucket.spans.add(span); + this._spansToBucketEntry.set(span, currentBucket); + + // If the span doesn't have a local parent ID (it's a root span), we're gonna flush all the ended spans + if (!getLocalParentId(span)) { + this._clearTimeout(); + + // If we got a parent span, we try to send the span tree + // Wait a tick for this, to ensure we avoid race conditions + this._flushTimeout = setTimeout(() => { + this.flush(); + }, 1); + } + } + + /** Try to flush any pending spans immediately. */ + flush() { + this._clearTimeout(); + + const finishedSpans = []; + this._finishedSpanBuckets.forEach(bucket => { + if (bucket) { + finishedSpans.push(...bucket.spans); + } + }); + + const sentSpans = maybeSend(finishedSpans); + + const sentSpanCount = sentSpans.size; + + const remainingOpenSpanCount = finishedSpans.length - sentSpanCount; + + DEBUG_BUILD && + core.logger.log( + `SpanExporter exported ${sentSpanCount} spans, ${remainingOpenSpanCount} spans are waiting for their parent spans to finish`, + ); + + sentSpans.forEach(span => { + const bucketEntry = this._spansToBucketEntry.get(span); + if (bucketEntry) { + bucketEntry.spans.delete(span); + } + }); + } + + /** Clear the exporter. */ + clear() { + this._finishedSpanBuckets = this._finishedSpanBuckets.fill(undefined); + this._clearTimeout(); + } + + /** Clear the flush timeout. */ + _clearTimeout() { + if (this._flushTimeout) { + clearTimeout(this._flushTimeout); + this._flushTimeout = undefined; + } + } +} + +/** + * Send the given spans, but only if they are part of a finished transaction. + * + * Returns the sent spans. + * Spans remain unsent when their parent span is not yet finished. + * This will happen regularly, as child spans are generally finished before their parents. + * But it _could_ also happen because, for whatever reason, a parent span was lost. + * In this case, we'll eventually need to clean this up. + */ +function maybeSend(spans) { + const grouped = groupSpansWithParents(spans); + const sentSpans = new Set(); + + const rootNodes = getCompletedRootNodes(grouped); + + rootNodes.forEach(root => { + const span = root.span; + sentSpans.add(span); + const transactionEvent = createTransactionForOtelSpan(span); + + // We'll recursively add all the child spans to this array + const spans = transactionEvent.spans || []; + + root.children.forEach(child => { + createAndFinishSpanForOtelSpan(child, spans, sentSpans); + }); + + // spans.sort() mutates the array, but we do not use this anymore after this point + // so we can safely mutate it here + transactionEvent.spans = + spans.length > MAX_SPAN_COUNT + ? spans.sort((a, b) => a.start_timestamp - b.start_timestamp).slice(0, MAX_SPAN_COUNT) + : spans; + + const measurements = core.timedEventsToMeasurements(span.events); + if (measurements) { + transactionEvent.measurements = measurements; + } + + core.captureEvent(transactionEvent); + }); + + return sentSpans; +} + +function nodeIsCompletedRootNode(node) { + return !!node.span && !node.parentNode; +} + +function getCompletedRootNodes(nodes) { + return nodes.filter(nodeIsCompletedRootNode); +} + +function parseSpan(span) { + const attributes = span.attributes; + + const origin = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] ; + const op = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] ; + const source = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] ; + + return { origin, op, source }; +} + +/** Exported only for tests. */ +function createTransactionForOtelSpan(span) { + const { op, description, data, origin = 'manual', source } = getSpanData(span); + const capturedSpanScopes = core.getCapturedScopesOnSpan(span ); + + const sampleRate = span.attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE] ; + + const attributes = core.dropUndefinedKeys({ + [core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: source, + [core.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: sampleRate, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: op, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: origin, + ...data, + ...removeSentryAttributes(span.attributes), + }); + + const { traceId: trace_id, spanId: span_id } = span.spanContext(); + + // If parentSpanIdFromTraceState is defined at all, we want it to take precedence + // In that case, an empty string should be interpreted as "no parent span id", + // even if `span.parentSpanId` is set + // this is the case when we are starting a new trace, where we have a virtual span based on the propagationContext + // We only want to continue the traceId in this case, but ignore the parent span + const parent_span_id = span.parentSpanId; + + const status = mapStatus(span); + + const traceContext = core.dropUndefinedKeys({ + parent_span_id, + span_id, + trace_id, + data: attributes, + origin, + op, + status: core.getStatusMessage(status), // As per protocol, span status is allowed to be undefined + }); + + const statusCode = attributes[semanticConventions.ATTR_HTTP_RESPONSE_STATUS_CODE]; + const responseContext = typeof statusCode === 'number' ? { response: { status_code: statusCode } } : undefined; + + const transactionEvent = core.dropUndefinedKeys({ + contexts: { + trace: traceContext, + otel: { + resource: span.resource.attributes, + }, + ...responseContext, + }, + spans: [], + start_timestamp: core.spanTimeInputToSeconds(span.startTime), + timestamp: core.spanTimeInputToSeconds(span.endTime), + transaction: description, + type: 'transaction', + sdkProcessingMetadata: { + ...core.dropUndefinedKeys({ + capturedSpanScope: capturedSpanScopes.scope, + capturedSpanIsolationScope: capturedSpanScopes.isolationScope, + sampleRate, + dynamicSamplingContext: core.getDynamicSamplingContextFromSpan(span ), + }), + }, + ...(source && { + transaction_info: { + source, + }, + }), + _metrics_summary: core.getMetricSummaryJsonForSpan(span ), + }); + + return transactionEvent; +} + +function createAndFinishSpanForOtelSpan(node, spans, sentSpans) { + const span = node.span; + + if (span) { + sentSpans.add(span); + } + + const shouldDrop = !span; + + // If this span should be dropped, we still want to create spans for the children of this + if (shouldDrop) { + node.children.forEach(child => { + createAndFinishSpanForOtelSpan(child, spans, sentSpans); + }); + return; + } + + const span_id = span.spanContext().spanId; + const trace_id = span.spanContext().traceId; + + const { attributes, startTime, endTime, parentSpanId } = span; + + const { op, description, data, origin = 'manual' } = getSpanData(span); + const allData = core.dropUndefinedKeys({ + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: origin, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: op, + ...removeSentryAttributes(attributes), + ...data, + }); + + const status = mapStatus(span); + + const spanJSON = core.dropUndefinedKeys({ + span_id, + trace_id, + data: allData, + description, + parent_span_id: parentSpanId, + start_timestamp: core.spanTimeInputToSeconds(startTime), + // This is [0,0] by default in OTEL, in which case we want to interpret this as no end time + timestamp: core.spanTimeInputToSeconds(endTime) || undefined, + status: core.getStatusMessage(status), // As per protocol, span status is allowed to be undefined + op, + origin, + _metrics_summary: core.getMetricSummaryJsonForSpan(span ), + measurements: core.timedEventsToMeasurements(span.events), + }); + + spans.push(spanJSON); + + node.children.forEach(child => { + createAndFinishSpanForOtelSpan(child, spans, sentSpans); + }); +} + +function getSpanData(span) + + { + const { op: definedOp, source: definedSource, origin } = parseSpan(span); + const { op: inferredOp, description, source: inferredSource, data: inferredData } = parseSpanDescription(span); + + const op = definedOp || inferredOp; + const source = definedSource || inferredSource; + + const data = { ...inferredData, ...getData(span) }; + + return { + op, + description, + source, + origin, + data, + }; +} + +/** + * Remove custom `sentry.` attributes we do not need to send. + * These are more carrier attributes we use inside of the SDK, we do not need to send them to the API. + */ +function removeSentryAttributes(data) { + const cleanedData = { ...data }; + + /* eslint-disable @typescript-eslint/no-dynamic-delete */ + delete cleanedData[core.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]; + delete cleanedData[SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE]; + delete cleanedData[core.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; + /* eslint-enable @typescript-eslint/no-dynamic-delete */ + + return cleanedData; +} + +function getData(span) { + const attributes = span.attributes; + const data = {}; + + if (span.kind !== api.SpanKind.INTERNAL) { + data['otel.kind'] = api.SpanKind[span.kind]; + } + + // eslint-disable-next-line deprecation/deprecation + const maybeHttpStatusCodeAttribute = attributes[semanticConventions.SEMATTRS_HTTP_STATUS_CODE]; + if (maybeHttpStatusCodeAttribute) { + data[semanticConventions.ATTR_HTTP_RESPONSE_STATUS_CODE] = maybeHttpStatusCodeAttribute ; + } + + const requestData = getRequestSpanData(span); + + if (requestData.url) { + data.url = requestData.url; + } + + if (requestData['http.query']) { + data['http.query'] = requestData['http.query'].slice(1); + } + if (requestData['http.fragment']) { + data['http.fragment'] = requestData['http.fragment'].slice(1); + } + + return data; +} + +function _optionalChain$1(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } + +function onSpanStart(span, parentContext) { + // This is a reliable way to get the parent span - because this is exactly how the parent is identified in the OTEL SDK + const parentSpan = api.trace.getSpan(parentContext); + + let scopes = getScopesFromContext(parentContext); + + // We need access to the parent span in order to be able to move up the span tree for breadcrumbs + if (parentSpan && !parentSpan.spanContext().isRemote) { + core.addChildSpanToSpan(parentSpan, span); + } + + // We need this in the span exporter + if (parentSpan && parentSpan.spanContext().isRemote) { + span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE, true); + } + + // The root context does not have scopes stored, so we check for this specifically + // As fallback we attach the global scopes + if (parentContext === api.ROOT_CONTEXT) { + scopes = { + scope: core.getDefaultCurrentScope(), + isolationScope: core.getDefaultIsolationScope(), + }; + } + + // We need the scope at time of span creation in order to apply it to the event when the span is finished + if (scopes) { + core.setCapturedScopesOnSpan(span, scopes.scope, scopes.isolationScope); + } + + core.logSpanStart(span); + + const client = core.getClient(); + _optionalChain$1([client, 'optionalAccess', _ => _.emit, 'call', _2 => _2('spanStart', span)]); +} + +function onSpanEnd(span) { + core.logSpanEnd(span); + + const client = core.getClient(); + _optionalChain$1([client, 'optionalAccess', _3 => _3.emit, 'call', _4 => _4('spanEnd', span)]); +} + +/** + * Converts OpenTelemetry Spans to Sentry Spans and sends them to Sentry via + * the Sentry SDK. + */ +class SentrySpanProcessor { + + constructor(options) { + setIsSetup('SentrySpanProcessor'); + this._exporter = new SentrySpanExporter(options); + } + + /** + * @inheritDoc + */ + async forceFlush() { + this._exporter.flush(); + } + + /** + * @inheritDoc + */ + async shutdown() { + this._exporter.clear(); + } + + /** + * @inheritDoc + */ + onStart(span, parentContext) { + onSpanStart(span, parentContext); + } + + /** @inheritDoc */ + onEnd(span) { + onSpanEnd(span); + + this._exporter.export(span); + } +} + +/** + * A custom OTEL sampler that uses Sentry sampling rates to make its decision + */ +class SentrySampler { + + constructor(client) { + this._client = client; + setIsSetup('SentrySampler'); + } + + /** @inheritDoc */ + shouldSample( + context, + traceId, + spanName, + spanKind, + spanAttributes, + _links, + ) { + const options = this._client.getOptions(); + + const parentSpan = getValidSpan(context); + const parentContext = _optionalChain([parentSpan, 'optionalAccess', _ => _.spanContext, 'call', _2 => _2()]); + + if (!core.hasTracingEnabled(options)) { + return wrapSamplingDecision({ decision: undefined, context, spanAttributes }); + } + + // `ATTR_HTTP_REQUEST_METHOD` is the new attribute, but we still support the old one, `SEMATTRS_HTTP_METHOD`, for now. + // eslint-disable-next-line deprecation/deprecation + const maybeSpanHttpMethod = spanAttributes[semanticConventions.SEMATTRS_HTTP_METHOD] || spanAttributes[semanticConventions.ATTR_HTTP_REQUEST_METHOD]; + + // If we have a http.client span that has no local parent, we never want to sample it + // but we want to leave downstream sampling decisions up to the server + if (spanKind === api.SpanKind.CLIENT && maybeSpanHttpMethod && (!parentSpan || _optionalChain([parentContext, 'optionalAccess', _3 => _3.isRemote]))) { + return wrapSamplingDecision({ decision: undefined, context, spanAttributes }); + } + + const parentSampled = parentSpan ? getParentSampled(parentSpan, traceId, spanName) : undefined; + + // We want to pass the inferred name & attributes to the sampler method + const { + description: inferredSpanName, + data: inferredAttributes, + op, + } = inferSpanData(spanName, spanAttributes, spanKind); + + const mergedAttributes = { + ...inferredAttributes, + ...spanAttributes, + }; + + if (op) { + mergedAttributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] = op; + } + + const mutableSamplingDecision = { decision: true }; + this._client.emit( + 'beforeSampling', + { + spanAttributes: mergedAttributes, + spanName: inferredSpanName, + parentSampled: parentSampled, + parentContext: parentContext, + }, + mutableSamplingDecision, + ); + if (!mutableSamplingDecision.decision) { + return wrapSamplingDecision({ decision: undefined, context, spanAttributes }); + } + + const [sampled, sampleRate] = core.sampleSpan(options, { + name: inferredSpanName, + attributes: mergedAttributes, + transactionContext: { + name: inferredSpanName, + parentSampled, + }, + parentSampled, + }); + + const attributes = { + [core.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: sampleRate, + }; + + const method = `${maybeSpanHttpMethod}`.toUpperCase(); + if (method === 'OPTIONS' || method === 'HEAD') { + DEBUG_BUILD && core.logger.log(`[Tracing] Not sampling span because HTTP method is '${method}' for ${spanName}`); + + return { + ...wrapSamplingDecision({ decision: sdkTraceBase.SamplingDecision.NOT_RECORD, context, spanAttributes }), + attributes, + }; + } + + if (!sampled) { + return { + ...wrapSamplingDecision({ decision: sdkTraceBase.SamplingDecision.NOT_RECORD, context, spanAttributes }), + attributes, + }; + } + return { + ...wrapSamplingDecision({ decision: sdkTraceBase.SamplingDecision.RECORD_AND_SAMPLED, context, spanAttributes }), + attributes, + }; + } + + /** Returns the sampler name or short description with the configuration. */ + toString() { + return 'SentrySampler'; + } +} + +function getParentRemoteSampled(parentSpan) { + const traceId = parentSpan.spanContext().traceId; + const traceparentData = getPropagationContextFromSpan(parentSpan); + + // Only inherit sampled if `traceId` is the same + return traceparentData && traceId === traceparentData.traceId ? traceparentData.sampled : undefined; +} + +function getParentSampled(parentSpan, traceId, spanName) { + const parentContext = parentSpan.spanContext(); + + // Only inherit sample rate if `traceId` is the same + // Note for testing: `isSpanContextValid()` checks the format of the traceId/spanId, so we need to pass valid ones + if (api.isSpanContextValid(parentContext) && parentContext.traceId === traceId) { + if (parentContext.isRemote) { + const parentSampled = getParentRemoteSampled(parentSpan); + DEBUG_BUILD && + core.logger.log(`[Tracing] Inheriting remote parent's sampled decision for ${spanName}: ${parentSampled}`); + return parentSampled; + } + + const parentSampled = getSamplingDecision(parentContext); + DEBUG_BUILD && core.logger.log(`[Tracing] Inheriting parent's sampled decision for ${spanName}: ${parentSampled}`); + return parentSampled; + } + + return undefined; +} + +/** + * Wrap a sampling decision with data that Sentry needs to work properly with it. + * If you pass `decision: undefined`, it will be treated as `NOT_RECORDING`, but in contrast to passing `NOT_RECORDING` + * it will not propagate this decision to downstream Sentry SDKs. + */ +function wrapSamplingDecision({ + decision, + context, + spanAttributes, +}) { + const traceState = getBaseTraceState(context, spanAttributes); + + // If the decision is undefined, we treat it as NOT_RECORDING, but we don't propagate this decision to downstream SDKs + // Which is done by not setting `SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING` traceState + if (decision == undefined) { + return { decision: sdkTraceBase.SamplingDecision.NOT_RECORD, traceState }; + } + + if (decision === sdkTraceBase.SamplingDecision.NOT_RECORD) { + return { decision, traceState: traceState.set(SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING, '1') }; + } + + return { decision, traceState }; +} + +function getBaseTraceState(context, spanAttributes) { + const parentSpan = api.trace.getSpan(context); + const parentContext = _optionalChain([parentSpan, 'optionalAccess', _4 => _4.spanContext, 'call', _5 => _5()]); + + let traceState = _optionalChain([parentContext, 'optionalAccess', _6 => _6.traceState]) || new core$1.TraceState(); + + // We always keep the URL on the trace state, so we can access it in the propagator + // `ATTR_URL_FULL` is the new attribute, but we still support the old one, `ATTR_HTTP_URL`, for now. + // eslint-disable-next-line deprecation/deprecation + const url = spanAttributes[semanticConventions.SEMATTRS_HTTP_URL] || spanAttributes[semanticConventions.ATTR_URL_FULL]; + if (url && typeof url === 'string') { + traceState = traceState.set(SENTRY_TRACE_STATE_URL, url); + } + + return traceState; +} + +/** + * If the active span is invalid, we want to ignore it as parent. + * This aligns with how otel tracers and default samplers handle these cases. + */ +function getValidSpan(context) { + const span = api.trace.getSpan(context); + return span && api.isSpanContextValid(span.spanContext()) ? span : undefined; +} + +/** + * This method takes an OpenTelemetry instrumentation or + * array of instrumentations and registers them with OpenTelemetry. + * + * @deprecated This method will be removed in the next major version of the SDK. + * Use the `openTelemetryInstrumentations` option in `Sentry.init()` or your custom Sentry Client instead. + */ +function addOpenTelemetryInstrumentation(...instrumentations) { + instrumentation.registerInstrumentations({ + instrumentations, + }); +} + +exports.getClient = core.getClient; +exports.getCurrentHubShim = core.getCurrentHubShim; +exports.getDynamicSamplingContextFromSpan = core.getDynamicSamplingContextFromSpan; +exports.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION = SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION; +exports.SentryPropagator = SentryPropagator; +exports.SentrySampler = SentrySampler; +exports.SentrySpanProcessor = SentrySpanProcessor; +exports.addOpenTelemetryInstrumentation = addOpenTelemetryInstrumentation; +exports.continueTrace = continueTrace; +exports.enhanceDscWithOpenTelemetryRootSpanName = enhanceDscWithOpenTelemetryRootSpanName; +exports.generateSpanContextForPropagationContext = generateSpanContextForPropagationContext; +exports.getActiveSpan = getActiveSpan; +exports.getPropagationContextFromSpan = getPropagationContextFromSpan; +exports.getRequestSpanData = getRequestSpanData; +exports.getScopesFromContext = getScopesFromContext; +exports.getSpanKind = getSpanKind; +exports.getTraceContextForScope = getTraceContextForScope; +exports.isSentryRequestSpan = isSentryRequestSpan; +exports.openTelemetrySetupCheck = openTelemetrySetupCheck; +exports.setOpenTelemetryContextAsyncContextStrategy = setOpenTelemetryContextAsyncContextStrategy; +exports.setupEventContextTrace = setupEventContextTrace; +exports.shouldPropagateTraceForUrl = shouldPropagateTraceForUrl; +exports.spanHasAttributes = spanHasAttributes; +exports.spanHasEvents = spanHasEvents; +exports.spanHasKind = spanHasKind; +exports.spanHasName = spanHasName; +exports.spanHasParentId = spanHasParentId; +exports.spanHasStatus = spanHasStatus; +exports.startInactiveSpan = startInactiveSpan; +exports.startSpan = startSpan; +exports.startSpanManual = startSpanManual; +exports.suppressTracing = suppressTracing; +exports.withActiveSpan = withActiveSpan; +exports.wrapClientClass = wrapClientClass; +exports.wrapContextManagerClass = wrapContextManagerClass; +exports.wrapSamplingDecision = wrapSamplingDecision; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 37289: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var util = __nccwpck_require__(73837); + +var ParseError = __nccwpck_require__(558); +var ascii = __nccwpck_require__(32789); + +var isDelimiter = ascii.isDelimiter; +var isTokenChar = ascii.isTokenChar; +var isExtended = ascii.isExtended; +var isPrint = ascii.isPrint; + +/** + * Unescape a string. + * + * @param {string} str The string to unescape. + * @returns {string} A new unescaped string. + * @private + */ +function decode(str) { + return str.replace(/\\(.)/g, '$1'); +} + +/** + * Build an error message when an unexpected character is found. + * + * @param {string} header The header field value. + * @param {number} position The position of the unexpected character. + * @returns {string} The error message. + * @private + */ +function unexpectedCharacterMessage(header, position) { + return util.format( + "Unexpected character '%s' at index %d", + header.charAt(position), + position + ); +} + +/** + * Parse the `Forwarded` header field value into an array of objects. + * + * @param {string} header The header field value. + * @returns {Object[]} + * @public + */ +function parse(header) { + var mustUnescape = false; + var isEscaping = false; + var inQuotes = false; + var forwarded = {}; + var output = []; + var start = -1; + var end = -1; + var parameter; + var code; + + for (var i = 0; i < header.length; i++) { + code = header.charCodeAt(i); + + if (parameter === undefined) { + if ( + i !== 0 && + start === -1 && + (code === 0x20/*' '*/ || code === 0x09/*'\t'*/) + ) { + continue; + } + + if (isTokenChar(code)) { + if (start === -1) start = i; + } else if (code === 0x3D/*'='*/ && start !== -1) { + parameter = header.slice(start, i).toLowerCase(); + start = -1; + } else { + throw new ParseError(unexpectedCharacterMessage(header, i), header); + } + } else { + if (isEscaping && (code === 0x09 || isPrint(code) || isExtended(code))) { + isEscaping = false; + } else if (isTokenChar(code)) { + if (end !== -1) { + throw new ParseError(unexpectedCharacterMessage(header, i), header); + } + + if (start === -1) start = i; + } else if (isDelimiter(code) || isExtended(code)) { + if (inQuotes) { + if (code === 0x22/*'"'*/) { + inQuotes = false; + end = i; + } else if (code === 0x5C/*'\'*/) { + if (start === -1) start = i; + isEscaping = mustUnescape = true; + } else if (start === -1) { + start = i; + } + } else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3D) { + inQuotes = true; + } else if ( + (code === 0x2C/*','*/|| code === 0x3B/*';'*/) && + (start !== -1 || end !== -1) + ) { + if (start !== -1) { + if (end === -1) end = i; + forwarded[parameter] = mustUnescape + ? decode(header.slice(start, end)) + : header.slice(start, end); + } else { + forwarded[parameter] = ''; + } + + if (code === 0x2C) { + output.push(forwarded); + forwarded = {}; + } + + parameter = undefined; + start = end = -1; + } else { + throw new ParseError(unexpectedCharacterMessage(header, i), header); + } + } else if (code === 0x20 || code === 0x09) { + if (end !== -1) continue; + + if (inQuotes) { + if (start === -1) start = i; + } else if (start !== -1) { + end = i; + } else { + throw new ParseError(unexpectedCharacterMessage(header, i), header); + } + } else { + throw new ParseError(unexpectedCharacterMessage(header, i), header); + } + } + } + + if ( + parameter === undefined || + inQuotes || + (start === -1 && end === -1) || + code === 0x20 || + code === 0x09 + ) { + throw new ParseError('Unexpected end of input', header); + } + + if (start !== -1) { + if (end === -1) end = i; + forwarded[parameter] = mustUnescape + ? decode(header.slice(start, end)) + : header.slice(start, end); + } else { + forwarded[parameter] = ''; + } + + output.push(forwarded); + return output; +} + +module.exports = parse; + + +/***/ }), + +/***/ 32789: +/***/ ((module) => { + +"use strict"; + + +/** + * Check if a character is a delimiter as defined in section 3.2.6 of RFC 7230. + * + * + * @param {number} code The code of the character to check. + * @returns {boolean} `true` if the character is a delimiter, else `false`. + * @public + */ +function isDelimiter(code) { + return code === 0x22 // '"' + || code === 0x28 // '(' + || code === 0x29 // ')' + || code === 0x2C // ',' + || code === 0x2F // '/' + || code >= 0x3A && code <= 0x40 // ':', ';', '<', '=', '>', '?' '@' + || code >= 0x5B && code <= 0x5D // '[', '\', ']' + || code === 0x7B // '{' + || code === 0x7D; // '}' +} + +/** + * Check if a character is allowed in a token as defined in section 3.2.6 + * of RFC 7230. + * + * @param {number} code The code of the character to check. + * @returns {boolean} `true` if the character is allowed, else `false`. + * @public + */ +function isTokenChar(code) { + return code === 0x21 // '!' + || code >= 0x23 && code <= 0x27 // '#', '$', '%', '&', ''' + || code === 0x2A // '*' + || code === 0x2B // '+' + || code === 0x2D // '-' + || code === 0x2E // '.' + || code >= 0x30 && code <= 0x39 // 0-9 + || code >= 0x41 && code <= 0x5A // A-Z + || code >= 0x5E && code <= 0x7A // '^', '_', '`', a-z + || code === 0x7C // '|' + || code === 0x7E; // '~' +} + +/** + * Check if a character is a printable ASCII character. + * + * @param {number} code The code of the character to check. + * @returns {boolean} `true` if `code` is in the %x20-7E range, else `false`. + * @public + */ +function isPrint(code) { + return code >= 0x20 && code <= 0x7E; +} + +/** + * Check if a character is an extended ASCII character. + * + * @param {number} code The code of the character to check. + * @returns {boolean} `true` if `code` is in the %x80-FF range, else `false`. + * @public + */ +function isExtended(code) { + return code >= 0x80 && code <= 0xFF; +} + +module.exports = { + isDelimiter: isDelimiter, + isTokenChar: isTokenChar, + isExtended: isExtended, + isPrint: isPrint +}; + + +/***/ }), + +/***/ 558: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var util = __nccwpck_require__(73837); + +/** + * An error thrown by the parser on unexpected input. + * + * @constructor + * @param {string} message The error message. + * @param {string} input The unexpected input. + * @public + */ +function ParseError(message, input) { + Error.captureStackTrace(this, ParseError); + + this.name = this.constructor.name; + this.message = message; + this.input = input; +} + +util.inherits(ParseError, Error); + +module.exports = ParseError; + + +/***/ }), + +/***/ 19320: +/***/ ((module) => { + +"use strict"; + + +/* eslint no-invalid-this: 1 */ + +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; +var toStr = Object.prototype.toString; +var max = Math.max; +var funcType = '[object Function]'; + +var concatty = function concatty(a, b) { + var arr = []; + + for (var i = 0; i < a.length; i += 1) { + arr[i] = a[i]; + } + for (var j = 0; j < b.length; j += 1) { + arr[j + a.length] = b[j]; + } + + return arr; +}; + +var slicy = function slicy(arrLike, offset) { + var arr = []; + for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { + arr[j] = arrLike[i]; + } + return arr; +}; + +var joiny = function (arr, joiner) { + var str = ''; + for (var i = 0; i < arr.length; i += 1) { + str += arr[i]; + if (i + 1 < arr.length) { + str += joiner; + } + } + return str; +}; + +module.exports = function bind(that) { + var target = this; + if (typeof target !== 'function' || toStr.apply(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slicy(arguments, 1); + + var bound; + var binder = function () { + if (this instanceof bound) { + var result = target.apply( + this, + concatty(args, arguments) + ); + if (Object(result) === result) { + return result; + } + return this; + } + return target.apply( + that, + concatty(args, arguments) + ); + + }; + + var boundLength = max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs[i] = '$' + i; + } + + bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder); + + if (target.prototype) { + var Empty = function Empty() {}; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + + return bound; +}; + + +/***/ }), + +/***/ 88334: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var implementation = __nccwpck_require__(19320); + +module.exports = Function.prototype.bind || implementation; + + +/***/ }), + +/***/ 31621: +/***/ ((module) => { + +"use strict"; + + +module.exports = (flag, argv = process.argv) => { + const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf('--'); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); +}; + + +/***/ }), + +/***/ 36151: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License. +// +// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc. + +const path = __nccwpck_require__(71017) +const parse = __nccwpck_require__(97751) +const { fileURLToPath } = __nccwpck_require__(57310) +const { MessageChannel } = __nccwpck_require__(71267) + +const { + importHooks, + specifiers, + toHook +} = __nccwpck_require__(37174) + +function addHook (hook) { + importHooks.push(hook) + toHook.forEach(([name, namespace]) => hook(name, namespace)) +} + +function removeHook (hook) { + const index = importHooks.indexOf(hook) + if (index > -1) { + importHooks.splice(index, 1) + } +} + +function callHookFn (hookFn, namespace, name, baseDir) { + const newDefault = hookFn(namespace, name, baseDir) + if (newDefault && newDefault !== namespace) { + namespace.default = newDefault + } +} + +let sendModulesToLoader + +/** + * EXPERIMENTAL + * This feature is experimental and may change in minor versions. + * **NOTE** This feature is incompatible with the {internals: true} Hook option. + * + * Creates a message channel with a port that can be used to add hooks to the + * list of exclusively included modules. + * + * This can be used to only wrap modules that are Hook'ed, however modules need + * to be hooked before they are imported. + * + * ```ts + * import { register } from 'module' + * import { Hook, createAddHookMessageChannel } from 'import-in-the-middle' + * + * const { registerOptions, waitForAllMessagesAcknowledged } = createAddHookMessageChannel() + * + * register('import-in-the-middle/hook.mjs', import.meta.url, registerOptions) + * + * Hook(['fs'], (exported, name, baseDir) => { + * // Instrument the fs module + * }) + * + * // Ensure that the loader has acknowledged all the modules + * // before we allow execution to continue + * await waitForAllMessagesAcknowledged() + * ``` + */ +function createAddHookMessageChannel () { + const { port1, port2 } = new MessageChannel() + let pendingAckCount = 0 + let resolveFn + + sendModulesToLoader = (modules) => { + pendingAckCount++ + port1.postMessage(modules) + } + + port1.on('message', () => { + pendingAckCount-- + + if (resolveFn && pendingAckCount <= 0) { + resolveFn() + } + }).unref() + + function waitForAllMessagesAcknowledged () { + // This timer is to prevent the process from exiting with code 13: + // 13: Unsettled Top-Level Await. + const timer = setInterval(() => { }, 1000) + const promise = new Promise((resolve) => { + resolveFn = resolve + }).then(() => { clearInterval(timer) }) + + if (pendingAckCount === 0) { + resolveFn() + } + + return promise + } + + const addHookMessagePort = port2 + const registerOptions = { data: { addHookMessagePort, include: [] }, transferList: [addHookMessagePort] } + + return { registerOptions, addHookMessagePort, waitForAllMessagesAcknowledged } +} + +function Hook (modules, options, hookFn) { + if ((this instanceof Hook) === false) return new Hook(modules, options, hookFn) + if (typeof modules === 'function') { + hookFn = modules + modules = null + options = null + } else if (typeof options === 'function') { + hookFn = options + options = null + } + const internals = options ? options.internals === true : false + + if (sendModulesToLoader && Array.isArray(modules)) { + sendModulesToLoader(modules) + } + + this._iitmHook = (name, namespace) => { + const filename = name + const isBuiltin = name.startsWith('node:') + let baseDir + + if (isBuiltin) { + name = name.replace(/^node:/, '') + } else { + if (name.startsWith('file://')) { + try { + name = fileURLToPath(name) + } catch (e) {} + } + const details = parse(name) + if (details) { + name = details.name + baseDir = details.basedir + } + } + + if (modules) { + for (const moduleName of modules) { + if (moduleName === name) { + if (baseDir) { + if (internals) { + name = name + path.sep + path.relative(baseDir, fileURLToPath(filename)) + } else { + if (!baseDir.endsWith(specifiers.get(filename))) continue + } + } + callHookFn(hookFn, namespace, name, baseDir) + } + } + } else { + callHookFn(hookFn, namespace, name, baseDir) + } + } + + addHook(this._iitmHook) +} + +Hook.prototype.unhook = function () { + removeHook(this._iitmHook) +} + +module.exports = Hook +module.exports.Hook = Hook +module.exports.addHook = addHook +module.exports.removeHook = removeHook +module.exports.createAddHookMessageChannel = createAddHookMessageChannel + + +/***/ }), + +/***/ 37174: +/***/ ((__unused_webpack_module, exports) => { + +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License. +// +// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc. + +const importHooks = [] // TODO should this be a Set? +const setters = new WeakMap() +const getters = new WeakMap() +const specifiers = new Map() +const toHook = [] + +const proxyHandler = { + set (target, name, value) { + return setters.get(target)[name](value) + }, + + get (target, name) { + if (name === Symbol.toStringTag) { + return 'Module' + } + + const getter = getters.get(target)[name] + + if (typeof getter === 'function') { + return getter() + } + }, + + defineProperty (target, property, descriptor) { + if ((!('value' in descriptor))) { + throw new Error('Getters/setters are not supported for exports property descriptors.') + } + + return setters.get(target)[property](descriptor.value) + } +} + +function register (name, namespace, set, get, specifier) { + specifiers.set(name, specifier) + setters.set(namespace, set) + getters.set(namespace, get) + const proxy = new Proxy(namespace, proxyHandler) + importHooks.forEach(hook => hook(name, proxy)) + toHook.push([name, proxy]) +} + +exports.register = register +exports.importHooks = importHooks +exports.specifiers = specifiers +exports.toHook = toHook + + +/***/ }), + +/***/ 97751: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var path = __nccwpck_require__(71017) + +module.exports = function (file) { + var segments = file.split(path.sep) + var index = segments.lastIndexOf('node_modules') + if (index === -1) return + if (!segments[index + 1]) return + var scoped = segments[index + 1][0] === '@' + var name = scoped ? segments[index + 1] + '/' + segments[index + 2] : segments[index + 1] + var offset = scoped ? 3 : 2 + return { + name: name, + basedir: segments.slice(0, index + offset).join(path.sep), + path: segments.slice(index + offset).join(path.sep) + } +} + + +/***/ }), + +/***/ 80900: +/***/ ((module) => { + +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function (val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + return ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +} + + +/***/ }), + +/***/ 5980: +/***/ ((module) => { + +"use strict"; + + +var isWindows = process.platform === 'win32'; + +// Regex to split a windows path into into [dir, root, basename, name, ext] +var splitWindowsRe = + /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/; + +var win32 = {}; + +function win32SplitPath(filename) { + return splitWindowsRe.exec(filename).slice(1); +} + +win32.parse = function(pathString) { + if (typeof pathString !== 'string') { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = win32SplitPath(pathString); + if (!allParts || allParts.length !== 5) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + return { + root: allParts[1], + dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1), + base: allParts[2], + ext: allParts[4], + name: allParts[3] + }; +}; + + + +// Split a filename into [dir, root, basename, name, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/; +var posix = {}; + + +function posixSplitPath(filename) { + return splitPathRe.exec(filename).slice(1); +} + + +posix.parse = function(pathString) { + if (typeof pathString !== 'string') { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = posixSplitPath(pathString); + if (!allParts || allParts.length !== 5) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + + return { + root: allParts[1], + dir: allParts[0].slice(0, -1), + base: allParts[2], + ext: allParts[4], + name: allParts[3], + }; +}; + + +if (isWindows) + module.exports = win32.parse; +else /* posix */ + module.exports = posix.parse; + +module.exports.posix = posix.parse; +module.exports.win32 = win32.parse; + + +/***/ }), + +/***/ 62009: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const path = __nccwpck_require__(71017) +const Module = __nccwpck_require__(98188) +const resolve = __nccwpck_require__(71597) +const debug = __nccwpck_require__(82949)('require-in-the-middle') +const moduleDetailsFromPath = __nccwpck_require__(97751) + +// Using the default export is discouraged, but kept for backward compatibility. +// Use this instead: +// const { Hook } = require('require-in-the-middle') +module.exports = Hook +module.exports.Hook = Hook + +/** + * Is the given module a "core" module? + * https://nodejs.org/api/modules.html#core-modules + * + * @type {(moduleName: string) => boolean} + */ +let isCore +if (Module.isBuiltin) { // Added in node v18.6.0, v16.17.0 + isCore = Module.isBuiltin +} else { + const [major, minor] = process.versions.node.split('.').map(Number) + if (major === 8 && minor < 8) { + // For node versions `[8.0, 8.8)` the "http2" module was built-in but + // behind the `--expose-http2` flag. `resolve` only considers unflagged + // modules to be core: https://github.com/browserify/resolve/issues/139 + // However, for `ExportsCache` to work for "http2" we need it to be + // considered core. + isCore = moduleName => { + if (moduleName === 'http2') { + return true + } + // Prefer `resolve.core` lookup to `resolve.isCore(moduleName)` because + // the latter is doing version range matches for every call. + return !!resolve.core[moduleName] + } + } else { + isCore = moduleName => { + // Prefer `resolve.core` lookup to `resolve.isCore(moduleName)` because + // the latter is doing version range matches for every call. + return !!resolve.core[moduleName] + } + } +} + +// 'foo/bar.js' or 'foo/bar/index.js' => 'foo/bar' +const normalize = /([/\\]index)?(\.js)?$/ + +// Cache `onrequire`-patched exports for modules. +// +// Exports for built-in (a.k.a. "core") modules are stored in an internal Map. +// +// Exports for non-core modules are stored on a private field on the `Module` +// object in `require.cache`. This allows users to delete from `require.cache` +// to trigger a re-load (and re-run of the hook's `onrequire`) of a module the +// next time it is required. +// https://nodejs.org/docs/latest/api/all.html#all_modules_requirecache +// +// In some special cases -- e.g. some other `require()` hook swapping out +// `Module._cache` like `@babel/register` -- a non-core module won't be in +// `require.cache`. In that case this falls back to caching on the internal Map. +class ExportsCache { + constructor () { + this._localCache = new Map() // -> + this._kRitmExports = Symbol('RitmExports') + } + + has (filename, isBuiltin) { + if (this._localCache.has(filename)) { + return true + } else if (!isBuiltin) { + const mod = require.cache[filename] + return !!(mod && this._kRitmExports in mod) + } else { + return false + } + } + + get (filename, isBuiltin) { + const cachedExports = this._localCache.get(filename) + if (cachedExports !== undefined) { + return cachedExports + } else if (!isBuiltin) { + const mod = require.cache[filename] + return (mod && mod[this._kRitmExports]) + } + } + + set (filename, exports, isBuiltin) { + if (isBuiltin) { + this._localCache.set(filename, exports) + } else if (filename in require.cache) { + require.cache[filename][this._kRitmExports] = exports + } else { + debug('non-core module is unexpectedly not in require.cache: "%s"', filename) + this._localCache.set(filename, exports) + } + } +} + +function Hook (modules, options, onrequire) { + if ((this instanceof Hook) === false) return new Hook(modules, options, onrequire) + if (typeof modules === 'function') { + onrequire = modules + modules = null + options = null + } else if (typeof options === 'function') { + onrequire = options + options = null + } + + if (typeof Module._resolveFilename !== 'function') { + console.error('Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!', typeof Module._resolveFilename) + console.error('Please report this error as an issue related to Node.js %s at %s', process.version, (__nccwpck_require__(85425)/* .bugs.url */ .eN.H)) + return + } + + this._cache = new ExportsCache() + + this._unhooked = false + this._origRequire = Module.prototype.require + + const self = this + const patching = new Set() + const internals = options ? options.internals === true : false + const hasWhitelist = Array.isArray(modules) + + debug('registering require hook') + + this._require = Module.prototype.require = function (id) { + if (self._unhooked === true) { + // if the patched require function could not be removed because + // someone else patched it after it was patched here, we just + // abort and pass the request onwards to the original require + debug('ignoring require call - module is soft-unhooked') + return self._origRequire.apply(this, arguments) + } + + return patchedRequire.call(this, arguments, false) + } + + if (typeof process.getBuiltinModule === 'function') { + this._origGetBuiltinModule = process.getBuiltinModule + this._getBuiltinModule = process.getBuiltinModule = function (id) { + if (self._unhooked === true) { + // if the patched process.getBuiltinModule function could not be removed because + // someone else patched it after it was patched here, we just abort and pass the + // request onwards to the original process.getBuiltinModule + debug('ignoring process.getBuiltinModule call - module is soft-unhooked') + return self._origGetBuiltinModule.apply(this, arguments) + } + + return patchedRequire.call(this, arguments, true) + } + } + + // Preserve the original require/process.getBuiltinModule arguments in `args` + function patchedRequire (args, coreOnly) { + const id = args[0] + const core = isCore(id) + let filename // the string used for caching + if (core) { + filename = id + // If this is a builtin module that can be identified both as 'foo' and + // 'node:foo', then prefer 'foo' as the caching key. + if (id.startsWith('node:')) { + const idWithoutPrefix = id.slice(5) + if (isCore(idWithoutPrefix)) { + filename = idWithoutPrefix + } + } + } else if (coreOnly) { + // `coreOnly` is `true` if this was a call to `process.getBuiltinModule`, in which case + // we don't want to return anything if the requested `id` isn't a core module. Falling + // back to default behaviour, which at the time of this wrting is simply returning `undefined` + debug('call to process.getBuiltinModule with unknown built-in id') + return self._origGetBuiltinModule.apply(this, args) + } else { + try { + filename = Module._resolveFilename(id, this) + } catch (resolveErr) { + // If someone *else* monkey-patches before this monkey-patch, then that + // code might expect `require(someId)` to get through so it can be + // handled, even if `someId` cannot be resolved to a filename. In this + // case, instead of throwing we defer to the underlying `require`. + // + // For example the Azure Functions Node.js worker module does this, + // where `@azure/functions-core` resolves to an internal object. + // https://github.com/Azure/azure-functions-nodejs-worker/blob/v3.5.2/src/setupCoreModule.ts#L46-L54 + debug('Module._resolveFilename("%s") threw %j, calling original Module.require', id, resolveErr.message) + return self._origRequire.apply(this, args) + } + } + + let moduleName, basedir + + debug('processing %s module require(\'%s\'): %s', core === true ? 'core' : 'non-core', id, filename) + + // return known patched modules immediately + if (self._cache.has(filename, core) === true) { + debug('returning already patched cached module: %s', filename) + return self._cache.get(filename, core) + } + + // Check if this module has a patcher in-progress already. + // Otherwise, mark this module as patching in-progress. + const isPatching = patching.has(filename) + if (isPatching === false) { + patching.add(filename) + } + + const exports = coreOnly + ? self._origGetBuiltinModule.apply(this, args) + : self._origRequire.apply(this, args) + + // If it's already patched, just return it as-is. + if (isPatching === true) { + debug('module is in the process of being patched already - ignoring: %s', filename) + return exports + } + + // The module has already been loaded, + // so the patching mark can be cleaned up. + patching.delete(filename) + + if (core === true) { + if (hasWhitelist === true && modules.includes(filename) === false) { + debug('ignoring core module not on whitelist: %s', filename) + return exports // abort if module name isn't on whitelist + } + moduleName = filename + } else if (hasWhitelist === true && modules.includes(filename)) { + // whitelist includes the absolute path to the file including extension + const parsedPath = path.parse(filename) + moduleName = parsedPath.name + basedir = parsedPath.dir + } else { + const stat = moduleDetailsFromPath(filename) + if (stat === undefined) { + debug('could not parse filename: %s', filename) + return exports // abort if filename could not be parsed + } + moduleName = stat.name + basedir = stat.basedir + + // Ex: require('foo/lib/../bar.js') + // moduleName = 'foo' + // fullModuleName = 'foo/bar' + const fullModuleName = resolveModuleName(stat) + + debug('resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)', moduleName, id, fullModuleName, basedir) + + let matchFound = false + if (hasWhitelist) { + if (!id.startsWith('.') && modules.includes(id)) { + // Not starting with '.' means `id` is identifying a module path, + // as opposed to a local file path. (Note: I'm not sure about + // absolute paths, but those are handled above.) + // If this `id` is in `modules`, then this could be a match to an + // package "exports" entry point that wouldn't otherwise match below. + moduleName = id + matchFound = true + } + + // abort if module name isn't on whitelist + if (!modules.includes(moduleName) && !modules.includes(fullModuleName)) { + return exports + } + + if (modules.includes(fullModuleName) && fullModuleName !== moduleName) { + // if we get to this point, it means that we're requiring a whitelisted sub-module + moduleName = fullModuleName + matchFound = true + } + } + + if (!matchFound) { + // figure out if this is the main module file, or a file inside the module + let res + try { + res = resolve.sync(moduleName, { basedir }) + } catch (e) { + debug('could not resolve module: %s', moduleName) + self._cache.set(filename, exports, core) + return exports // abort if module could not be resolved (e.g. no main in package.json and no index.js file) + } + + if (res !== filename) { + // this is a module-internal file + if (internals === true) { + // use the module-relative path to the file, prefixed by original module name + moduleName = moduleName + path.sep + path.relative(basedir, filename) + debug('preparing to process require of internal file: %s', moduleName) + } else { + debug('ignoring require of non-main module file: %s', res) + self._cache.set(filename, exports, core) + return exports // abort if not main module file + } + } + } + } + + // ensure that the cache entry is assigned a value before calling + // onrequire, in case calling onrequire requires the same module. + self._cache.set(filename, exports, core) + debug('calling require hook: %s', moduleName) + const patchedExports = onrequire(exports, moduleName, basedir) + self._cache.set(filename, patchedExports, core) + + debug('returning module: %s', moduleName) + return patchedExports + } +} + +Hook.prototype.unhook = function () { + this._unhooked = true + + if (this._require === Module.prototype.require) { + Module.prototype.require = this._origRequire + debug('require unhook successful') + } else { + debug('require unhook unsuccessful') + } + + if (process.getBuiltinModule !== undefined) { + if (this._getBuiltinModule === process.getBuiltinModule) { + process.getBuiltinModule = this._origGetBuiltinModule + debug('process.getBuiltinModule unhook successful') + } else { + debug('process.getBuiltinModule unhook unsuccessful') + } + } +} + +function resolveModuleName (stat) { + const normalizedPath = path.sep !== '/' ? stat.path.split(path.sep).join('/') : stat.path + return path.posix.join(stat.name, normalizedPath).replace(normalize, '') +} + + +/***/ }), + +/***/ 85407: +/***/ ((module, exports, __nccwpck_require__) => { + +/* eslint-env browser */ + +/** + * This is the web browser implementation of `debug()`. + */ + +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); +exports.destroy = (() => { + let warned = false; + + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +})(); + +/** + * Colors. + */ + +exports.colors = [ + '#0000CC', + '#0000FF', + '#0033CC', + '#0033FF', + '#0066CC', + '#0066FF', + '#0099CC', + '#0099FF', + '#00CC00', + '#00CC33', + '#00CC66', + '#00CC99', + '#00CCCC', + '#00CCFF', + '#3300CC', + '#3300FF', + '#3333CC', + '#3333FF', + '#3366CC', + '#3366FF', + '#3399CC', + '#3399FF', + '#33CC00', + '#33CC33', + '#33CC66', + '#33CC99', + '#33CCCC', + '#33CCFF', + '#6600CC', + '#6600FF', + '#6633CC', + '#6633FF', + '#66CC00', + '#66CC33', + '#9900CC', + '#9900FF', + '#9933CC', + '#9933FF', + '#99CC00', + '#99CC33', + '#CC0000', + '#CC0033', + '#CC0066', + '#CC0099', + '#CC00CC', + '#CC00FF', + '#CC3300', + '#CC3333', + '#CC3366', + '#CC3399', + '#CC33CC', + '#CC33FF', + '#CC6600', + '#CC6633', + '#CC9900', + '#CC9933', + '#CCCC00', + '#CCCC33', + '#FF0000', + '#FF0033', + '#FF0066', + '#FF0099', + '#FF00CC', + '#FF00FF', + '#FF3300', + '#FF3333', + '#FF3366', + '#FF3399', + '#FF33CC', + '#FF33FF', + '#FF6600', + '#FF6633', + '#FF9900', + '#FF9933', + '#FFCC00', + '#FFCC33' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +// eslint-disable-next-line complexity +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } + + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + + let m; + + // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + // eslint-disable-next-line no-return-assign + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // Is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) || + // Double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + + this.namespace + + (this.useColors ? ' %c' : ' ') + + args[0] + + (this.useColors ? '%c ' : ' ') + + '+' + module.exports.humanize(this.diff); + + if (!this.useColors) { + return; + } + + const c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); + + // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, match => { + if (match === '%%') { + return; + } + index++; + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ +exports.log = console.debug || console.log || (() => {}); + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ +function load() { + let r; + try { + r = exports.storage.getItem('debug'); + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} + +module.exports = __nccwpck_require__(33532)(exports); + +const {formatters} = module.exports; + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } +}; + + +/***/ }), + +/***/ 33532: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ + +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = __nccwpck_require__(80900); + createDebug.destroy = destroy; + + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); + + /** + * The currently active debug mode names, and names to skip. + */ + + createDebug.names = []; + createDebug.skips = []; + + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; + + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; + + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } + + const self = debug; + + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + args[0] = createDebug.coerce(args[0]); + + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } + + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); + + // Now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // Apply env-specific formatting (colors, etc.) + createDebug.formatArgs.call(self, args); + + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } + + return enabledCache; + }, + set: v => { + enableOverride = v; + } + }); + + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } + + return debug; + } + + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; + + createDebug.names = []; + createDebug.skips = []; + + const split = (typeof namespaces === 'string' ? namespaces : '') + .trim() + .replace(' ', ',') + .split(',') + .filter(Boolean); + + for (const ns of split) { + if (ns[0] === '-') { + createDebug.skips.push(ns.slice(1)); + } else { + createDebug.names.push(ns); + } + } + } + + /** + * Checks if the given string matches a namespace template, honoring + * asterisks as wildcards. + * + * @param {String} search + * @param {String} template + * @return {Boolean} + */ + function matchesTemplate(search, template) { + let searchIndex = 0; + let templateIndex = 0; + let starIndex = -1; + let matchIndex = 0; + + while (searchIndex < search.length) { + if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) { + // Match character or proceed with wildcard + if (template[templateIndex] === '*') { + starIndex = templateIndex; + matchIndex = searchIndex; + templateIndex++; // Skip the '*' + } else { + searchIndex++; + templateIndex++; + } + } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition + // Backtrack to the last '*' and try to match more characters + templateIndex = starIndex + 1; + matchIndex++; + searchIndex = matchIndex; + } else { + return false; // No match + } + } + + // Handle trailing '*' in template + while (templateIndex < template.length && template[templateIndex] === '*') { + templateIndex++; + } + + return templateIndex === template.length; + } + + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names, + ...createDebug.skips.map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } + + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + for (const skip of createDebug.skips) { + if (matchesTemplate(name, skip)) { + return false; + } + } + + for (const ns of createDebug.names) { + if (matchesTemplate(name, ns)) { + return true; + } + } + + return false; + } + + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + + createDebug.enable(createDebug.load()); + + return createDebug; +} + +module.exports = setup; + + +/***/ }), + +/***/ 82949: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ + +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + module.exports = __nccwpck_require__(85407); +} else { + module.exports = __nccwpck_require__(64737); +} + + +/***/ }), + +/***/ 64737: +/***/ ((module, exports, __nccwpck_require__) => { + +/** + * Module dependencies. + */ + +const tty = __nccwpck_require__(76224); +const util = __nccwpck_require__(73837); + +/** + * This is the Node.js implementation of `debug()`. + */ + +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.destroy = util.deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' +); + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + const supportsColor = __nccwpck_require__(59318); + + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } +} catch (error) { + // Swallow - we only care if `supports-color` is available; it doesn't have to be. +} + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + +exports.inspectOpts = Object.keys(process.env).filter(key => { + return /^debug_/i.test(key); +}).reduce((obj, key) => { + // Camel-case + const prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); + + // Coerce string value into JS value + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } + + obj[prop] = val; + return obj; +}, {}); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts ? + Boolean(exports.inspectOpts.colors) : + tty.isatty(process.stderr.fd); +} + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + const {namespace: name, useColors} = this; + + if (useColors) { + const c = this.color; + const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); + const prefix = ` ${colorCode};1m${name} \u001B[0m`; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} + +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + return new Date().toISOString() + ' '; +} + +/** + * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr. + */ + +function log(...args) { + return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + +function init(debug) { + debug.inspectOpts = {}; + + const keys = Object.keys(exports.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +module.exports = __nccwpck_require__(33532)(exports); + +const {formatters} = module.exports; + +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(str => str.trim()) + .join(' '); +}; + +/** + * Map %O to `util.inspect()`, allowing multiple lines if needed. + */ + +formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; + + +/***/ }), + +/***/ 64781: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var call = Function.prototype.call; +var $hasOwn = Object.prototype.hasOwnProperty; +var bind = __nccwpck_require__(88334); + +/** @type {import('.')} */ +module.exports = bind.call(call, $hasOwn); + + +/***/ }), + +/***/ 89899: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var hasOwn = __nccwpck_require__(64781); + +function specifierIncluded(current, specifier) { + var nodeParts = current.split('.'); + var parts = specifier.split(' '); + var op = parts.length > 1 ? parts[0] : '='; + var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.'); + + for (var i = 0; i < 3; ++i) { + var cur = parseInt(nodeParts[i] || 0, 10); + var ver = parseInt(versionParts[i] || 0, 10); + if (cur === ver) { + continue; // eslint-disable-line no-restricted-syntax, no-continue + } + if (op === '<') { + return cur < ver; + } + if (op === '>=') { + return cur >= ver; + } + return false; + } + return op === '>='; +} + +function matchesRange(current, range) { + var specifiers = range.split(/ ?&& ?/); + if (specifiers.length === 0) { + return false; + } + for (var i = 0; i < specifiers.length; ++i) { + if (!specifierIncluded(current, specifiers[i])) { + return false; + } + } + return true; +} + +function versionIncluded(nodeVersion, specifierValue) { + if (typeof specifierValue === 'boolean') { + return specifierValue; + } + + var current = typeof nodeVersion === 'undefined' + ? process.versions && process.versions.node + : nodeVersion; + + if (typeof current !== 'string') { + throw new TypeError(typeof nodeVersion === 'undefined' ? 'Unable to determine current node version' : 'If provided, a valid node version is required'); + } + + if (specifierValue && typeof specifierValue === 'object') { + for (var i = 0; i < specifierValue.length; ++i) { + if (matchesRange(current, specifierValue[i])) { + return true; + } + } + return false; + } + return matchesRange(current, specifierValue); +} + +var data = __nccwpck_require__(78154); + +module.exports = function isCore(x, nodeVersion) { + return hasOwn(data, x) && versionIncluded(nodeVersion, data[x]); +}; + + +/***/ }), + +/***/ 71597: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var async = __nccwpck_require__(39663); +async.core = __nccwpck_require__(9529); +async.isCore = __nccwpck_require__(85439); +async.sync = __nccwpck_require__(15609); + +module.exports = async; + + +/***/ }), + +/***/ 39663: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var fs = __nccwpck_require__(57147); +var getHomedir = __nccwpck_require__(84213); +var path = __nccwpck_require__(71017); +var caller = __nccwpck_require__(71099); +var nodeModulesPaths = __nccwpck_require__(91156); +var normalizeOptions = __nccwpck_require__(33669); +var isCore = __nccwpck_require__(89899); + +var realpathFS = process.platform !== 'win32' && fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath; + +var homedir = getHomedir(); +var defaultPaths = function () { + return [ + path.join(homedir, '.node_modules'), + path.join(homedir, '.node_libraries') + ]; +}; + +var defaultIsFile = function isFile(file, cb) { + fs.stat(file, function (err, stat) { + if (!err) { + return cb(null, stat.isFile() || stat.isFIFO()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); +}; + +var defaultIsDir = function isDirectory(dir, cb) { + fs.stat(dir, function (err, stat) { + if (!err) { + return cb(null, stat.isDirectory()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); +}; + +var defaultRealpath = function realpath(x, cb) { + realpathFS(x, function (realpathErr, realPath) { + if (realpathErr && realpathErr.code !== 'ENOENT') cb(realpathErr); + else cb(null, realpathErr ? x : realPath); + }); +}; + +var maybeRealpath = function maybeRealpath(realpath, x, opts, cb) { + if (opts && opts.preserveSymlinks === false) { + realpath(x, cb); + } else { + cb(null, x); + } +}; + +var defaultReadPackage = function defaultReadPackage(readFile, pkgfile, cb) { + readFile(pkgfile, function (readFileErr, body) { + if (readFileErr) cb(readFileErr); + else { + try { + var pkg = JSON.parse(body); + cb(null, pkg); + } catch (jsonErr) { + cb(null); + } + } + }); +}; + +var getPackageCandidates = function getPackageCandidates(x, start, opts) { + var dirs = nodeModulesPaths(start, opts, x); + for (var i = 0; i < dirs.length; i++) { + dirs[i] = path.join(dirs[i], x); + } + return dirs; +}; + +module.exports = function resolve(x, options, callback) { + var cb = callback; + var opts = options; + if (typeof options === 'function') { + cb = opts; + opts = {}; + } + if (typeof x !== 'string') { + var err = new TypeError('Path must be a string.'); + return process.nextTick(function () { + cb(err); + }); + } + + opts = normalizeOptions(x, opts); + + var isFile = opts.isFile || defaultIsFile; + var isDirectory = opts.isDirectory || defaultIsDir; + var readFile = opts.readFile || fs.readFile; + var realpath = opts.realpath || defaultRealpath; + var readPackage = opts.readPackage || defaultReadPackage; + if (opts.readFile && opts.readPackage) { + var conflictErr = new TypeError('`readFile` and `readPackage` are mutually exclusive.'); + return process.nextTick(function () { + cb(conflictErr); + }); + } + var packageIterator = opts.packageIterator; + + var extensions = opts.extensions || ['.js']; + var includeCoreModules = opts.includeCoreModules !== false; + var basedir = opts.basedir || path.dirname(caller()); + var parent = opts.filename || basedir; + + opts.paths = opts.paths || defaultPaths(); + + // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory + var absoluteStart = path.resolve(basedir); + + maybeRealpath( + realpath, + absoluteStart, + opts, + function (err, realStart) { + if (err) cb(err); + else init(realStart); + } + ); + + var res; + function init(basedir) { + if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { + res = path.resolve(basedir, x); + if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/'; + if ((/\/$/).test(x) && res === basedir) { + loadAsDirectory(res, opts.package, onfile); + } else loadAsFile(res, opts.package, onfile); + } else if (includeCoreModules && isCore(x)) { + return cb(null, x); + } else loadNodeModules(x, basedir, function (err, n, pkg) { + if (err) cb(err); + else if (n) { + return maybeRealpath(realpath, n, opts, function (err, realN) { + if (err) { + cb(err); + } else { + cb(null, realN, pkg); + } + }); + } else { + var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + moduleError.code = 'MODULE_NOT_FOUND'; + cb(moduleError); + } + }); + } + + function onfile(err, m, pkg) { + if (err) cb(err); + else if (m) cb(null, m, pkg); + else loadAsDirectory(res, function (err, d, pkg) { + if (err) cb(err); + else if (d) { + maybeRealpath(realpath, d, opts, function (err, realD) { + if (err) { + cb(err); + } else { + cb(null, realD, pkg); + } + }); + } else { + var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + moduleError.code = 'MODULE_NOT_FOUND'; + cb(moduleError); + } + }); + } + + function loadAsFile(x, thePackage, callback) { + var loadAsFilePackage = thePackage; + var cb = callback; + if (typeof loadAsFilePackage === 'function') { + cb = loadAsFilePackage; + loadAsFilePackage = undefined; + } + + var exts = [''].concat(extensions); + load(exts, x, loadAsFilePackage); + + function load(exts, x, loadPackage) { + if (exts.length === 0) return cb(null, undefined, loadPackage); + var file = x + exts[0]; + + var pkg = loadPackage; + if (pkg) onpkg(null, pkg); + else loadpkg(path.dirname(file), onpkg); + + function onpkg(err, pkg_, dir) { + pkg = pkg_; + if (err) return cb(err); + if (dir && pkg && opts.pathFilter) { + var rfile = path.relative(dir, file); + var rel = rfile.slice(0, rfile.length - exts[0].length); + var r = opts.pathFilter(pkg, x, rel); + if (r) return load( + [''].concat(extensions.slice()), + path.resolve(dir, r), + pkg + ); + } + isFile(file, onex); + } + function onex(err, ex) { + if (err) return cb(err); + if (ex) return cb(null, file, pkg); + load(exts.slice(1), x, pkg); + } + } + } + + function loadpkg(dir, cb) { + if (dir === '' || dir === '/') return cb(null); + if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { + return cb(null); + } + if ((/[/\\]node_modules[/\\]*$/).test(dir)) return cb(null); + + maybeRealpath(realpath, dir, opts, function (unwrapErr, pkgdir) { + if (unwrapErr) return loadpkg(path.dirname(dir), cb); + var pkgfile = path.join(pkgdir, 'package.json'); + isFile(pkgfile, function (err, ex) { + // on err, ex is false + if (!ex) return loadpkg(path.dirname(dir), cb); + + readPackage(readFile, pkgfile, function (err, pkgParam) { + if (err) cb(err); + + var pkg = pkgParam; + + if (pkg && opts.packageFilter) { + pkg = opts.packageFilter(pkg, pkgfile); + } + cb(null, pkg, dir); + }); + }); + }); + } + + function loadAsDirectory(x, loadAsDirectoryPackage, callback) { + var cb = callback; + var fpkg = loadAsDirectoryPackage; + if (typeof fpkg === 'function') { + cb = fpkg; + fpkg = opts.package; + } + + maybeRealpath(realpath, x, opts, function (unwrapErr, pkgdir) { + if (unwrapErr) return cb(unwrapErr); + var pkgfile = path.join(pkgdir, 'package.json'); + isFile(pkgfile, function (err, ex) { + if (err) return cb(err); + if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb); + + readPackage(readFile, pkgfile, function (err, pkgParam) { + if (err) return cb(err); + + var pkg = pkgParam; + + if (pkg && opts.packageFilter) { + pkg = opts.packageFilter(pkg, pkgfile); + } + + if (pkg && pkg.main) { + if (typeof pkg.main !== 'string') { + var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); + mainError.code = 'INVALID_PACKAGE_MAIN'; + return cb(mainError); + } + if (pkg.main === '.' || pkg.main === './') { + pkg.main = 'index'; + } + loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) { + if (err) return cb(err); + if (m) return cb(null, m, pkg); + if (!pkg) return loadAsFile(path.join(x, 'index'), pkg, cb); + + var dir = path.resolve(x, pkg.main); + loadAsDirectory(dir, pkg, function (err, n, pkg) { + if (err) return cb(err); + if (n) return cb(null, n, pkg); + loadAsFile(path.join(x, 'index'), pkg, cb); + }); + }); + return; + } + + loadAsFile(path.join(x, '/index'), pkg, cb); + }); + }); + }); + } + + function processDirs(cb, dirs) { + if (dirs.length === 0) return cb(null, undefined); + var dir = dirs[0]; + + isDirectory(path.dirname(dir), isdir); + + function isdir(err, isdir) { + if (err) return cb(err); + if (!isdir) return processDirs(cb, dirs.slice(1)); + loadAsFile(dir, opts.package, onfile); + } + + function onfile(err, m, pkg) { + if (err) return cb(err); + if (m) return cb(null, m, pkg); + loadAsDirectory(dir, opts.package, ondir); + } + + function ondir(err, n, pkg) { + if (err) return cb(err); + if (n) return cb(null, n, pkg); + processDirs(cb, dirs.slice(1)); + } + } + function loadNodeModules(x, start, cb) { + var thunk = function () { return getPackageCandidates(x, start, opts); }; + processDirs( + cb, + packageIterator ? packageIterator(x, start, thunk, opts) : thunk() + ); + } +}; + + +/***/ }), + +/***/ 71099: +/***/ ((module) => { + +module.exports = function () { + // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi + var origPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = function (_, stack) { return stack; }; + var stack = (new Error()).stack; + Error.prepareStackTrace = origPrepareStackTrace; + return stack[2].getFileName(); +}; + + +/***/ }), + +/***/ 9529: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var isCoreModule = __nccwpck_require__(89899); +var data = __nccwpck_require__(74476); + +var core = {}; +for (var mod in data) { // eslint-disable-line no-restricted-syntax + if (Object.prototype.hasOwnProperty.call(data, mod)) { + core[mod] = isCoreModule(mod); + } +} +module.exports = core; + + +/***/ }), + +/***/ 84213: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var os = __nccwpck_require__(22037); + +// adapted from https://github.com/sindresorhus/os-homedir/blob/11e089f4754db38bb535e5a8416320c4446e8cfd/index.js + +module.exports = os.homedir || function homedir() { + var home = process.env.HOME; + var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME; + + if (process.platform === 'win32') { + return process.env.USERPROFILE || process.env.HOMEDRIVE + process.env.HOMEPATH || home || null; + } + + if (process.platform === 'darwin') { + return home || (user ? '/Users/' + user : null); + } + + if (process.platform === 'linux') { + return home || (process.getuid() === 0 ? '/root' : (user ? '/home/' + user : null)); // eslint-disable-line no-extra-parens + } + + return home || null; +}; + + +/***/ }), + +/***/ 85439: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var isCoreModule = __nccwpck_require__(89899); + +module.exports = function isCore(x) { + return isCoreModule(x); +}; + + +/***/ }), + +/***/ 91156: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var path = __nccwpck_require__(71017); +var parse = path.parse || __nccwpck_require__(5980); // eslint-disable-line global-require + +var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) { + var prefix = '/'; + if ((/^([A-Za-z]:)/).test(absoluteStart)) { + prefix = ''; + } else if ((/^\\\\/).test(absoluteStart)) { + prefix = '\\\\'; + } + + var paths = [absoluteStart]; + var parsed = parse(absoluteStart); + while (parsed.dir !== paths[paths.length - 1]) { + paths.push(parsed.dir); + parsed = parse(parsed.dir); + } + + return paths.reduce(function (dirs, aPath) { + return dirs.concat(modules.map(function (moduleDir) { + return path.resolve(prefix, aPath, moduleDir); + })); + }, []); +}; + +module.exports = function nodeModulesPaths(start, opts, request) { + var modules = opts && opts.moduleDirectory + ? [].concat(opts.moduleDirectory) + : ['node_modules']; + + if (opts && typeof opts.paths === 'function') { + return opts.paths( + request, + start, + function () { return getNodeModulesDirs(start, modules); }, + opts + ); + } + + var dirs = getNodeModulesDirs(start, modules); + return opts && opts.paths ? dirs.concat(opts.paths) : dirs; +}; + + +/***/ }), + +/***/ 33669: +/***/ ((module) => { + +module.exports = function (x, opts) { + /** + * This file is purposefully a passthrough. It's expected that third-party + * environments will override it at runtime in order to inject special logic + * into `resolve` (by manipulating the options). One such example is the PnP + * code path in Yarn. + */ + + return opts || {}; +}; + + +/***/ }), + +/***/ 15609: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var isCore = __nccwpck_require__(89899); +var fs = __nccwpck_require__(57147); +var path = __nccwpck_require__(71017); +var getHomedir = __nccwpck_require__(84213); +var caller = __nccwpck_require__(71099); +var nodeModulesPaths = __nccwpck_require__(91156); +var normalizeOptions = __nccwpck_require__(33669); + +var realpathFS = process.platform !== 'win32' && fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync; + +var homedir = getHomedir(); +var defaultPaths = function () { + return [ + path.join(homedir, '.node_modules'), + path.join(homedir, '.node_libraries') + ]; +}; + +var defaultIsFile = function isFile(file) { + try { + var stat = fs.statSync(file, { throwIfNoEntry: false }); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return !!stat && (stat.isFile() || stat.isFIFO()); +}; + +var defaultIsDir = function isDirectory(dir) { + try { + var stat = fs.statSync(dir, { throwIfNoEntry: false }); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return !!stat && stat.isDirectory(); +}; + +var defaultRealpathSync = function realpathSync(x) { + try { + return realpathFS(x); + } catch (realpathErr) { + if (realpathErr.code !== 'ENOENT') { + throw realpathErr; + } + } + return x; +}; + +var maybeRealpathSync = function maybeRealpathSync(realpathSync, x, opts) { + if (opts && opts.preserveSymlinks === false) { + return realpathSync(x); + } + return x; +}; + +var defaultReadPackageSync = function defaultReadPackageSync(readFileSync, pkgfile) { + var body = readFileSync(pkgfile); + try { + var pkg = JSON.parse(body); + return pkg; + } catch (jsonErr) {} +}; + +var getPackageCandidates = function getPackageCandidates(x, start, opts) { + var dirs = nodeModulesPaths(start, opts, x); + for (var i = 0; i < dirs.length; i++) { + dirs[i] = path.join(dirs[i], x); + } + return dirs; +}; + +module.exports = function resolveSync(x, options) { + if (typeof x !== 'string') { + throw new TypeError('Path must be a string.'); + } + var opts = normalizeOptions(x, options); + + var isFile = opts.isFile || defaultIsFile; + var readFileSync = opts.readFileSync || fs.readFileSync; + var isDirectory = opts.isDirectory || defaultIsDir; + var realpathSync = opts.realpathSync || defaultRealpathSync; + var readPackageSync = opts.readPackageSync || defaultReadPackageSync; + if (opts.readFileSync && opts.readPackageSync) { + throw new TypeError('`readFileSync` and `readPackageSync` are mutually exclusive.'); + } + var packageIterator = opts.packageIterator; + + var extensions = opts.extensions || ['.js']; + var includeCoreModules = opts.includeCoreModules !== false; + var basedir = opts.basedir || path.dirname(caller()); + var parent = opts.filename || basedir; + + opts.paths = opts.paths || defaultPaths(); + + // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory + var absoluteStart = maybeRealpathSync(realpathSync, path.resolve(basedir), opts); + + if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { + var res = path.resolve(absoluteStart, x); + if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/'; + var m = loadAsFileSync(res) || loadAsDirectorySync(res); + if (m) return maybeRealpathSync(realpathSync, m, opts); + } else if (includeCoreModules && isCore(x)) { + return x; + } else { + var n = loadNodeModulesSync(x, absoluteStart); + if (n) return maybeRealpathSync(realpathSync, n, opts); + } + + var err = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + err.code = 'MODULE_NOT_FOUND'; + throw err; + + function loadAsFileSync(x) { + var pkg = loadpkg(path.dirname(x)); + + if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) { + var rfile = path.relative(pkg.dir, x); + var r = opts.pathFilter(pkg.pkg, x, rfile); + if (r) { + x = path.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign + } + } + + if (isFile(x)) { + return x; + } + + for (var i = 0; i < extensions.length; i++) { + var file = x + extensions[i]; + if (isFile(file)) { + return file; + } + } + } + + function loadpkg(dir) { + if (dir === '' || dir === '/') return; + if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { + return; + } + if ((/[/\\]node_modules[/\\]*$/).test(dir)) return; + + var pkgfile = path.join(maybeRealpathSync(realpathSync, dir, opts), 'package.json'); + + if (!isFile(pkgfile)) { + return loadpkg(path.dirname(dir)); + } + + var pkg = readPackageSync(readFileSync, pkgfile); + + if (pkg && opts.packageFilter) { + // v2 will pass pkgfile + pkg = opts.packageFilter(pkg, /*pkgfile,*/ dir); // eslint-disable-line spaced-comment + } + + return { pkg: pkg, dir: dir }; + } + + function loadAsDirectorySync(x) { + var pkgfile = path.join(maybeRealpathSync(realpathSync, x, opts), '/package.json'); + if (isFile(pkgfile)) { + try { + var pkg = readPackageSync(readFileSync, pkgfile); + } catch (e) {} + + if (pkg && opts.packageFilter) { + // v2 will pass pkgfile + pkg = opts.packageFilter(pkg, /*pkgfile,*/ x); // eslint-disable-line spaced-comment + } + + if (pkg && pkg.main) { + if (typeof pkg.main !== 'string') { + var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); + mainError.code = 'INVALID_PACKAGE_MAIN'; + throw mainError; + } + if (pkg.main === '.' || pkg.main === './') { + pkg.main = 'index'; + } + try { + var m = loadAsFileSync(path.resolve(x, pkg.main)); + if (m) return m; + var n = loadAsDirectorySync(path.resolve(x, pkg.main)); + if (n) return n; + } catch (e) {} + } + } + + return loadAsFileSync(path.join(x, '/index')); + } + + function loadNodeModulesSync(x, start) { + var thunk = function () { return getPackageCandidates(x, start, opts); }; + var dirs = packageIterator ? packageIterator(x, start, thunk, opts) : thunk(); + + for (var i = 0; i < dirs.length; i++) { + var dir = dirs[i]; + if (isDirectory(path.dirname(dir))) { + var m = loadAsFileSync(dir); + if (m) return m; + var n = loadAsDirectorySync(dir); + if (n) return n; + } + } + } +}; + + +/***/ }), + +/***/ 16672: +/***/ ((module) => { + +"use strict"; + + +function isFunction (funktion) { + return typeof funktion === 'function' +} + +// Default to complaining loudly when things don't go according to plan. +var logger = console.error.bind(console) + +// Sets a property on an object, preserving its enumerability. +// This function assumes that the property is already writable. +function defineProperty (obj, name, value) { + var enumerable = !!obj[name] && obj.propertyIsEnumerable(name) + Object.defineProperty(obj, name, { + configurable: true, + enumerable: enumerable, + writable: true, + value: value + }) +} + +// Keep initialization idempotent. +function shimmer (options) { + if (options && options.logger) { + if (!isFunction(options.logger)) logger("new logger isn't a function, not replacing") + else logger = options.logger + } +} + +function wrap (nodule, name, wrapper) { + if (!nodule || !nodule[name]) { + logger('no original function ' + name + ' to wrap') + return + } + + if (!wrapper) { + logger('no wrapper function') + logger((new Error()).stack) + return + } + + if (!isFunction(nodule[name]) || !isFunction(wrapper)) { + logger('original object and wrapper must be functions') + return + } + + var original = nodule[name] + var wrapped = wrapper(original, name) + + defineProperty(wrapped, '__original', original) + defineProperty(wrapped, '__unwrap', function () { + if (nodule[name] === wrapped) defineProperty(nodule, name, original) + }) + defineProperty(wrapped, '__wrapped', true) + + defineProperty(nodule, name, wrapped) + return wrapped +} + +function massWrap (nodules, names, wrapper) { + if (!nodules) { + logger('must provide one or more modules to patch') + logger((new Error()).stack) + return + } else if (!Array.isArray(nodules)) { + nodules = [nodules] + } + + if (!(names && Array.isArray(names))) { + logger('must provide one or more functions to wrap on modules') + return + } + + nodules.forEach(function (nodule) { + names.forEach(function (name) { + wrap(nodule, name, wrapper) + }) + }) +} + +function unwrap (nodule, name) { + if (!nodule || !nodule[name]) { + logger('no function to unwrap.') + logger((new Error()).stack) + return + } + + if (!nodule[name].__unwrap) { + logger('no original to unwrap to -- has ' + name + ' already been unwrapped?') + } else { + return nodule[name].__unwrap() + } +} + +function massUnwrap (nodules, names) { + if (!nodules) { + logger('must provide one or more modules to patch') + logger((new Error()).stack) + return + } else if (!Array.isArray(nodules)) { + nodules = [nodules] + } + + if (!(names && Array.isArray(names))) { + logger('must provide one or more functions to unwrap on modules') + return + } + + nodules.forEach(function (nodule) { + names.forEach(function (name) { + unwrap(nodule, name) + }) + }) +} + +shimmer.wrap = wrap +shimmer.massWrap = massWrap +shimmer.unwrap = unwrap +shimmer.massUnwrap = massUnwrap + +module.exports = shimmer + + +/***/ }), + +/***/ 59318: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const os = __nccwpck_require__(22037); +const tty = __nccwpck_require__(76224); +const hasFlag = __nccwpck_require__(31621); + +const {env} = process; + +let forceColor; +if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false') || + hasFlag('color=never')) { + forceColor = 0; +} else if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + forceColor = 1; +} + +if ('FORCE_COLOR' in env) { + if (env.FORCE_COLOR === 'true') { + forceColor = 1; + } else if (env.FORCE_COLOR === 'false') { + forceColor = 0; + } else { + forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); + } +} + +function translateLevel(level) { + if (level === 0) { + return false; + } + + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; +} + +function supportsColor(haveStream, streamIsTTY) { + if (forceColor === 0) { + return 0; + } + + if (hasFlag('color=16m') || + hasFlag('color=full') || + hasFlag('color=truecolor')) { + return 3; + } + + if (hasFlag('color=256')) { + return 2; + } + + if (haveStream && !streamIsTTY && forceColor === undefined) { + return 0; + } + + const min = forceColor || 0; + + if (env.TERM === 'dumb') { + return min; + } + + if (process.platform === 'win32') { + // Windows 10 build 10586 is the first Windows release that supports 256 colors. + // Windows 10 build 14931 is the first release that supports 16m/TrueColor. + const osRelease = os.release().split('.'); + if ( + Number(osRelease[0]) >= 10 && + Number(osRelease[2]) >= 10586 + ) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + + return 1; + } + + if ('CI' in env) { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + return 1; + } + + return min; + } + + if ('TEAMCITY_VERSION' in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + + if (env.COLORTERM === 'truecolor') { + return 3; + } + + if ('TERM_PROGRAM' in env) { + const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); + + switch (env.TERM_PROGRAM) { + case 'iTerm.app': + return version >= 3 ? 3 : 2; + case 'Apple_Terminal': + return 2; + // No default + } + } + + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + + if ('COLORTERM' in env) { + return 1; + } + + return min; +} + +function getSupportLevel(stream) { + const level = supportsColor(stream, stream && stream.isTTY); + return translateLevel(level); +} + +module.exports = { + supportsColor: getSupportLevel, + stdout: translateLevel(supportsColor(true, tty.isatty(1))), + stderr: translateLevel(supportsColor(true, tty.isatty(2))) +}; + + +/***/ }), + +/***/ 74294: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = __nccwpck_require__(54219); + + +/***/ }), + +/***/ 54219: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var net = __nccwpck_require__(41808); +var tls = __nccwpck_require__(24404); +var http = __nccwpck_require__(13685); +var https = __nccwpck_require__(95687); +var events = __nccwpck_require__(82361); +var assert = __nccwpck_require__(39491); +var util = __nccwpck_require__(73837); + + +exports.httpOverHttp = httpOverHttp; +exports.httpsOverHttp = httpsOverHttp; +exports.httpOverHttps = httpOverHttps; +exports.httpsOverHttps = httpsOverHttps; + + +function httpOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http.request; + return agent; +} + +function httpsOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http.request; + agent.createSocket = createSecureSocket; + agent.defaultPort = 443; + return agent; +} + +function httpOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https.request; + return agent; +} + +function httpsOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https.request; + agent.createSocket = createSecureSocket; + agent.defaultPort = 443; + return agent; +} + + +function TunnelingAgent(options) { + var self = this; + self.options = options || {}; + self.proxyOptions = self.options.proxy || {}; + self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets; + self.requests = []; + self.sockets = []; + + self.on('free', function onFree(socket, host, port, localAddress) { + var options = toOptions(host, port, localAddress); + for (var i = 0, len = self.requests.length; i < len; ++i) { + var pending = self.requests[i]; + if (pending.host === options.host && pending.port === options.port) { + // Detect the request to connect same origin server, + // reuse the connection. + self.requests.splice(i, 1); + pending.request.onSocket(socket); + return; + } + } + socket.destroy(); + self.removeSocket(socket); + }); +} +util.inherits(TunnelingAgent, events.EventEmitter); + +TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { + var self = this; + var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress)); + + if (self.sockets.length >= this.maxSockets) { + // We are over limit so we'll add it to the queue. + self.requests.push(options); + return; + } + + // If we are under maxSockets create a new one. + self.createSocket(options, function(socket) { + socket.on('free', onFree); + socket.on('close', onCloseOrRemove); + socket.on('agentRemove', onCloseOrRemove); + req.onSocket(socket); + + function onFree() { + self.emit('free', socket, options); + } + + function onCloseOrRemove(err) { + self.removeSocket(socket); + socket.removeListener('free', onFree); + socket.removeListener('close', onCloseOrRemove); + socket.removeListener('agentRemove', onCloseOrRemove); + } + }); +}; + +TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { + var self = this; + var placeholder = {}; + self.sockets.push(placeholder); + + var connectOptions = mergeOptions({}, self.proxyOptions, { + method: 'CONNECT', + path: options.host + ':' + options.port, + agent: false, + headers: { + host: options.host + ':' + options.port + } + }); + if (options.localAddress) { + connectOptions.localAddress = options.localAddress; + } + if (connectOptions.proxyAuth) { + connectOptions.headers = connectOptions.headers || {}; + connectOptions.headers['Proxy-Authorization'] = 'Basic ' + + new Buffer(connectOptions.proxyAuth).toString('base64'); + } + + debug('making CONNECT request'); + var connectReq = self.request(connectOptions); + connectReq.useChunkedEncodingByDefault = false; // for v0.6 + connectReq.once('response', onResponse); // for v0.6 + connectReq.once('upgrade', onUpgrade); // for v0.6 + connectReq.once('connect', onConnect); // for v0.7 or later + connectReq.once('error', onError); + connectReq.end(); + + function onResponse(res) { + // Very hacky. This is necessary to avoid http-parser leaks. + res.upgrade = true; + } + + function onUpgrade(res, socket, head) { + // Hacky. + process.nextTick(function() { + onConnect(res, socket, head); + }); + } + + function onConnect(res, socket, head) { + connectReq.removeAllListeners(); + socket.removeAllListeners(); + + if (res.statusCode !== 200) { + debug('tunneling socket could not be established, statusCode=%d', + res.statusCode); + socket.destroy(); + var error = new Error('tunneling socket could not be established, ' + + 'statusCode=' + res.statusCode); + error.code = 'ECONNRESET'; + options.request.emit('error', error); + self.removeSocket(placeholder); + return; + } + if (head.length > 0) { + debug('got illegal response body from proxy'); + socket.destroy(); + var error = new Error('got illegal response body from proxy'); + error.code = 'ECONNRESET'; + options.request.emit('error', error); + self.removeSocket(placeholder); + return; + } + debug('tunneling connection has established'); + self.sockets[self.sockets.indexOf(placeholder)] = socket; + return cb(socket); + } + + function onError(cause) { + connectReq.removeAllListeners(); + + debug('tunneling socket could not be established, cause=%s\n', + cause.message, cause.stack); + var error = new Error('tunneling socket could not be established, ' + + 'cause=' + cause.message); + error.code = 'ECONNRESET'; + options.request.emit('error', error); + self.removeSocket(placeholder); + } +}; + +TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { + var pos = this.sockets.indexOf(socket) + if (pos === -1) { + return; + } + this.sockets.splice(pos, 1); + + var pending = this.requests.shift(); + if (pending) { + // If we have pending requests and a socket gets closed a new one + // needs to be created to take over in the pool for the one that closed. + this.createSocket(pending, function(socket) { + pending.request.onSocket(socket); + }); + } +}; + +function createSecureSocket(options, cb) { + var self = this; + TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { + var hostHeader = options.request.getHeader('host'); + var tlsOptions = mergeOptions({}, self.options, { + socket: socket, + servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host + }); + + // 0 is dummy port for v0.6 + var secureSocket = tls.connect(0, tlsOptions); + self.sockets[self.sockets.indexOf(socket)] = secureSocket; + cb(secureSocket); + }); +} + + +function toOptions(host, port, localAddress) { + if (typeof host === 'string') { // since v0.10 + return { + host: host, + port: port, + localAddress: localAddress + }; + } + return host; // for v0.11 or later +} + +function mergeOptions(target) { + for (var i = 1, len = arguments.length; i < len; ++i) { + var overrides = arguments[i]; + if (typeof overrides === 'object') { + var keys = Object.keys(overrides); + for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { + var k = keys[j]; + if (overrides[k] !== undefined) { + target[k] = overrides[k]; + } + } + } + } + return target; +} + + +var debug; +if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { + debug = function() { + var args = Array.prototype.slice.call(arguments); + if (typeof args[0] === 'string') { + args[0] = 'TUNNEL: ' + args[0]; + } else { + args.unshift('TUNNEL:'); + } + console.error.apply(console, args); + } +} else { + debug = function() {}; +} +exports.debug = debug; // for test + + +/***/ }), + +/***/ 41773: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const Client = __nccwpck_require__(33598) +const Dispatcher = __nccwpck_require__(60412) +const errors = __nccwpck_require__(48045) +const Pool = __nccwpck_require__(4634) +const BalancedPool = __nccwpck_require__(37931) +const Agent = __nccwpck_require__(7890) +const util = __nccwpck_require__(83983) +const { InvalidArgumentError } = errors +const api = __nccwpck_require__(44059) +const buildConnector = __nccwpck_require__(82067) +const MockClient = __nccwpck_require__(58687) +const MockAgent = __nccwpck_require__(66771) +const MockPool = __nccwpck_require__(26193) +const mockErrors = __nccwpck_require__(50888) +const ProxyAgent = __nccwpck_require__(97858) +const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(21892) +const DecoratorHandler = __nccwpck_require__(46930) +const RedirectHandler = __nccwpck_require__(72860) +const createRedirectInterceptor = __nccwpck_require__(38861) + +let hasCrypto +try { + __nccwpck_require__(6113) + hasCrypto = true +} catch { + hasCrypto = false +} + +Object.assign(Dispatcher.prototype, api) + +module.exports.Dispatcher = Dispatcher +module.exports.Client = Client +module.exports.Pool = Pool +module.exports.BalancedPool = BalancedPool +module.exports.Agent = Agent +module.exports.ProxyAgent = ProxyAgent + +module.exports.DecoratorHandler = DecoratorHandler +module.exports.RedirectHandler = RedirectHandler +module.exports.createRedirectInterceptor = createRedirectInterceptor + +module.exports.buildConnector = buildConnector +module.exports.errors = errors + +function makeDispatcher (fn) { + return (url, opts, handler) => { + if (typeof opts === 'function') { + handler = opts + opts = null + } + + if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) { + throw new InvalidArgumentError('invalid url') + } + + if (opts != null && typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + if (opts && opts.path != null) { + if (typeof opts.path !== 'string') { + throw new InvalidArgumentError('invalid opts.path') + } + + let path = opts.path + if (!opts.path.startsWith('/')) { + path = `/${path}` + } + + url = new URL(util.parseOrigin(url).origin + path) + } else { + if (!opts) { + opts = typeof url === 'object' ? url : {} + } + + url = util.parseURL(url) + } + + const { agent, dispatcher = getGlobalDispatcher() } = opts + + if (agent) { + throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?') + } + + return fn.call(dispatcher, { + ...opts, + origin: url.origin, + path: url.search ? `${url.pathname}${url.search}` : url.pathname, + method: opts.method || (opts.body ? 'PUT' : 'GET') + }, handler) + } +} + +module.exports.setGlobalDispatcher = setGlobalDispatcher +module.exports.getGlobalDispatcher = getGlobalDispatcher + +if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) { + let fetchImpl = null + module.exports.fetch = async function fetch (resource) { + if (!fetchImpl) { + fetchImpl = (__nccwpck_require__(74881).fetch) + } + + try { + return await fetchImpl(...arguments) + } catch (err) { + if (typeof err === 'object') { + Error.captureStackTrace(err, this) + } + + throw err + } + } + module.exports.Headers = __nccwpck_require__(10554).Headers + module.exports.Response = __nccwpck_require__(27823).Response + module.exports.Request = __nccwpck_require__(48359).Request + module.exports.FormData = __nccwpck_require__(72015).FormData + module.exports.File = __nccwpck_require__(78511).File + module.exports.FileReader = __nccwpck_require__(1446).FileReader + + const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(71246) + + module.exports.setGlobalOrigin = setGlobalOrigin + module.exports.getGlobalOrigin = getGlobalOrigin + + const { CacheStorage } = __nccwpck_require__(37907) + const { kConstruct } = __nccwpck_require__(29174) + + // Cache & CacheStorage are tightly coupled with fetch. Even if it may run + // in an older version of Node, it doesn't have any use without fetch. + module.exports.caches = new CacheStorage(kConstruct) +} + +if (util.nodeMajor >= 16) { + const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(41724) + + module.exports.deleteCookie = deleteCookie + module.exports.getCookies = getCookies + module.exports.getSetCookies = getSetCookies + module.exports.setCookie = setCookie + + const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685) + + module.exports.parseMIMEType = parseMIMEType + module.exports.serializeAMimeType = serializeAMimeType +} + +if (util.nodeMajor >= 18 && hasCrypto) { + const { WebSocket } = __nccwpck_require__(54284) + + module.exports.WebSocket = WebSocket +} + +module.exports.request = makeDispatcher(api.request) +module.exports.stream = makeDispatcher(api.stream) +module.exports.pipeline = makeDispatcher(api.pipeline) +module.exports.connect = makeDispatcher(api.connect) +module.exports.upgrade = makeDispatcher(api.upgrade) + +module.exports.MockClient = MockClient +module.exports.MockPool = MockPool +module.exports.MockAgent = MockAgent +module.exports.mockErrors = mockErrors + + +/***/ }), + +/***/ 7890: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { InvalidArgumentError } = __nccwpck_require__(48045) +const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(72785) +const DispatcherBase = __nccwpck_require__(74839) +const Pool = __nccwpck_require__(4634) +const Client = __nccwpck_require__(33598) +const util = __nccwpck_require__(83983) +const createRedirectInterceptor = __nccwpck_require__(38861) +const { WeakRef, FinalizationRegistry } = __nccwpck_require__(56436)() + +const kOnConnect = Symbol('onConnect') +const kOnDisconnect = Symbol('onDisconnect') +const kOnConnectionError = Symbol('onConnectionError') +const kMaxRedirections = Symbol('maxRedirections') +const kOnDrain = Symbol('onDrain') +const kFactory = Symbol('factory') +const kFinalizer = Symbol('finalizer') +const kOptions = Symbol('options') + +function defaultFactory (origin, opts) { + return opts && opts.connections === 1 + ? new Client(origin, opts) + : new Pool(origin, opts) +} + +class Agent extends DispatcherBase { + constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { + super() + + if (typeof factory !== 'function') { + throw new InvalidArgumentError('factory must be a function.') + } + + if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { + throw new InvalidArgumentError('connect must be a function or an object') + } + + if (!Number.isInteger(maxRedirections) || maxRedirections < 0) { + throw new InvalidArgumentError('maxRedirections must be a positive number') + } + + if (connect && typeof connect !== 'function') { + connect = { ...connect } + } + + this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent) + ? options.interceptors.Agent + : [createRedirectInterceptor({ maxRedirections })] + + this[kOptions] = { ...util.deepClone(options), connect } + this[kOptions].interceptors = options.interceptors + ? { ...options.interceptors } + : undefined + this[kMaxRedirections] = maxRedirections + this[kFactory] = factory + this[kClients] = new Map() + this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => { + const ref = this[kClients].get(key) + if (ref !== undefined && ref.deref() === undefined) { + this[kClients].delete(key) + } + }) + + const agent = this + + this[kOnDrain] = (origin, targets) => { + agent.emit('drain', origin, [agent, ...targets]) + } + + this[kOnConnect] = (origin, targets) => { + agent.emit('connect', origin, [agent, ...targets]) + } + + this[kOnDisconnect] = (origin, targets, err) => { + agent.emit('disconnect', origin, [agent, ...targets], err) + } + + this[kOnConnectionError] = (origin, targets, err) => { + agent.emit('connectionError', origin, [agent, ...targets], err) + } + } + + get [kRunning] () { + let ret = 0 + for (const ref of this[kClients].values()) { + const client = ref.deref() + /* istanbul ignore next: gc is undeterministic */ + if (client) { + ret += client[kRunning] + } + } + return ret + } + + [kDispatch] (opts, handler) { + let key + if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) { + key = String(opts.origin) + } else { + throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.') + } + + const ref = this[kClients].get(key) + + let dispatcher = ref ? ref.deref() : null + if (!dispatcher) { + dispatcher = this[kFactory](opts.origin, this[kOptions]) + .on('drain', this[kOnDrain]) + .on('connect', this[kOnConnect]) + .on('disconnect', this[kOnDisconnect]) + .on('connectionError', this[kOnConnectionError]) + + this[kClients].set(key, new WeakRef(dispatcher)) + this[kFinalizer].register(dispatcher, key) + } + + return dispatcher.dispatch(opts, handler) + } + + async [kClose] () { + const closePromises = [] + for (const ref of this[kClients].values()) { + const client = ref.deref() + /* istanbul ignore else: gc is undeterministic */ + if (client) { + closePromises.push(client.close()) + } + } + + await Promise.all(closePromises) + } + + async [kDestroy] (err) { + const destroyPromises = [] + for (const ref of this[kClients].values()) { + const client = ref.deref() + /* istanbul ignore else: gc is undeterministic */ + if (client) { + destroyPromises.push(client.destroy(err)) + } + } + + await Promise.all(destroyPromises) + } +} + +module.exports = Agent + + +/***/ }), + +/***/ 7032: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const { addAbortListener } = __nccwpck_require__(83983) +const { RequestAbortedError } = __nccwpck_require__(48045) + +const kListener = Symbol('kListener') +const kSignal = Symbol('kSignal') + +function abort (self) { + if (self.abort) { + self.abort() + } else { + self.onError(new RequestAbortedError()) + } +} + +function addSignal (self, signal) { + self[kSignal] = null + self[kListener] = null + + if (!signal) { + return + } + + if (signal.aborted) { + abort(self) + return + } + + self[kSignal] = signal + self[kListener] = () => { + abort(self) + } + + addAbortListener(self[kSignal], self[kListener]) +} + +function removeSignal (self) { + if (!self[kSignal]) { + return + } + + if ('removeEventListener' in self[kSignal]) { + self[kSignal].removeEventListener('abort', self[kListener]) + } else { + self[kSignal].removeListener('abort', self[kListener]) + } + + self[kSignal] = null + self[kListener] = null +} + +module.exports = { + addSignal, + removeSignal +} + + +/***/ }), + +/***/ 29744: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { AsyncResource } = __nccwpck_require__(50852) +const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(48045) +const util = __nccwpck_require__(83983) +const { addSignal, removeSignal } = __nccwpck_require__(7032) + +class ConnectHandler extends AsyncResource { + constructor (opts, callback) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + const { signal, opaque, responseHeaders } = opts + + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } + + super('UNDICI_CONNECT') + + this.opaque = opaque || null + this.responseHeaders = responseHeaders || null + this.callback = callback + this.abort = null + + addSignal(this, signal) + } + + onConnect (abort, context) { + if (!this.callback) { + throw new RequestAbortedError() + } + + this.abort = abort + this.context = context + } + + onHeaders () { + throw new SocketError('bad connect', null) + } + + onUpgrade (statusCode, rawHeaders, socket) { + const { callback, opaque, context } = this + + removeSignal(this) + + this.callback = null + + let headers = rawHeaders + // Indicates is an HTTP2Session + if (headers != null) { + headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + } + + this.runInAsyncScope(callback, null, null, { + statusCode, + headers, + socket, + opaque, + context + }) + } + + onError (err) { + const { callback, opaque } = this + + removeSignal(this) + + if (callback) { + this.callback = null + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }) + }) + } + } +} + +function connect (opts, callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + connect.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } + + try { + const connectHandler = new ConnectHandler(opts, callback) + this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler) + } catch (err) { + if (typeof callback !== 'function') { + throw err + } + const opaque = opts && opts.opaque + queueMicrotask(() => callback(err, { opaque })) + } +} + +module.exports = connect + + +/***/ }), + +/***/ 28752: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { + Readable, + Duplex, + PassThrough +} = __nccwpck_require__(12781) +const { + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError +} = __nccwpck_require__(48045) +const util = __nccwpck_require__(83983) +const { AsyncResource } = __nccwpck_require__(50852) +const { addSignal, removeSignal } = __nccwpck_require__(7032) +const assert = __nccwpck_require__(39491) + +const kResume = Symbol('resume') + +class PipelineRequest extends Readable { + constructor () { + super({ autoDestroy: true }) + + this[kResume] = null + } + + _read () { + const { [kResume]: resume } = this + + if (resume) { + this[kResume] = null + resume() + } + } + + _destroy (err, callback) { + this._read() + + callback(err) + } +} + +class PipelineResponse extends Readable { + constructor (resume) { + super({ autoDestroy: true }) + this[kResume] = resume + } + + _read () { + this[kResume]() + } + + _destroy (err, callback) { + if (!err && !this._readableState.endEmitted) { + err = new RequestAbortedError() + } + + callback(err) + } +} + +class PipelineHandler extends AsyncResource { + constructor (opts, handler) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + if (typeof handler !== 'function') { + throw new InvalidArgumentError('invalid handler') + } + + const { signal, method, opaque, onInfo, responseHeaders } = opts + + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } + + if (method === 'CONNECT') { + throw new InvalidArgumentError('invalid method') + } + + if (onInfo && typeof onInfo !== 'function') { + throw new InvalidArgumentError('invalid onInfo callback') + } + + super('UNDICI_PIPELINE') + + this.opaque = opaque || null + this.responseHeaders = responseHeaders || null + this.handler = handler + this.abort = null + this.context = null + this.onInfo = onInfo || null + + this.req = new PipelineRequest().on('error', util.nop) + + this.ret = new Duplex({ + readableObjectMode: opts.objectMode, + autoDestroy: true, + read: () => { + const { body } = this + + if (body && body.resume) { + body.resume() + } + }, + write: (chunk, encoding, callback) => { + const { req } = this + + if (req.push(chunk, encoding) || req._readableState.destroyed) { + callback() + } else { + req[kResume] = callback + } + }, + destroy: (err, callback) => { + const { body, req, res, ret, abort } = this + + if (!err && !ret._readableState.endEmitted) { + err = new RequestAbortedError() + } + + if (abort && err) { + abort() + } + + util.destroy(body, err) + util.destroy(req, err) + util.destroy(res, err) + + removeSignal(this) + + callback(err) + } + }).on('prefinish', () => { + const { req } = this + + // Node < 15 does not call _final in same tick. + req.push(null) + }) + + this.res = null + + addSignal(this, signal) + } + + onConnect (abort, context) { + const { ret, res } = this + + assert(!res, 'pipeline cannot be retried') + + if (ret.destroyed) { + throw new RequestAbortedError() + } + + this.abort = abort + this.context = context + } + + onHeaders (statusCode, rawHeaders, resume) { + const { opaque, handler, context } = this + + if (statusCode < 200) { + if (this.onInfo) { + const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + this.onInfo({ statusCode, headers }) + } + return + } + + this.res = new PipelineResponse(resume) + + let body + try { + this.handler = null + const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + body = this.runInAsyncScope(handler, null, { + statusCode, + headers, + opaque, + body: this.res, + context + }) + } catch (err) { + this.res.on('error', util.nop) + throw err + } + + if (!body || typeof body.on !== 'function') { + throw new InvalidReturnValueError('expected Readable') + } + + body + .on('data', (chunk) => { + const { ret, body } = this + + if (!ret.push(chunk) && body.pause) { + body.pause() + } + }) + .on('error', (err) => { + const { ret } = this + + util.destroy(ret, err) + }) + .on('end', () => { + const { ret } = this + + ret.push(null) + }) + .on('close', () => { + const { ret } = this + + if (!ret._readableState.ended) { + util.destroy(ret, new RequestAbortedError()) + } + }) + + this.body = body + } + + onData (chunk) { + const { res } = this + return res.push(chunk) + } + + onComplete (trailers) { + const { res } = this + res.push(null) + } + + onError (err) { + const { ret } = this + this.handler = null + util.destroy(ret, err) + } +} + +function pipeline (opts, handler) { + try { + const pipelineHandler = new PipelineHandler(opts, handler) + this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler) + return pipelineHandler.ret + } catch (err) { + return new PassThrough().destroy(err) + } +} + +module.exports = pipeline + + +/***/ }), + +/***/ 55448: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const Readable = __nccwpck_require__(73858) +const { + InvalidArgumentError, + RequestAbortedError +} = __nccwpck_require__(48045) +const util = __nccwpck_require__(83983) +const { getResolveErrorBodyCallback } = __nccwpck_require__(77474) +const { AsyncResource } = __nccwpck_require__(50852) +const { addSignal, removeSignal } = __nccwpck_require__(7032) + +class RequestHandler extends AsyncResource { + constructor (opts, callback) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts + + try { + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) { + throw new InvalidArgumentError('invalid highWaterMark') + } + + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } + + if (method === 'CONNECT') { + throw new InvalidArgumentError('invalid method') + } + + if (onInfo && typeof onInfo !== 'function') { + throw new InvalidArgumentError('invalid onInfo callback') + } + + super('UNDICI_REQUEST') + } catch (err) { + if (util.isStream(body)) { + util.destroy(body.on('error', util.nop), err) + } + throw err + } + + this.responseHeaders = responseHeaders || null + this.opaque = opaque || null + this.callback = callback + this.res = null + this.abort = null + this.body = body + this.trailers = {} + this.context = null + this.onInfo = onInfo || null + this.throwOnError = throwOnError + this.highWaterMark = highWaterMark + + if (util.isStream(body)) { + body.on('error', (err) => { + this.onError(err) + }) + } + + addSignal(this, signal) + } + + onConnect (abort, context) { + if (!this.callback) { + throw new RequestAbortedError() + } + + this.abort = abort + this.context = context + } + + onHeaders (statusCode, rawHeaders, resume, statusMessage) { + const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this + + const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + + if (statusCode < 200) { + if (this.onInfo) { + this.onInfo({ statusCode, headers }) + } + return + } + + const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers + const contentType = parsedHeaders['content-type'] + const body = new Readable({ resume, abort, contentType, highWaterMark }) + + this.callback = null + this.res = body + if (callback !== null) { + if (this.throwOnError && statusCode >= 400) { + this.runInAsyncScope(getResolveErrorBodyCallback, null, + { callback, body, contentType, statusCode, statusMessage, headers } + ) + } else { + this.runInAsyncScope(callback, null, null, { + statusCode, + headers, + trailers: this.trailers, + opaque, + body, + context + }) + } + } + } + + onData (chunk) { + const { res } = this + return res.push(chunk) + } + + onComplete (trailers) { + const { res } = this + + removeSignal(this) + + util.parseHeaders(trailers, this.trailers) + + res.push(null) + } + + onError (err) { + const { res, callback, body, opaque } = this + + removeSignal(this) + + if (callback) { + // TODO: Does this need queueMicrotask? + this.callback = null + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }) + }) + } + + if (res) { + this.res = null + // Ensure all queued handlers are invoked before destroying res. + queueMicrotask(() => { + util.destroy(res, err) + }) + } + + if (body) { + this.body = null + util.destroy(body, err) + } + } +} + +function request (opts, callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + request.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } + + try { + this.dispatch(opts, new RequestHandler(opts, callback)) + } catch (err) { + if (typeof callback !== 'function') { + throw err + } + const opaque = opts && opts.opaque + queueMicrotask(() => callback(err, { opaque })) + } +} + +module.exports = request + + +/***/ }), + +/***/ 75395: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { finished, PassThrough } = __nccwpck_require__(12781) +const { + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError +} = __nccwpck_require__(48045) +const util = __nccwpck_require__(83983) +const { getResolveErrorBodyCallback } = __nccwpck_require__(77474) +const { AsyncResource } = __nccwpck_require__(50852) +const { addSignal, removeSignal } = __nccwpck_require__(7032) + +class StreamHandler extends AsyncResource { + constructor (opts, factory, callback) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts + + try { + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + if (typeof factory !== 'function') { + throw new InvalidArgumentError('invalid factory') + } + + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } + + if (method === 'CONNECT') { + throw new InvalidArgumentError('invalid method') + } + + if (onInfo && typeof onInfo !== 'function') { + throw new InvalidArgumentError('invalid onInfo callback') + } + + super('UNDICI_STREAM') + } catch (err) { + if (util.isStream(body)) { + util.destroy(body.on('error', util.nop), err) + } + throw err + } + + this.responseHeaders = responseHeaders || null + this.opaque = opaque || null + this.factory = factory + this.callback = callback + this.res = null + this.abort = null + this.context = null + this.trailers = null + this.body = body + this.onInfo = onInfo || null + this.throwOnError = throwOnError || false + + if (util.isStream(body)) { + body.on('error', (err) => { + this.onError(err) + }) + } + + addSignal(this, signal) + } + + onConnect (abort, context) { + if (!this.callback) { + throw new RequestAbortedError() + } + + this.abort = abort + this.context = context + } + + onHeaders (statusCode, rawHeaders, resume, statusMessage) { + const { factory, opaque, context, callback, responseHeaders } = this + + const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + + if (statusCode < 200) { + if (this.onInfo) { + this.onInfo({ statusCode, headers }) + } + return + } + + this.factory = null + + let res + + if (this.throwOnError && statusCode >= 400) { + const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers + const contentType = parsedHeaders['content-type'] + res = new PassThrough() + + this.callback = null + this.runInAsyncScope(getResolveErrorBodyCallback, null, + { callback, body: res, contentType, statusCode, statusMessage, headers } + ) + } else { + if (factory === null) { + return + } + + res = this.runInAsyncScope(factory, null, { + statusCode, + headers, + opaque, + context + }) + + if ( + !res || + typeof res.write !== 'function' || + typeof res.end !== 'function' || + typeof res.on !== 'function' + ) { + throw new InvalidReturnValueError('expected Writable') + } + + // TODO: Avoid finished. It registers an unnecessary amount of listeners. + finished(res, { readable: false }, (err) => { + const { callback, res, opaque, trailers, abort } = this + + this.res = null + if (err || !res.readable) { + util.destroy(res, err) + } + + this.callback = null + this.runInAsyncScope(callback, null, err || null, { opaque, trailers }) + + if (err) { + abort() + } + }) + } + + res.on('drain', resume) + + this.res = res + + const needDrain = res.writableNeedDrain !== undefined + ? res.writableNeedDrain + : res._writableState && res._writableState.needDrain + + return needDrain !== true + } + + onData (chunk) { + const { res } = this + + return res ? res.write(chunk) : true + } + + onComplete (trailers) { + const { res } = this + + removeSignal(this) + + if (!res) { + return + } + + this.trailers = util.parseHeaders(trailers) + + res.end() + } + + onError (err) { + const { res, callback, opaque, body } = this + + removeSignal(this) + + this.factory = null + + if (res) { + this.res = null + util.destroy(res, err) + } else if (callback) { + this.callback = null + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }) + }) + } + + if (body) { + this.body = null + util.destroy(body, err) + } + } +} + +function stream (opts, factory, callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + stream.call(this, opts, factory, (err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } + + try { + this.dispatch(opts, new StreamHandler(opts, factory, callback)) + } catch (err) { + if (typeof callback !== 'function') { + throw err + } + const opaque = opts && opts.opaque + queueMicrotask(() => callback(err, { opaque })) + } +} + +module.exports = stream + + +/***/ }), + +/***/ 36923: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(48045) +const { AsyncResource } = __nccwpck_require__(50852) +const util = __nccwpck_require__(83983) +const { addSignal, removeSignal } = __nccwpck_require__(7032) +const assert = __nccwpck_require__(39491) + +class UpgradeHandler extends AsyncResource { + constructor (opts, callback) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + const { signal, opaque, responseHeaders } = opts + + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } + + super('UNDICI_UPGRADE') + + this.responseHeaders = responseHeaders || null + this.opaque = opaque || null + this.callback = callback + this.abort = null + this.context = null + + addSignal(this, signal) + } + + onConnect (abort, context) { + if (!this.callback) { + throw new RequestAbortedError() + } + + this.abort = abort + this.context = null + } + + onHeaders () { + throw new SocketError('bad upgrade', null) + } + + onUpgrade (statusCode, rawHeaders, socket) { + const { callback, opaque, context } = this + + assert.strictEqual(statusCode, 101) + + removeSignal(this) + + this.callback = null + const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + this.runInAsyncScope(callback, null, null, { + headers, + socket, + opaque, + context + }) + } + + onError (err) { + const { callback, opaque } = this + + removeSignal(this) + + if (callback) { + this.callback = null + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }) + }) + } + } +} + +function upgrade (opts, callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + upgrade.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } + + try { + const upgradeHandler = new UpgradeHandler(opts, callback) + this.dispatch({ + ...opts, + method: opts.method || 'GET', + upgrade: opts.protocol || 'Websocket' + }, upgradeHandler) + } catch (err) { + if (typeof callback !== 'function') { + throw err + } + const opaque = opts && opts.opaque + queueMicrotask(() => callback(err, { opaque })) + } +} + +module.exports = upgrade + + +/***/ }), + +/***/ 44059: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +module.exports.request = __nccwpck_require__(55448) +module.exports.stream = __nccwpck_require__(75395) +module.exports.pipeline = __nccwpck_require__(28752) +module.exports.upgrade = __nccwpck_require__(36923) +module.exports.connect = __nccwpck_require__(29744) + + +/***/ }), + +/***/ 73858: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Ported from https://github.com/nodejs/undici/pull/907 + + + +const assert = __nccwpck_require__(39491) +const { Readable } = __nccwpck_require__(12781) +const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(48045) +const util = __nccwpck_require__(83983) +const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(83983) + +let Blob + +const kConsume = Symbol('kConsume') +const kReading = Symbol('kReading') +const kBody = Symbol('kBody') +const kAbort = Symbol('abort') +const kContentType = Symbol('kContentType') + +module.exports = class BodyReadable extends Readable { + constructor ({ + resume, + abort, + contentType = '', + highWaterMark = 64 * 1024 // Same as nodejs fs streams. + }) { + super({ + autoDestroy: true, + read: resume, + highWaterMark + }) + + this._readableState.dataEmitted = false + + this[kAbort] = abort + this[kConsume] = null + this[kBody] = null + this[kContentType] = contentType + + // Is stream being consumed through Readable API? + // This is an optimization so that we avoid checking + // for 'data' and 'readable' listeners in the hot path + // inside push(). + this[kReading] = false + } + + destroy (err) { + if (this.destroyed) { + // Node < 16 + return this + } + + if (!err && !this._readableState.endEmitted) { + err = new RequestAbortedError() + } + + if (err) { + this[kAbort]() + } + + return super.destroy(err) + } + + emit (ev, ...args) { + if (ev === 'data') { + // Node < 16.7 + this._readableState.dataEmitted = true + } else if (ev === 'error') { + // Node < 16 + this._readableState.errorEmitted = true + } + return super.emit(ev, ...args) + } + + on (ev, ...args) { + if (ev === 'data' || ev === 'readable') { + this[kReading] = true + } + return super.on(ev, ...args) + } + + addListener (ev, ...args) { + return this.on(ev, ...args) + } + + off (ev, ...args) { + const ret = super.off(ev, ...args) + if (ev === 'data' || ev === 'readable') { + this[kReading] = ( + this.listenerCount('data') > 0 || + this.listenerCount('readable') > 0 + ) + } + return ret + } + + removeListener (ev, ...args) { + return this.off(ev, ...args) + } + + push (chunk) { + if (this[kConsume] && chunk !== null && this.readableLength === 0) { + consumePush(this[kConsume], chunk) + return this[kReading] ? super.push(chunk) : true + } + return super.push(chunk) + } + + // https://fetch.spec.whatwg.org/#dom-body-text + async text () { + return consume(this, 'text') + } + + // https://fetch.spec.whatwg.org/#dom-body-json + async json () { + return consume(this, 'json') + } + + // https://fetch.spec.whatwg.org/#dom-body-blob + async blob () { + return consume(this, 'blob') + } + + // https://fetch.spec.whatwg.org/#dom-body-arraybuffer + async arrayBuffer () { + return consume(this, 'arrayBuffer') + } + + // https://fetch.spec.whatwg.org/#dom-body-formdata + async formData () { + // TODO: Implement. + throw new NotSupportedError() + } + + // https://fetch.spec.whatwg.org/#dom-body-bodyused + get bodyUsed () { + return util.isDisturbed(this) + } + + // https://fetch.spec.whatwg.org/#dom-body-body + get body () { + if (!this[kBody]) { + this[kBody] = ReadableStreamFrom(this) + if (this[kConsume]) { + // TODO: Is this the best way to force a lock? + this[kBody].getReader() // Ensure stream is locked. + assert(this[kBody].locked) + } + } + return this[kBody] + } + + async dump (opts) { + let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144 + const signal = opts && opts.signal + const abortFn = () => { + this.destroy() + } + let signalListenerCleanup + if (signal) { + if (typeof signal !== 'object' || !('aborted' in signal)) { + throw new InvalidArgumentError('signal must be an AbortSignal') + } + util.throwIfAborted(signal) + signalListenerCleanup = util.addAbortListener(signal, abortFn) + } + try { + for await (const chunk of this) { + util.throwIfAborted(signal) + limit -= Buffer.byteLength(chunk) + if (limit < 0) { + return + } + } + } catch { + util.throwIfAborted(signal) + } finally { + if (typeof signalListenerCleanup === 'function') { + signalListenerCleanup() + } else if (signalListenerCleanup) { + signalListenerCleanup[Symbol.dispose]() + } + } + } +} + +// https://streams.spec.whatwg.org/#readablestream-locked +function isLocked (self) { + // Consume is an implicit lock. + return (self[kBody] && self[kBody].locked === true) || self[kConsume] +} + +// https://fetch.spec.whatwg.org/#body-unusable +function isUnusable (self) { + return util.isDisturbed(self) || isLocked(self) +} + +async function consume (stream, type) { + if (isUnusable(stream)) { + throw new TypeError('unusable') + } + + assert(!stream[kConsume]) + + return new Promise((resolve, reject) => { + stream[kConsume] = { + type, + stream, + resolve, + reject, + length: 0, + body: [] + } + + stream + .on('error', function (err) { + consumeFinish(this[kConsume], err) + }) + .on('close', function () { + if (this[kConsume].body !== null) { + consumeFinish(this[kConsume], new RequestAbortedError()) + } + }) + + process.nextTick(consumeStart, stream[kConsume]) + }) +} + +function consumeStart (consume) { + if (consume.body === null) { + return + } + + const { _readableState: state } = consume.stream + + for (const chunk of state.buffer) { + consumePush(consume, chunk) + } + + if (state.endEmitted) { + consumeEnd(this[kConsume]) + } else { + consume.stream.on('end', function () { + consumeEnd(this[kConsume]) + }) + } + + consume.stream.resume() + + while (consume.stream.read() != null) { + // Loop + } +} + +function consumeEnd (consume) { + const { type, body, resolve, stream, length } = consume + + try { + if (type === 'text') { + resolve(toUSVString(Buffer.concat(body))) + } else if (type === 'json') { + resolve(JSON.parse(Buffer.concat(body))) + } else if (type === 'arrayBuffer') { + const dst = new Uint8Array(length) + + let pos = 0 + for (const buf of body) { + dst.set(buf, pos) + pos += buf.byteLength + } + + resolve(dst.buffer) + } else if (type === 'blob') { + if (!Blob) { + Blob = (__nccwpck_require__(14300).Blob) + } + resolve(new Blob(body, { type: stream[kContentType] })) + } + + consumeFinish(consume) + } catch (err) { + stream.destroy(err) + } +} + +function consumePush (consume, chunk) { + consume.length += chunk.length + consume.body.push(chunk) +} + +function consumeFinish (consume, err) { + if (consume.body === null) { + return + } + + if (err) { + consume.reject(err) + } else { + consume.resolve() + } + + consume.type = null + consume.stream = null + consume.resolve = null + consume.reject = null + consume.length = 0 + consume.body = null +} + + +/***/ }), + +/***/ 77474: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const assert = __nccwpck_require__(39491) +const { + ResponseStatusCodeError +} = __nccwpck_require__(48045) +const { toUSVString } = __nccwpck_require__(83983) + +async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) { + assert(body) + + let chunks = [] + let limit = 0 + + for await (const chunk of body) { + chunks.push(chunk) + limit += chunk.length + if (limit > 128 * 1024) { + chunks = null + break + } + } + + if (statusCode === 204 || !contentType || !chunks) { + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers)) + return + } + + try { + if (contentType.startsWith('application/json')) { + const payload = JSON.parse(toUSVString(Buffer.concat(chunks))) + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload)) + return + } + + if (contentType.startsWith('text/')) { + const payload = toUSVString(Buffer.concat(chunks)) + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload)) + return + } + } catch (err) { + // Process in a fallback if error + } + + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers)) +} + +module.exports = { getResolveErrorBodyCallback } + + +/***/ }), + +/***/ 37931: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { + BalancedPoolMissingUpstreamError, + InvalidArgumentError +} = __nccwpck_require__(48045) +const { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kRemoveClient, + kGetDispatcher +} = __nccwpck_require__(73198) +const Pool = __nccwpck_require__(4634) +const { kUrl, kInterceptors } = __nccwpck_require__(72785) +const { parseOrigin } = __nccwpck_require__(83983) +const kFactory = Symbol('factory') + +const kOptions = Symbol('options') +const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor') +const kCurrentWeight = Symbol('kCurrentWeight') +const kIndex = Symbol('kIndex') +const kWeight = Symbol('kWeight') +const kMaxWeightPerServer = Symbol('kMaxWeightPerServer') +const kErrorPenalty = Symbol('kErrorPenalty') + +function getGreatestCommonDivisor (a, b) { + if (b === 0) return a + return getGreatestCommonDivisor(b, a % b) +} + +function defaultFactory (origin, opts) { + return new Pool(origin, opts) +} + +class BalancedPool extends PoolBase { + constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) { + super() + + this[kOptions] = opts + this[kIndex] = -1 + this[kCurrentWeight] = 0 + + this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100 + this[kErrorPenalty] = this[kOptions].errorPenalty || 15 + + if (!Array.isArray(upstreams)) { + upstreams = [upstreams] + } + + if (typeof factory !== 'function') { + throw new InvalidArgumentError('factory must be a function.') + } + + this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool) + ? opts.interceptors.BalancedPool + : [] + this[kFactory] = factory + + for (const upstream of upstreams) { + this.addUpstream(upstream) + } + this._updateBalancedPoolStats() + } + + addUpstream (upstream) { + const upstreamOrigin = parseOrigin(upstream).origin + + if (this[kClients].find((pool) => ( + pool[kUrl].origin === upstreamOrigin && + pool.closed !== true && + pool.destroyed !== true + ))) { + return this + } + const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions])) + + this[kAddClient](pool) + pool.on('connect', () => { + pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty]) + }) + + pool.on('connectionError', () => { + pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]) + this._updateBalancedPoolStats() + }) + + pool.on('disconnect', (...args) => { + const err = args[2] + if (err && err.code === 'UND_ERR_SOCKET') { + // decrease the weight of the pool. + pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]) + this._updateBalancedPoolStats() + } + }) + + for (const client of this[kClients]) { + client[kWeight] = this[kMaxWeightPerServer] + } + + this._updateBalancedPoolStats() + + return this + } + + _updateBalancedPoolStats () { + this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0) + } + + removeUpstream (upstream) { + const upstreamOrigin = parseOrigin(upstream).origin + + const pool = this[kClients].find((pool) => ( + pool[kUrl].origin === upstreamOrigin && + pool.closed !== true && + pool.destroyed !== true + )) + + if (pool) { + this[kRemoveClient](pool) + } + + return this + } + + get upstreams () { + return this[kClients] + .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true) + .map((p) => p[kUrl].origin) + } + + [kGetDispatcher] () { + // We validate that pools is greater than 0, + // otherwise we would have to wait until an upstream + // is added, which might never happen. + if (this[kClients].length === 0) { + throw new BalancedPoolMissingUpstreamError() + } + + const dispatcher = this[kClients].find(dispatcher => ( + !dispatcher[kNeedDrain] && + dispatcher.closed !== true && + dispatcher.destroyed !== true + )) + + if (!dispatcher) { + return + } + + const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true) + + if (allClientsBusy) { + return + } + + let counter = 0 + + let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain]) + + while (counter++ < this[kClients].length) { + this[kIndex] = (this[kIndex] + 1) % this[kClients].length + const pool = this[kClients][this[kIndex]] + + // find pool index with the largest weight + if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) { + maxWeightIndex = this[kIndex] + } + + // decrease the current weight every `this[kClients].length`. + if (this[kIndex] === 0) { + // Set the current weight to the next lower weight. + this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor] + + if (this[kCurrentWeight] <= 0) { + this[kCurrentWeight] = this[kMaxWeightPerServer] + } + } + if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) { + return pool + } + } + + this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight] + this[kIndex] = maxWeightIndex + return this[kClients][maxWeightIndex] + } +} + +module.exports = BalancedPool + + +/***/ }), + +/***/ 66101: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { kConstruct } = __nccwpck_require__(29174) +const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(82396) +const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(83983) +const { kHeadersList } = __nccwpck_require__(72785) +const { webidl } = __nccwpck_require__(21744) +const { Response, cloneResponse } = __nccwpck_require__(27823) +const { Request } = __nccwpck_require__(48359) +const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(15861) +const { fetching } = __nccwpck_require__(74881) +const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(52538) +const assert = __nccwpck_require__(39491) +const { getGlobalDispatcher } = __nccwpck_require__(21892) + +/** + * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation + * @typedef {Object} CacheBatchOperation + * @property {'delete' | 'put'} type + * @property {any} request + * @property {any} response + * @property {import('../../types/cache').CacheQueryOptions} options + */ + +/** + * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list + * @typedef {[any, any][]} requestResponseList + */ + +class Cache { + /** + * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list + * @type {requestResponseList} + */ + #relevantRequestResponseList + + constructor () { + if (arguments[0] !== kConstruct) { + webidl.illegalConstructor() + } + + this.#relevantRequestResponseList = arguments[1] + } + + async match (request, options = {}) { + webidl.brandCheck(this, Cache) + webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' }) + + request = webidl.converters.RequestInfo(request) + options = webidl.converters.CacheQueryOptions(options) + + const p = await this.matchAll(request, options) + + if (p.length === 0) { + return + } + + return p[0] + } + + async matchAll (request = undefined, options = {}) { + webidl.brandCheck(this, Cache) + + if (request !== undefined) request = webidl.converters.RequestInfo(request) + options = webidl.converters.CacheQueryOptions(options) + + // 1. + let r = null + + // 2. + if (request !== undefined) { + if (request instanceof Request) { + // 2.1.1 + r = request[kState] + + // 2.1.2 + if (r.method !== 'GET' && !options.ignoreMethod) { + return [] + } + } else if (typeof request === 'string') { + // 2.2.1 + r = new Request(request)[kState] + } + } + + // 5. + // 5.1 + const responses = [] + + // 5.2 + if (request === undefined) { + // 5.2.1 + for (const requestResponse of this.#relevantRequestResponseList) { + responses.push(requestResponse[1]) + } + } else { // 5.3 + // 5.3.1 + const requestResponses = this.#queryCache(r, options) + + // 5.3.2 + for (const requestResponse of requestResponses) { + responses.push(requestResponse[1]) + } + } + + // 5.4 + // We don't implement CORs so we don't need to loop over the responses, yay! + + // 5.5.1 + const responseList = [] + + // 5.5.2 + for (const response of responses) { + // 5.5.2.1 + const responseObject = new Response(response.body?.source ?? null) + const body = responseObject[kState].body + responseObject[kState] = response + responseObject[kState].body = body + responseObject[kHeaders][kHeadersList] = response.headersList + responseObject[kHeaders][kGuard] = 'immutable' + + responseList.push(responseObject) + } + + // 6. + return Object.freeze(responseList) + } + + async add (request) { + webidl.brandCheck(this, Cache) + webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' }) + + request = webidl.converters.RequestInfo(request) + + // 1. + const requests = [request] + + // 2. + const responseArrayPromise = this.addAll(requests) + + // 3. + return await responseArrayPromise + } + + async addAll (requests) { + webidl.brandCheck(this, Cache) + webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' }) + + requests = webidl.converters['sequence'](requests) + + // 1. + const responsePromises = [] + + // 2. + const requestList = [] + + // 3. + for (const request of requests) { + if (typeof request === 'string') { + continue + } + + // 3.1 + const r = request[kState] + + // 3.2 + if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') { + throw webidl.errors.exception({ + header: 'Cache.addAll', + message: 'Expected http/s scheme when method is not GET.' + }) + } + } + + // 4. + /** @type {ReturnType[]} */ + const fetchControllers = [] + + // 5. + for (const request of requests) { + // 5.1 + const r = new Request(request)[kState] + + // 5.2 + if (!urlIsHttpHttpsScheme(r.url)) { + throw webidl.errors.exception({ + header: 'Cache.addAll', + message: 'Expected http/s scheme.' + }) + } + + // 5.4 + r.initiator = 'fetch' + r.destination = 'subresource' + + // 5.5 + requestList.push(r) + + // 5.6 + const responsePromise = createDeferredPromise() + + // 5.7 + fetchControllers.push(fetching({ + request: r, + dispatcher: getGlobalDispatcher(), + processResponse (response) { + // 1. + if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) { + responsePromise.reject(webidl.errors.exception({ + header: 'Cache.addAll', + message: 'Received an invalid status code or the request failed.' + })) + } else if (response.headersList.contains('vary')) { // 2. + // 2.1 + const fieldValues = getFieldValues(response.headersList.get('vary')) + + // 2.2 + for (const fieldValue of fieldValues) { + // 2.2.1 + if (fieldValue === '*') { + responsePromise.reject(webidl.errors.exception({ + header: 'Cache.addAll', + message: 'invalid vary field value' + })) + + for (const controller of fetchControllers) { + controller.abort() + } + + return + } + } + } + }, + processResponseEndOfBody (response) { + // 1. + if (response.aborted) { + responsePromise.reject(new DOMException('aborted', 'AbortError')) + return + } + + // 2. + responsePromise.resolve(response) + } + })) + + // 5.8 + responsePromises.push(responsePromise.promise) + } + + // 6. + const p = Promise.all(responsePromises) + + // 7. + const responses = await p + + // 7.1 + const operations = [] + + // 7.2 + let index = 0 + + // 7.3 + for (const response of responses) { + // 7.3.1 + /** @type {CacheBatchOperation} */ + const operation = { + type: 'put', // 7.3.2 + request: requestList[index], // 7.3.3 + response // 7.3.4 + } + + operations.push(operation) // 7.3.5 + + index++ // 7.3.6 + } + + // 7.5 + const cacheJobPromise = createDeferredPromise() + + // 7.6.1 + let errorData = null + + // 7.6.2 + try { + this.#batchCacheOperations(operations) + } catch (e) { + errorData = e + } + + // 7.6.3 + queueMicrotask(() => { + // 7.6.3.1 + if (errorData === null) { + cacheJobPromise.resolve(undefined) + } else { + // 7.6.3.2 + cacheJobPromise.reject(errorData) + } + }) + + // 7.7 + return cacheJobPromise.promise + } + + async put (request, response) { + webidl.brandCheck(this, Cache) + webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' }) + + request = webidl.converters.RequestInfo(request) + response = webidl.converters.Response(response) + + // 1. + let innerRequest = null + + // 2. + if (request instanceof Request) { + innerRequest = request[kState] + } else { // 3. + innerRequest = new Request(request)[kState] + } + + // 4. + if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') { + throw webidl.errors.exception({ + header: 'Cache.put', + message: 'Expected an http/s scheme when method is not GET' + }) + } + + // 5. + const innerResponse = response[kState] + + // 6. + if (innerResponse.status === 206) { + throw webidl.errors.exception({ + header: 'Cache.put', + message: 'Got 206 status' + }) + } + + // 7. + if (innerResponse.headersList.contains('vary')) { + // 7.1. + const fieldValues = getFieldValues(innerResponse.headersList.get('vary')) + + // 7.2. + for (const fieldValue of fieldValues) { + // 7.2.1 + if (fieldValue === '*') { + throw webidl.errors.exception({ + header: 'Cache.put', + message: 'Got * vary field value' + }) + } + } + } + + // 8. + if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) { + throw webidl.errors.exception({ + header: 'Cache.put', + message: 'Response body is locked or disturbed' + }) + } + + // 9. + const clonedResponse = cloneResponse(innerResponse) + + // 10. + const bodyReadPromise = createDeferredPromise() + + // 11. + if (innerResponse.body != null) { + // 11.1 + const stream = innerResponse.body.stream + + // 11.2 + const reader = stream.getReader() + + // 11.3 + readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject) + } else { + bodyReadPromise.resolve(undefined) + } + + // 12. + /** @type {CacheBatchOperation[]} */ + const operations = [] + + // 13. + /** @type {CacheBatchOperation} */ + const operation = { + type: 'put', // 14. + request: innerRequest, // 15. + response: clonedResponse // 16. + } + + // 17. + operations.push(operation) + + // 19. + const bytes = await bodyReadPromise.promise + + if (clonedResponse.body != null) { + clonedResponse.body.source = bytes + } + + // 19.1 + const cacheJobPromise = createDeferredPromise() + + // 19.2.1 + let errorData = null + + // 19.2.2 + try { + this.#batchCacheOperations(operations) + } catch (e) { + errorData = e + } + + // 19.2.3 + queueMicrotask(() => { + // 19.2.3.1 + if (errorData === null) { + cacheJobPromise.resolve() + } else { // 19.2.3.2 + cacheJobPromise.reject(errorData) + } + }) + + return cacheJobPromise.promise + } + + async delete (request, options = {}) { + webidl.brandCheck(this, Cache) + webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' }) + + request = webidl.converters.RequestInfo(request) + options = webidl.converters.CacheQueryOptions(options) + + /** + * @type {Request} + */ + let r = null + + if (request instanceof Request) { + r = request[kState] + + if (r.method !== 'GET' && !options.ignoreMethod) { + return false + } + } else { + assert(typeof request === 'string') + + r = new Request(request)[kState] + } + + /** @type {CacheBatchOperation[]} */ + const operations = [] + + /** @type {CacheBatchOperation} */ + const operation = { + type: 'delete', + request: r, + options + } + + operations.push(operation) + + const cacheJobPromise = createDeferredPromise() + + let errorData = null + let requestResponses + + try { + requestResponses = this.#batchCacheOperations(operations) + } catch (e) { + errorData = e + } + + queueMicrotask(() => { + if (errorData === null) { + cacheJobPromise.resolve(!!requestResponses?.length) + } else { + cacheJobPromise.reject(errorData) + } + }) + + return cacheJobPromise.promise + } + + /** + * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys + * @param {any} request + * @param {import('../../types/cache').CacheQueryOptions} options + * @returns {readonly Request[]} + */ + async keys (request = undefined, options = {}) { + webidl.brandCheck(this, Cache) + + if (request !== undefined) request = webidl.converters.RequestInfo(request) + options = webidl.converters.CacheQueryOptions(options) + + // 1. + let r = null + + // 2. + if (request !== undefined) { + // 2.1 + if (request instanceof Request) { + // 2.1.1 + r = request[kState] + + // 2.1.2 + if (r.method !== 'GET' && !options.ignoreMethod) { + return [] + } + } else if (typeof request === 'string') { // 2.2 + r = new Request(request)[kState] + } + } + + // 4. + const promise = createDeferredPromise() + + // 5. + // 5.1 + const requests = [] + + // 5.2 + if (request === undefined) { + // 5.2.1 + for (const requestResponse of this.#relevantRequestResponseList) { + // 5.2.1.1 + requests.push(requestResponse[0]) + } + } else { // 5.3 + // 5.3.1 + const requestResponses = this.#queryCache(r, options) + + // 5.3.2 + for (const requestResponse of requestResponses) { + // 5.3.2.1 + requests.push(requestResponse[0]) + } + } + + // 5.4 + queueMicrotask(() => { + // 5.4.1 + const requestList = [] + + // 5.4.2 + for (const request of requests) { + const requestObject = new Request('https://a') + requestObject[kState] = request + requestObject[kHeaders][kHeadersList] = request.headersList + requestObject[kHeaders][kGuard] = 'immutable' + requestObject[kRealm] = request.client + + // 5.4.2.1 + requestList.push(requestObject) + } + + // 5.4.3 + promise.resolve(Object.freeze(requestList)) + }) + + return promise.promise + } + + /** + * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm + * @param {CacheBatchOperation[]} operations + * @returns {requestResponseList} + */ + #batchCacheOperations (operations) { + // 1. + const cache = this.#relevantRequestResponseList + + // 2. + const backupCache = [...cache] + + // 3. + const addedItems = [] + + // 4.1 + const resultList = [] + + try { + // 4.2 + for (const operation of operations) { + // 4.2.1 + if (operation.type !== 'delete' && operation.type !== 'put') { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'operation type does not match "delete" or "put"' + }) + } + + // 4.2.2 + if (operation.type === 'delete' && operation.response != null) { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'delete operation should not have an associated response' + }) + } + + // 4.2.3 + if (this.#queryCache(operation.request, operation.options, addedItems).length) { + throw new DOMException('???', 'InvalidStateError') + } + + // 4.2.4 + let requestResponses + + // 4.2.5 + if (operation.type === 'delete') { + // 4.2.5.1 + requestResponses = this.#queryCache(operation.request, operation.options) + + // TODO: the spec is wrong, this is needed to pass WPTs + if (requestResponses.length === 0) { + return [] + } + + // 4.2.5.2 + for (const requestResponse of requestResponses) { + const idx = cache.indexOf(requestResponse) + assert(idx !== -1) + + // 4.2.5.2.1 + cache.splice(idx, 1) + } + } else if (operation.type === 'put') { // 4.2.6 + // 4.2.6.1 + if (operation.response == null) { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'put operation should have an associated response' + }) + } + + // 4.2.6.2 + const r = operation.request + + // 4.2.6.3 + if (!urlIsHttpHttpsScheme(r.url)) { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'expected http or https scheme' + }) + } + + // 4.2.6.4 + if (r.method !== 'GET') { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'not get method' + }) + } + + // 4.2.6.5 + if (operation.options != null) { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'options must not be defined' + }) + } + + // 4.2.6.6 + requestResponses = this.#queryCache(operation.request) + + // 4.2.6.7 + for (const requestResponse of requestResponses) { + const idx = cache.indexOf(requestResponse) + assert(idx !== -1) + + // 4.2.6.7.1 + cache.splice(idx, 1) + } + + // 4.2.6.8 + cache.push([operation.request, operation.response]) + + // 4.2.6.10 + addedItems.push([operation.request, operation.response]) + } + + // 4.2.7 + resultList.push([operation.request, operation.response]) + } + + // 4.3 + return resultList + } catch (e) { // 5. + // 5.1 + this.#relevantRequestResponseList.length = 0 + + // 5.2 + this.#relevantRequestResponseList = backupCache + + // 5.3 + throw e + } + } + + /** + * @see https://w3c.github.io/ServiceWorker/#query-cache + * @param {any} requestQuery + * @param {import('../../types/cache').CacheQueryOptions} options + * @param {requestResponseList} targetStorage + * @returns {requestResponseList} + */ + #queryCache (requestQuery, options, targetStorage) { + /** @type {requestResponseList} */ + const resultList = [] + + const storage = targetStorage ?? this.#relevantRequestResponseList + + for (const requestResponse of storage) { + const [cachedRequest, cachedResponse] = requestResponse + if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) { + resultList.push(requestResponse) + } + } + + return resultList + } + + /** + * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm + * @param {any} requestQuery + * @param {any} request + * @param {any | null} response + * @param {import('../../types/cache').CacheQueryOptions | undefined} options + * @returns {boolean} + */ + #requestMatchesCachedItem (requestQuery, request, response = null, options) { + // if (options?.ignoreMethod === false && request.method === 'GET') { + // return false + // } + + const queryURL = new URL(requestQuery.url) + + const cachedURL = new URL(request.url) + + if (options?.ignoreSearch) { + cachedURL.search = '' + + queryURL.search = '' + } + + if (!urlEquals(queryURL, cachedURL, true)) { + return false + } + + if ( + response == null || + options?.ignoreVary || + !response.headersList.contains('vary') + ) { + return true + } + + const fieldValues = getFieldValues(response.headersList.get('vary')) + + for (const fieldValue of fieldValues) { + if (fieldValue === '*') { + return false + } + + const requestValue = request.headersList.get(fieldValue) + const queryValue = requestQuery.headersList.get(fieldValue) + + // If one has the header and the other doesn't, or one has + // a different value than the other, return false + if (requestValue !== queryValue) { + return false + } + } + + return true + } +} + +Object.defineProperties(Cache.prototype, { + [Symbol.toStringTag]: { + value: 'Cache', + configurable: true + }, + match: kEnumerableProperty, + matchAll: kEnumerableProperty, + add: kEnumerableProperty, + addAll: kEnumerableProperty, + put: kEnumerableProperty, + delete: kEnumerableProperty, + keys: kEnumerableProperty +}) + +const cacheQueryOptionConverters = [ + { + key: 'ignoreSearch', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'ignoreMethod', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'ignoreVary', + converter: webidl.converters.boolean, + defaultValue: false + } +] + +webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters) + +webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([ + ...cacheQueryOptionConverters, + { + key: 'cacheName', + converter: webidl.converters.DOMString + } +]) + +webidl.converters.Response = webidl.interfaceConverter(Response) + +webidl.converters['sequence'] = webidl.sequenceConverter( + webidl.converters.RequestInfo +) + +module.exports = { + Cache +} + + +/***/ }), + +/***/ 37907: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { kConstruct } = __nccwpck_require__(29174) +const { Cache } = __nccwpck_require__(66101) +const { webidl } = __nccwpck_require__(21744) +const { kEnumerableProperty } = __nccwpck_require__(83983) + +class CacheStorage { + /** + * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map + * @type {Map} + */ + async has (cacheName) { + webidl.brandCheck(this, CacheStorage) + webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' }) + + cacheName = webidl.converters.DOMString(cacheName) + + // 2.1.1 + // 2.2 + return this.#caches.has(cacheName) + } + + /** + * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open + * @param {string} cacheName + * @returns {Promise} + */ + async open (cacheName) { + webidl.brandCheck(this, CacheStorage) + webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' }) + + cacheName = webidl.converters.DOMString(cacheName) + + // 2.1 + if (this.#caches.has(cacheName)) { + // await caches.open('v1') !== await caches.open('v1') + + // 2.1.1 + const cache = this.#caches.get(cacheName) + + // 2.1.1.1 + return new Cache(kConstruct, cache) + } + + // 2.2 + const cache = [] + + // 2.3 + this.#caches.set(cacheName, cache) + + // 2.4 + return new Cache(kConstruct, cache) + } + + /** + * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete + * @param {string} cacheName + * @returns {Promise} + */ + async delete (cacheName) { + webidl.brandCheck(this, CacheStorage) + webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' }) + + cacheName = webidl.converters.DOMString(cacheName) + + return this.#caches.delete(cacheName) + } + + /** + * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys + * @returns {string[]} + */ + async keys () { + webidl.brandCheck(this, CacheStorage) + + // 2.1 + const keys = this.#caches.keys() + + // 2.2 + return [...keys] + } +} + +Object.defineProperties(CacheStorage.prototype, { + [Symbol.toStringTag]: { + value: 'CacheStorage', + configurable: true + }, + match: kEnumerableProperty, + has: kEnumerableProperty, + open: kEnumerableProperty, + delete: kEnumerableProperty, + keys: kEnumerableProperty +}) + +module.exports = { + CacheStorage +} + + +/***/ }), + +/***/ 29174: +/***/ ((module) => { + +"use strict"; + + +module.exports = { + kConstruct: Symbol('constructable') +} + + +/***/ }), + +/***/ 82396: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const assert = __nccwpck_require__(39491) +const { URLSerializer } = __nccwpck_require__(685) +const { isValidHeaderName } = __nccwpck_require__(52538) + +/** + * @see https://url.spec.whatwg.org/#concept-url-equals + * @param {URL} A + * @param {URL} B + * @param {boolean | undefined} excludeFragment + * @returns {boolean} + */ +function urlEquals (A, B, excludeFragment = false) { + const serializedA = URLSerializer(A, excludeFragment) + + const serializedB = URLSerializer(B, excludeFragment) + + return serializedA === serializedB +} + +/** + * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262 + * @param {string} header + */ +function fieldValues (header) { + assert(header !== null) + + const values = [] + + for (let value of header.split(',')) { + value = value.trim() + + if (!value.length) { + continue + } else if (!isValidHeaderName(value)) { + continue + } + + values.push(value) + } + + return values +} + +module.exports = { + urlEquals, + fieldValues +} + + +/***/ }), + +/***/ 33598: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// @ts-check + + + +/* global WebAssembly */ + +const assert = __nccwpck_require__(39491) +const net = __nccwpck_require__(41808) +const http = __nccwpck_require__(13685) +const { pipeline } = __nccwpck_require__(12781) +const util = __nccwpck_require__(83983) +const timers = __nccwpck_require__(29459) +const Request = __nccwpck_require__(62905) +const DispatcherBase = __nccwpck_require__(74839) +const { + RequestContentLengthMismatchError, + ResponseContentLengthMismatchError, + InvalidArgumentError, + RequestAbortedError, + HeadersTimeoutError, + HeadersOverflowError, + SocketError, + InformationalError, + BodyTimeoutError, + HTTPParserError, + ResponseExceededMaxSizeError, + ClientDestroyedError +} = __nccwpck_require__(48045) +const buildConnector = __nccwpck_require__(82067) +const { + kUrl, + kReset, + kServerName, + kClient, + kBusy, + kParser, + kConnect, + kBlocking, + kResuming, + kRunning, + kPending, + kSize, + kWriting, + kQueue, + kConnected, + kConnecting, + kNeedDrain, + kNoRef, + kKeepAliveDefaultTimeout, + kHostHeader, + kPendingIdx, + kRunningIdx, + kError, + kPipelining, + kSocket, + kKeepAliveTimeoutValue, + kMaxHeadersSize, + kKeepAliveMaxTimeout, + kKeepAliveTimeoutThreshold, + kHeadersTimeout, + kBodyTimeout, + kStrictContentLength, + kConnector, + kMaxRedirections, + kMaxRequests, + kCounter, + kClose, + kDestroy, + kDispatch, + kInterceptors, + kLocalAddress, + kMaxResponseSize, + kHTTPConnVersion, + // HTTP2 + kHost, + kHTTP2Session, + kHTTP2SessionState, + kHTTP2BuildRequest, + kHTTP2CopyHeaders, + kHTTP1BuildRequest +} = __nccwpck_require__(72785) + +/** @type {import('http2')} */ +let http2 +try { + http2 = __nccwpck_require__(85158) +} catch { + // @ts-ignore + http2 = { constants: {} } +} + +const { + constants: { + HTTP2_HEADER_AUTHORITY, + HTTP2_HEADER_METHOD, + HTTP2_HEADER_PATH, + HTTP2_HEADER_SCHEME, + HTTP2_HEADER_CONTENT_LENGTH, + HTTP2_HEADER_EXPECT, + HTTP2_HEADER_STATUS + } +} = http2 + +// Experimental +let h2ExperimentalWarned = false + +const FastBuffer = Buffer[Symbol.species] + +const kClosedResolve = Symbol('kClosedResolve') + +const channels = {} + +try { + const diagnosticsChannel = __nccwpck_require__(67643) + channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders') + channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect') + channels.connectError = diagnosticsChannel.channel('undici:client:connectError') + channels.connected = diagnosticsChannel.channel('undici:client:connected') +} catch { + channels.sendHeaders = { hasSubscribers: false } + channels.beforeConnect = { hasSubscribers: false } + channels.connectError = { hasSubscribers: false } + channels.connected = { hasSubscribers: false } +} + +/** + * @type {import('../types/client').default} + */ +class Client extends DispatcherBase { + /** + * + * @param {string|URL} url + * @param {import('../types/client').Client.Options} options + */ + constructor (url, { + interceptors, + maxHeaderSize, + headersTimeout, + socketTimeout, + requestTimeout, + connectTimeout, + bodyTimeout, + idleTimeout, + keepAlive, + keepAliveTimeout, + maxKeepAliveTimeout, + keepAliveMaxTimeout, + keepAliveTimeoutThreshold, + socketPath, + pipelining, + tls, + strictContentLength, + maxCachedSessions, + maxRedirections, + connect, + maxRequestsPerClient, + localAddress, + maxResponseSize, + autoSelectFamily, + autoSelectFamilyAttemptTimeout, + // h2 + allowH2, + maxConcurrentStreams + } = {}) { + super() + + if (keepAlive !== undefined) { + throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead') + } + + if (socketTimeout !== undefined) { + throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead') + } + + if (requestTimeout !== undefined) { + throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead') + } + + if (idleTimeout !== undefined) { + throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead') + } + + if (maxKeepAliveTimeout !== undefined) { + throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead') + } + + if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) { + throw new InvalidArgumentError('invalid maxHeaderSize') + } + + if (socketPath != null && typeof socketPath !== 'string') { + throw new InvalidArgumentError('invalid socketPath') + } + + if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) { + throw new InvalidArgumentError('invalid connectTimeout') + } + + if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) { + throw new InvalidArgumentError('invalid keepAliveTimeout') + } + + if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) { + throw new InvalidArgumentError('invalid keepAliveMaxTimeout') + } + + if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) { + throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold') + } + + if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) { + throw new InvalidArgumentError('headersTimeout must be a positive integer or zero') + } + + if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) { + throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero') + } + + if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { + throw new InvalidArgumentError('connect must be a function or an object') + } + + if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { + throw new InvalidArgumentError('maxRedirections must be a positive number') + } + + if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) { + throw new InvalidArgumentError('maxRequestsPerClient must be a positive number') + } + + if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) { + throw new InvalidArgumentError('localAddress must be valid string IP address') + } + + if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) { + throw new InvalidArgumentError('maxResponseSize must be a positive number') + } + + if ( + autoSelectFamilyAttemptTimeout != null && + (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1) + ) { + throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number') + } + + // h2 + if (allowH2 != null && typeof allowH2 !== 'boolean') { + throw new InvalidArgumentError('allowH2 must be a valid boolean value') + } + + if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) { + throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0') + } + + if (typeof connect !== 'function') { + connect = buildConnector({ + ...tls, + maxCachedSessions, + allowH2, + socketPath, + timeout: connectTimeout, + ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined), + ...connect + }) + } + + this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client) + ? interceptors.Client + : [createRedirectInterceptor({ maxRedirections })] + this[kUrl] = util.parseOrigin(url) + this[kConnector] = connect + this[kSocket] = null + this[kPipelining] = pipelining != null ? pipelining : 1 + this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize + this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout + this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout + this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold + this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout] + this[kServerName] = null + this[kLocalAddress] = localAddress != null ? localAddress : null + this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming + this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming + this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n` + this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3 + this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3 + this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength + this[kMaxRedirections] = maxRedirections + this[kMaxRequests] = maxRequestsPerClient + this[kClosedResolve] = null + this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1 + this[kHTTPConnVersion] = 'h1' + + // HTTP/2 + this[kHTTP2Session] = null + this[kHTTP2SessionState] = !allowH2 + ? null + : { + // streams: null, // Fixed queue of streams - For future support of `push` + openStreams: 0, // Keep track of them to decide wether or not unref the session + maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server + } + this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}` + + // kQueue is built up of 3 sections separated by + // the kRunningIdx and kPendingIdx indices. + // | complete | running | pending | + // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length + // kRunningIdx points to the first running element. + // kPendingIdx points to the first pending element. + // This implements a fast queue with an amortized + // time of O(1). + + this[kQueue] = [] + this[kRunningIdx] = 0 + this[kPendingIdx] = 0 + } + + get pipelining () { + return this[kPipelining] + } + + set pipelining (value) { + this[kPipelining] = value + resume(this, true) + } + + get [kPending] () { + return this[kQueue].length - this[kPendingIdx] + } + + get [kRunning] () { + return this[kPendingIdx] - this[kRunningIdx] + } + + get [kSize] () { + return this[kQueue].length - this[kRunningIdx] + } + + get [kConnected] () { + return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed + } + + get [kBusy] () { + const socket = this[kSocket] + return ( + (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) || + (this[kSize] >= (this[kPipelining] || 1)) || + this[kPending] > 0 + ) + } + + /* istanbul ignore: only used for test */ + [kConnect] (cb) { + connect(this) + this.once('connect', cb) + } + + [kDispatch] (opts, handler) { + const origin = opts.origin || this[kUrl].origin + + const request = this[kHTTPConnVersion] === 'h2' + ? Request[kHTTP2BuildRequest](origin, opts, handler) + : Request[kHTTP1BuildRequest](origin, opts, handler) + + this[kQueue].push(request) + if (this[kResuming]) { + // Do nothing. + } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) { + // Wait a tick in case stream/iterator is ended in the same tick. + this[kResuming] = 1 + process.nextTick(resume, this) + } else { + resume(this, true) + } + + if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) { + this[kNeedDrain] = 2 + } + + return this[kNeedDrain] < 2 + } + + async [kClose] () { + // TODO: for H2 we need to gracefully flush the remaining enqueued + // request and close each stream. + return new Promise((resolve) => { + if (!this[kSize]) { + resolve(null) + } else { + this[kClosedResolve] = resolve + } + }) + } + + async [kDestroy] (err) { + return new Promise((resolve) => { + const requests = this[kQueue].splice(this[kPendingIdx]) + for (let i = 0; i < requests.length; i++) { + const request = requests[i] + errorRequest(this, request, err) + } + + const callback = () => { + if (this[kClosedResolve]) { + // TODO (fix): Should we error here with ClientDestroyedError? + this[kClosedResolve]() + this[kClosedResolve] = null + } + resolve() + } + + if (this[kHTTP2Session] != null) { + util.destroy(this[kHTTP2Session], err) + this[kHTTP2Session] = null + this[kHTTP2SessionState] = null + } + + if (!this[kSocket]) { + queueMicrotask(callback) + } else { + util.destroy(this[kSocket].on('close', callback), err) + } + + resume(this) + }) + } +} + +function onHttp2SessionError (err) { + assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID') + + this[kSocket][kError] = err + + onError(this[kClient], err) +} + +function onHttp2FrameError (type, code, id) { + const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`) + + if (id === 0) { + this[kSocket][kError] = err + onError(this[kClient], err) + } +} + +function onHttp2SessionEnd () { + util.destroy(this, new SocketError('other side closed')) + util.destroy(this[kSocket], new SocketError('other side closed')) +} + +function onHTTP2GoAway (code) { + const client = this[kClient] + const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`) + client[kSocket] = null + client[kHTTP2Session] = null + + if (client.destroyed) { + assert(this[kPending] === 0) + + // Fail entire queue. + const requests = client[kQueue].splice(client[kRunningIdx]) + for (let i = 0; i < requests.length; i++) { + const request = requests[i] + errorRequest(this, request, err) + } + } else if (client[kRunning] > 0) { + // Fail head of pipeline. + const request = client[kQueue][client[kRunningIdx]] + client[kQueue][client[kRunningIdx]++] = null + + errorRequest(client, request, err) + } + + client[kPendingIdx] = client[kRunningIdx] + + assert(client[kRunning] === 0) + + client.emit('disconnect', + client[kUrl], + [client], + err + ) + + resume(client) +} + +const constants = __nccwpck_require__(30953) +const createRedirectInterceptor = __nccwpck_require__(38861) +const EMPTY_BUF = Buffer.alloc(0) + +async function lazyllhttp () { + const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(61145) : undefined + + let mod + try { + mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(95627), 'base64')) + } catch (e) { + /* istanbul ignore next */ + + // We could check if the error was caused by the simd option not + // being enabled, but the occurring of this other error + // * https://github.com/emscripten-core/emscripten/issues/11495 + // got me to remove that check to avoid breaking Node 12. + mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(61145), 'base64')) + } + + return await WebAssembly.instantiate(mod, { + env: { + /* eslint-disable camelcase */ + + wasm_on_url: (p, at, len) => { + /* istanbul ignore next */ + return 0 + }, + wasm_on_status: (p, at, len) => { + assert.strictEqual(currentParser.ptr, p) + const start = at - currentBufferPtr + currentBufferRef.byteOffset + return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 + }, + wasm_on_message_begin: (p) => { + assert.strictEqual(currentParser.ptr, p) + return currentParser.onMessageBegin() || 0 + }, + wasm_on_header_field: (p, at, len) => { + assert.strictEqual(currentParser.ptr, p) + const start = at - currentBufferPtr + currentBufferRef.byteOffset + return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 + }, + wasm_on_header_value: (p, at, len) => { + assert.strictEqual(currentParser.ptr, p) + const start = at - currentBufferPtr + currentBufferRef.byteOffset + return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 + }, + wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => { + assert.strictEqual(currentParser.ptr, p) + return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0 + }, + wasm_on_body: (p, at, len) => { + assert.strictEqual(currentParser.ptr, p) + const start = at - currentBufferPtr + currentBufferRef.byteOffset + return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 + }, + wasm_on_message_complete: (p) => { + assert.strictEqual(currentParser.ptr, p) + return currentParser.onMessageComplete() || 0 + } + + /* eslint-enable camelcase */ + } + }) +} + +let llhttpInstance = null +let llhttpPromise = lazyllhttp() +llhttpPromise.catch() + +let currentParser = null +let currentBufferRef = null +let currentBufferSize = 0 +let currentBufferPtr = null + +const TIMEOUT_HEADERS = 1 +const TIMEOUT_BODY = 2 +const TIMEOUT_IDLE = 3 + +class Parser { + constructor (client, socket, { exports }) { + assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0) + + this.llhttp = exports + this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE) + this.client = client + this.socket = socket + this.timeout = null + this.timeoutValue = null + this.timeoutType = null + this.statusCode = null + this.statusText = '' + this.upgrade = false + this.headers = [] + this.headersSize = 0 + this.headersMaxSize = client[kMaxHeadersSize] + this.shouldKeepAlive = false + this.paused = false + this.resume = this.resume.bind(this) + + this.bytesRead = 0 + + this.keepAlive = '' + this.contentLength = '' + this.connection = '' + this.maxResponseSize = client[kMaxResponseSize] + } + + setTimeout (value, type) { + this.timeoutType = type + if (value !== this.timeoutValue) { + timers.clearTimeout(this.timeout) + if (value) { + this.timeout = timers.setTimeout(onParserTimeout, value, this) + // istanbul ignore else: only for jest + if (this.timeout.unref) { + this.timeout.unref() + } + } else { + this.timeout = null + } + this.timeoutValue = value + } else if (this.timeout) { + // istanbul ignore else: only for jest + if (this.timeout.refresh) { + this.timeout.refresh() + } + } + } + + resume () { + if (this.socket.destroyed || !this.paused) { + return + } + + assert(this.ptr != null) + assert(currentParser == null) + + this.llhttp.llhttp_resume(this.ptr) + + assert(this.timeoutType === TIMEOUT_BODY) + if (this.timeout) { + // istanbul ignore else: only for jest + if (this.timeout.refresh) { + this.timeout.refresh() + } + } + + this.paused = false + this.execute(this.socket.read() || EMPTY_BUF) // Flush parser. + this.readMore() + } + + readMore () { + while (!this.paused && this.ptr) { + const chunk = this.socket.read() + if (chunk === null) { + break + } + this.execute(chunk) + } + } + + execute (data) { + assert(this.ptr != null) + assert(currentParser == null) + assert(!this.paused) + + const { socket, llhttp } = this + + if (data.length > currentBufferSize) { + if (currentBufferPtr) { + llhttp.free(currentBufferPtr) + } + currentBufferSize = Math.ceil(data.length / 4096) * 4096 + currentBufferPtr = llhttp.malloc(currentBufferSize) + } + + new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data) + + // Call `execute` on the wasm parser. + // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data, + // and finally the length of bytes to parse. + // The return value is an error code or `constants.ERROR.OK`. + try { + let ret + + try { + currentBufferRef = data + currentParser = this + ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length) + /* eslint-disable-next-line no-useless-catch */ + } catch (err) { + /* istanbul ignore next: difficult to make a test case for */ + throw err + } finally { + currentParser = null + currentBufferRef = null + } + + const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr + + if (ret === constants.ERROR.PAUSED_UPGRADE) { + this.onUpgrade(data.slice(offset)) + } else if (ret === constants.ERROR.PAUSED) { + this.paused = true + socket.unshift(data.slice(offset)) + } else if (ret !== constants.ERROR.OK) { + const ptr = llhttp.llhttp_get_error_reason(this.ptr) + let message = '' + /* istanbul ignore else: difficult to make a test case for */ + if (ptr) { + const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0) + message = + 'Response does not match the HTTP/1.1 protocol (' + + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + + ')' + } + throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset)) + } + } catch (err) { + util.destroy(socket, err) + } + } + + destroy () { + assert(this.ptr != null) + assert(currentParser == null) + + this.llhttp.llhttp_free(this.ptr) + this.ptr = null + + timers.clearTimeout(this.timeout) + this.timeout = null + this.timeoutValue = null + this.timeoutType = null + + this.paused = false + } + + onStatus (buf) { + this.statusText = buf.toString() + } + + onMessageBegin () { + const { socket, client } = this + + /* istanbul ignore next: difficult to make a test case for */ + if (socket.destroyed) { + return -1 + } + + const request = client[kQueue][client[kRunningIdx]] + if (!request) { + return -1 + } + } + + onHeaderField (buf) { + const len = this.headers.length + + if ((len & 1) === 0) { + this.headers.push(buf) + } else { + this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]) + } + + this.trackHeader(buf.length) + } + + onHeaderValue (buf) { + let len = this.headers.length + + if ((len & 1) === 1) { + this.headers.push(buf) + len += 1 + } else { + this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]) + } + + const key = this.headers[len - 2] + if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') { + this.keepAlive += buf.toString() + } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') { + this.connection += buf.toString() + } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') { + this.contentLength += buf.toString() + } + + this.trackHeader(buf.length) + } + + trackHeader (len) { + this.headersSize += len + if (this.headersSize >= this.headersMaxSize) { + util.destroy(this.socket, new HeadersOverflowError()) + } + } + + onUpgrade (head) { + const { upgrade, client, socket, headers, statusCode } = this + + assert(upgrade) + + const request = client[kQueue][client[kRunningIdx]] + assert(request) + + assert(!socket.destroyed) + assert(socket === client[kSocket]) + assert(!this.paused) + assert(request.upgrade || request.method === 'CONNECT') + + this.statusCode = null + this.statusText = '' + this.shouldKeepAlive = null + + assert(this.headers.length % 2 === 0) + this.headers = [] + this.headersSize = 0 + + socket.unshift(head) + + socket[kParser].destroy() + socket[kParser] = null + + socket[kClient] = null + socket[kError] = null + socket + .removeListener('error', onSocketError) + .removeListener('readable', onSocketReadable) + .removeListener('end', onSocketEnd) + .removeListener('close', onSocketClose) + + client[kSocket] = null + client[kQueue][client[kRunningIdx]++] = null + client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade')) + + try { + request.onUpgrade(statusCode, headers, socket) + } catch (err) { + util.destroy(socket, err) + } + + resume(client) + } + + onHeadersComplete (statusCode, upgrade, shouldKeepAlive) { + const { client, socket, headers, statusText } = this + + /* istanbul ignore next: difficult to make a test case for */ + if (socket.destroyed) { + return -1 + } + + const request = client[kQueue][client[kRunningIdx]] + + /* istanbul ignore next: difficult to make a test case for */ + if (!request) { + return -1 + } + + assert(!this.upgrade) + assert(this.statusCode < 200) + + if (statusCode === 100) { + util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket))) + return -1 + } + + /* this can only happen if server is misbehaving */ + if (upgrade && !request.upgrade) { + util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket))) + return -1 + } + + assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS) + + this.statusCode = statusCode + this.shouldKeepAlive = ( + shouldKeepAlive || + // Override llhttp value which does not allow keepAlive for HEAD. + (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive') + ) + + if (this.statusCode >= 200) { + const bodyTimeout = request.bodyTimeout != null + ? request.bodyTimeout + : client[kBodyTimeout] + this.setTimeout(bodyTimeout, TIMEOUT_BODY) + } else if (this.timeout) { + // istanbul ignore else: only for jest + if (this.timeout.refresh) { + this.timeout.refresh() + } + } + + if (request.method === 'CONNECT') { + assert(client[kRunning] === 1) + this.upgrade = true + return 2 + } + + if (upgrade) { + assert(client[kRunning] === 1) + this.upgrade = true + return 2 + } + + assert(this.headers.length % 2 === 0) + this.headers = [] + this.headersSize = 0 + + if (this.shouldKeepAlive && client[kPipelining]) { + const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null + + if (keepAliveTimeout != null) { + const timeout = Math.min( + keepAliveTimeout - client[kKeepAliveTimeoutThreshold], + client[kKeepAliveMaxTimeout] + ) + if (timeout <= 0) { + socket[kReset] = true + } else { + client[kKeepAliveTimeoutValue] = timeout + } + } else { + client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout] + } + } else { + // Stop more requests from being dispatched. + socket[kReset] = true + } + + let pause + try { + pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false + } catch (err) { + util.destroy(socket, err) + return -1 + } + + if (request.method === 'HEAD') { + return 1 + } + + if (statusCode < 200) { + return 1 + } + + if (socket[kBlocking]) { + socket[kBlocking] = false + resume(client) + } + + return pause ? constants.ERROR.PAUSED : 0 + } + + onBody (buf) { + const { client, socket, statusCode, maxResponseSize } = this + + if (socket.destroyed) { + return -1 + } + + const request = client[kQueue][client[kRunningIdx]] + assert(request) + + assert.strictEqual(this.timeoutType, TIMEOUT_BODY) + if (this.timeout) { + // istanbul ignore else: only for jest + if (this.timeout.refresh) { + this.timeout.refresh() + } + } + + assert(statusCode >= 200) + + if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { + util.destroy(socket, new ResponseExceededMaxSizeError()) + return -1 + } + + this.bytesRead += buf.length + + try { + if (request.onData(buf) === false) { + return constants.ERROR.PAUSED + } + } catch (err) { + util.destroy(socket, err) + return -1 + } + } + + onMessageComplete () { + const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this + + if (socket.destroyed && (!statusCode || shouldKeepAlive)) { + return -1 + } + + if (upgrade) { + return + } + + const request = client[kQueue][client[kRunningIdx]] + assert(request) + + assert(statusCode >= 100) + + this.statusCode = null + this.statusText = '' + this.bytesRead = 0 + this.contentLength = '' + this.keepAlive = '' + this.connection = '' + + assert(this.headers.length % 2 === 0) + this.headers = [] + this.headersSize = 0 + + if (statusCode < 200) { + return + } + + /* istanbul ignore next: should be handled by llhttp? */ + if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) { + util.destroy(socket, new ResponseContentLengthMismatchError()) + return -1 + } + + try { + request.onComplete(headers) + } catch (err) { + errorRequest(client, request, err) + } + + client[kQueue][client[kRunningIdx]++] = null + + if (socket[kWriting]) { + assert.strictEqual(client[kRunning], 0) + // Response completed before request. + util.destroy(socket, new InformationalError('reset')) + return constants.ERROR.PAUSED + } else if (!shouldKeepAlive) { + util.destroy(socket, new InformationalError('reset')) + return constants.ERROR.PAUSED + } else if (socket[kReset] && client[kRunning] === 0) { + // Destroy socket once all requests have completed. + // The request at the tail of the pipeline is the one + // that requested reset and no further requests should + // have been queued since then. + util.destroy(socket, new InformationalError('reset')) + return constants.ERROR.PAUSED + } else if (client[kPipelining] === 1) { + // We must wait a full event loop cycle to reuse this socket to make sure + // that non-spec compliant servers are not closing the connection even if they + // said they won't. + setImmediate(resume, client) + } else { + resume(client) + } + } +} + +function onParserTimeout (parser) { + const { socket, timeoutType, client } = parser + + /* istanbul ignore else */ + if (timeoutType === TIMEOUT_HEADERS) { + if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { + assert(!parser.paused, 'cannot be paused while waiting for headers') + util.destroy(socket, new HeadersTimeoutError()) + } + } else if (timeoutType === TIMEOUT_BODY) { + if (!parser.paused) { + util.destroy(socket, new BodyTimeoutError()) + } + } else if (timeoutType === TIMEOUT_IDLE) { + assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]) + util.destroy(socket, new InformationalError('socket idle timeout')) + } +} + +function onSocketReadable () { + const { [kParser]: parser } = this + if (parser) { + parser.readMore() + } +} + +function onSocketError (err) { + const { [kClient]: client, [kParser]: parser } = this + + assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID') + + if (client[kHTTPConnVersion] !== 'h2') { + // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded + // to the user. + if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) { + // We treat all incoming data so for as a valid response. + parser.onMessageComplete() + return + } + } + + this[kError] = err + + onError(this[kClient], err) +} + +function onError (client, err) { + if ( + client[kRunning] === 0 && + err.code !== 'UND_ERR_INFO' && + err.code !== 'UND_ERR_SOCKET' + ) { + // Error is not caused by running request and not a recoverable + // socket error. + + assert(client[kPendingIdx] === client[kRunningIdx]) + + const requests = client[kQueue].splice(client[kRunningIdx]) + for (let i = 0; i < requests.length; i++) { + const request = requests[i] + errorRequest(client, request, err) + } + assert(client[kSize] === 0) + } +} + +function onSocketEnd () { + const { [kParser]: parser, [kClient]: client } = this + + if (client[kHTTPConnVersion] !== 'h2') { + if (parser.statusCode && !parser.shouldKeepAlive) { + // We treat all incoming data so far as a valid response. + parser.onMessageComplete() + return + } + } + + util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this))) +} + +function onSocketClose () { + const { [kClient]: client, [kParser]: parser } = this + + if (client[kHTTPConnVersion] === 'h1' && parser) { + if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { + // We treat all incoming data so far as a valid response. + parser.onMessageComplete() + } + + this[kParser].destroy() + this[kParser] = null + } + + const err = this[kError] || new SocketError('closed', util.getSocketInfo(this)) + + client[kSocket] = null + + if (client.destroyed) { + assert(client[kPending] === 0) + + // Fail entire queue. + const requests = client[kQueue].splice(client[kRunningIdx]) + for (let i = 0; i < requests.length; i++) { + const request = requests[i] + errorRequest(client, request, err) + } + } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') { + // Fail head of pipeline. + const request = client[kQueue][client[kRunningIdx]] + client[kQueue][client[kRunningIdx]++] = null + + errorRequest(client, request, err) + } + + client[kPendingIdx] = client[kRunningIdx] + + assert(client[kRunning] === 0) + + client.emit('disconnect', client[kUrl], [client], err) + + resume(client) +} + +async function connect (client) { + assert(!client[kConnecting]) + assert(!client[kSocket]) + + let { host, hostname, protocol, port } = client[kUrl] + + // Resolve ipv6 + if (hostname[0] === '[') { + const idx = hostname.indexOf(']') + + assert(idx !== -1) + const ip = hostname.substr(1, idx - 1) + + assert(net.isIP(ip)) + hostname = ip + } + + client[kConnecting] = true + + if (channels.beforeConnect.hasSubscribers) { + channels.beforeConnect.publish({ + connectParams: { + host, + hostname, + protocol, + port, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector] + }) + } + + try { + const socket = await new Promise((resolve, reject) => { + client[kConnector]({ + host, + hostname, + protocol, + port, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, (err, socket) => { + if (err) { + reject(err) + } else { + resolve(socket) + } + }) + }) + + if (client.destroyed) { + util.destroy(socket.on('error', () => {}), new ClientDestroyedError()) + return + } + + client[kConnecting] = false + + assert(socket) + + const isH2 = socket.alpnProtocol === 'h2' + if (isH2) { + if (!h2ExperimentalWarned) { + h2ExperimentalWarned = true + process.emitWarning('H2 support is experimental, expect them to change at any time.', { + code: 'UNDICI-H2' + }) + } + + const session = http2.connect(client[kUrl], { + createConnection: () => socket, + peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams + }) + + client[kHTTPConnVersion] = 'h2' + session[kClient] = client + session[kSocket] = socket + session.on('error', onHttp2SessionError) + session.on('frameError', onHttp2FrameError) + session.on('end', onHttp2SessionEnd) + session.on('goaway', onHTTP2GoAway) + session.on('close', onSocketClose) + session.unref() + + client[kHTTP2Session] = session + socket[kHTTP2Session] = session + } else { + if (!llhttpInstance) { + llhttpInstance = await llhttpPromise + llhttpPromise = null + } + + socket[kNoRef] = false + socket[kWriting] = false + socket[kReset] = false + socket[kBlocking] = false + socket[kParser] = new Parser(client, socket, llhttpInstance) + } + + socket[kCounter] = 0 + socket[kMaxRequests] = client[kMaxRequests] + socket[kClient] = client + socket[kError] = null + + socket + .on('error', onSocketError) + .on('readable', onSocketReadable) + .on('end', onSocketEnd) + .on('close', onSocketClose) + + client[kSocket] = socket + + if (channels.connected.hasSubscribers) { + channels.connected.publish({ + connectParams: { + host, + hostname, + protocol, + port, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector], + socket + }) + } + client.emit('connect', client[kUrl], [client]) + } catch (err) { + if (client.destroyed) { + return + } + + client[kConnecting] = false + + if (channels.connectError.hasSubscribers) { + channels.connectError.publish({ + connectParams: { + host, + hostname, + protocol, + port, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector], + error: err + }) + } + + if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') { + assert(client[kRunning] === 0) + while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { + const request = client[kQueue][client[kPendingIdx]++] + errorRequest(client, request, err) + } + } else { + onError(client, err) + } + + client.emit('connectionError', client[kUrl], [client], err) + } + + resume(client) +} + +function emitDrain (client) { + client[kNeedDrain] = 0 + client.emit('drain', client[kUrl], [client]) +} + +function resume (client, sync) { + if (client[kResuming] === 2) { + return + } + + client[kResuming] = 2 + + _resume(client, sync) + client[kResuming] = 0 + + if (client[kRunningIdx] > 256) { + client[kQueue].splice(0, client[kRunningIdx]) + client[kPendingIdx] -= client[kRunningIdx] + client[kRunningIdx] = 0 + } +} + +function _resume (client, sync) { + while (true) { + if (client.destroyed) { + assert(client[kPending] === 0) + return + } + + if (client[kClosedResolve] && !client[kSize]) { + client[kClosedResolve]() + client[kClosedResolve] = null + return + } + + const socket = client[kSocket] + + if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') { + if (client[kSize] === 0) { + if (!socket[kNoRef] && socket.unref) { + socket.unref() + socket[kNoRef] = true + } + } else if (socket[kNoRef] && socket.ref) { + socket.ref() + socket[kNoRef] = false + } + + if (client[kSize] === 0) { + if (socket[kParser].timeoutType !== TIMEOUT_IDLE) { + socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE) + } + } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) { + if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) { + const request = client[kQueue][client[kRunningIdx]] + const headersTimeout = request.headersTimeout != null + ? request.headersTimeout + : client[kHeadersTimeout] + socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS) + } + } + } + + if (client[kBusy]) { + client[kNeedDrain] = 2 + } else if (client[kNeedDrain] === 2) { + if (sync) { + client[kNeedDrain] = 1 + process.nextTick(emitDrain, client) + } else { + emitDrain(client) + } + continue + } + + if (client[kPending] === 0) { + return + } + + if (client[kRunning] >= (client[kPipelining] || 1)) { + return + } + + const request = client[kQueue][client[kPendingIdx]] + + if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) { + if (client[kRunning] > 0) { + return + } + + client[kServerName] = request.servername + + if (socket && socket.servername !== request.servername) { + util.destroy(socket, new InformationalError('servername changed')) + return + } + } + + if (client[kConnecting]) { + return + } + + if (!socket && !client[kHTTP2Session]) { + connect(client) + return + } + + if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) { + return + } + + if (client[kRunning] > 0 && !request.idempotent) { + // Non-idempotent request cannot be retried. + // Ensure that no other requests are inflight and + // could cause failure. + return + } + + if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) { + // Don't dispatch an upgrade until all preceding requests have completed. + // A misbehaving server might upgrade the connection before all pipelined + // request has completed. + return + } + + if (util.isStream(request.body) && util.bodyLength(request.body) === 0) { + request.body + .on('data', /* istanbul ignore next */ function () { + /* istanbul ignore next */ + assert(false) + }) + .on('error', function (err) { + errorRequest(client, request, err) + }) + .on('end', function () { + util.destroy(this) + }) + + request.body = null + } + + if (client[kRunning] > 0 && + (util.isStream(request.body) || util.isAsyncIterable(request.body))) { + // Request with stream or iterator body can error while other requests + // are inflight and indirectly error those as well. + // Ensure this doesn't happen by waiting for inflight + // to complete before dispatching. + + // Request with stream or iterator body cannot be retried. + // Ensure that no other requests are inflight and + // could cause failure. + return + } + + if (!request.aborted && write(client, request)) { + client[kPendingIdx]++ + } else { + client[kQueue].splice(client[kPendingIdx], 1) + } + } +} + +function write (client, request) { + if (client[kHTTPConnVersion] === 'h2') { + writeH2(client, client[kHTTP2Session], request) + return + } + + const { body, method, path, host, upgrade, headers, blocking, reset } = request + + // https://tools.ietf.org/html/rfc7231#section-4.3.1 + // https://tools.ietf.org/html/rfc7231#section-4.3.2 + // https://tools.ietf.org/html/rfc7231#section-4.3.5 + + // Sending a payload body on a request that does not + // expect it can cause undefined behavior on some + // servers and corrupt connection state. Do not + // re-use the connection for further requests. + + const expectsPayload = ( + method === 'PUT' || + method === 'POST' || + method === 'PATCH' + ) + + if (body && typeof body.read === 'function') { + // Try to read EOF in order to get length. + body.read(0) + } + + let contentLength = util.bodyLength(body) + + if (contentLength === null) { + contentLength = request.contentLength + } + + if (contentLength === 0 && !expectsPayload) { + // https://tools.ietf.org/html/rfc7230#section-3.3.2 + // A user agent SHOULD NOT send a Content-Length header field when + // the request message does not contain a payload body and the method + // semantics do not anticipate such a body. + + contentLength = null + } + + if (request.contentLength !== null && request.contentLength !== contentLength) { + if (client[kStrictContentLength]) { + errorRequest(client, request, new RequestContentLengthMismatchError()) + return false + } + + process.emitWarning(new RequestContentLengthMismatchError()) + } + + const socket = client[kSocket] + + try { + request.onConnect((err) => { + if (request.aborted || request.completed) { + return + } + + errorRequest(client, request, err || new RequestAbortedError()) + + util.destroy(socket, new InformationalError('aborted')) + }) + } catch (err) { + errorRequest(client, request, err) + } + + if (request.aborted) { + return false + } + + if (method === 'HEAD') { + // https://github.com/mcollina/undici/issues/258 + // Close after a HEAD request to interop with misbehaving servers + // that may send a body in the response. + + socket[kReset] = true + } + + if (upgrade || method === 'CONNECT') { + // On CONNECT or upgrade, block pipeline from dispatching further + // requests on this connection. + + socket[kReset] = true + } + + if (reset != null) { + socket[kReset] = reset + } + + if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) { + socket[kReset] = true + } + + if (blocking) { + socket[kBlocking] = true + } + + let header = `${method} ${path} HTTP/1.1\r\n` + + if (typeof host === 'string') { + header += `host: ${host}\r\n` + } else { + header += client[kHostHeader] + } + + if (upgrade) { + header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n` + } else if (client[kPipelining] && !socket[kReset]) { + header += 'connection: keep-alive\r\n' + } else { + header += 'connection: close\r\n' + } + + if (headers) { + header += headers + } + + if (channels.sendHeaders.hasSubscribers) { + channels.sendHeaders.publish({ request, headers: header, socket }) + } + + /* istanbul ignore else: assertion */ + if (!body) { + if (contentLength === 0) { + socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1') + } else { + assert(contentLength === null, 'no body must not have content length') + socket.write(`${header}\r\n`, 'latin1') + } + request.onRequestSent() + } else if (util.isBuffer(body)) { + assert(contentLength === body.byteLength, 'buffer body must have content length') + + socket.cork() + socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') + socket.write(body) + socket.uncork() + request.onBodySent(body) + request.onRequestSent() + if (!expectsPayload) { + socket[kReset] = true + } + } else if (util.isBlobLike(body)) { + if (typeof body.stream === 'function') { + writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload }) + } else { + writeBlob({ body, client, request, socket, contentLength, header, expectsPayload }) + } + } else if (util.isStream(body)) { + writeStream({ body, client, request, socket, contentLength, header, expectsPayload }) + } else if (util.isIterable(body)) { + writeIterable({ body, client, request, socket, contentLength, header, expectsPayload }) + } else { + assert(false) + } + + return true +} + +function writeH2 (client, session, request) { + const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request + + let headers + if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim()) + else headers = reqHeaders + + if (upgrade) { + errorRequest(client, request, new Error('Upgrade not supported for H2')) + return false + } + + try { + // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event? + request.onConnect((err) => { + if (request.aborted || request.completed) { + return + } + + errorRequest(client, request, err || new RequestAbortedError()) + }) + } catch (err) { + errorRequest(client, request, err) + } + + if (request.aborted) { + return false + } + + let stream + const h2State = client[kHTTP2SessionState] + + headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost] + headers[HTTP2_HEADER_METHOD] = method + + if (method === 'CONNECT') { + session.ref() + // we are already connected, streams are pending, first request + // will create a new stream. We trigger a request to create the stream and wait until + // `ready` event is triggered + // We disabled endStream to allow the user to write to the stream + stream = session.request(headers, { endStream: false, signal }) + + if (stream.id && !stream.pending) { + request.onUpgrade(null, null, stream) + ++h2State.openStreams + } else { + stream.once('ready', () => { + request.onUpgrade(null, null, stream) + ++h2State.openStreams + }) + } + + stream.once('close', () => { + h2State.openStreams -= 1 + // TODO(HTTP/2): unref only if current streams count is 0 + if (h2State.openStreams === 0) session.unref() + }) + + return true + } + + // https://tools.ietf.org/html/rfc7540#section-8.3 + // :path and :scheme headers must be omited when sending CONNECT + + headers[HTTP2_HEADER_PATH] = path + headers[HTTP2_HEADER_SCHEME] = 'https' + + // https://tools.ietf.org/html/rfc7231#section-4.3.1 + // https://tools.ietf.org/html/rfc7231#section-4.3.2 + // https://tools.ietf.org/html/rfc7231#section-4.3.5 + + // Sending a payload body on a request that does not + // expect it can cause undefined behavior on some + // servers and corrupt connection state. Do not + // re-use the connection for further requests. + + const expectsPayload = ( + method === 'PUT' || + method === 'POST' || + method === 'PATCH' + ) + + if (body && typeof body.read === 'function') { + // Try to read EOF in order to get length. + body.read(0) + } + + let contentLength = util.bodyLength(body) + + if (contentLength == null) { + contentLength = request.contentLength + } + + if (contentLength === 0 || !expectsPayload) { + // https://tools.ietf.org/html/rfc7230#section-3.3.2 + // A user agent SHOULD NOT send a Content-Length header field when + // the request message does not contain a payload body and the method + // semantics do not anticipate such a body. + + contentLength = null + } + + if (request.contentLength != null && request.contentLength !== contentLength) { + if (client[kStrictContentLength]) { + errorRequest(client, request, new RequestContentLengthMismatchError()) + return false + } + + process.emitWarning(new RequestContentLengthMismatchError()) + } + + if (contentLength != null) { + assert(body, 'no body must not have content length') + headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}` + } + + session.ref() + + const shouldEndStream = method === 'GET' || method === 'HEAD' + if (expectContinue) { + headers[HTTP2_HEADER_EXPECT] = '100-continue' + /** + * @type {import('node:http2').ClientHttp2Stream} + */ + stream = session.request(headers, { endStream: shouldEndStream, signal }) + + stream.once('continue', writeBodyH2) + } else { + /** @type {import('node:http2').ClientHttp2Stream} */ + stream = session.request(headers, { + endStream: shouldEndStream, + signal + }) + writeBodyH2() + } + + // Increment counter as we have new several streams open + ++h2State.openStreams + + stream.once('response', headers => { + if (request.onHeaders(Number(headers[HTTP2_HEADER_STATUS]), headers, stream.resume.bind(stream), '') === false) { + stream.pause() + } + }) + + stream.once('end', () => { + request.onComplete([]) + }) + + stream.on('data', (chunk) => { + if (request.onData(chunk) === false) stream.pause() + }) + + stream.once('close', () => { + h2State.openStreams -= 1 + // TODO(HTTP/2): unref only if current streams count is 0 + if (h2State.openStreams === 0) session.unref() + }) + + stream.once('error', function (err) { + if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { + h2State.streams -= 1 + util.destroy(stream, err) + } + }) + + stream.once('frameError', (type, code) => { + const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`) + errorRequest(client, request, err) + + if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { + h2State.streams -= 1 + util.destroy(stream, err) + } + }) + + // stream.on('aborted', () => { + // // TODO(HTTP/2): Support aborted + // }) + + // stream.on('timeout', () => { + // // TODO(HTTP/2): Support timeout + // }) + + // stream.on('push', headers => { + // // TODO(HTTP/2): Suppor push + // }) + + // stream.on('trailers', headers => { + // // TODO(HTTP/2): Support trailers + // }) + + return true + + function writeBodyH2 () { + /* istanbul ignore else: assertion */ + if (!body) { + request.onRequestSent() + } else if (util.isBuffer(body)) { + assert(contentLength === body.byteLength, 'buffer body must have content length') + stream.cork() + stream.write(body) + stream.uncork() + stream.end() + request.onBodySent(body) + request.onRequestSent() + } else if (util.isBlobLike(body)) { + if (typeof body.stream === 'function') { + writeIterable({ + client, + request, + contentLength, + h2stream: stream, + expectsPayload, + body: body.stream(), + socket: client[kSocket], + header: '' + }) + } else { + writeBlob({ + body, + client, + request, + contentLength, + expectsPayload, + h2stream: stream, + header: '', + socket: client[kSocket] + }) + } + } else if (util.isStream(body)) { + writeStream({ + body, + client, + request, + contentLength, + expectsPayload, + socket: client[kSocket], + h2stream: stream, + header: '' + }) + } else if (util.isIterable(body)) { + writeIterable({ + body, + client, + request, + contentLength, + expectsPayload, + header: '', + h2stream: stream, + socket: client[kSocket] + }) + } else { + assert(false) + } + } +} + +function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { + assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined') + + if (client[kHTTPConnVersion] === 'h2') { + // For HTTP/2, is enough to pipe the stream + const pipe = pipeline( + body, + h2stream, + (err) => { + if (err) { + util.destroy(body, err) + util.destroy(h2stream, err) + } else { + request.onRequestSent() + } + } + ) + + pipe.on('data', onPipeData) + pipe.once('end', () => { + pipe.removeListener('data', onPipeData) + util.destroy(pipe) + }) + + function onPipeData (chunk) { + request.onBodySent(chunk) + } + + return + } + + let finished = false + + const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header }) + + const onData = function (chunk) { + if (finished) { + return + } + + try { + if (!writer.write(chunk) && this.pause) { + this.pause() + } + } catch (err) { + util.destroy(this, err) + } + } + const onDrain = function () { + if (finished) { + return + } + + if (body.resume) { + body.resume() + } + } + const onAbort = function () { + onFinished(new RequestAbortedError()) + } + const onFinished = function (err) { + if (finished) { + return + } + + finished = true + + assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1)) + + socket + .off('drain', onDrain) + .off('error', onFinished) + + body + .removeListener('data', onData) + .removeListener('end', onFinished) + .removeListener('error', onFinished) + .removeListener('close', onAbort) + + if (!err) { + try { + writer.end() + } catch (er) { + err = er + } + } + + writer.destroy(err) + + if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) { + util.destroy(body, err) + } else { + util.destroy(body) + } + } + + body + .on('data', onData) + .on('end', onFinished) + .on('error', onFinished) + .on('close', onAbort) + + if (body.resume) { + body.resume() + } + + socket + .on('drain', onDrain) + .on('error', onFinished) +} + +async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { + assert(contentLength === body.size, 'blob body must have content length') + + const isH2 = client[kHTTPConnVersion] === 'h2' + try { + if (contentLength != null && contentLength !== body.size) { + throw new RequestContentLengthMismatchError() + } + + const buffer = Buffer.from(await body.arrayBuffer()) + + if (isH2) { + h2stream.cork() + h2stream.write(buffer) + h2stream.uncork() + } else { + socket.cork() + socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') + socket.write(buffer) + socket.uncork() + } + + request.onBodySent(buffer) + request.onRequestSent() + + if (!expectsPayload) { + socket[kReset] = true + } + + resume(client) + } catch (err) { + util.destroy(isH2 ? h2stream : socket, err) + } +} + +async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { + assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined') + + let callback = null + function onDrain () { + if (callback) { + const cb = callback + callback = null + cb() + } + } + + const waitForDrain = () => new Promise((resolve, reject) => { + assert(callback === null) + + if (socket[kError]) { + reject(socket[kError]) + } else { + callback = resolve + } + }) + + if (client[kHTTPConnVersion] === 'h2') { + h2stream + .on('close', onDrain) + .on('drain', onDrain) + + try { + // It's up to the user to somehow abort the async iterable. + for await (const chunk of body) { + if (socket[kError]) { + throw socket[kError] + } + + const res = h2stream.write(chunk) + request.onBodySent(chunk) + if (!res) { + await waitForDrain() + } + } + } catch (err) { + h2stream.destroy(err) + } finally { + request.onRequestSent() + h2stream.end() + h2stream + .off('close', onDrain) + .off('drain', onDrain) + } + + return + } + + socket + .on('close', onDrain) + .on('drain', onDrain) + + const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header }) + try { + // It's up to the user to somehow abort the async iterable. + for await (const chunk of body) { + if (socket[kError]) { + throw socket[kError] + } + + if (!writer.write(chunk)) { + await waitForDrain() + } + } + + writer.end() + } catch (err) { + writer.destroy(err) + } finally { + socket + .off('close', onDrain) + .off('drain', onDrain) + } +} + +class AsyncWriter { + constructor ({ socket, request, contentLength, client, expectsPayload, header }) { + this.socket = socket + this.request = request + this.contentLength = contentLength + this.client = client + this.bytesWritten = 0 + this.expectsPayload = expectsPayload + this.header = header + + socket[kWriting] = true + } + + write (chunk) { + const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this + + if (socket[kError]) { + throw socket[kError] + } + + if (socket.destroyed) { + return false + } + + const len = Buffer.byteLength(chunk) + if (!len) { + return true + } + + // We should defer writing chunks. + if (contentLength !== null && bytesWritten + len > contentLength) { + if (client[kStrictContentLength]) { + throw new RequestContentLengthMismatchError() + } + + process.emitWarning(new RequestContentLengthMismatchError()) + } + + socket.cork() + + if (bytesWritten === 0) { + if (!expectsPayload) { + socket[kReset] = true + } + + if (contentLength === null) { + socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1') + } else { + socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') + } + } + + if (contentLength === null) { + socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1') + } + + this.bytesWritten += len + + const ret = socket.write(chunk) + + socket.uncork() + + request.onBodySent(chunk) + + if (!ret) { + if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { + // istanbul ignore else: only for jest + if (socket[kParser].timeout.refresh) { + socket[kParser].timeout.refresh() + } + } + } + + return ret + } + + end () { + const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this + request.onRequestSent() + + socket[kWriting] = false + + if (socket[kError]) { + throw socket[kError] + } + + if (socket.destroyed) { + return + } + + if (bytesWritten === 0) { + if (expectsPayload) { + // https://tools.ietf.org/html/rfc7230#section-3.3.2 + // A user agent SHOULD send a Content-Length in a request message when + // no Transfer-Encoding is sent and the request method defines a meaning + // for an enclosed payload body. + + socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1') + } else { + socket.write(`${header}\r\n`, 'latin1') + } + } else if (contentLength === null) { + socket.write('\r\n0\r\n\r\n', 'latin1') + } + + if (contentLength !== null && bytesWritten !== contentLength) { + if (client[kStrictContentLength]) { + throw new RequestContentLengthMismatchError() + } else { + process.emitWarning(new RequestContentLengthMismatchError()) + } + } + + if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { + // istanbul ignore else: only for jest + if (socket[kParser].timeout.refresh) { + socket[kParser].timeout.refresh() + } + } + + resume(client) + } + + destroy (err) { + const { socket, client } = this + + socket[kWriting] = false + + if (err) { + assert(client[kRunning] <= 1, 'pipeline should only contain this request') + util.destroy(socket, err) + } + } +} + +function errorRequest (client, request, err) { + try { + request.onError(err) + assert(request.aborted) + } catch (err) { + client.emit('error', err) + } +} + +module.exports = Client + + +/***/ }), + +/***/ 56436: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +/* istanbul ignore file: only for Node 12 */ + +const { kConnected, kSize } = __nccwpck_require__(72785) + +class CompatWeakRef { + constructor (value) { + this.value = value + } + + deref () { + return this.value[kConnected] === 0 && this.value[kSize] === 0 + ? undefined + : this.value + } +} + +class CompatFinalizer { + constructor (finalizer) { + this.finalizer = finalizer + } + + register (dispatcher, key) { + if (dispatcher.on) { + dispatcher.on('disconnect', () => { + if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) { + this.finalizer(key) + } + }) + } + } +} + +module.exports = function () { + // FIXME: remove workaround when the Node bug is fixed + // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308 + if (process.env.NODE_V8_COVERAGE) { + return { + WeakRef: CompatWeakRef, + FinalizationRegistry: CompatFinalizer + } + } + return { + WeakRef: global.WeakRef || CompatWeakRef, + FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer + } +} + + +/***/ }), + +/***/ 20663: +/***/ ((module) => { + +"use strict"; + + +// https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size +const maxAttributeValueSize = 1024 + +// https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size +const maxNameValuePairSize = 4096 + +module.exports = { + maxAttributeValueSize, + maxNameValuePairSize +} + + +/***/ }), + +/***/ 41724: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { parseSetCookie } = __nccwpck_require__(24408) +const { stringify, getHeadersList } = __nccwpck_require__(43121) +const { webidl } = __nccwpck_require__(21744) +const { Headers } = __nccwpck_require__(10554) + +/** + * @typedef {Object} Cookie + * @property {string} name + * @property {string} value + * @property {Date|number|undefined} expires + * @property {number|undefined} maxAge + * @property {string|undefined} domain + * @property {string|undefined} path + * @property {boolean|undefined} secure + * @property {boolean|undefined} httpOnly + * @property {'Strict'|'Lax'|'None'} sameSite + * @property {string[]} unparsed + */ + +/** + * @param {Headers} headers + * @returns {Record} + */ +function getCookies (headers) { + webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' }) + + webidl.brandCheck(headers, Headers, { strict: false }) + + const cookie = headers.get('cookie') + const out = {} + + if (!cookie) { + return out + } + + for (const piece of cookie.split(';')) { + const [name, ...value] = piece.split('=') + + out[name.trim()] = value.join('=') + } + + return out +} + +/** + * @param {Headers} headers + * @param {string} name + * @param {{ path?: string, domain?: string }|undefined} attributes + * @returns {void} + */ +function deleteCookie (headers, name, attributes) { + webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' }) + + webidl.brandCheck(headers, Headers, { strict: false }) + + name = webidl.converters.DOMString(name) + attributes = webidl.converters.DeleteCookieAttributes(attributes) + + // Matches behavior of + // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278 + setCookie(headers, { + name, + value: '', + expires: new Date(0), + ...attributes + }) +} + +/** + * @param {Headers} headers + * @returns {Cookie[]} + */ +function getSetCookies (headers) { + webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' }) + + webidl.brandCheck(headers, Headers, { strict: false }) + + const cookies = getHeadersList(headers).cookies + + if (!cookies) { + return [] + } + + // In older versions of undici, cookies is a list of name:value. + return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair)) +} + +/** + * @param {Headers} headers + * @param {Cookie} cookie + * @returns {void} + */ +function setCookie (headers, cookie) { + webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' }) + + webidl.brandCheck(headers, Headers, { strict: false }) + + cookie = webidl.converters.Cookie(cookie) + + const str = stringify(cookie) + + if (str) { + headers.append('Set-Cookie', stringify(cookie)) + } +} + +webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([ + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: 'path', + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: 'domain', + defaultValue: null + } +]) + +webidl.converters.Cookie = webidl.dictionaryConverter([ + { + converter: webidl.converters.DOMString, + key: 'name' + }, + { + converter: webidl.converters.DOMString, + key: 'value' + }, + { + converter: webidl.nullableConverter((value) => { + if (typeof value === 'number') { + return webidl.converters['unsigned long long'](value) + } + + return new Date(value) + }), + key: 'expires', + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters['long long']), + key: 'maxAge', + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: 'domain', + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: 'path', + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.boolean), + key: 'secure', + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.boolean), + key: 'httpOnly', + defaultValue: null + }, + { + converter: webidl.converters.USVString, + key: 'sameSite', + allowedValues: ['Strict', 'Lax', 'None'] + }, + { + converter: webidl.sequenceConverter(webidl.converters.DOMString), + key: 'unparsed', + defaultValue: [] + } +]) + +module.exports = { + getCookies, + deleteCookie, + getSetCookies, + setCookie +} + + +/***/ }), + +/***/ 24408: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(20663) +const { isCTLExcludingHtab } = __nccwpck_require__(43121) +const { collectASequenceOfCodePointsFast } = __nccwpck_require__(685) +const assert = __nccwpck_require__(39491) + +/** + * @description Parses the field-value attributes of a set-cookie header string. + * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4 + * @param {string} header + * @returns if the header is invalid, null will be returned + */ +function parseSetCookie (header) { + // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F + // character (CTL characters excluding HTAB): Abort these steps and + // ignore the set-cookie-string entirely. + if (isCTLExcludingHtab(header)) { + return null + } + + let nameValuePair = '' + let unparsedAttributes = '' + let name = '' + let value = '' + + // 2. If the set-cookie-string contains a %x3B (";") character: + if (header.includes(';')) { + // 1. The name-value-pair string consists of the characters up to, + // but not including, the first %x3B (";"), and the unparsed- + // attributes consist of the remainder of the set-cookie-string + // (including the %x3B (";") in question). + const position = { position: 0 } + + nameValuePair = collectASequenceOfCodePointsFast(';', header, position) + unparsedAttributes = header.slice(position.position) + } else { + // Otherwise: + + // 1. The name-value-pair string consists of all the characters + // contained in the set-cookie-string, and the unparsed- + // attributes is the empty string. + nameValuePair = header + } + + // 3. If the name-value-pair string lacks a %x3D ("=") character, then + // the name string is empty, and the value string is the value of + // name-value-pair. + if (!nameValuePair.includes('=')) { + value = nameValuePair + } else { + // Otherwise, the name string consists of the characters up to, but + // not including, the first %x3D ("=") character, and the (possibly + // empty) value string consists of the characters after the first + // %x3D ("=") character. + const position = { position: 0 } + name = collectASequenceOfCodePointsFast( + '=', + nameValuePair, + position + ) + value = nameValuePair.slice(position.position + 1) + } + + // 4. Remove any leading or trailing WSP characters from the name + // string and the value string. + name = name.trim() + value = value.trim() + + // 5. If the sum of the lengths of the name string and the value string + // is more than 4096 octets, abort these steps and ignore the set- + // cookie-string entirely. + if (name.length + value.length > maxNameValuePairSize) { + return null + } + + // 6. The cookie-name is the name string, and the cookie-value is the + // value string. + return { + name, value, ...parseUnparsedAttributes(unparsedAttributes) + } +} + +/** + * Parses the remaining attributes of a set-cookie header + * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4 + * @param {string} unparsedAttributes + * @param {[Object.]={}} cookieAttributeList + */ +function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) { + // 1. If the unparsed-attributes string is empty, skip the rest of + // these steps. + if (unparsedAttributes.length === 0) { + return cookieAttributeList + } + + // 2. Discard the first character of the unparsed-attributes (which + // will be a %x3B (";") character). + assert(unparsedAttributes[0] === ';') + unparsedAttributes = unparsedAttributes.slice(1) + + let cookieAv = '' + + // 3. If the remaining unparsed-attributes contains a %x3B (";") + // character: + if (unparsedAttributes.includes(';')) { + // 1. Consume the characters of the unparsed-attributes up to, but + // not including, the first %x3B (";") character. + cookieAv = collectASequenceOfCodePointsFast( + ';', + unparsedAttributes, + { position: 0 } + ) + unparsedAttributes = unparsedAttributes.slice(cookieAv.length) + } else { + // Otherwise: + + // 1. Consume the remainder of the unparsed-attributes. + cookieAv = unparsedAttributes + unparsedAttributes = '' + } + + // Let the cookie-av string be the characters consumed in this step. + + let attributeName = '' + let attributeValue = '' + + // 4. If the cookie-av string contains a %x3D ("=") character: + if (cookieAv.includes('=')) { + // 1. The (possibly empty) attribute-name string consists of the + // characters up to, but not including, the first %x3D ("=") + // character, and the (possibly empty) attribute-value string + // consists of the characters after the first %x3D ("=") + // character. + const position = { position: 0 } + + attributeName = collectASequenceOfCodePointsFast( + '=', + cookieAv, + position + ) + attributeValue = cookieAv.slice(position.position + 1) + } else { + // Otherwise: + + // 1. The attribute-name string consists of the entire cookie-av + // string, and the attribute-value string is empty. + attributeName = cookieAv + } + + // 5. Remove any leading or trailing WSP characters from the attribute- + // name string and the attribute-value string. + attributeName = attributeName.trim() + attributeValue = attributeValue.trim() + + // 6. If the attribute-value is longer than 1024 octets, ignore the + // cookie-av string and return to Step 1 of this algorithm. + if (attributeValue.length > maxAttributeValueSize) { + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) + } + + // 7. Process the attribute-name and attribute-value according to the + // requirements in the following subsections. (Notice that + // attributes with unrecognized attribute-names are ignored.) + const attributeNameLowercase = attributeName.toLowerCase() + + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1 + // If the attribute-name case-insensitively matches the string + // "Expires", the user agent MUST process the cookie-av as follows. + if (attributeNameLowercase === 'expires') { + // 1. Let the expiry-time be the result of parsing the attribute-value + // as cookie-date (see Section 5.1.1). + const expiryTime = new Date(attributeValue) + + // 2. If the attribute-value failed to parse as a cookie date, ignore + // the cookie-av. + + cookieAttributeList.expires = expiryTime + } else if (attributeNameLowercase === 'max-age') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2 + // If the attribute-name case-insensitively matches the string "Max- + // Age", the user agent MUST process the cookie-av as follows. + + // 1. If the first character of the attribute-value is not a DIGIT or a + // "-" character, ignore the cookie-av. + const charCode = attributeValue.charCodeAt(0) + + if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') { + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) + } + + // 2. If the remainder of attribute-value contains a non-DIGIT + // character, ignore the cookie-av. + if (!/^\d+$/.test(attributeValue)) { + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) + } + + // 3. Let delta-seconds be the attribute-value converted to an integer. + const deltaSeconds = Number(attributeValue) + + // 4. Let cookie-age-limit be the maximum age of the cookie (which + // SHOULD be 400 days or less, see Section 4.1.2.2). + + // 5. Set delta-seconds to the smaller of its present value and cookie- + // age-limit. + // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs) + + // 6. If delta-seconds is less than or equal to zero (0), let expiry- + // time be the earliest representable date and time. Otherwise, let + // the expiry-time be the current date and time plus delta-seconds + // seconds. + // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds + + // 7. Append an attribute to the cookie-attribute-list with an + // attribute-name of Max-Age and an attribute-value of expiry-time. + cookieAttributeList.maxAge = deltaSeconds + } else if (attributeNameLowercase === 'domain') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3 + // If the attribute-name case-insensitively matches the string "Domain", + // the user agent MUST process the cookie-av as follows. + + // 1. Let cookie-domain be the attribute-value. + let cookieDomain = attributeValue + + // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be + // cookie-domain without its leading %x2E ("."). + if (cookieDomain[0] === '.') { + cookieDomain = cookieDomain.slice(1) + } + + // 3. Convert the cookie-domain to lower case. + cookieDomain = cookieDomain.toLowerCase() + + // 4. Append an attribute to the cookie-attribute-list with an + // attribute-name of Domain and an attribute-value of cookie-domain. + cookieAttributeList.domain = cookieDomain + } else if (attributeNameLowercase === 'path') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4 + // If the attribute-name case-insensitively matches the string "Path", + // the user agent MUST process the cookie-av as follows. + + // 1. If the attribute-value is empty or if the first character of the + // attribute-value is not %x2F ("/"): + let cookiePath = '' + if (attributeValue.length === 0 || attributeValue[0] !== '/') { + // 1. Let cookie-path be the default-path. + cookiePath = '/' + } else { + // Otherwise: + + // 1. Let cookie-path be the attribute-value. + cookiePath = attributeValue + } + + // 2. Append an attribute to the cookie-attribute-list with an + // attribute-name of Path and an attribute-value of cookie-path. + cookieAttributeList.path = cookiePath + } else if (attributeNameLowercase === 'secure') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5 + // If the attribute-name case-insensitively matches the string "Secure", + // the user agent MUST append an attribute to the cookie-attribute-list + // with an attribute-name of Secure and an empty attribute-value. + + cookieAttributeList.secure = true + } else if (attributeNameLowercase === 'httponly') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6 + // If the attribute-name case-insensitively matches the string + // "HttpOnly", the user agent MUST append an attribute to the cookie- + // attribute-list with an attribute-name of HttpOnly and an empty + // attribute-value. + + cookieAttributeList.httpOnly = true + } else if (attributeNameLowercase === 'samesite') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7 + // If the attribute-name case-insensitively matches the string + // "SameSite", the user agent MUST process the cookie-av as follows: + + // 1. Let enforcement be "Default". + let enforcement = 'Default' + + const attributeValueLowercase = attributeValue.toLowerCase() + // 2. If cookie-av's attribute-value is a case-insensitive match for + // "None", set enforcement to "None". + if (attributeValueLowercase.includes('none')) { + enforcement = 'None' + } + + // 3. If cookie-av's attribute-value is a case-insensitive match for + // "Strict", set enforcement to "Strict". + if (attributeValueLowercase.includes('strict')) { + enforcement = 'Strict' + } + + // 4. If cookie-av's attribute-value is a case-insensitive match for + // "Lax", set enforcement to "Lax". + if (attributeValueLowercase.includes('lax')) { + enforcement = 'Lax' + } + + // 5. Append an attribute to the cookie-attribute-list with an + // attribute-name of "SameSite" and an attribute-value of + // enforcement. + cookieAttributeList.sameSite = enforcement + } else { + cookieAttributeList.unparsed ??= [] + + cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`) + } + + // 8. Return to Step 1 of this algorithm. + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) +} + +module.exports = { + parseSetCookie, + parseUnparsedAttributes +} + + +/***/ }), + +/***/ 43121: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const assert = __nccwpck_require__(39491) +const { kHeadersList } = __nccwpck_require__(72785) + +function isCTLExcludingHtab (value) { + if (value.length === 0) { + return false + } + + for (const char of value) { + const code = char.charCodeAt(0) + + if ( + (code >= 0x00 || code <= 0x08) || + (code >= 0x0A || code <= 0x1F) || + code === 0x7F + ) { + return false + } + } +} + +/** + CHAR = + token = 1* + separators = "(" | ")" | "<" | ">" | "@" + | "," | ";" | ":" | "\" | <"> + | "/" | "[" | "]" | "?" | "=" + | "{" | "}" | SP | HT + * @param {string} name + */ +function validateCookieName (name) { + for (const char of name) { + const code = char.charCodeAt(0) + + if ( + (code <= 0x20 || code > 0x7F) || + char === '(' || + char === ')' || + char === '>' || + char === '<' || + char === '@' || + char === ',' || + char === ';' || + char === ':' || + char === '\\' || + char === '"' || + char === '/' || + char === '[' || + char === ']' || + char === '?' || + char === '=' || + char === '{' || + char === '}' + ) { + throw new Error('Invalid cookie name') + } + } +} + +/** + cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE ) + cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E + ; US-ASCII characters excluding CTLs, + ; whitespace DQUOTE, comma, semicolon, + ; and backslash + * @param {string} value + */ +function validateCookieValue (value) { + for (const char of value) { + const code = char.charCodeAt(0) + + if ( + code < 0x21 || // exclude CTLs (0-31) + code === 0x22 || + code === 0x2C || + code === 0x3B || + code === 0x5C || + code > 0x7E // non-ascii + ) { + throw new Error('Invalid header value') + } + } +} + +/** + * path-value = + * @param {string} path + */ +function validateCookiePath (path) { + for (const char of path) { + const code = char.charCodeAt(0) + + if (code < 0x21 || char === ';') { + throw new Error('Invalid cookie path') + } + } +} + +/** + * I have no idea why these values aren't allowed to be honest, + * but Deno tests these. - Khafra + * @param {string} domain + */ +function validateCookieDomain (domain) { + if ( + domain.startsWith('-') || + domain.endsWith('.') || + domain.endsWith('-') + ) { + throw new Error('Invalid cookie domain') + } +} + +/** + * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1 + * @param {number|Date} date + IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT + ; fixed length/zone/capitalization subset of the format + ; see Section 3.3 of [RFC5322] + + day-name = %x4D.6F.6E ; "Mon", case-sensitive + / %x54.75.65 ; "Tue", case-sensitive + / %x57.65.64 ; "Wed", case-sensitive + / %x54.68.75 ; "Thu", case-sensitive + / %x46.72.69 ; "Fri", case-sensitive + / %x53.61.74 ; "Sat", case-sensitive + / %x53.75.6E ; "Sun", case-sensitive + date1 = day SP month SP year + ; e.g., 02 Jun 1982 + + day = 2DIGIT + month = %x4A.61.6E ; "Jan", case-sensitive + / %x46.65.62 ; "Feb", case-sensitive + / %x4D.61.72 ; "Mar", case-sensitive + / %x41.70.72 ; "Apr", case-sensitive + / %x4D.61.79 ; "May", case-sensitive + / %x4A.75.6E ; "Jun", case-sensitive + / %x4A.75.6C ; "Jul", case-sensitive + / %x41.75.67 ; "Aug", case-sensitive + / %x53.65.70 ; "Sep", case-sensitive + / %x4F.63.74 ; "Oct", case-sensitive + / %x4E.6F.76 ; "Nov", case-sensitive + / %x44.65.63 ; "Dec", case-sensitive + year = 4DIGIT + + GMT = %x47.4D.54 ; "GMT", case-sensitive + + time-of-day = hour ":" minute ":" second + ; 00:00:00 - 23:59:60 (leap second) + + hour = 2DIGIT + minute = 2DIGIT + second = 2DIGIT + */ +function toIMFDate (date) { + if (typeof date === 'number') { + date = new Date(date) + } + + const days = [ + 'Sun', 'Mon', 'Tue', 'Wed', + 'Thu', 'Fri', 'Sat' + ] + + const months = [ + 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' + ] + + const dayName = days[date.getUTCDay()] + const day = date.getUTCDate().toString().padStart(2, '0') + const month = months[date.getUTCMonth()] + const year = date.getUTCFullYear() + const hour = date.getUTCHours().toString().padStart(2, '0') + const minute = date.getUTCMinutes().toString().padStart(2, '0') + const second = date.getUTCSeconds().toString().padStart(2, '0') + + return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT` +} + +/** + max-age-av = "Max-Age=" non-zero-digit *DIGIT + ; In practice, both expires-av and max-age-av + ; are limited to dates representable by the + ; user agent. + * @param {number} maxAge + */ +function validateCookieMaxAge (maxAge) { + if (maxAge < 0) { + throw new Error('Invalid cookie max-age') + } +} + +/** + * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1 + * @param {import('./index').Cookie} cookie + */ +function stringify (cookie) { + if (cookie.name.length === 0) { + return null + } + + validateCookieName(cookie.name) + validateCookieValue(cookie.value) + + const out = [`${cookie.name}=${cookie.value}`] + + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1 + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2 + if (cookie.name.startsWith('__Secure-')) { + cookie.secure = true + } + + if (cookie.name.startsWith('__Host-')) { + cookie.secure = true + cookie.domain = null + cookie.path = '/' + } + + if (cookie.secure) { + out.push('Secure') + } + + if (cookie.httpOnly) { + out.push('HttpOnly') + } + + if (typeof cookie.maxAge === 'number') { + validateCookieMaxAge(cookie.maxAge) + out.push(`Max-Age=${cookie.maxAge}`) + } + + if (cookie.domain) { + validateCookieDomain(cookie.domain) + out.push(`Domain=${cookie.domain}`) + } + + if (cookie.path) { + validateCookiePath(cookie.path) + out.push(`Path=${cookie.path}`) + } + + if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') { + out.push(`Expires=${toIMFDate(cookie.expires)}`) + } + + if (cookie.sameSite) { + out.push(`SameSite=${cookie.sameSite}`) + } + + for (const part of cookie.unparsed) { + if (!part.includes('=')) { + throw new Error('Invalid unparsed') + } + + const [key, ...value] = part.split('=') + + out.push(`${key.trim()}=${value.join('=')}`) + } + + return out.join('; ') +} + +let kHeadersListNode + +function getHeadersList (headers) { + if (headers[kHeadersList]) { + return headers[kHeadersList] + } + + if (!kHeadersListNode) { + kHeadersListNode = Object.getOwnPropertySymbols(headers).find( + (symbol) => symbol.description === 'headers list' + ) + + assert(kHeadersListNode, 'Headers cannot be parsed') + } + + const headersList = headers[kHeadersListNode] + assert(headersList) + + return headersList +} + +module.exports = { + isCTLExcludingHtab, + stringify, + getHeadersList +} + + +/***/ }), + +/***/ 82067: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const net = __nccwpck_require__(41808) +const assert = __nccwpck_require__(39491) +const util = __nccwpck_require__(83983) +const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(48045) + +let tls // include tls conditionally since it is not always available + +// TODO: session re-use does not wait for the first +// connection to resolve the session and might therefore +// resolve the same servername multiple times even when +// re-use is enabled. + +let SessionCache +// FIXME: remove workaround when the Node bug is fixed +// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308 +if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) { + SessionCache = class WeakSessionCache { + constructor (maxCachedSessions) { + this._maxCachedSessions = maxCachedSessions + this._sessionCache = new Map() + this._sessionRegistry = new global.FinalizationRegistry((key) => { + if (this._sessionCache.size < this._maxCachedSessions) { + return + } + + const ref = this._sessionCache.get(key) + if (ref !== undefined && ref.deref() === undefined) { + this._sessionCache.delete(key) + } + }) + } + + get (sessionKey) { + const ref = this._sessionCache.get(sessionKey) + return ref ? ref.deref() : null + } + + set (sessionKey, session) { + if (this._maxCachedSessions === 0) { + return + } + + this._sessionCache.set(sessionKey, new WeakRef(session)) + this._sessionRegistry.register(session, sessionKey) + } + } +} else { + SessionCache = class SimpleSessionCache { + constructor (maxCachedSessions) { + this._maxCachedSessions = maxCachedSessions + this._sessionCache = new Map() + } + + get (sessionKey) { + return this._sessionCache.get(sessionKey) + } + + set (sessionKey, session) { + if (this._maxCachedSessions === 0) { + return + } + + if (this._sessionCache.size >= this._maxCachedSessions) { + // remove the oldest session + const { value: oldestKey } = this._sessionCache.keys().next() + this._sessionCache.delete(oldestKey) + } + + this._sessionCache.set(sessionKey, session) + } + } +} + +function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) { + if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) { + throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero') + } + + const options = { path: socketPath, ...opts } + const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions) + timeout = timeout == null ? 10e3 : timeout + allowH2 = allowH2 != null ? allowH2 : false + return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) { + let socket + if (protocol === 'https:') { + if (!tls) { + tls = __nccwpck_require__(24404) + } + servername = servername || options.servername || util.getServerName(host) || null + + const sessionKey = servername || hostname + const session = sessionCache.get(sessionKey) || null + + assert(sessionKey) + + socket = tls.connect({ + highWaterMark: 16384, // TLS in node can't have bigger HWM anyway... + ...options, + servername, + session, + localAddress, + // TODO(HTTP/2): Add support for h2c + ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'], + socket: httpSocket, // upgrade socket connection + port: port || 443, + host: hostname + }) + + socket + .on('session', function (session) { + // TODO (fix): Can a session become invalid once established? Don't think so? + sessionCache.set(sessionKey, session) + }) + } else { + assert(!httpSocket, 'httpSocket can only be sent on TLS update') + socket = net.connect({ + highWaterMark: 64 * 1024, // Same as nodejs fs streams. + ...options, + localAddress, + port: port || 80, + host: hostname + }) + } + + // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket + if (options.keepAlive == null || options.keepAlive) { + const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay + socket.setKeepAlive(true, keepAliveInitialDelay) + } + + const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout) + + socket + .setNoDelay(true) + .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () { + cancelTimeout() + + if (callback) { + const cb = callback + callback = null + cb(null, this) + } + }) + .on('error', function (err) { + cancelTimeout() + + if (callback) { + const cb = callback + callback = null + cb(err) + } + }) + + return socket + } +} + +function setupTimeout (onConnectTimeout, timeout) { + if (!timeout) { + return () => {} + } + + let s1 = null + let s2 = null + const timeoutId = setTimeout(() => { + // setImmediate is added to make sure that we priotorise socket error events over timeouts + s1 = setImmediate(() => { + if (process.platform === 'win32') { + // Windows needs an extra setImmediate probably due to implementation differences in the socket logic + s2 = setImmediate(() => onConnectTimeout()) + } else { + onConnectTimeout() + } + }) + }, timeout) + return () => { + clearTimeout(timeoutId) + clearImmediate(s1) + clearImmediate(s2) + } +} + +function onConnectTimeout (socket) { + util.destroy(socket, new ConnectTimeoutError()) +} + +module.exports = buildConnector + + +/***/ }), + +/***/ 48045: +/***/ ((module) => { + +"use strict"; + + +class UndiciError extends Error { + constructor (message) { + super(message) + this.name = 'UndiciError' + this.code = 'UND_ERR' + } +} + +class ConnectTimeoutError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, ConnectTimeoutError) + this.name = 'ConnectTimeoutError' + this.message = message || 'Connect Timeout Error' + this.code = 'UND_ERR_CONNECT_TIMEOUT' + } +} + +class HeadersTimeoutError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, HeadersTimeoutError) + this.name = 'HeadersTimeoutError' + this.message = message || 'Headers Timeout Error' + this.code = 'UND_ERR_HEADERS_TIMEOUT' + } +} + +class HeadersOverflowError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, HeadersOverflowError) + this.name = 'HeadersOverflowError' + this.message = message || 'Headers Overflow Error' + this.code = 'UND_ERR_HEADERS_OVERFLOW' + } +} + +class BodyTimeoutError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, BodyTimeoutError) + this.name = 'BodyTimeoutError' + this.message = message || 'Body Timeout Error' + this.code = 'UND_ERR_BODY_TIMEOUT' + } +} + +class ResponseStatusCodeError extends UndiciError { + constructor (message, statusCode, headers, body) { + super(message) + Error.captureStackTrace(this, ResponseStatusCodeError) + this.name = 'ResponseStatusCodeError' + this.message = message || 'Response Status Code Error' + this.code = 'UND_ERR_RESPONSE_STATUS_CODE' + this.body = body + this.status = statusCode + this.statusCode = statusCode + this.headers = headers + } +} + +class InvalidArgumentError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, InvalidArgumentError) + this.name = 'InvalidArgumentError' + this.message = message || 'Invalid Argument Error' + this.code = 'UND_ERR_INVALID_ARG' + } +} + +class InvalidReturnValueError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, InvalidReturnValueError) + this.name = 'InvalidReturnValueError' + this.message = message || 'Invalid Return Value Error' + this.code = 'UND_ERR_INVALID_RETURN_VALUE' + } +} + +class RequestAbortedError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, RequestAbortedError) + this.name = 'AbortError' + this.message = message || 'Request aborted' + this.code = 'UND_ERR_ABORTED' + } +} + +class InformationalError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, InformationalError) + this.name = 'InformationalError' + this.message = message || 'Request information' + this.code = 'UND_ERR_INFO' + } +} + +class RequestContentLengthMismatchError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, RequestContentLengthMismatchError) + this.name = 'RequestContentLengthMismatchError' + this.message = message || 'Request body length does not match content-length header' + this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH' + } +} + +class ResponseContentLengthMismatchError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, ResponseContentLengthMismatchError) + this.name = 'ResponseContentLengthMismatchError' + this.message = message || 'Response body length does not match content-length header' + this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH' + } +} + +class ClientDestroyedError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, ClientDestroyedError) + this.name = 'ClientDestroyedError' + this.message = message || 'The client is destroyed' + this.code = 'UND_ERR_DESTROYED' + } +} + +class ClientClosedError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, ClientClosedError) + this.name = 'ClientClosedError' + this.message = message || 'The client is closed' + this.code = 'UND_ERR_CLOSED' + } +} + +class SocketError extends UndiciError { + constructor (message, socket) { + super(message) + Error.captureStackTrace(this, SocketError) + this.name = 'SocketError' + this.message = message || 'Socket error' + this.code = 'UND_ERR_SOCKET' + this.socket = socket + } +} + +class NotSupportedError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, NotSupportedError) + this.name = 'NotSupportedError' + this.message = message || 'Not supported error' + this.code = 'UND_ERR_NOT_SUPPORTED' + } +} + +class BalancedPoolMissingUpstreamError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, NotSupportedError) + this.name = 'MissingUpstreamError' + this.message = message || 'No upstream has been added to the BalancedPool' + this.code = 'UND_ERR_BPL_MISSING_UPSTREAM' + } +} + +class HTTPParserError extends Error { + constructor (message, code, data) { + super(message) + Error.captureStackTrace(this, HTTPParserError) + this.name = 'HTTPParserError' + this.code = code ? `HPE_${code}` : undefined + this.data = data ? data.toString() : undefined + } +} + +class ResponseExceededMaxSizeError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, ResponseExceededMaxSizeError) + this.name = 'ResponseExceededMaxSizeError' + this.message = message || 'Response content exceeded max size' + this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE' + } +} + +module.exports = { + HTTPParserError, + UndiciError, + HeadersTimeoutError, + HeadersOverflowError, + BodyTimeoutError, + RequestContentLengthMismatchError, + ConnectTimeoutError, + ResponseStatusCodeError, + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError, + ClientDestroyedError, + ClientClosedError, + InformationalError, + SocketError, + NotSupportedError, + ResponseContentLengthMismatchError, + BalancedPoolMissingUpstreamError, + ResponseExceededMaxSizeError +} + + +/***/ }), + +/***/ 62905: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { + InvalidArgumentError, + NotSupportedError +} = __nccwpck_require__(48045) +const assert = __nccwpck_require__(39491) +const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(72785) +const util = __nccwpck_require__(83983) + +// tokenRegExp and headerCharRegex have been lifted from +// https://github.com/nodejs/node/blob/main/lib/_http_common.js + +/** + * Verifies that the given val is a valid HTTP token + * per the rules defined in RFC 7230 + * See https://tools.ietf.org/html/rfc7230#section-3.2.6 + */ +const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/ + +/** + * Matches if val contains an invalid field-vchar + * field-value = *( field-content / obs-fold ) + * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] + * field-vchar = VCHAR / obs-text + */ +const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/ + +// Verifies that a given path is valid does not contain control chars \x00 to \x20 +const invalidPathRegex = /[^\u0021-\u00ff]/ + +const kHandler = Symbol('handler') + +const channels = {} + +let extractBody + +try { + const diagnosticsChannel = __nccwpck_require__(67643) + channels.create = diagnosticsChannel.channel('undici:request:create') + channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent') + channels.headers = diagnosticsChannel.channel('undici:request:headers') + channels.trailers = diagnosticsChannel.channel('undici:request:trailers') + channels.error = diagnosticsChannel.channel('undici:request:error') +} catch { + channels.create = { hasSubscribers: false } + channels.bodySent = { hasSubscribers: false } + channels.headers = { hasSubscribers: false } + channels.trailers = { hasSubscribers: false } + channels.error = { hasSubscribers: false } +} + +class Request { + constructor (origin, { + path, + method, + body, + headers, + query, + idempotent, + blocking, + upgrade, + headersTimeout, + bodyTimeout, + reset, + throwOnError, + expectContinue + }, handler) { + if (typeof path !== 'string') { + throw new InvalidArgumentError('path must be a string') + } else if ( + path[0] !== '/' && + !(path.startsWith('http://') || path.startsWith('https://')) && + method !== 'CONNECT' + ) { + throw new InvalidArgumentError('path must be an absolute URL or start with a slash') + } else if (invalidPathRegex.exec(path) !== null) { + throw new InvalidArgumentError('invalid request path') + } + + if (typeof method !== 'string') { + throw new InvalidArgumentError('method must be a string') + } else if (tokenRegExp.exec(method) === null) { + throw new InvalidArgumentError('invalid request method') + } + + if (upgrade && typeof upgrade !== 'string') { + throw new InvalidArgumentError('upgrade must be a string') + } + + if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) { + throw new InvalidArgumentError('invalid headersTimeout') + } + + if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) { + throw new InvalidArgumentError('invalid bodyTimeout') + } + + if (reset != null && typeof reset !== 'boolean') { + throw new InvalidArgumentError('invalid reset') + } + + if (expectContinue != null && typeof expectContinue !== 'boolean') { + throw new InvalidArgumentError('invalid expectContinue') + } + + this.headersTimeout = headersTimeout + + this.bodyTimeout = bodyTimeout + + this.throwOnError = throwOnError === true + + this.method = method + + if (body == null) { + this.body = null + } else if (util.isStream(body)) { + this.body = body + } else if (util.isBuffer(body)) { + this.body = body.byteLength ? body : null + } else if (ArrayBuffer.isView(body)) { + this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null + } else if (body instanceof ArrayBuffer) { + this.body = body.byteLength ? Buffer.from(body) : null + } else if (typeof body === 'string') { + this.body = body.length ? Buffer.from(body) : null + } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) { + this.body = body + } else { + throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable') + } + + this.completed = false + + this.aborted = false + + this.upgrade = upgrade || null + + this.path = query ? util.buildURL(path, query) : path + + this.origin = origin + + this.idempotent = idempotent == null + ? method === 'HEAD' || method === 'GET' + : idempotent + + this.blocking = blocking == null ? false : blocking + + this.reset = reset == null ? null : reset + + this.host = null + + this.contentLength = null + + this.contentType = null + + this.headers = '' + + // Only for H2 + this.expectContinue = expectContinue != null ? expectContinue : false + + if (Array.isArray(headers)) { + if (headers.length % 2 !== 0) { + throw new InvalidArgumentError('headers array must be even') + } + for (let i = 0; i < headers.length; i += 2) { + processHeader(this, headers[i], headers[i + 1]) + } + } else if (headers && typeof headers === 'object') { + const keys = Object.keys(headers) + for (let i = 0; i < keys.length; i++) { + const key = keys[i] + processHeader(this, key, headers[key]) + } + } else if (headers != null) { + throw new InvalidArgumentError('headers must be an object or an array') + } + + if (util.isFormDataLike(this.body)) { + if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) { + throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.') + } + + if (!extractBody) { + extractBody = (__nccwpck_require__(41472).extractBody) + } + + const [bodyStream, contentType] = extractBody(body) + if (this.contentType == null) { + this.contentType = contentType + this.headers += `content-type: ${contentType}\r\n` + } + this.body = bodyStream.stream + this.contentLength = bodyStream.length + } else if (util.isBlobLike(body) && this.contentType == null && body.type) { + this.contentType = body.type + this.headers += `content-type: ${body.type}\r\n` + } + + util.validateHandler(handler, method, upgrade) + + this.servername = util.getServerName(this.host) + + this[kHandler] = handler + + if (channels.create.hasSubscribers) { + channels.create.publish({ request: this }) + } + } + + onBodySent (chunk) { + if (this[kHandler].onBodySent) { + try { + this[kHandler].onBodySent(chunk) + } catch (err) { + this.onError(err) + } + } + } + + onRequestSent () { + if (channels.bodySent.hasSubscribers) { + channels.bodySent.publish({ request: this }) + } + + if (this[kHandler].onRequestSent) { + try { + this[kHandler].onRequestSent() + } catch (err) { + this.onError(err) + } + } + } + + onConnect (abort) { + assert(!this.aborted) + assert(!this.completed) + + return this[kHandler].onConnect(abort) + } + + onHeaders (statusCode, headers, resume, statusText) { + assert(!this.aborted) + assert(!this.completed) + + if (channels.headers.hasSubscribers) { + channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }) + } + + return this[kHandler].onHeaders(statusCode, headers, resume, statusText) + } + + onData (chunk) { + assert(!this.aborted) + assert(!this.completed) + + return this[kHandler].onData(chunk) + } + + onUpgrade (statusCode, headers, socket) { + assert(!this.aborted) + assert(!this.completed) + + return this[kHandler].onUpgrade(statusCode, headers, socket) + } + + onComplete (trailers) { + assert(!this.aborted) + + this.completed = true + if (channels.trailers.hasSubscribers) { + channels.trailers.publish({ request: this, trailers }) + } + return this[kHandler].onComplete(trailers) + } + + onError (error) { + if (channels.error.hasSubscribers) { + channels.error.publish({ request: this, error }) + } + + if (this.aborted) { + return + } + this.aborted = true + return this[kHandler].onError(error) + } + + // TODO: adjust to support H2 + addHeader (key, value) { + processHeader(this, key, value) + return this + } + + static [kHTTP1BuildRequest] (origin, opts, handler) { + // TODO: Migrate header parsing here, to make Requests + // HTTP agnostic + return new Request(origin, opts, handler) + } + + static [kHTTP2BuildRequest] (origin, opts, handler) { + const headers = opts.headers + opts = { ...opts, headers: null } + + const request = new Request(origin, opts, handler) + + request.headers = {} + + if (Array.isArray(headers)) { + if (headers.length % 2 !== 0) { + throw new InvalidArgumentError('headers array must be even') + } + for (let i = 0; i < headers.length; i += 2) { + processHeader(request, headers[i], headers[i + 1], true) + } + } else if (headers && typeof headers === 'object') { + const keys = Object.keys(headers) + for (let i = 0; i < keys.length; i++) { + const key = keys[i] + processHeader(request, key, headers[key], true) + } + } else if (headers != null) { + throw new InvalidArgumentError('headers must be an object or an array') + } + + return request + } + + static [kHTTP2CopyHeaders] (raw) { + const rawHeaders = raw.split('\r\n') + const headers = {} + + for (const header of rawHeaders) { + const [key, value] = header.split(': ') + + if (value == null || value.length === 0) continue + + if (headers[key]) headers[key] += `,${value}` + else headers[key] = value + } + + return headers + } +} + +function processHeaderValue (key, val, skipAppend) { + if (val && typeof val === 'object') { + throw new InvalidArgumentError(`invalid ${key} header`) + } + + val = val != null ? `${val}` : '' + + if (headerCharRegex.exec(val) !== null) { + throw new InvalidArgumentError(`invalid ${key} header`) + } + + return skipAppend ? val : `${key}: ${val}\r\n` +} + +function processHeader (request, key, val, skipAppend = false) { + if (val && (typeof val === 'object' && !Array.isArray(val))) { + throw new InvalidArgumentError(`invalid ${key} header`) + } else if (val === undefined) { + return + } + + if ( + request.host === null && + key.length === 4 && + key.toLowerCase() === 'host' + ) { + if (headerCharRegex.exec(val) !== null) { + throw new InvalidArgumentError(`invalid ${key} header`) + } + // Consumed by Client + request.host = val + } else if ( + request.contentLength === null && + key.length === 14 && + key.toLowerCase() === 'content-length' + ) { + request.contentLength = parseInt(val, 10) + if (!Number.isFinite(request.contentLength)) { + throw new InvalidArgumentError('invalid content-length header') + } + } else if ( + request.contentType === null && + key.length === 12 && + key.toLowerCase() === 'content-type' + ) { + request.contentType = val + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend) + else request.headers += processHeaderValue(key, val) + } else if ( + key.length === 17 && + key.toLowerCase() === 'transfer-encoding' + ) { + throw new InvalidArgumentError('invalid transfer-encoding header') + } else if ( + key.length === 10 && + key.toLowerCase() === 'connection' + ) { + const value = typeof val === 'string' ? val.toLowerCase() : null + if (value !== 'close' && value !== 'keep-alive') { + throw new InvalidArgumentError('invalid connection header') + } else if (value === 'close') { + request.reset = true + } + } else if ( + key.length === 10 && + key.toLowerCase() === 'keep-alive' + ) { + throw new InvalidArgumentError('invalid keep-alive header') + } else if ( + key.length === 7 && + key.toLowerCase() === 'upgrade' + ) { + throw new InvalidArgumentError('invalid upgrade header') + } else if ( + key.length === 6 && + key.toLowerCase() === 'expect' + ) { + throw new NotSupportedError('expect header not supported') + } else if (tokenRegExp.exec(key) === null) { + throw new InvalidArgumentError('invalid header key') + } else { + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { + if (skipAppend) { + if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}` + else request.headers[key] = processHeaderValue(key, val[i], skipAppend) + } else { + request.headers += processHeaderValue(key, val[i]) + } + } + } else { + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend) + else request.headers += processHeaderValue(key, val) + } + } +} + +module.exports = Request + + +/***/ }), + +/***/ 72785: +/***/ ((module) => { + +module.exports = { + kClose: Symbol('close'), + kDestroy: Symbol('destroy'), + kDispatch: Symbol('dispatch'), + kUrl: Symbol('url'), + kWriting: Symbol('writing'), + kResuming: Symbol('resuming'), + kQueue: Symbol('queue'), + kConnect: Symbol('connect'), + kConnecting: Symbol('connecting'), + kHeadersList: Symbol('headers list'), + kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'), + kKeepAliveMaxTimeout: Symbol('max keep alive timeout'), + kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'), + kKeepAliveTimeoutValue: Symbol('keep alive timeout'), + kKeepAlive: Symbol('keep alive'), + kHeadersTimeout: Symbol('headers timeout'), + kBodyTimeout: Symbol('body timeout'), + kServerName: Symbol('server name'), + kLocalAddress: Symbol('local address'), + kHost: Symbol('host'), + kNoRef: Symbol('no ref'), + kBodyUsed: Symbol('used'), + kRunning: Symbol('running'), + kBlocking: Symbol('blocking'), + kPending: Symbol('pending'), + kSize: Symbol('size'), + kBusy: Symbol('busy'), + kQueued: Symbol('queued'), + kFree: Symbol('free'), + kConnected: Symbol('connected'), + kClosed: Symbol('closed'), + kNeedDrain: Symbol('need drain'), + kReset: Symbol('reset'), + kDestroyed: Symbol.for('nodejs.stream.destroyed'), + kMaxHeadersSize: Symbol('max headers size'), + kRunningIdx: Symbol('running index'), + kPendingIdx: Symbol('pending index'), + kError: Symbol('error'), + kClients: Symbol('clients'), + kClient: Symbol('client'), + kParser: Symbol('parser'), + kOnDestroyed: Symbol('destroy callbacks'), + kPipelining: Symbol('pipelining'), + kSocket: Symbol('socket'), + kHostHeader: Symbol('host header'), + kConnector: Symbol('connector'), + kStrictContentLength: Symbol('strict content length'), + kMaxRedirections: Symbol('maxRedirections'), + kMaxRequests: Symbol('maxRequestsPerClient'), + kProxy: Symbol('proxy agent options'), + kCounter: Symbol('socket request counter'), + kInterceptors: Symbol('dispatch interceptors'), + kMaxResponseSize: Symbol('max response size'), + kHTTP2Session: Symbol('http2Session'), + kHTTP2SessionState: Symbol('http2Session state'), + kHTTP2BuildRequest: Symbol('http2 build request'), + kHTTP1BuildRequest: Symbol('http1 build request'), + kHTTP2CopyHeaders: Symbol('http2 copy headers'), + kHTTPConnVersion: Symbol('http connection version') +} + + +/***/ }), + +/***/ 83983: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const assert = __nccwpck_require__(39491) +const { kDestroyed, kBodyUsed } = __nccwpck_require__(72785) +const { IncomingMessage } = __nccwpck_require__(13685) +const stream = __nccwpck_require__(12781) +const net = __nccwpck_require__(41808) +const { InvalidArgumentError } = __nccwpck_require__(48045) +const { Blob } = __nccwpck_require__(14300) +const nodeUtil = __nccwpck_require__(73837) +const { stringify } = __nccwpck_require__(63477) + +const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v)) + +function nop () {} + +function isStream (obj) { + return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function' +} + +// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License) +function isBlobLike (object) { + return (Blob && object instanceof Blob) || ( + object && + typeof object === 'object' && + (typeof object.stream === 'function' || + typeof object.arrayBuffer === 'function') && + /^(Blob|File)$/.test(object[Symbol.toStringTag]) + ) +} + +function buildURL (url, queryParams) { + if (url.includes('?') || url.includes('#')) { + throw new Error('Query params cannot be passed when url already contains "?" or "#".') + } + + const stringified = stringify(queryParams) + + if (stringified) { + url += '?' + stringified + } + + return url +} + +function parseURL (url) { + if (typeof url === 'string') { + url = new URL(url) + + if (!/^https?:/.test(url.origin || url.protocol)) { + throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.') + } + + return url + } + + if (!url || typeof url !== 'object') { + throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.') + } + + if (!/^https?:/.test(url.origin || url.protocol)) { + throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.') + } + + if (!(url instanceof URL)) { + if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) { + throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.') + } + + if (url.path != null && typeof url.path !== 'string') { + throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.') + } + + if (url.pathname != null && typeof url.pathname !== 'string') { + throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.') + } + + if (url.hostname != null && typeof url.hostname !== 'string') { + throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.') + } + + if (url.origin != null && typeof url.origin !== 'string') { + throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.') + } + + const port = url.port != null + ? url.port + : (url.protocol === 'https:' ? 443 : 80) + let origin = url.origin != null + ? url.origin + : `${url.protocol}//${url.hostname}:${port}` + let path = url.path != null + ? url.path + : `${url.pathname || ''}${url.search || ''}` + + if (origin.endsWith('/')) { + origin = origin.substring(0, origin.length - 1) + } + + if (path && !path.startsWith('/')) { + path = `/${path}` + } + // new URL(path, origin) is unsafe when `path` contains an absolute URL + // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL: + // If first parameter is a relative URL, second param is required, and will be used as the base URL. + // If first parameter is an absolute URL, a given second param will be ignored. + url = new URL(origin + path) + } + + return url +} + +function parseOrigin (url) { + url = parseURL(url) + + if (url.pathname !== '/' || url.search || url.hash) { + throw new InvalidArgumentError('invalid url') + } + + return url +} + +function getHostname (host) { + if (host[0] === '[') { + const idx = host.indexOf(']') + + assert(idx !== -1) + return host.substr(1, idx - 1) + } + + const idx = host.indexOf(':') + if (idx === -1) return host + + return host.substr(0, idx) +} + +// IP addresses are not valid server names per RFC6066 +// > Currently, the only server names supported are DNS hostnames +function getServerName (host) { + if (!host) { + return null + } + + assert.strictEqual(typeof host, 'string') + + const servername = getHostname(host) + if (net.isIP(servername)) { + return '' + } + + return servername +} + +function deepClone (obj) { + return JSON.parse(JSON.stringify(obj)) +} + +function isAsyncIterable (obj) { + return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function') +} + +function isIterable (obj) { + return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function')) +} + +function bodyLength (body) { + if (body == null) { + return 0 + } else if (isStream(body)) { + const state = body._readableState + return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length) + ? state.length + : null + } else if (isBlobLike(body)) { + return body.size != null ? body.size : null + } else if (isBuffer(body)) { + return body.byteLength + } + + return null +} + +function isDestroyed (stream) { + return !stream || !!(stream.destroyed || stream[kDestroyed]) +} + +function isReadableAborted (stream) { + const state = stream && stream._readableState + return isDestroyed(stream) && state && !state.endEmitted +} + +function destroy (stream, err) { + if (!isStream(stream) || isDestroyed(stream)) { + return + } + + if (typeof stream.destroy === 'function') { + if (Object.getPrototypeOf(stream).constructor === IncomingMessage) { + // See: https://github.com/nodejs/node/pull/38505/files + stream.socket = null + } + + stream.destroy(err) + } else if (err) { + process.nextTick((stream, err) => { + stream.emit('error', err) + }, stream, err) + } + + if (stream.destroyed !== true) { + stream[kDestroyed] = true + } +} + +const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/ +function parseKeepAliveTimeout (val) { + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR) + return m ? parseInt(m[1], 10) * 1000 : null +} + +function parseHeaders (headers, obj = {}) { + // For H2 support + if (!Array.isArray(headers)) return headers + + for (let i = 0; i < headers.length; i += 2) { + const key = headers[i].toString().toLowerCase() + let val = obj[key] + + if (!val) { + if (Array.isArray(headers[i + 1])) { + obj[key] = headers[i + 1] + } else { + obj[key] = headers[i + 1].toString('utf8') + } + } else { + if (!Array.isArray(val)) { + val = [val] + obj[key] = val + } + val.push(headers[i + 1].toString('utf8')) + } + } + + // See https://github.com/nodejs/node/pull/46528 + if ('content-length' in obj && 'content-disposition' in obj) { + obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1') + } + + return obj +} + +function parseRawHeaders (headers) { + const ret = [] + let hasContentLength = false + let contentDispositionIdx = -1 + + for (let n = 0; n < headers.length; n += 2) { + const key = headers[n + 0].toString() + const val = headers[n + 1].toString('utf8') + + if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) { + ret.push(key, val) + hasContentLength = true + } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) { + contentDispositionIdx = ret.push(key, val) - 1 + } else { + ret.push(key, val) + } + } + + // See https://github.com/nodejs/node/pull/46528 + if (hasContentLength && contentDispositionIdx !== -1) { + ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1') + } + + return ret +} + +function isBuffer (buffer) { + // See, https://github.com/mcollina/undici/pull/319 + return buffer instanceof Uint8Array || Buffer.isBuffer(buffer) +} + +function validateHandler (handler, method, upgrade) { + if (!handler || typeof handler !== 'object') { + throw new InvalidArgumentError('handler must be an object') + } + + if (typeof handler.onConnect !== 'function') { + throw new InvalidArgumentError('invalid onConnect method') + } + + if (typeof handler.onError !== 'function') { + throw new InvalidArgumentError('invalid onError method') + } + + if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) { + throw new InvalidArgumentError('invalid onBodySent method') + } + + if (upgrade || method === 'CONNECT') { + if (typeof handler.onUpgrade !== 'function') { + throw new InvalidArgumentError('invalid onUpgrade method') + } + } else { + if (typeof handler.onHeaders !== 'function') { + throw new InvalidArgumentError('invalid onHeaders method') + } + + if (typeof handler.onData !== 'function') { + throw new InvalidArgumentError('invalid onData method') + } + + if (typeof handler.onComplete !== 'function') { + throw new InvalidArgumentError('invalid onComplete method') + } + } +} + +// A body is disturbed if it has been read from and it cannot +// be re-used without losing state or data. +function isDisturbed (body) { + return !!(body && ( + stream.isDisturbed + ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed? + : body[kBodyUsed] || + body.readableDidRead || + (body._readableState && body._readableState.dataEmitted) || + isReadableAborted(body) + )) +} + +function isErrored (body) { + return !!(body && ( + stream.isErrored + ? stream.isErrored(body) + : /state: 'errored'/.test(nodeUtil.inspect(body) + ))) +} + +function isReadable (body) { + return !!(body && ( + stream.isReadable + ? stream.isReadable(body) + : /state: 'readable'/.test(nodeUtil.inspect(body) + ))) +} + +function getSocketInfo (socket) { + return { + localAddress: socket.localAddress, + localPort: socket.localPort, + remoteAddress: socket.remoteAddress, + remotePort: socket.remotePort, + remoteFamily: socket.remoteFamily, + timeout: socket.timeout, + bytesWritten: socket.bytesWritten, + bytesRead: socket.bytesRead + } +} + +async function * convertIterableToBuffer (iterable) { + for await (const chunk of iterable) { + yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk) + } +} + +let ReadableStream +function ReadableStreamFrom (iterable) { + if (!ReadableStream) { + ReadableStream = (__nccwpck_require__(35356).ReadableStream) + } + + if (ReadableStream.from) { + return ReadableStream.from(convertIterableToBuffer(iterable)) + } + + let iterator + return new ReadableStream( + { + async start () { + iterator = iterable[Symbol.asyncIterator]() + }, + async pull (controller) { + const { done, value } = await iterator.next() + if (done) { + queueMicrotask(() => { + controller.close() + }) + } else { + const buf = Buffer.isBuffer(value) ? value : Buffer.from(value) + controller.enqueue(new Uint8Array(buf)) + } + return controller.desiredSize > 0 + }, + async cancel (reason) { + await iterator.return() + } + }, + 0 + ) +} + +// The chunk should be a FormData instance and contains +// all the required methods. +function isFormDataLike (object) { + return ( + object && + typeof object === 'object' && + typeof object.append === 'function' && + typeof object.delete === 'function' && + typeof object.get === 'function' && + typeof object.getAll === 'function' && + typeof object.has === 'function' && + typeof object.set === 'function' && + object[Symbol.toStringTag] === 'FormData' + ) +} + +function throwIfAborted (signal) { + if (!signal) { return } + if (typeof signal.throwIfAborted === 'function') { + signal.throwIfAborted() + } else { + if (signal.aborted) { + // DOMException not available < v17.0.0 + const err = new Error('The operation was aborted') + err.name = 'AbortError' + throw err + } + } +} + +let events +function addAbortListener (signal, listener) { + if (typeof Symbol.dispose === 'symbol') { + if (!events) { + events = __nccwpck_require__(82361) + } + if (typeof events.addAbortListener === 'function' && 'aborted' in signal) { + return events.addAbortListener(signal, listener) + } + } + if ('addEventListener' in signal) { + signal.addEventListener('abort', listener, { once: true }) + return () => signal.removeEventListener('abort', listener) + } + signal.addListener('abort', listener) + return () => signal.removeListener('abort', listener) +} + +const hasToWellFormed = !!String.prototype.toWellFormed + +/** + * @param {string} val + */ +function toUSVString (val) { + if (hasToWellFormed) { + return `${val}`.toWellFormed() + } else if (nodeUtil.toUSVString) { + return nodeUtil.toUSVString(val) + } + + return `${val}` +} + +const kEnumerableProperty = Object.create(null) +kEnumerableProperty.enumerable = true + +module.exports = { + kEnumerableProperty, + nop, + isDisturbed, + isErrored, + isReadable, + toUSVString, + isReadableAborted, + isBlobLike, + parseOrigin, + parseURL, + getServerName, + isStream, + isIterable, + isAsyncIterable, + isDestroyed, + parseRawHeaders, + parseHeaders, + parseKeepAliveTimeout, + destroy, + bodyLength, + deepClone, + ReadableStreamFrom, + isBuffer, + validateHandler, + getSocketInfo, + isFormDataLike, + buildURL, + throwIfAborted, + addAbortListener, + nodeMajor, + nodeMinor, + nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13) +} + + +/***/ }), + +/***/ 74839: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const Dispatcher = __nccwpck_require__(60412) +const { + ClientDestroyedError, + ClientClosedError, + InvalidArgumentError +} = __nccwpck_require__(48045) +const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(72785) + +const kDestroyed = Symbol('destroyed') +const kClosed = Symbol('closed') +const kOnDestroyed = Symbol('onDestroyed') +const kOnClosed = Symbol('onClosed') +const kInterceptedDispatch = Symbol('Intercepted Dispatch') + +class DispatcherBase extends Dispatcher { + constructor () { + super() + + this[kDestroyed] = false + this[kOnDestroyed] = null + this[kClosed] = false + this[kOnClosed] = [] + } + + get destroyed () { + return this[kDestroyed] + } + + get closed () { + return this[kClosed] + } + + get interceptors () { + return this[kInterceptors] + } + + set interceptors (newInterceptors) { + if (newInterceptors) { + for (let i = newInterceptors.length - 1; i >= 0; i--) { + const interceptor = this[kInterceptors][i] + if (typeof interceptor !== 'function') { + throw new InvalidArgumentError('interceptor must be an function') + } + } + } + + this[kInterceptors] = newInterceptors + } + + close (callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + this.close((err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } + + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + if (this[kDestroyed]) { + queueMicrotask(() => callback(new ClientDestroyedError(), null)) + return + } + + if (this[kClosed]) { + if (this[kOnClosed]) { + this[kOnClosed].push(callback) + } else { + queueMicrotask(() => callback(null, null)) + } + return + } + + this[kClosed] = true + this[kOnClosed].push(callback) + + const onClosed = () => { + const callbacks = this[kOnClosed] + this[kOnClosed] = null + for (let i = 0; i < callbacks.length; i++) { + callbacks[i](null, null) + } + } + + // Should not error. + this[kClose]() + .then(() => this.destroy()) + .then(() => { + queueMicrotask(onClosed) + }) + } + + destroy (err, callback) { + if (typeof err === 'function') { + callback = err + err = null + } + + if (callback === undefined) { + return new Promise((resolve, reject) => { + this.destroy(err, (err, data) => { + return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data) + }) + }) + } + + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + if (this[kDestroyed]) { + if (this[kOnDestroyed]) { + this[kOnDestroyed].push(callback) + } else { + queueMicrotask(() => callback(null, null)) + } + return + } + + if (!err) { + err = new ClientDestroyedError() + } + + this[kDestroyed] = true + this[kOnDestroyed] = this[kOnDestroyed] || [] + this[kOnDestroyed].push(callback) + + const onDestroyed = () => { + const callbacks = this[kOnDestroyed] + this[kOnDestroyed] = null + for (let i = 0; i < callbacks.length; i++) { + callbacks[i](null, null) + } + } + + // Should not error. + this[kDestroy](err).then(() => { + queueMicrotask(onDestroyed) + }) + } + + [kInterceptedDispatch] (opts, handler) { + if (!this[kInterceptors] || this[kInterceptors].length === 0) { + this[kInterceptedDispatch] = this[kDispatch] + return this[kDispatch](opts, handler) + } + + let dispatch = this[kDispatch].bind(this) + for (let i = this[kInterceptors].length - 1; i >= 0; i--) { + dispatch = this[kInterceptors][i](dispatch) + } + this[kInterceptedDispatch] = dispatch + return dispatch(opts, handler) + } + + dispatch (opts, handler) { + if (!handler || typeof handler !== 'object') { + throw new InvalidArgumentError('handler must be an object') + } + + try { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('opts must be an object.') + } + + if (this[kDestroyed] || this[kOnDestroyed]) { + throw new ClientDestroyedError() + } + + if (this[kClosed]) { + throw new ClientClosedError() + } + + return this[kInterceptedDispatch](opts, handler) + } catch (err) { + if (typeof handler.onError !== 'function') { + throw new InvalidArgumentError('invalid onError method') + } + + handler.onError(err) + + return false + } + } +} + +module.exports = DispatcherBase + + +/***/ }), + +/***/ 60412: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const EventEmitter = __nccwpck_require__(82361) + +class Dispatcher extends EventEmitter { + dispatch () { + throw new Error('not implemented') + } + + close () { + throw new Error('not implemented') + } + + destroy () { + throw new Error('not implemented') + } +} + +module.exports = Dispatcher + + +/***/ }), + +/***/ 41472: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const Busboy = __nccwpck_require__(33438) +const util = __nccwpck_require__(83983) +const { + ReadableStreamFrom, + isBlobLike, + isReadableStreamLike, + readableStreamClose, + createDeferredPromise, + fullyReadBody +} = __nccwpck_require__(52538) +const { FormData } = __nccwpck_require__(72015) +const { kState } = __nccwpck_require__(15861) +const { webidl } = __nccwpck_require__(21744) +const { DOMException, structuredClone } = __nccwpck_require__(41037) +const { Blob, File: NativeFile } = __nccwpck_require__(14300) +const { kBodyUsed } = __nccwpck_require__(72785) +const assert = __nccwpck_require__(39491) +const { isErrored } = __nccwpck_require__(83983) +const { isUint8Array, isArrayBuffer } = __nccwpck_require__(29830) +const { File: UndiciFile } = __nccwpck_require__(78511) +const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685) + +let ReadableStream = globalThis.ReadableStream + +/** @type {globalThis['File']} */ +const File = NativeFile ?? UndiciFile +const textEncoder = new TextEncoder() +const textDecoder = new TextDecoder() + +// https://fetch.spec.whatwg.org/#concept-bodyinit-extract +function extractBody (object, keepalive = false) { + if (!ReadableStream) { + ReadableStream = (__nccwpck_require__(35356).ReadableStream) + } + + // 1. Let stream be null. + let stream = null + + // 2. If object is a ReadableStream object, then set stream to object. + if (object instanceof ReadableStream) { + stream = object + } else if (isBlobLike(object)) { + // 3. Otherwise, if object is a Blob object, set stream to the + // result of running object’s get stream. + stream = object.stream() + } else { + // 4. Otherwise, set stream to a new ReadableStream object, and set + // up stream. + stream = new ReadableStream({ + async pull (controller) { + controller.enqueue( + typeof source === 'string' ? textEncoder.encode(source) : source + ) + queueMicrotask(() => readableStreamClose(controller)) + }, + start () {}, + type: undefined + }) + } + + // 5. Assert: stream is a ReadableStream object. + assert(isReadableStreamLike(stream)) + + // 6. Let action be null. + let action = null + + // 7. Let source be null. + let source = null + + // 8. Let length be null. + let length = null + + // 9. Let type be null. + let type = null + + // 10. Switch on object: + if (typeof object === 'string') { + // Set source to the UTF-8 encoding of object. + // Note: setting source to a Uint8Array here breaks some mocking assumptions. + source = object + + // Set type to `text/plain;charset=UTF-8`. + type = 'text/plain;charset=UTF-8' + } else if (object instanceof URLSearchParams) { + // URLSearchParams + + // spec says to run application/x-www-form-urlencoded on body.list + // this is implemented in Node.js as apart of an URLSearchParams instance toString method + // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490 + // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100 + + // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list. + source = object.toString() + + // Set type to `application/x-www-form-urlencoded;charset=UTF-8`. + type = 'application/x-www-form-urlencoded;charset=UTF-8' + } else if (isArrayBuffer(object)) { + // BufferSource/ArrayBuffer + + // Set source to a copy of the bytes held by object. + source = new Uint8Array(object.slice()) + } else if (ArrayBuffer.isView(object)) { + // BufferSource/ArrayBufferView + + // Set source to a copy of the bytes held by object. + source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength)) + } else if (util.isFormDataLike(object)) { + const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}` + const prefix = `--${boundary}\r\nContent-Disposition: form-data` + + /*! formdata-polyfill. MIT License. Jimmy Wärting */ + const escape = (str) => + str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22') + const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, '\r\n') + + // Set action to this step: run the multipart/form-data + // encoding algorithm, with object’s entry list and UTF-8. + // - This ensures that the body is immutable and can't be changed afterwords + // - That the content-length is calculated in advance. + // - And that all parts are pre-encoded and ready to be sent. + + const blobParts = [] + const rn = new Uint8Array([13, 10]) // '\r\n' + length = 0 + let hasUnknownSizeValue = false + + for (const [name, value] of object) { + if (typeof value === 'string') { + const chunk = textEncoder.encode(prefix + + `; name="${escape(normalizeLinefeeds(name))}"` + + `\r\n\r\n${normalizeLinefeeds(value)}\r\n`) + blobParts.push(chunk) + length += chunk.byteLength + } else { + const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` + + (value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' + + `Content-Type: ${ + value.type || 'application/octet-stream' + }\r\n\r\n`) + blobParts.push(chunk, value, rn) + if (typeof value.size === 'number') { + length += chunk.byteLength + value.size + rn.byteLength + } else { + hasUnknownSizeValue = true + } + } + } + + const chunk = textEncoder.encode(`--${boundary}--`) + blobParts.push(chunk) + length += chunk.byteLength + if (hasUnknownSizeValue) { + length = null + } + + // Set source to object. + source = object + + action = async function * () { + for (const part of blobParts) { + if (part.stream) { + yield * part.stream() + } else { + yield part + } + } + } + + // Set type to `multipart/form-data; boundary=`, + // followed by the multipart/form-data boundary string generated + // by the multipart/form-data encoding algorithm. + type = 'multipart/form-data; boundary=' + boundary + } else if (isBlobLike(object)) { + // Blob + + // Set source to object. + source = object + + // Set length to object’s size. + length = object.size + + // If object’s type attribute is not the empty byte sequence, set + // type to its value. + if (object.type) { + type = object.type + } + } else if (typeof object[Symbol.asyncIterator] === 'function') { + // If keepalive is true, then throw a TypeError. + if (keepalive) { + throw new TypeError('keepalive') + } + + // If object is disturbed or locked, then throw a TypeError. + if (util.isDisturbed(object) || object.locked) { + throw new TypeError( + 'Response body object should not be disturbed or locked' + ) + } + + stream = + object instanceof ReadableStream ? object : ReadableStreamFrom(object) + } + + // 11. If source is a byte sequence, then set action to a + // step that returns source and length to source’s length. + if (typeof source === 'string' || util.isBuffer(source)) { + length = Buffer.byteLength(source) + } + + // 12. If action is non-null, then run these steps in in parallel: + if (action != null) { + // Run action. + let iterator + stream = new ReadableStream({ + async start () { + iterator = action(object)[Symbol.asyncIterator]() + }, + async pull (controller) { + const { value, done } = await iterator.next() + if (done) { + // When running action is done, close stream. + queueMicrotask(() => { + controller.close() + }) + } else { + // Whenever one or more bytes are available and stream is not errored, + // enqueue a Uint8Array wrapping an ArrayBuffer containing the available + // bytes into stream. + if (!isErrored(stream)) { + controller.enqueue(new Uint8Array(value)) + } + } + return controller.desiredSize > 0 + }, + async cancel (reason) { + await iterator.return() + }, + type: undefined + }) + } + + // 13. Let body be a body whose stream is stream, source is source, + // and length is length. + const body = { stream, source, length } + + // 14. Return (body, type). + return [body, type] +} + +// https://fetch.spec.whatwg.org/#bodyinit-safely-extract +function safelyExtractBody (object, keepalive = false) { + if (!ReadableStream) { + // istanbul ignore next + ReadableStream = (__nccwpck_require__(35356).ReadableStream) + } + + // To safely extract a body and a `Content-Type` value from + // a byte sequence or BodyInit object object, run these steps: + + // 1. If object is a ReadableStream object, then: + if (object instanceof ReadableStream) { + // Assert: object is neither disturbed nor locked. + // istanbul ignore next + assert(!util.isDisturbed(object), 'The body has already been consumed.') + // istanbul ignore next + assert(!object.locked, 'The stream is locked.') + } + + // 2. Return the results of extracting object. + return extractBody(object, keepalive) +} + +function cloneBody (body) { + // To clone a body body, run these steps: + + // https://fetch.spec.whatwg.org/#concept-body-clone + + // 1. Let « out1, out2 » be the result of teeing body’s stream. + const [out1, out2] = body.stream.tee() + const out2Clone = structuredClone(out2, { transfer: [out2] }) + // This, for whatever reasons, unrefs out2Clone which allows + // the process to exit by itself. + const [, finalClone] = out2Clone.tee() + + // 2. Set body’s stream to out1. + body.stream = out1 + + // 3. Return a body whose stream is out2 and other members are copied from body. + return { + stream: finalClone, + length: body.length, + source: body.source + } +} + +async function * consumeBody (body) { + if (body) { + if (isUint8Array(body)) { + yield body + } else { + const stream = body.stream + + if (util.isDisturbed(stream)) { + throw new TypeError('The body has already been consumed.') + } + + if (stream.locked) { + throw new TypeError('The stream is locked.') + } + + // Compat. + stream[kBodyUsed] = true + + yield * stream + } + } +} + +function throwIfAborted (state) { + if (state.aborted) { + throw new DOMException('The operation was aborted.', 'AbortError') + } +} + +function bodyMixinMethods (instance) { + const methods = { + blob () { + // The blob() method steps are to return the result of + // running consume body with this and the following step + // given a byte sequence bytes: return a Blob whose + // contents are bytes and whose type attribute is this’s + // MIME type. + return specConsumeBody(this, (bytes) => { + let mimeType = bodyMimeType(this) + + if (mimeType === 'failure') { + mimeType = '' + } else if (mimeType) { + mimeType = serializeAMimeType(mimeType) + } + + // Return a Blob whose contents are bytes and type attribute + // is mimeType. + return new Blob([bytes], { type: mimeType }) + }, instance) + }, + + arrayBuffer () { + // The arrayBuffer() method steps are to return the result + // of running consume body with this and the following step + // given a byte sequence bytes: return a new ArrayBuffer + // whose contents are bytes. + return specConsumeBody(this, (bytes) => { + return new Uint8Array(bytes).buffer + }, instance) + }, + + text () { + // The text() method steps are to return the result of running + // consume body with this and UTF-8 decode. + return specConsumeBody(this, utf8DecodeBytes, instance) + }, + + json () { + // The json() method steps are to return the result of running + // consume body with this and parse JSON from bytes. + return specConsumeBody(this, parseJSONFromBytes, instance) + }, + + async formData () { + webidl.brandCheck(this, instance) + + throwIfAborted(this[kState]) + + const contentType = this.headers.get('Content-Type') + + // If mimeType’s essence is "multipart/form-data", then: + if (/multipart\/form-data/.test(contentType)) { + const headers = {} + for (const [key, value] of this.headers) headers[key.toLowerCase()] = value + + const responseFormData = new FormData() + + let busboy + + try { + busboy = new Busboy({ + headers, + preservePath: true + }) + } catch (err) { + throw new DOMException(`${err}`, 'AbortError') + } + + busboy.on('field', (name, value) => { + responseFormData.append(name, value) + }) + busboy.on('file', (name, value, filename, encoding, mimeType) => { + const chunks = [] + + if (encoding === 'base64' || encoding.toLowerCase() === 'base64') { + let base64chunk = '' + + value.on('data', (chunk) => { + base64chunk += chunk.toString().replace(/[\r\n]/gm, '') + + const end = base64chunk.length - base64chunk.length % 4 + chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64')) + + base64chunk = base64chunk.slice(end) + }) + value.on('end', () => { + chunks.push(Buffer.from(base64chunk, 'base64')) + responseFormData.append(name, new File(chunks, filename, { type: mimeType })) + }) + } else { + value.on('data', (chunk) => { + chunks.push(chunk) + }) + value.on('end', () => { + responseFormData.append(name, new File(chunks, filename, { type: mimeType })) + }) + } + }) + + const busboyResolve = new Promise((resolve, reject) => { + busboy.on('finish', resolve) + busboy.on('error', (err) => reject(new TypeError(err))) + }) + + if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk) + busboy.end() + await busboyResolve + + return responseFormData + } else if (/application\/x-www-form-urlencoded/.test(contentType)) { + // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then: + + // 1. Let entries be the result of parsing bytes. + let entries + try { + let text = '' + // application/x-www-form-urlencoded parser will keep the BOM. + // https://url.spec.whatwg.org/#concept-urlencoded-parser + // Note that streaming decoder is stateful and cannot be reused + const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true }) + + for await (const chunk of consumeBody(this[kState].body)) { + if (!isUint8Array(chunk)) { + throw new TypeError('Expected Uint8Array chunk') + } + text += streamingDecoder.decode(chunk, { stream: true }) + } + text += streamingDecoder.decode() + entries = new URLSearchParams(text) + } catch (err) { + // istanbul ignore next: Unclear when new URLSearchParams can fail on a string. + // 2. If entries is failure, then throw a TypeError. + throw Object.assign(new TypeError(), { cause: err }) + } + + // 3. Return a new FormData object whose entries are entries. + const formData = new FormData() + for (const [name, value] of entries) { + formData.append(name, value) + } + return formData + } else { + // Wait a tick before checking if the request has been aborted. + // Otherwise, a TypeError can be thrown when an AbortError should. + await Promise.resolve() + + throwIfAborted(this[kState]) + + // Otherwise, throw a TypeError. + throw webidl.errors.exception({ + header: `${instance.name}.formData`, + message: 'Could not parse content as FormData.' + }) + } + } + } + + return methods +} + +function mixinBody (prototype) { + Object.assign(prototype.prototype, bodyMixinMethods(prototype)) +} + +/** + * @see https://fetch.spec.whatwg.org/#concept-body-consume-body + * @param {Response|Request} object + * @param {(value: unknown) => unknown} convertBytesToJSValue + * @param {Response|Request} instance + */ +async function specConsumeBody (object, convertBytesToJSValue, instance) { + webidl.brandCheck(object, instance) + + throwIfAborted(object[kState]) + + // 1. If object is unusable, then return a promise rejected + // with a TypeError. + if (bodyUnusable(object[kState].body)) { + throw new TypeError('Body is unusable') + } + + // 2. Let promise be a new promise. + const promise = createDeferredPromise() + + // 3. Let errorSteps given error be to reject promise with error. + const errorSteps = (error) => promise.reject(error) + + // 4. Let successSteps given a byte sequence data be to resolve + // promise with the result of running convertBytesToJSValue + // with data. If that threw an exception, then run errorSteps + // with that exception. + const successSteps = (data) => { + try { + promise.resolve(convertBytesToJSValue(data)) + } catch (e) { + errorSteps(e) + } + } + + // 5. If object’s body is null, then run successSteps with an + // empty byte sequence. + if (object[kState].body == null) { + successSteps(new Uint8Array()) + return promise.promise + } + + // 6. Otherwise, fully read object’s body given successSteps, + // errorSteps, and object’s relevant global object. + await fullyReadBody(object[kState].body, successSteps, errorSteps) + + // 7. Return promise. + return promise.promise +} + +// https://fetch.spec.whatwg.org/#body-unusable +function bodyUnusable (body) { + // An object including the Body interface mixin is + // said to be unusable if its body is non-null and + // its body’s stream is disturbed or locked. + return body != null && (body.stream.locked || util.isDisturbed(body.stream)) +} + +/** + * @see https://encoding.spec.whatwg.org/#utf-8-decode + * @param {Buffer} buffer + */ +function utf8DecodeBytes (buffer) { + if (buffer.length === 0) { + return '' + } + + // 1. Let buffer be the result of peeking three bytes from + // ioQueue, converted to a byte sequence. + + // 2. If buffer is 0xEF 0xBB 0xBF, then read three + // bytes from ioQueue. (Do nothing with those bytes.) + if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) { + buffer = buffer.subarray(3) + } + + // 3. Process a queue with an instance of UTF-8’s + // decoder, ioQueue, output, and "replacement". + const output = textDecoder.decode(buffer) + + // 4. Return output. + return output +} + +/** + * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value + * @param {Uint8Array} bytes + */ +function parseJSONFromBytes (bytes) { + return JSON.parse(utf8DecodeBytes(bytes)) +} + +/** + * @see https://fetch.spec.whatwg.org/#concept-body-mime-type + * @param {import('./response').Response|import('./request').Request} object + */ +function bodyMimeType (object) { + const { headersList } = object[kState] + const contentType = headersList.get('content-type') + + if (contentType === null) { + return 'failure' + } + + return parseMIMEType(contentType) +} + +module.exports = { + extractBody, + safelyExtractBody, + cloneBody, + mixinBody +} + + +/***/ }), + +/***/ 41037: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(71267) + +const corsSafeListedMethods = ['GET', 'HEAD', 'POST'] +const corsSafeListedMethodsSet = new Set(corsSafeListedMethods) + +const nullBodyStatus = [101, 204, 205, 304] + +const redirectStatus = [301, 302, 303, 307, 308] +const redirectStatusSet = new Set(redirectStatus) + +// https://fetch.spec.whatwg.org/#block-bad-port +const badPorts = [ + '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79', + '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137', + '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532', + '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723', + '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697', + '10080' +] + +const badPortsSet = new Set(badPorts) + +// https://w3c.github.io/webappsec-referrer-policy/#referrer-policies +const referrerPolicy = [ + '', + 'no-referrer', + 'no-referrer-when-downgrade', + 'same-origin', + 'origin', + 'strict-origin', + 'origin-when-cross-origin', + 'strict-origin-when-cross-origin', + 'unsafe-url' +] +const referrerPolicySet = new Set(referrerPolicy) + +const requestRedirect = ['follow', 'manual', 'error'] + +const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE'] +const safeMethodsSet = new Set(safeMethods) + +const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors'] + +const requestCredentials = ['omit', 'same-origin', 'include'] + +const requestCache = [ + 'default', + 'no-store', + 'reload', + 'no-cache', + 'force-cache', + 'only-if-cached' +] + +// https://fetch.spec.whatwg.org/#request-body-header-name +const requestBodyHeader = [ + 'content-encoding', + 'content-language', + 'content-location', + 'content-type', + // See https://github.com/nodejs/undici/issues/2021 + // 'Content-Length' is a forbidden header name, which is typically + // removed in the Headers implementation. However, undici doesn't + // filter out headers, so we add it here. + 'content-length' +] + +// https://fetch.spec.whatwg.org/#enumdef-requestduplex +const requestDuplex = [ + 'half' +] + +// http://fetch.spec.whatwg.org/#forbidden-method +const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK'] +const forbiddenMethodsSet = new Set(forbiddenMethods) + +const subresource = [ + 'audio', + 'audioworklet', + 'font', + 'image', + 'manifest', + 'paintworklet', + 'script', + 'style', + 'track', + 'video', + 'xslt', + '' +] +const subresourceSet = new Set(subresource) + +/** @type {globalThis['DOMException']} */ +const DOMException = globalThis.DOMException ?? (() => { + // DOMException was only made a global in Node v17.0.0, + // but fetch supports >= v16.8. + try { + atob('~') + } catch (err) { + return Object.getPrototypeOf(err).constructor + } +})() + +let channel + +/** @type {globalThis['structuredClone']} */ +const structuredClone = + globalThis.structuredClone ?? + // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js + // structuredClone was added in v17.0.0, but fetch supports v16.8 + function structuredClone (value, options = undefined) { + if (arguments.length === 0) { + throw new TypeError('missing argument') + } + + if (!channel) { + channel = new MessageChannel() + } + channel.port1.unref() + channel.port2.unref() + channel.port1.postMessage(value, options?.transfer) + return receiveMessageOnPort(channel.port2).message + } + +module.exports = { + DOMException, + structuredClone, + subresource, + forbiddenMethods, + requestBodyHeader, + referrerPolicy, + requestRedirect, + requestMode, + requestCredentials, + requestCache, + redirectStatus, + corsSafeListedMethods, + nullBodyStatus, + safeMethods, + badPorts, + requestDuplex, + subresourceSet, + badPortsSet, + redirectStatusSet, + corsSafeListedMethodsSet, + safeMethodsSet, + forbiddenMethodsSet, + referrerPolicySet +} + + +/***/ }), + +/***/ 685: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const assert = __nccwpck_require__(39491) +const { atob } = __nccwpck_require__(14300) +const { isomorphicDecode } = __nccwpck_require__(52538) + +const encoder = new TextEncoder() + +/** + * @see https://mimesniff.spec.whatwg.org/#http-token-code-point + */ +const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/ +const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line +/** + * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point + */ +const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line + +// https://fetch.spec.whatwg.org/#data-url-processor +/** @param {URL} dataURL */ +function dataURLProcessor (dataURL) { + // 1. Assert: dataURL’s scheme is "data". + assert(dataURL.protocol === 'data:') + + // 2. Let input be the result of running the URL + // serializer on dataURL with exclude fragment + // set to true. + let input = URLSerializer(dataURL, true) + + // 3. Remove the leading "data:" string from input. + input = input.slice(5) + + // 4. Let position point at the start of input. + const position = { position: 0 } + + // 5. Let mimeType be the result of collecting a + // sequence of code points that are not equal + // to U+002C (,), given position. + let mimeType = collectASequenceOfCodePointsFast( + ',', + input, + position + ) + + // 6. Strip leading and trailing ASCII whitespace + // from mimeType. + // Undici implementation note: we need to store the + // length because if the mimetype has spaces removed, + // the wrong amount will be sliced from the input in + // step #9 + const mimeTypeLength = mimeType.length + mimeType = removeASCIIWhitespace(mimeType, true, true) + + // 7. If position is past the end of input, then + // return failure + if (position.position >= input.length) { + return 'failure' + } + + // 8. Advance position by 1. + position.position++ + + // 9. Let encodedBody be the remainder of input. + const encodedBody = input.slice(mimeTypeLength + 1) + + // 10. Let body be the percent-decoding of encodedBody. + let body = stringPercentDecode(encodedBody) + + // 11. If mimeType ends with U+003B (;), followed by + // zero or more U+0020 SPACE, followed by an ASCII + // case-insensitive match for "base64", then: + if (/;(\u0020){0,}base64$/i.test(mimeType)) { + // 1. Let stringBody be the isomorphic decode of body. + const stringBody = isomorphicDecode(body) + + // 2. Set body to the forgiving-base64 decode of + // stringBody. + body = forgivingBase64(stringBody) + + // 3. If body is failure, then return failure. + if (body === 'failure') { + return 'failure' + } + + // 4. Remove the last 6 code points from mimeType. + mimeType = mimeType.slice(0, -6) + + // 5. Remove trailing U+0020 SPACE code points from mimeType, + // if any. + mimeType = mimeType.replace(/(\u0020)+$/, '') + + // 6. Remove the last U+003B (;) code point from mimeType. + mimeType = mimeType.slice(0, -1) + } + + // 12. If mimeType starts with U+003B (;), then prepend + // "text/plain" to mimeType. + if (mimeType.startsWith(';')) { + mimeType = 'text/plain' + mimeType + } + + // 13. Let mimeTypeRecord be the result of parsing + // mimeType. + let mimeTypeRecord = parseMIMEType(mimeType) + + // 14. If mimeTypeRecord is failure, then set + // mimeTypeRecord to text/plain;charset=US-ASCII. + if (mimeTypeRecord === 'failure') { + mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII') + } + + // 15. Return a new data: URL struct whose MIME + // type is mimeTypeRecord and body is body. + // https://fetch.spec.whatwg.org/#data-url-struct + return { mimeType: mimeTypeRecord, body } +} + +// https://url.spec.whatwg.org/#concept-url-serializer +/** + * @param {URL} url + * @param {boolean} excludeFragment + */ +function URLSerializer (url, excludeFragment = false) { + const href = url.href + + if (!excludeFragment) { + return href + } + + const hash = href.lastIndexOf('#') + if (hash === -1) { + return href + } + return href.slice(0, hash) +} + +// https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points +/** + * @param {(char: string) => boolean} condition + * @param {string} input + * @param {{ position: number }} position + */ +function collectASequenceOfCodePoints (condition, input, position) { + // 1. Let result be the empty string. + let result = '' + + // 2. While position doesn’t point past the end of input and the + // code point at position within input meets the condition condition: + while (position.position < input.length && condition(input[position.position])) { + // 1. Append that code point to the end of result. + result += input[position.position] + + // 2. Advance position by 1. + position.position++ + } + + // 3. Return result. + return result +} + +/** + * A faster collectASequenceOfCodePoints that only works when comparing a single character. + * @param {string} char + * @param {string} input + * @param {{ position: number }} position + */ +function collectASequenceOfCodePointsFast (char, input, position) { + const idx = input.indexOf(char, position.position) + const start = position.position + + if (idx === -1) { + position.position = input.length + return input.slice(start) + } + + position.position = idx + return input.slice(start, position.position) +} + +// https://url.spec.whatwg.org/#string-percent-decode +/** @param {string} input */ +function stringPercentDecode (input) { + // 1. Let bytes be the UTF-8 encoding of input. + const bytes = encoder.encode(input) + + // 2. Return the percent-decoding of bytes. + return percentDecode(bytes) +} + +// https://url.spec.whatwg.org/#percent-decode +/** @param {Uint8Array} input */ +function percentDecode (input) { + // 1. Let output be an empty byte sequence. + /** @type {number[]} */ + const output = [] + + // 2. For each byte byte in input: + for (let i = 0; i < input.length; i++) { + const byte = input[i] + + // 1. If byte is not 0x25 (%), then append byte to output. + if (byte !== 0x25) { + output.push(byte) + + // 2. Otherwise, if byte is 0x25 (%) and the next two bytes + // after byte in input are not in the ranges + // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F), + // and 0x61 (a) to 0x66 (f), all inclusive, append byte + // to output. + } else if ( + byte === 0x25 && + !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2])) + ) { + output.push(0x25) + + // 3. Otherwise: + } else { + // 1. Let bytePoint be the two bytes after byte in input, + // decoded, and then interpreted as hexadecimal number. + const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2]) + const bytePoint = Number.parseInt(nextTwoBytes, 16) + + // 2. Append a byte whose value is bytePoint to output. + output.push(bytePoint) + + // 3. Skip the next two bytes in input. + i += 2 + } + } + + // 3. Return output. + return Uint8Array.from(output) +} + +// https://mimesniff.spec.whatwg.org/#parse-a-mime-type +/** @param {string} input */ +function parseMIMEType (input) { + // 1. Remove any leading and trailing HTTP whitespace + // from input. + input = removeHTTPWhitespace(input, true, true) + + // 2. Let position be a position variable for input, + // initially pointing at the start of input. + const position = { position: 0 } + + // 3. Let type be the result of collecting a sequence + // of code points that are not U+002F (/) from + // input, given position. + const type = collectASequenceOfCodePointsFast( + '/', + input, + position + ) + + // 4. If type is the empty string or does not solely + // contain HTTP token code points, then return failure. + // https://mimesniff.spec.whatwg.org/#http-token-code-point + if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) { + return 'failure' + } + + // 5. If position is past the end of input, then return + // failure + if (position.position > input.length) { + return 'failure' + } + + // 6. Advance position by 1. (This skips past U+002F (/).) + position.position++ + + // 7. Let subtype be the result of collecting a sequence of + // code points that are not U+003B (;) from input, given + // position. + let subtype = collectASequenceOfCodePointsFast( + ';', + input, + position + ) + + // 8. Remove any trailing HTTP whitespace from subtype. + subtype = removeHTTPWhitespace(subtype, false, true) + + // 9. If subtype is the empty string or does not solely + // contain HTTP token code points, then return failure. + if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) { + return 'failure' + } + + const typeLowercase = type.toLowerCase() + const subtypeLowercase = subtype.toLowerCase() + + // 10. Let mimeType be a new MIME type record whose type + // is type, in ASCII lowercase, and subtype is subtype, + // in ASCII lowercase. + // https://mimesniff.spec.whatwg.org/#mime-type + const mimeType = { + type: typeLowercase, + subtype: subtypeLowercase, + /** @type {Map} */ + parameters: new Map(), + // https://mimesniff.spec.whatwg.org/#mime-type-essence + essence: `${typeLowercase}/${subtypeLowercase}` + } + + // 11. While position is not past the end of input: + while (position.position < input.length) { + // 1. Advance position by 1. (This skips past U+003B (;).) + position.position++ + + // 2. Collect a sequence of code points that are HTTP + // whitespace from input given position. + collectASequenceOfCodePoints( + // https://fetch.spec.whatwg.org/#http-whitespace + char => HTTP_WHITESPACE_REGEX.test(char), + input, + position + ) + + // 3. Let parameterName be the result of collecting a + // sequence of code points that are not U+003B (;) + // or U+003D (=) from input, given position. + let parameterName = collectASequenceOfCodePoints( + (char) => char !== ';' && char !== '=', + input, + position + ) + + // 4. Set parameterName to parameterName, in ASCII + // lowercase. + parameterName = parameterName.toLowerCase() + + // 5. If position is not past the end of input, then: + if (position.position < input.length) { + // 1. If the code point at position within input is + // U+003B (;), then continue. + if (input[position.position] === ';') { + continue + } + + // 2. Advance position by 1. (This skips past U+003D (=).) + position.position++ + } + + // 6. If position is past the end of input, then break. + if (position.position > input.length) { + break + } + + // 7. Let parameterValue be null. + let parameterValue = null + + // 8. If the code point at position within input is + // U+0022 ("), then: + if (input[position.position] === '"') { + // 1. Set parameterValue to the result of collecting + // an HTTP quoted string from input, given position + // and the extract-value flag. + parameterValue = collectAnHTTPQuotedString(input, position, true) + + // 2. Collect a sequence of code points that are not + // U+003B (;) from input, given position. + collectASequenceOfCodePointsFast( + ';', + input, + position + ) + + // 9. Otherwise: + } else { + // 1. Set parameterValue to the result of collecting + // a sequence of code points that are not U+003B (;) + // from input, given position. + parameterValue = collectASequenceOfCodePointsFast( + ';', + input, + position + ) + + // 2. Remove any trailing HTTP whitespace from parameterValue. + parameterValue = removeHTTPWhitespace(parameterValue, false, true) + + // 3. If parameterValue is the empty string, then continue. + if (parameterValue.length === 0) { + continue + } + } + + // 10. If all of the following are true + // - parameterName is not the empty string + // - parameterName solely contains HTTP token code points + // - parameterValue solely contains HTTP quoted-string token code points + // - mimeType’s parameters[parameterName] does not exist + // then set mimeType’s parameters[parameterName] to parameterValue. + if ( + parameterName.length !== 0 && + HTTP_TOKEN_CODEPOINTS.test(parameterName) && + (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) && + !mimeType.parameters.has(parameterName) + ) { + mimeType.parameters.set(parameterName, parameterValue) + } + } + + // 12. Return mimeType. + return mimeType +} + +// https://infra.spec.whatwg.org/#forgiving-base64-decode +/** @param {string} data */ +function forgivingBase64 (data) { + // 1. Remove all ASCII whitespace from data. + data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line + + // 2. If data’s code point length divides by 4 leaving + // no remainder, then: + if (data.length % 4 === 0) { + // 1. If data ends with one or two U+003D (=) code points, + // then remove them from data. + data = data.replace(/=?=$/, '') + } + + // 3. If data’s code point length divides by 4 leaving + // a remainder of 1, then return failure. + if (data.length % 4 === 1) { + return 'failure' + } + + // 4. If data contains a code point that is not one of + // U+002B (+) + // U+002F (/) + // ASCII alphanumeric + // then return failure. + if (/[^+/0-9A-Za-z]/.test(data)) { + return 'failure' + } + + const binary = atob(data) + const bytes = new Uint8Array(binary.length) + + for (let byte = 0; byte < binary.length; byte++) { + bytes[byte] = binary.charCodeAt(byte) + } + + return bytes +} + +// https://fetch.spec.whatwg.org/#collect-an-http-quoted-string +// tests: https://fetch.spec.whatwg.org/#example-http-quoted-string +/** + * @param {string} input + * @param {{ position: number }} position + * @param {boolean?} extractValue + */ +function collectAnHTTPQuotedString (input, position, extractValue) { + // 1. Let positionStart be position. + const positionStart = position.position + + // 2. Let value be the empty string. + let value = '' + + // 3. Assert: the code point at position within input + // is U+0022 ("). + assert(input[position.position] === '"') + + // 4. Advance position by 1. + position.position++ + + // 5. While true: + while (true) { + // 1. Append the result of collecting a sequence of code points + // that are not U+0022 (") or U+005C (\) from input, given + // position, to value. + value += collectASequenceOfCodePoints( + (char) => char !== '"' && char !== '\\', + input, + position + ) + + // 2. If position is past the end of input, then break. + if (position.position >= input.length) { + break + } + + // 3. Let quoteOrBackslash be the code point at position within + // input. + const quoteOrBackslash = input[position.position] + + // 4. Advance position by 1. + position.position++ + + // 5. If quoteOrBackslash is U+005C (\), then: + if (quoteOrBackslash === '\\') { + // 1. If position is past the end of input, then append + // U+005C (\) to value and break. + if (position.position >= input.length) { + value += '\\' + break + } + + // 2. Append the code point at position within input to value. + value += input[position.position] + + // 3. Advance position by 1. + position.position++ + + // 6. Otherwise: + } else { + // 1. Assert: quoteOrBackslash is U+0022 ("). + assert(quoteOrBackslash === '"') + + // 2. Break. + break + } + } + + // 6. If the extract-value flag is set, then return value. + if (extractValue) { + return value + } + + // 7. Return the code points from positionStart to position, + // inclusive, within input. + return input.slice(positionStart, position.position) +} + +/** + * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type + */ +function serializeAMimeType (mimeType) { + assert(mimeType !== 'failure') + const { parameters, essence } = mimeType + + // 1. Let serialization be the concatenation of mimeType’s + // type, U+002F (/), and mimeType’s subtype. + let serialization = essence + + // 2. For each name → value of mimeType’s parameters: + for (let [name, value] of parameters.entries()) { + // 1. Append U+003B (;) to serialization. + serialization += ';' + + // 2. Append name to serialization. + serialization += name + + // 3. Append U+003D (=) to serialization. + serialization += '=' + + // 4. If value does not solely contain HTTP token code + // points or value is the empty string, then: + if (!HTTP_TOKEN_CODEPOINTS.test(value)) { + // 1. Precede each occurence of U+0022 (") or + // U+005C (\) in value with U+005C (\). + value = value.replace(/(\\|")/g, '\\$1') + + // 2. Prepend U+0022 (") to value. + value = '"' + value + + // 3. Append U+0022 (") to value. + value += '"' + } + + // 5. Append value to serialization. + serialization += value + } + + // 3. Return serialization. + return serialization +} + +/** + * @see https://fetch.spec.whatwg.org/#http-whitespace + * @param {string} char + */ +function isHTTPWhiteSpace (char) { + return char === '\r' || char === '\n' || char === '\t' || char === ' ' +} + +/** + * @see https://fetch.spec.whatwg.org/#http-whitespace + * @param {string} str + */ +function removeHTTPWhitespace (str, leading = true, trailing = true) { + let lead = 0 + let trail = str.length - 1 + + if (leading) { + for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++); + } + + if (trailing) { + for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--); + } + + return str.slice(lead, trail + 1) +} + +/** + * @see https://infra.spec.whatwg.org/#ascii-whitespace + * @param {string} char + */ +function isASCIIWhitespace (char) { + return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' ' +} + +/** + * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace + */ +function removeASCIIWhitespace (str, leading = true, trailing = true) { + let lead = 0 + let trail = str.length - 1 + + if (leading) { + for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++); + } + + if (trailing) { + for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--); + } + + return str.slice(lead, trail + 1) +} + +module.exports = { + dataURLProcessor, + URLSerializer, + collectASequenceOfCodePoints, + collectASequenceOfCodePointsFast, + stringPercentDecode, + parseMIMEType, + collectAnHTTPQuotedString, + serializeAMimeType +} + + +/***/ }), + +/***/ 78511: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { Blob, File: NativeFile } = __nccwpck_require__(14300) +const { types } = __nccwpck_require__(73837) +const { kState } = __nccwpck_require__(15861) +const { isBlobLike } = __nccwpck_require__(52538) +const { webidl } = __nccwpck_require__(21744) +const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685) +const { kEnumerableProperty } = __nccwpck_require__(83983) +const encoder = new TextEncoder() + +class File extends Blob { + constructor (fileBits, fileName, options = {}) { + // The File constructor is invoked with two or three parameters, depending + // on whether the optional dictionary parameter is used. When the File() + // constructor is invoked, user agents must run the following steps: + webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' }) + + fileBits = webidl.converters['sequence'](fileBits) + fileName = webidl.converters.USVString(fileName) + options = webidl.converters.FilePropertyBag(options) + + // 1. Let bytes be the result of processing blob parts given fileBits and + // options. + // Note: Blob handles this for us + + // 2. Let n be the fileName argument to the constructor. + const n = fileName + + // 3. Process FilePropertyBag dictionary argument by running the following + // substeps: + + // 1. If the type member is provided and is not the empty string, let t + // be set to the type dictionary member. If t contains any characters + // outside the range U+0020 to U+007E, then set t to the empty string + // and return from these substeps. + // 2. Convert every character in t to ASCII lowercase. + let t = options.type + let d + + // eslint-disable-next-line no-labels + substep: { + if (t) { + t = parseMIMEType(t) + + if (t === 'failure') { + t = '' + // eslint-disable-next-line no-labels + break substep + } + + t = serializeAMimeType(t).toLowerCase() + } + + // 3. If the lastModified member is provided, let d be set to the + // lastModified dictionary member. If it is not provided, set d to the + // current date and time represented as the number of milliseconds since + // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]). + d = options.lastModified + } + + // 4. Return a new File object F such that: + // F refers to the bytes byte sequence. + // F.size is set to the number of total bytes in bytes. + // F.name is set to n. + // F.type is set to t. + // F.lastModified is set to d. + + super(processBlobParts(fileBits, options), { type: t }) + this[kState] = { + name: n, + lastModified: d, + type: t + } + } + + get name () { + webidl.brandCheck(this, File) + + return this[kState].name + } + + get lastModified () { + webidl.brandCheck(this, File) + + return this[kState].lastModified + } + + get type () { + webidl.brandCheck(this, File) + + return this[kState].type + } +} + +class FileLike { + constructor (blobLike, fileName, options = {}) { + // TODO: argument idl type check + + // The File constructor is invoked with two or three parameters, depending + // on whether the optional dictionary parameter is used. When the File() + // constructor is invoked, user agents must run the following steps: + + // 1. Let bytes be the result of processing blob parts given fileBits and + // options. + + // 2. Let n be the fileName argument to the constructor. + const n = fileName + + // 3. Process FilePropertyBag dictionary argument by running the following + // substeps: + + // 1. If the type member is provided and is not the empty string, let t + // be set to the type dictionary member. If t contains any characters + // outside the range U+0020 to U+007E, then set t to the empty string + // and return from these substeps. + // TODO + const t = options.type + + // 2. Convert every character in t to ASCII lowercase. + // TODO + + // 3. If the lastModified member is provided, let d be set to the + // lastModified dictionary member. If it is not provided, set d to the + // current date and time represented as the number of milliseconds since + // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]). + const d = options.lastModified ?? Date.now() + + // 4. Return a new File object F such that: + // F refers to the bytes byte sequence. + // F.size is set to the number of total bytes in bytes. + // F.name is set to n. + // F.type is set to t. + // F.lastModified is set to d. + + this[kState] = { + blobLike, + name: n, + type: t, + lastModified: d + } + } + + stream (...args) { + webidl.brandCheck(this, FileLike) + + return this[kState].blobLike.stream(...args) + } + + arrayBuffer (...args) { + webidl.brandCheck(this, FileLike) + + return this[kState].blobLike.arrayBuffer(...args) + } + + slice (...args) { + webidl.brandCheck(this, FileLike) + + return this[kState].blobLike.slice(...args) + } + + text (...args) { + webidl.brandCheck(this, FileLike) + + return this[kState].blobLike.text(...args) + } + + get size () { + webidl.brandCheck(this, FileLike) + + return this[kState].blobLike.size + } + + get type () { + webidl.brandCheck(this, FileLike) + + return this[kState].blobLike.type + } + + get name () { + webidl.brandCheck(this, FileLike) + + return this[kState].name + } + + get lastModified () { + webidl.brandCheck(this, FileLike) + + return this[kState].lastModified + } + + get [Symbol.toStringTag] () { + return 'File' + } +} + +Object.defineProperties(File.prototype, { + [Symbol.toStringTag]: { + value: 'File', + configurable: true + }, + name: kEnumerableProperty, + lastModified: kEnumerableProperty +}) + +webidl.converters.Blob = webidl.interfaceConverter(Blob) + +webidl.converters.BlobPart = function (V, opts) { + if (webidl.util.Type(V) === 'Object') { + if (isBlobLike(V)) { + return webidl.converters.Blob(V, { strict: false }) + } + + if ( + ArrayBuffer.isView(V) || + types.isAnyArrayBuffer(V) + ) { + return webidl.converters.BufferSource(V, opts) + } + } + + return webidl.converters.USVString(V, opts) +} + +webidl.converters['sequence'] = webidl.sequenceConverter( + webidl.converters.BlobPart +) + +// https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag +webidl.converters.FilePropertyBag = webidl.dictionaryConverter([ + { + key: 'lastModified', + converter: webidl.converters['long long'], + get defaultValue () { + return Date.now() + } + }, + { + key: 'type', + converter: webidl.converters.DOMString, + defaultValue: '' + }, + { + key: 'endings', + converter: (value) => { + value = webidl.converters.DOMString(value) + value = value.toLowerCase() + + if (value !== 'native') { + value = 'transparent' + } + + return value + }, + defaultValue: 'transparent' + } +]) + +/** + * @see https://www.w3.org/TR/FileAPI/#process-blob-parts + * @param {(NodeJS.TypedArray|Blob|string)[]} parts + * @param {{ type: string, endings: string }} options + */ +function processBlobParts (parts, options) { + // 1. Let bytes be an empty sequence of bytes. + /** @type {NodeJS.TypedArray[]} */ + const bytes = [] + + // 2. For each element in parts: + for (const element of parts) { + // 1. If element is a USVString, run the following substeps: + if (typeof element === 'string') { + // 1. Let s be element. + let s = element + + // 2. If the endings member of options is "native", set s + // to the result of converting line endings to native + // of element. + if (options.endings === 'native') { + s = convertLineEndingsNative(s) + } + + // 3. Append the result of UTF-8 encoding s to bytes. + bytes.push(encoder.encode(s)) + } else if ( + types.isAnyArrayBuffer(element) || + types.isTypedArray(element) + ) { + // 2. If element is a BufferSource, get a copy of the + // bytes held by the buffer source, and append those + // bytes to bytes. + if (!element.buffer) { // ArrayBuffer + bytes.push(new Uint8Array(element)) + } else { + bytes.push( + new Uint8Array(element.buffer, element.byteOffset, element.byteLength) + ) + } + } else if (isBlobLike(element)) { + // 3. If element is a Blob, append the bytes it represents + // to bytes. + bytes.push(element) + } + } + + // 3. Return bytes. + return bytes +} + +/** + * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native + * @param {string} s + */ +function convertLineEndingsNative (s) { + // 1. Let native line ending be be the code point U+000A LF. + let nativeLineEnding = '\n' + + // 2. If the underlying platform’s conventions are to + // represent newlines as a carriage return and line feed + // sequence, set native line ending to the code point + // U+000D CR followed by the code point U+000A LF. + if (process.platform === 'win32') { + nativeLineEnding = '\r\n' + } + + return s.replace(/\r?\n/g, nativeLineEnding) +} + +// If this function is moved to ./util.js, some tools (such as +// rollup) will warn about circular dependencies. See: +// https://github.com/nodejs/undici/issues/1629 +function isFileLike (object) { + return ( + (NativeFile && object instanceof NativeFile) || + object instanceof File || ( + object && + (typeof object.stream === 'function' || + typeof object.arrayBuffer === 'function') && + object[Symbol.toStringTag] === 'File' + ) + ) +} + +module.exports = { File, FileLike, isFileLike } + + +/***/ }), + +/***/ 72015: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(52538) +const { kState } = __nccwpck_require__(15861) +const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(78511) +const { webidl } = __nccwpck_require__(21744) +const { Blob, File: NativeFile } = __nccwpck_require__(14300) + +/** @type {globalThis['File']} */ +const File = NativeFile ?? UndiciFile + +// https://xhr.spec.whatwg.org/#formdata +class FormData { + constructor (form) { + if (form !== undefined) { + throw webidl.errors.conversionFailed({ + prefix: 'FormData constructor', + argument: 'Argument 1', + types: ['undefined'] + }) + } + + this[kState] = [] + } + + append (name, value, filename = undefined) { + webidl.brandCheck(this, FormData) + + webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' }) + + if (arguments.length === 3 && !isBlobLike(value)) { + throw new TypeError( + "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'" + ) + } + + // 1. Let value be value if given; otherwise blobValue. + + name = webidl.converters.USVString(name) + value = isBlobLike(value) + ? webidl.converters.Blob(value, { strict: false }) + : webidl.converters.USVString(value) + filename = arguments.length === 3 + ? webidl.converters.USVString(filename) + : undefined + + // 2. Let entry be the result of creating an entry with + // name, value, and filename if given. + const entry = makeEntry(name, value, filename) + + // 3. Append entry to this’s entry list. + this[kState].push(entry) + } + + delete (name) { + webidl.brandCheck(this, FormData) + + webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' }) + + name = webidl.converters.USVString(name) + + // The delete(name) method steps are to remove all entries whose name + // is name from this’s entry list. + this[kState] = this[kState].filter(entry => entry.name !== name) + } + + get (name) { + webidl.brandCheck(this, FormData) + + webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' }) + + name = webidl.converters.USVString(name) + + // 1. If there is no entry whose name is name in this’s entry list, + // then return null. + const idx = this[kState].findIndex((entry) => entry.name === name) + if (idx === -1) { + return null + } + + // 2. Return the value of the first entry whose name is name from + // this’s entry list. + return this[kState][idx].value + } + + getAll (name) { + webidl.brandCheck(this, FormData) + + webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' }) + + name = webidl.converters.USVString(name) + + // 1. If there is no entry whose name is name in this’s entry list, + // then return the empty list. + // 2. Return the values of all entries whose name is name, in order, + // from this’s entry list. + return this[kState] + .filter((entry) => entry.name === name) + .map((entry) => entry.value) + } + + has (name) { + webidl.brandCheck(this, FormData) + + webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' }) + + name = webidl.converters.USVString(name) + + // The has(name) method steps are to return true if there is an entry + // whose name is name in this’s entry list; otherwise false. + return this[kState].findIndex((entry) => entry.name === name) !== -1 + } + + set (name, value, filename = undefined) { + webidl.brandCheck(this, FormData) + + webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' }) + + if (arguments.length === 3 && !isBlobLike(value)) { + throw new TypeError( + "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'" + ) + } + + // The set(name, value) and set(name, blobValue, filename) method steps + // are: + + // 1. Let value be value if given; otherwise blobValue. + + name = webidl.converters.USVString(name) + value = isBlobLike(value) + ? webidl.converters.Blob(value, { strict: false }) + : webidl.converters.USVString(value) + filename = arguments.length === 3 + ? toUSVString(filename) + : undefined + + // 2. Let entry be the result of creating an entry with name, value, and + // filename if given. + const entry = makeEntry(name, value, filename) + + // 3. If there are entries in this’s entry list whose name is name, then + // replace the first such entry with entry and remove the others. + const idx = this[kState].findIndex((entry) => entry.name === name) + if (idx !== -1) { + this[kState] = [ + ...this[kState].slice(0, idx), + entry, + ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name) + ] + } else { + // 4. Otherwise, append entry to this’s entry list. + this[kState].push(entry) + } + } + + entries () { + webidl.brandCheck(this, FormData) + + return makeIterator( + () => this[kState].map(pair => [pair.name, pair.value]), + 'FormData', + 'key+value' + ) + } + + keys () { + webidl.brandCheck(this, FormData) + + return makeIterator( + () => this[kState].map(pair => [pair.name, pair.value]), + 'FormData', + 'key' + ) + } + + values () { + webidl.brandCheck(this, FormData) + + return makeIterator( + () => this[kState].map(pair => [pair.name, pair.value]), + 'FormData', + 'value' + ) + } + + /** + * @param {(value: string, key: string, self: FormData) => void} callbackFn + * @param {unknown} thisArg + */ + forEach (callbackFn, thisArg = globalThis) { + webidl.brandCheck(this, FormData) + + webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' }) + + if (typeof callbackFn !== 'function') { + throw new TypeError( + "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'." + ) + } + + for (const [key, value] of this) { + callbackFn.apply(thisArg, [value, key, this]) + } + } +} + +FormData.prototype[Symbol.iterator] = FormData.prototype.entries + +Object.defineProperties(FormData.prototype, { + [Symbol.toStringTag]: { + value: 'FormData', + configurable: true + } +}) + +/** + * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry + * @param {string} name + * @param {string|Blob} value + * @param {?string} filename + * @returns + */ +function makeEntry (name, value, filename) { + // 1. Set name to the result of converting name into a scalar value string. + // "To convert a string into a scalar value string, replace any surrogates + // with U+FFFD." + // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end + name = Buffer.from(name).toString('utf8') + + // 2. If value is a string, then set value to the result of converting + // value into a scalar value string. + if (typeof value === 'string') { + value = Buffer.from(value).toString('utf8') + } else { + // 3. Otherwise: + + // 1. If value is not a File object, then set value to a new File object, + // representing the same bytes, whose name attribute value is "blob" + if (!isFileLike(value)) { + value = value instanceof Blob + ? new File([value], 'blob', { type: value.type }) + : new FileLike(value, 'blob', { type: value.type }) + } + + // 2. If filename is given, then set value to a new File object, + // representing the same bytes, whose name attribute is filename. + if (filename !== undefined) { + /** @type {FilePropertyBag} */ + const options = { + type: value.type, + lastModified: value.lastModified + } + + value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile + ? new File([value], filename, options) + : new FileLike(value, filename, options) + } + } + + // 4. Return an entry whose name is name and whose value is value. + return { name, value } +} + +module.exports = { FormData } + + +/***/ }), + +/***/ 71246: +/***/ ((module) => { + +"use strict"; + + +// In case of breaking changes, increase the version +// number to avoid conflicts. +const globalOrigin = Symbol.for('undici.globalOrigin.1') + +function getGlobalOrigin () { + return globalThis[globalOrigin] +} + +function setGlobalOrigin (newOrigin) { + if (newOrigin === undefined) { + Object.defineProperty(globalThis, globalOrigin, { + value: undefined, + writable: true, + enumerable: false, + configurable: false + }) + + return + } + + const parsedURL = new URL(newOrigin) + + if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') { + throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`) + } + + Object.defineProperty(globalThis, globalOrigin, { + value: parsedURL, + writable: true, + enumerable: false, + configurable: false + }) +} + +module.exports = { + getGlobalOrigin, + setGlobalOrigin +} + + +/***/ }), + +/***/ 10554: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// https://github.com/Ethan-Arrowood/undici-fetch + + + +const { kHeadersList } = __nccwpck_require__(72785) +const { kGuard } = __nccwpck_require__(15861) +const { kEnumerableProperty } = __nccwpck_require__(83983) +const { + makeIterator, + isValidHeaderName, + isValidHeaderValue +} = __nccwpck_require__(52538) +const { webidl } = __nccwpck_require__(21744) +const assert = __nccwpck_require__(39491) + +const kHeadersMap = Symbol('headers map') +const kHeadersSortedMap = Symbol('headers map sorted') + +/** + * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize + * @param {string} potentialValue + */ +function headerValueNormalize (potentialValue) { + // To normalize a byte sequence potentialValue, remove + // any leading and trailing HTTP whitespace bytes from + // potentialValue. + + // Trimming the end with `.replace()` and a RegExp is typically subject to + // ReDoS. This is safer and faster. + let i = potentialValue.length + while (/[\r\n\t ]/.test(potentialValue.charAt(--i))); + return potentialValue.slice(0, i + 1).replace(/^[\r\n\t ]+/, '') +} + +function fill (headers, object) { + // To fill a Headers object headers with a given object object, run these steps: + + // 1. If object is a sequence, then for each header in object: + // Note: webidl conversion to array has already been done. + if (Array.isArray(object)) { + for (const header of object) { + // 1. If header does not contain exactly two items, then throw a TypeError. + if (header.length !== 2) { + throw webidl.errors.exception({ + header: 'Headers constructor', + message: `expected name/value pair to be length 2, found ${header.length}.` + }) + } + + // 2. Append (header’s first item, header’s second item) to headers. + headers.append(header[0], header[1]) + } + } else if (typeof object === 'object' && object !== null) { + // Note: null should throw + + // 2. Otherwise, object is a record, then for each key → value in object, + // append (key, value) to headers + for (const [key, value] of Object.entries(object)) { + headers.append(key, value) + } + } else { + throw webidl.errors.conversionFailed({ + prefix: 'Headers constructor', + argument: 'Argument 1', + types: ['sequence>', 'record'] + }) + } +} + +class HeadersList { + /** @type {[string, string][]|null} */ + cookies = null + + constructor (init) { + if (init instanceof HeadersList) { + this[kHeadersMap] = new Map(init[kHeadersMap]) + this[kHeadersSortedMap] = init[kHeadersSortedMap] + this.cookies = init.cookies + } else { + this[kHeadersMap] = new Map(init) + this[kHeadersSortedMap] = null + } + } + + // https://fetch.spec.whatwg.org/#header-list-contains + contains (name) { + // A header list list contains a header name name if list + // contains a header whose name is a byte-case-insensitive + // match for name. + name = name.toLowerCase() + + return this[kHeadersMap].has(name) + } + + clear () { + this[kHeadersMap].clear() + this[kHeadersSortedMap] = null + this.cookies = null + } + + // https://fetch.spec.whatwg.org/#concept-header-list-append + append (name, value) { + this[kHeadersSortedMap] = null + + // 1. If list contains name, then set name to the first such + // header’s name. + const lowercaseName = name.toLowerCase() + const exists = this[kHeadersMap].get(lowercaseName) + + // 2. Append (name, value) to list. + if (exists) { + const delimiter = lowercaseName === 'cookie' ? '; ' : ', ' + this[kHeadersMap].set(lowercaseName, { + name: exists.name, + value: `${exists.value}${delimiter}${value}` + }) + } else { + this[kHeadersMap].set(lowercaseName, { name, value }) + } + + if (lowercaseName === 'set-cookie') { + this.cookies ??= [] + this.cookies.push(value) + } + } + + // https://fetch.spec.whatwg.org/#concept-header-list-set + set (name, value) { + this[kHeadersSortedMap] = null + const lowercaseName = name.toLowerCase() + + if (lowercaseName === 'set-cookie') { + this.cookies = [value] + } + + // 1. If list contains name, then set the value of + // the first such header to value and remove the + // others. + // 2. Otherwise, append header (name, value) to list. + return this[kHeadersMap].set(lowercaseName, { name, value }) + } + + // https://fetch.spec.whatwg.org/#concept-header-list-delete + delete (name) { + this[kHeadersSortedMap] = null + + name = name.toLowerCase() + + if (name === 'set-cookie') { + this.cookies = null + } + + return this[kHeadersMap].delete(name) + } + + // https://fetch.spec.whatwg.org/#concept-header-list-get + get (name) { + // 1. If list does not contain name, then return null. + if (!this.contains(name)) { + return null + } + + // 2. Return the values of all headers in list whose name + // is a byte-case-insensitive match for name, + // separated from each other by 0x2C 0x20, in order. + return this[kHeadersMap].get(name.toLowerCase())?.value ?? null + } + + * [Symbol.iterator] () { + // use the lowercased name + for (const [name, { value }] of this[kHeadersMap]) { + yield [name, value] + } + } + + get entries () { + const headers = {} + + if (this[kHeadersMap].size) { + for (const { name, value } of this[kHeadersMap].values()) { + headers[name] = value + } + } + + return headers + } +} + +// https://fetch.spec.whatwg.org/#headers-class +class Headers { + constructor (init = undefined) { + this[kHeadersList] = new HeadersList() + + // The new Headers(init) constructor steps are: + + // 1. Set this’s guard to "none". + this[kGuard] = 'none' + + // 2. If init is given, then fill this with init. + if (init !== undefined) { + init = webidl.converters.HeadersInit(init) + fill(this, init) + } + } + + // https://fetch.spec.whatwg.org/#dom-headers-append + append (name, value) { + webidl.brandCheck(this, Headers) + + webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' }) + + name = webidl.converters.ByteString(name) + value = webidl.converters.ByteString(value) + + // 1. Normalize value. + value = headerValueNormalize(value) + + // 2. If name is not a header name or value is not a + // header value, then throw a TypeError. + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.append', + value: name, + type: 'header name' + }) + } else if (!isValidHeaderValue(value)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.append', + value, + type: 'header value' + }) + } + + // 3. If headers’s guard is "immutable", then throw a TypeError. + // 4. Otherwise, if headers’s guard is "request" and name is a + // forbidden header name, return. + // Note: undici does not implement forbidden header names + if (this[kGuard] === 'immutable') { + throw new TypeError('immutable') + } else if (this[kGuard] === 'request-no-cors') { + // 5. Otherwise, if headers’s guard is "request-no-cors": + // TODO + } + + // 6. Otherwise, if headers’s guard is "response" and name is a + // forbidden response-header name, return. + + // 7. Append (name, value) to headers’s header list. + // 8. If headers’s guard is "request-no-cors", then remove + // privileged no-CORS request headers from headers + return this[kHeadersList].append(name, value) + } + + // https://fetch.spec.whatwg.org/#dom-headers-delete + delete (name) { + webidl.brandCheck(this, Headers) + + webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' }) + + name = webidl.converters.ByteString(name) + + // 1. If name is not a header name, then throw a TypeError. + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.delete', + value: name, + type: 'header name' + }) + } + + // 2. If this’s guard is "immutable", then throw a TypeError. + // 3. Otherwise, if this’s guard is "request" and name is a + // forbidden header name, return. + // 4. Otherwise, if this’s guard is "request-no-cors", name + // is not a no-CORS-safelisted request-header name, and + // name is not a privileged no-CORS request-header name, + // return. + // 5. Otherwise, if this’s guard is "response" and name is + // a forbidden response-header name, return. + // Note: undici does not implement forbidden header names + if (this[kGuard] === 'immutable') { + throw new TypeError('immutable') + } else if (this[kGuard] === 'request-no-cors') { + // TODO + } + + // 6. If this’s header list does not contain name, then + // return. + if (!this[kHeadersList].contains(name)) { + return + } + + // 7. Delete name from this’s header list. + // 8. If this’s guard is "request-no-cors", then remove + // privileged no-CORS request headers from this. + return this[kHeadersList].delete(name) + } + + // https://fetch.spec.whatwg.org/#dom-headers-get + get (name) { + webidl.brandCheck(this, Headers) + + webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' }) + + name = webidl.converters.ByteString(name) + + // 1. If name is not a header name, then throw a TypeError. + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.get', + value: name, + type: 'header name' + }) + } + + // 2. Return the result of getting name from this’s header + // list. + return this[kHeadersList].get(name) + } + + // https://fetch.spec.whatwg.org/#dom-headers-has + has (name) { + webidl.brandCheck(this, Headers) + + webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' }) + + name = webidl.converters.ByteString(name) + + // 1. If name is not a header name, then throw a TypeError. + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.has', + value: name, + type: 'header name' + }) + } + + // 2. Return true if this’s header list contains name; + // otherwise false. + return this[kHeadersList].contains(name) + } + + // https://fetch.spec.whatwg.org/#dom-headers-set + set (name, value) { + webidl.brandCheck(this, Headers) + + webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' }) + + name = webidl.converters.ByteString(name) + value = webidl.converters.ByteString(value) + + // 1. Normalize value. + value = headerValueNormalize(value) + + // 2. If name is not a header name or value is not a + // header value, then throw a TypeError. + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.set', + value: name, + type: 'header name' + }) + } else if (!isValidHeaderValue(value)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.set', + value, + type: 'header value' + }) + } + + // 3. If this’s guard is "immutable", then throw a TypeError. + // 4. Otherwise, if this’s guard is "request" and name is a + // forbidden header name, return. + // 5. Otherwise, if this’s guard is "request-no-cors" and + // name/value is not a no-CORS-safelisted request-header, + // return. + // 6. Otherwise, if this’s guard is "response" and name is a + // forbidden response-header name, return. + // Note: undici does not implement forbidden header names + if (this[kGuard] === 'immutable') { + throw new TypeError('immutable') + } else if (this[kGuard] === 'request-no-cors') { + // TODO + } + + // 7. Set (name, value) in this’s header list. + // 8. If this’s guard is "request-no-cors", then remove + // privileged no-CORS request headers from this + return this[kHeadersList].set(name, value) + } + + // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie + getSetCookie () { + webidl.brandCheck(this, Headers) + + // 1. If this’s header list does not contain `Set-Cookie`, then return « ». + // 2. Return the values of all headers in this’s header list whose name is + // a byte-case-insensitive match for `Set-Cookie`, in order. + + const list = this[kHeadersList].cookies + + if (list) { + return [...list] + } + + return [] + } + + // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine + get [kHeadersSortedMap] () { + if (this[kHeadersList][kHeadersSortedMap]) { + return this[kHeadersList][kHeadersSortedMap] + } + + // 1. Let headers be an empty list of headers with the key being the name + // and value the value. + const headers = [] + + // 2. Let names be the result of convert header names to a sorted-lowercase + // set with all the names of the headers in list. + const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1) + const cookies = this[kHeadersList].cookies + + // 3. For each name of names: + for (const [name, value] of names) { + // 1. If name is `set-cookie`, then: + if (name === 'set-cookie') { + // 1. Let values be a list of all values of headers in list whose name + // is a byte-case-insensitive match for name, in order. + + // 2. For each value of values: + // 1. Append (name, value) to headers. + for (const value of cookies) { + headers.push([name, value]) + } + } else { + // 2. Otherwise: + + // 1. Let value be the result of getting name from list. + + // 2. Assert: value is non-null. + assert(value !== null) + + // 3. Append (name, value) to headers. + headers.push([name, value]) + } + } + + this[kHeadersList][kHeadersSortedMap] = headers + + // 4. Return headers. + return headers + } + + keys () { + webidl.brandCheck(this, Headers) + + return makeIterator( + () => [...this[kHeadersSortedMap].values()], + 'Headers', + 'key' + ) + } + + values () { + webidl.brandCheck(this, Headers) + + return makeIterator( + () => [...this[kHeadersSortedMap].values()], + 'Headers', + 'value' + ) + } + + entries () { + webidl.brandCheck(this, Headers) + + return makeIterator( + () => [...this[kHeadersSortedMap].values()], + 'Headers', + 'key+value' + ) + } + + /** + * @param {(value: string, key: string, self: Headers) => void} callbackFn + * @param {unknown} thisArg + */ + forEach (callbackFn, thisArg = globalThis) { + webidl.brandCheck(this, Headers) + + webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' }) + + if (typeof callbackFn !== 'function') { + throw new TypeError( + "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'." + ) + } + + for (const [key, value] of this) { + callbackFn.apply(thisArg, [value, key, this]) + } + } + + [Symbol.for('nodejs.util.inspect.custom')] () { + webidl.brandCheck(this, Headers) + + return this[kHeadersList] + } +} + +Headers.prototype[Symbol.iterator] = Headers.prototype.entries + +Object.defineProperties(Headers.prototype, { + append: kEnumerableProperty, + delete: kEnumerableProperty, + get: kEnumerableProperty, + has: kEnumerableProperty, + set: kEnumerableProperty, + getSetCookie: kEnumerableProperty, + keys: kEnumerableProperty, + values: kEnumerableProperty, + entries: kEnumerableProperty, + forEach: kEnumerableProperty, + [Symbol.iterator]: { enumerable: false }, + [Symbol.toStringTag]: { + value: 'Headers', + configurable: true + } +}) + +webidl.converters.HeadersInit = function (V) { + if (webidl.util.Type(V) === 'Object') { + if (V[Symbol.iterator]) { + return webidl.converters['sequence>'](V) + } + + return webidl.converters['record'](V) + } + + throw webidl.errors.conversionFailed({ + prefix: 'Headers constructor', + argument: 'Argument 1', + types: ['sequence>', 'record'] + }) +} + +module.exports = { + fill, + Headers, + HeadersList +} + + +/***/ }), + +/***/ 74881: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// https://github.com/Ethan-Arrowood/undici-fetch + + + +const { + Response, + makeNetworkError, + makeAppropriateNetworkError, + filterResponse, + makeResponse +} = __nccwpck_require__(27823) +const { Headers } = __nccwpck_require__(10554) +const { Request, makeRequest } = __nccwpck_require__(48359) +const zlib = __nccwpck_require__(59796) +const { + bytesMatch, + makePolicyContainer, + clonePolicyContainer, + requestBadPort, + TAOCheck, + appendRequestOriginHeader, + responseLocationURL, + requestCurrentURL, + setRequestReferrerPolicyOnRedirect, + tryUpgradeRequestToAPotentiallyTrustworthyURL, + createOpaqueTimingInfo, + appendFetchMetadata, + corsCheck, + crossOriginResourcePolicyCheck, + determineRequestsReferrer, + coarsenedSharedCurrentTime, + createDeferredPromise, + isBlobLike, + sameOrigin, + isCancelled, + isAborted, + isErrorLike, + fullyReadBody, + readableStreamClose, + isomorphicEncode, + urlIsLocal, + urlIsHttpHttpsScheme, + urlHasHttpsScheme +} = __nccwpck_require__(52538) +const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(15861) +const assert = __nccwpck_require__(39491) +const { safelyExtractBody } = __nccwpck_require__(41472) +const { + redirectStatusSet, + nullBodyStatus, + safeMethodsSet, + requestBodyHeader, + subresourceSet, + DOMException +} = __nccwpck_require__(41037) +const { kHeadersList } = __nccwpck_require__(72785) +const EE = __nccwpck_require__(82361) +const { Readable, pipeline } = __nccwpck_require__(12781) +const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(83983) +const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(685) +const { TransformStream } = __nccwpck_require__(35356) +const { getGlobalDispatcher } = __nccwpck_require__(21892) +const { webidl } = __nccwpck_require__(21744) +const { STATUS_CODES } = __nccwpck_require__(13685) +const GET_OR_HEAD = ['GET', 'HEAD'] + +/** @type {import('buffer').resolveObjectURL} */ +let resolveObjectURL +let ReadableStream = globalThis.ReadableStream + +class Fetch extends EE { + constructor (dispatcher) { + super() + + this.dispatcher = dispatcher + this.connection = null + this.dump = false + this.state = 'ongoing' + // 2 terminated listeners get added per request, + // but only 1 gets removed. If there are 20 redirects, + // 21 listeners will be added. + // See https://github.com/nodejs/undici/issues/1711 + // TODO (fix): Find and fix root cause for leaked listener. + this.setMaxListeners(21) + } + + terminate (reason) { + if (this.state !== 'ongoing') { + return + } + + this.state = 'terminated' + this.connection?.destroy(reason) + this.emit('terminated', reason) + } + + // https://fetch.spec.whatwg.org/#fetch-controller-abort + abort (error) { + if (this.state !== 'ongoing') { + return + } + + // 1. Set controller’s state to "aborted". + this.state = 'aborted' + + // 2. Let fallbackError be an "AbortError" DOMException. + // 3. Set error to fallbackError if it is not given. + if (!error) { + error = new DOMException('The operation was aborted.', 'AbortError') + } + + // 4. Let serializedError be StructuredSerialize(error). + // If that threw an exception, catch it, and let + // serializedError be StructuredSerialize(fallbackError). + + // 5. Set controller’s serialized abort reason to serializedError. + this.serializedAbortReason = error + + this.connection?.destroy(error) + this.emit('terminated', error) + } +} + +// https://fetch.spec.whatwg.org/#fetch-method +function fetch (input, init = {}) { + webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' }) + + // 1. Let p be a new promise. + const p = createDeferredPromise() + + // 2. Let requestObject be the result of invoking the initial value of + // Request as constructor with input and init as arguments. If this throws + // an exception, reject p with it and return p. + let requestObject + + try { + requestObject = new Request(input, init) + } catch (e) { + p.reject(e) + return p.promise + } + + // 3. Let request be requestObject’s request. + const request = requestObject[kState] + + // 4. If requestObject’s signal’s aborted flag is set, then: + if (requestObject.signal.aborted) { + // 1. Abort the fetch() call with p, request, null, and + // requestObject’s signal’s abort reason. + abortFetch(p, request, null, requestObject.signal.reason) + + // 2. Return p. + return p.promise + } + + // 5. Let globalObject be request’s client’s global object. + const globalObject = request.client.globalObject + + // 6. If globalObject is a ServiceWorkerGlobalScope object, then set + // request’s service-workers mode to "none". + if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') { + request.serviceWorkers = 'none' + } + + // 7. Let responseObject be null. + let responseObject = null + + // 8. Let relevantRealm be this’s relevant Realm. + const relevantRealm = null + + // 9. Let locallyAborted be false. + let locallyAborted = false + + // 10. Let controller be null. + let controller = null + + // 11. Add the following abort steps to requestObject’s signal: + addAbortListener( + requestObject.signal, + () => { + // 1. Set locallyAborted to true. + locallyAborted = true + + // 2. Assert: controller is non-null. + assert(controller != null) + + // 3. Abort controller with requestObject’s signal’s abort reason. + controller.abort(requestObject.signal.reason) + + // 4. Abort the fetch() call with p, request, responseObject, + // and requestObject’s signal’s abort reason. + abortFetch(p, request, responseObject, requestObject.signal.reason) + } + ) + + // 12. Let handleFetchDone given response response be to finalize and + // report timing with response, globalObject, and "fetch". + const handleFetchDone = (response) => + finalizeAndReportTiming(response, 'fetch') + + // 13. Set controller to the result of calling fetch given request, + // with processResponseEndOfBody set to handleFetchDone, and processResponse + // given response being these substeps: + + const processResponse = (response) => { + // 1. If locallyAborted is true, terminate these substeps. + if (locallyAborted) { + return Promise.resolve() + } + + // 2. If response’s aborted flag is set, then: + if (response.aborted) { + // 1. Let deserializedError be the result of deserialize a serialized + // abort reason given controller’s serialized abort reason and + // relevantRealm. + + // 2. Abort the fetch() call with p, request, responseObject, and + // deserializedError. + + abortFetch(p, request, responseObject, controller.serializedAbortReason) + return Promise.resolve() + } + + // 3. If response is a network error, then reject p with a TypeError + // and terminate these substeps. + if (response.type === 'error') { + p.reject( + Object.assign(new TypeError('fetch failed'), { cause: response.error }) + ) + return Promise.resolve() + } + + // 4. Set responseObject to the result of creating a Response object, + // given response, "immutable", and relevantRealm. + responseObject = new Response() + responseObject[kState] = response + responseObject[kRealm] = relevantRealm + responseObject[kHeaders][kHeadersList] = response.headersList + responseObject[kHeaders][kGuard] = 'immutable' + responseObject[kHeaders][kRealm] = relevantRealm + + // 5. Resolve p with responseObject. + p.resolve(responseObject) + } + + controller = fetching({ + request, + processResponseEndOfBody: handleFetchDone, + processResponse, + dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici + }) + + // 14. Return p. + return p.promise +} + +// https://fetch.spec.whatwg.org/#finalize-and-report-timing +function finalizeAndReportTiming (response, initiatorType = 'other') { + // 1. If response is an aborted network error, then return. + if (response.type === 'error' && response.aborted) { + return + } + + // 2. If response’s URL list is null or empty, then return. + if (!response.urlList?.length) { + return + } + + // 3. Let originalURL be response’s URL list[0]. + const originalURL = response.urlList[0] + + // 4. Let timingInfo be response’s timing info. + let timingInfo = response.timingInfo + + // 5. Let cacheState be response’s cache state. + let cacheState = response.cacheState + + // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return. + if (!urlIsHttpHttpsScheme(originalURL)) { + return + } + + // 7. If timingInfo is null, then return. + if (timingInfo === null) { + return + } + + // 8. If response’s timing allow passed flag is not set, then: + if (!timingInfo.timingAllowPassed) { + // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo. + timingInfo = createOpaqueTimingInfo({ + startTime: timingInfo.startTime + }) + + // 2. Set cacheState to the empty string. + cacheState = '' + } + + // 9. Set timingInfo’s end time to the coarsened shared current time + // given global’s relevant settings object’s cross-origin isolated + // capability. + // TODO: given global’s relevant settings object’s cross-origin isolated + // capability? + timingInfo.endTime = coarsenedSharedCurrentTime() + + // 10. Set response’s timing info to timingInfo. + response.timingInfo = timingInfo + + // 11. Mark resource timing for timingInfo, originalURL, initiatorType, + // global, and cacheState. + markResourceTiming( + timingInfo, + originalURL, + initiatorType, + globalThis, + cacheState + ) +} + +// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing +function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) { + if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) { + performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState) + } +} + +// https://fetch.spec.whatwg.org/#abort-fetch +function abortFetch (p, request, responseObject, error) { + // Note: AbortSignal.reason was added in node v17.2.0 + // which would give us an undefined error to reject with. + // Remove this once node v16 is no longer supported. + if (!error) { + error = new DOMException('The operation was aborted.', 'AbortError') + } + + // 1. Reject promise with error. + p.reject(error) + + // 2. If request’s body is not null and is readable, then cancel request’s + // body with error. + if (request.body != null && isReadable(request.body?.stream)) { + request.body.stream.cancel(error).catch((err) => { + if (err.code === 'ERR_INVALID_STATE') { + // Node bug? + return + } + throw err + }) + } + + // 3. If responseObject is null, then return. + if (responseObject == null) { + return + } + + // 4. Let response be responseObject’s response. + const response = responseObject[kState] + + // 5. If response’s body is not null and is readable, then error response’s + // body with error. + if (response.body != null && isReadable(response.body?.stream)) { + response.body.stream.cancel(error).catch((err) => { + if (err.code === 'ERR_INVALID_STATE') { + // Node bug? + return + } + throw err + }) + } +} + +// https://fetch.spec.whatwg.org/#fetching +function fetching ({ + request, + processRequestBodyChunkLength, + processRequestEndOfBody, + processResponse, + processResponseEndOfBody, + processResponseConsumeBody, + useParallelQueue = false, + dispatcher // undici +}) { + // 1. Let taskDestination be null. + let taskDestination = null + + // 2. Let crossOriginIsolatedCapability be false. + let crossOriginIsolatedCapability = false + + // 3. If request’s client is non-null, then: + if (request.client != null) { + // 1. Set taskDestination to request’s client’s global object. + taskDestination = request.client.globalObject + + // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin + // isolated capability. + crossOriginIsolatedCapability = + request.client.crossOriginIsolatedCapability + } + + // 4. If useParallelQueue is true, then set taskDestination to the result of + // starting a new parallel queue. + // TODO + + // 5. Let timingInfo be a new fetch timing info whose start time and + // post-redirect start time are the coarsened shared current time given + // crossOriginIsolatedCapability. + const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability) + const timingInfo = createOpaqueTimingInfo({ + startTime: currenTime + }) + + // 6. Let fetchParams be a new fetch params whose + // request is request, + // timing info is timingInfo, + // process request body chunk length is processRequestBodyChunkLength, + // process request end-of-body is processRequestEndOfBody, + // process response is processResponse, + // process response consume body is processResponseConsumeBody, + // process response end-of-body is processResponseEndOfBody, + // task destination is taskDestination, + // and cross-origin isolated capability is crossOriginIsolatedCapability. + const fetchParams = { + controller: new Fetch(dispatcher), + request, + timingInfo, + processRequestBodyChunkLength, + processRequestEndOfBody, + processResponse, + processResponseConsumeBody, + processResponseEndOfBody, + taskDestination, + crossOriginIsolatedCapability + } + + // 7. If request’s body is a byte sequence, then set request’s body to + // request’s body as a body. + // NOTE: Since fetching is only called from fetch, body should already be + // extracted. + assert(!request.body || request.body.stream) + + // 8. If request’s window is "client", then set request’s window to request’s + // client, if request’s client’s global object is a Window object; otherwise + // "no-window". + if (request.window === 'client') { + // TODO: What if request.client is null? + request.window = + request.client?.globalObject?.constructor?.name === 'Window' + ? request.client + : 'no-window' + } + + // 9. If request’s origin is "client", then set request’s origin to request’s + // client’s origin. + if (request.origin === 'client') { + // TODO: What if request.client is null? + request.origin = request.client?.origin + } + + // 10. If all of the following conditions are true: + // TODO + + // 11. If request’s policy container is "client", then: + if (request.policyContainer === 'client') { + // 1. If request’s client is non-null, then set request’s policy + // container to a clone of request’s client’s policy container. [HTML] + if (request.client != null) { + request.policyContainer = clonePolicyContainer( + request.client.policyContainer + ) + } else { + // 2. Otherwise, set request’s policy container to a new policy + // container. + request.policyContainer = makePolicyContainer() + } + } + + // 12. If request’s header list does not contain `Accept`, then: + if (!request.headersList.contains('accept')) { + // 1. Let value be `*/*`. + const value = '*/*' + + // 2. A user agent should set value to the first matching statement, if + // any, switching on request’s destination: + // "document" + // "frame" + // "iframe" + // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8` + // "image" + // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5` + // "style" + // `text/css,*/*;q=0.1` + // TODO + + // 3. Append `Accept`/value to request’s header list. + request.headersList.append('accept', value) + } + + // 13. If request’s header list does not contain `Accept-Language`, then + // user agents should append `Accept-Language`/an appropriate value to + // request’s header list. + if (!request.headersList.contains('accept-language')) { + request.headersList.append('accept-language', '*') + } + + // 14. If request’s priority is null, then use request’s initiator and + // destination appropriately in setting request’s priority to a + // user-agent-defined object. + if (request.priority === null) { + // TODO + } + + // 15. If request is a subresource request, then: + if (subresourceSet.has(request.destination)) { + // TODO + } + + // 16. Run main fetch given fetchParams. + mainFetch(fetchParams) + .catch(err => { + fetchParams.controller.terminate(err) + }) + + // 17. Return fetchParam's controller + return fetchParams.controller +} + +// https://fetch.spec.whatwg.org/#concept-main-fetch +async function mainFetch (fetchParams, recursive = false) { + // 1. Let request be fetchParams’s request. + const request = fetchParams.request + + // 2. Let response be null. + let response = null + + // 3. If request’s local-URLs-only flag is set and request’s current URL is + // not local, then set response to a network error. + if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) { + response = makeNetworkError('local URLs only') + } + + // 4. Run report Content Security Policy violations for request. + // TODO + + // 5. Upgrade request to a potentially trustworthy URL, if appropriate. + tryUpgradeRequestToAPotentiallyTrustworthyURL(request) + + // 6. If should request be blocked due to a bad port, should fetching request + // be blocked as mixed content, or should request be blocked by Content + // Security Policy returns blocked, then set response to a network error. + if (requestBadPort(request) === 'blocked') { + response = makeNetworkError('bad port') + } + // TODO: should fetching request be blocked as mixed content? + // TODO: should request be blocked by Content Security Policy? + + // 7. If request’s referrer policy is the empty string, then set request’s + // referrer policy to request’s policy container’s referrer policy. + if (request.referrerPolicy === '') { + request.referrerPolicy = request.policyContainer.referrerPolicy + } + + // 8. If request’s referrer is not "no-referrer", then set request’s + // referrer to the result of invoking determine request’s referrer. + if (request.referrer !== 'no-referrer') { + request.referrer = determineRequestsReferrer(request) + } + + // 9. Set request’s current URL’s scheme to "https" if all of the following + // conditions are true: + // - request’s current URL’s scheme is "http" + // - request’s current URL’s host is a domain + // - Matching request’s current URL’s host per Known HSTS Host Domain Name + // Matching results in either a superdomain match with an asserted + // includeSubDomains directive or a congruent match (with or without an + // asserted includeSubDomains directive). [HSTS] + // TODO + + // 10. If recursive is false, then run the remaining steps in parallel. + // TODO + + // 11. If response is null, then set response to the result of running + // the steps corresponding to the first matching statement: + if (response === null) { + response = await (async () => { + const currentURL = requestCurrentURL(request) + + if ( + // - request’s current URL’s origin is same origin with request’s origin, + // and request’s response tainting is "basic" + (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') || + // request’s current URL’s scheme is "data" + (currentURL.protocol === 'data:') || + // - request’s mode is "navigate" or "websocket" + (request.mode === 'navigate' || request.mode === 'websocket') + ) { + // 1. Set request’s response tainting to "basic". + request.responseTainting = 'basic' + + // 2. Return the result of running scheme fetch given fetchParams. + return await schemeFetch(fetchParams) + } + + // request’s mode is "same-origin" + if (request.mode === 'same-origin') { + // 1. Return a network error. + return makeNetworkError('request mode cannot be "same-origin"') + } + + // request’s mode is "no-cors" + if (request.mode === 'no-cors') { + // 1. If request’s redirect mode is not "follow", then return a network + // error. + if (request.redirect !== 'follow') { + return makeNetworkError( + 'redirect mode cannot be "follow" for "no-cors" request' + ) + } + + // 2. Set request’s response tainting to "opaque". + request.responseTainting = 'opaque' + + // 3. Return the result of running scheme fetch given fetchParams. + return await schemeFetch(fetchParams) + } + + // request’s current URL’s scheme is not an HTTP(S) scheme + if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) { + // Return a network error. + return makeNetworkError('URL scheme must be a HTTP(S) scheme') + } + + // - request’s use-CORS-preflight flag is set + // - request’s unsafe-request flag is set and either request’s method is + // not a CORS-safelisted method or CORS-unsafe request-header names with + // request’s header list is not empty + // 1. Set request’s response tainting to "cors". + // 2. Let corsWithPreflightResponse be the result of running HTTP fetch + // given fetchParams and true. + // 3. If corsWithPreflightResponse is a network error, then clear cache + // entries using request. + // 4. Return corsWithPreflightResponse. + // TODO + + // Otherwise + // 1. Set request’s response tainting to "cors". + request.responseTainting = 'cors' + + // 2. Return the result of running HTTP fetch given fetchParams. + return await httpFetch(fetchParams) + })() + } + + // 12. If recursive is true, then return response. + if (recursive) { + return response + } + + // 13. If response is not a network error and response is not a filtered + // response, then: + if (response.status !== 0 && !response.internalResponse) { + // If request’s response tainting is "cors", then: + if (request.responseTainting === 'cors') { + // 1. Let headerNames be the result of extracting header list values + // given `Access-Control-Expose-Headers` and response’s header list. + // TODO + // 2. If request’s credentials mode is not "include" and headerNames + // contains `*`, then set response’s CORS-exposed header-name list to + // all unique header names in response’s header list. + // TODO + // 3. Otherwise, if headerNames is not null or failure, then set + // response’s CORS-exposed header-name list to headerNames. + // TODO + } + + // Set response to the following filtered response with response as its + // internal response, depending on request’s response tainting: + if (request.responseTainting === 'basic') { + response = filterResponse(response, 'basic') + } else if (request.responseTainting === 'cors') { + response = filterResponse(response, 'cors') + } else if (request.responseTainting === 'opaque') { + response = filterResponse(response, 'opaque') + } else { + assert(false) + } + } + + // 14. Let internalResponse be response, if response is a network error, + // and response’s internal response otherwise. + let internalResponse = + response.status === 0 ? response : response.internalResponse + + // 15. If internalResponse’s URL list is empty, then set it to a clone of + // request’s URL list. + if (internalResponse.urlList.length === 0) { + internalResponse.urlList.push(...request.urlList) + } + + // 16. If request’s timing allow failed flag is unset, then set + // internalResponse’s timing allow passed flag. + if (!request.timingAllowFailed) { + response.timingAllowPassed = true + } + + // 17. If response is not a network error and any of the following returns + // blocked + // - should internalResponse to request be blocked as mixed content + // - should internalResponse to request be blocked by Content Security Policy + // - should internalResponse to request be blocked due to its MIME type + // - should internalResponse to request be blocked due to nosniff + // TODO + + // 18. If response’s type is "opaque", internalResponse’s status is 206, + // internalResponse’s range-requested flag is set, and request’s header + // list does not contain `Range`, then set response and internalResponse + // to a network error. + if ( + response.type === 'opaque' && + internalResponse.status === 206 && + internalResponse.rangeRequested && + !request.headers.contains('range') + ) { + response = internalResponse = makeNetworkError() + } + + // 19. If response is not a network error and either request’s method is + // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status, + // set internalResponse’s body to null and disregard any enqueuing toward + // it (if any). + if ( + response.status !== 0 && + (request.method === 'HEAD' || + request.method === 'CONNECT' || + nullBodyStatus.includes(internalResponse.status)) + ) { + internalResponse.body = null + fetchParams.controller.dump = true + } + + // 20. If request’s integrity metadata is not the empty string, then: + if (request.integrity) { + // 1. Let processBodyError be this step: run fetch finale given fetchParams + // and a network error. + const processBodyError = (reason) => + fetchFinale(fetchParams, makeNetworkError(reason)) + + // 2. If request’s response tainting is "opaque", or response’s body is null, + // then run processBodyError and abort these steps. + if (request.responseTainting === 'opaque' || response.body == null) { + processBodyError(response.error) + return + } + + // 3. Let processBody given bytes be these steps: + const processBody = (bytes) => { + // 1. If bytes do not match request’s integrity metadata, + // then run processBodyError and abort these steps. [SRI] + if (!bytesMatch(bytes, request.integrity)) { + processBodyError('integrity mismatch') + return + } + + // 2. Set response’s body to bytes as a body. + response.body = safelyExtractBody(bytes)[0] + + // 3. Run fetch finale given fetchParams and response. + fetchFinale(fetchParams, response) + } + + // 4. Fully read response’s body given processBody and processBodyError. + await fullyReadBody(response.body, processBody, processBodyError) + } else { + // 21. Otherwise, run fetch finale given fetchParams and response. + fetchFinale(fetchParams, response) + } +} + +// https://fetch.spec.whatwg.org/#concept-scheme-fetch +// given a fetch params fetchParams +function schemeFetch (fetchParams) { + // Note: since the connection is destroyed on redirect, which sets fetchParams to a + // cancelled state, we do not want this condition to trigger *unless* there have been + // no redirects. See https://github.com/nodejs/undici/issues/1776 + // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams. + if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) { + return Promise.resolve(makeAppropriateNetworkError(fetchParams)) + } + + // 2. Let request be fetchParams’s request. + const { request } = fetchParams + + const { protocol: scheme } = requestCurrentURL(request) + + // 3. Switch on request’s current URL’s scheme and run the associated steps: + switch (scheme) { + case 'about:': { + // If request’s current URL’s path is the string "blank", then return a new response + // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) », + // and body is the empty byte sequence as a body. + + // Otherwise, return a network error. + return Promise.resolve(makeNetworkError('about scheme is not supported')) + } + case 'blob:': { + if (!resolveObjectURL) { + resolveObjectURL = (__nccwpck_require__(14300).resolveObjectURL) + } + + // 1. Let blobURLEntry be request’s current URL’s blob URL entry. + const blobURLEntry = requestCurrentURL(request) + + // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56 + // Buffer.resolveObjectURL does not ignore URL queries. + if (blobURLEntry.search.length !== 0) { + return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.')) + } + + const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString()) + + // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s + // object is not a Blob object, then return a network error. + if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) { + return Promise.resolve(makeNetworkError('invalid method')) + } + + // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object. + const bodyWithType = safelyExtractBody(blobURLEntryObject) + + // 4. Let body be bodyWithType’s body. + const body = bodyWithType[0] + + // 5. Let length be body’s length, serialized and isomorphic encoded. + const length = isomorphicEncode(`${body.length}`) + + // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence. + const type = bodyWithType[1] ?? '' + + // 7. Return a new response whose status message is `OK`, header list is + // « (`Content-Length`, length), (`Content-Type`, type) », and body is body. + const response = makeResponse({ + statusText: 'OK', + headersList: [ + ['content-length', { name: 'Content-Length', value: length }], + ['content-type', { name: 'Content-Type', value: type }] + ] + }) + + response.body = body + + return Promise.resolve(response) + } + case 'data:': { + // 1. Let dataURLStruct be the result of running the + // data: URL processor on request’s current URL. + const currentURL = requestCurrentURL(request) + const dataURLStruct = dataURLProcessor(currentURL) + + // 2. If dataURLStruct is failure, then return a + // network error. + if (dataURLStruct === 'failure') { + return Promise.resolve(makeNetworkError('failed to fetch the data URL')) + } + + // 3. Let mimeType be dataURLStruct’s MIME type, serialized. + const mimeType = serializeAMimeType(dataURLStruct.mimeType) + + // 4. Return a response whose status message is `OK`, + // header list is « (`Content-Type`, mimeType) », + // and body is dataURLStruct’s body as a body. + return Promise.resolve(makeResponse({ + statusText: 'OK', + headersList: [ + ['content-type', { name: 'Content-Type', value: mimeType }] + ], + body: safelyExtractBody(dataURLStruct.body)[0] + })) + } + case 'file:': { + // For now, unfortunate as it is, file URLs are left as an exercise for the reader. + // When in doubt, return a network error. + return Promise.resolve(makeNetworkError('not implemented... yet...')) + } + case 'http:': + case 'https:': { + // Return the result of running HTTP fetch given fetchParams. + + return httpFetch(fetchParams) + .catch((err) => makeNetworkError(err)) + } + default: { + return Promise.resolve(makeNetworkError('unknown scheme')) + } + } +} + +// https://fetch.spec.whatwg.org/#finalize-response +function finalizeResponse (fetchParams, response) { + // 1. Set fetchParams’s request’s done flag. + fetchParams.request.done = true + + // 2, If fetchParams’s process response done is not null, then queue a fetch + // task to run fetchParams’s process response done given response, with + // fetchParams’s task destination. + if (fetchParams.processResponseDone != null) { + queueMicrotask(() => fetchParams.processResponseDone(response)) + } +} + +// https://fetch.spec.whatwg.org/#fetch-finale +function fetchFinale (fetchParams, response) { + // 1. If response is a network error, then: + if (response.type === 'error') { + // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ». + response.urlList = [fetchParams.request.urlList[0]] + + // 2. Set response’s timing info to the result of creating an opaque timing + // info for fetchParams’s timing info. + response.timingInfo = createOpaqueTimingInfo({ + startTime: fetchParams.timingInfo.startTime + }) + } + + // 2. Let processResponseEndOfBody be the following steps: + const processResponseEndOfBody = () => { + // 1. Set fetchParams’s request’s done flag. + fetchParams.request.done = true + + // If fetchParams’s process response end-of-body is not null, + // then queue a fetch task to run fetchParams’s process response + // end-of-body given response with fetchParams’s task destination. + if (fetchParams.processResponseEndOfBody != null) { + queueMicrotask(() => fetchParams.processResponseEndOfBody(response)) + } + } + + // 3. If fetchParams’s process response is non-null, then queue a fetch task + // to run fetchParams’s process response given response, with fetchParams’s + // task destination. + if (fetchParams.processResponse != null) { + queueMicrotask(() => fetchParams.processResponse(response)) + } + + // 4. If response’s body is null, then run processResponseEndOfBody. + if (response.body == null) { + processResponseEndOfBody() + } else { + // 5. Otherwise: + + // 1. Let transformStream be a new a TransformStream. + + // 2. Let identityTransformAlgorithm be an algorithm which, given chunk, + // enqueues chunk in transformStream. + const identityTransformAlgorithm = (chunk, controller) => { + controller.enqueue(chunk) + } + + // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm + // and flushAlgorithm set to processResponseEndOfBody. + const transformStream = new TransformStream({ + start () {}, + transform: identityTransformAlgorithm, + flush: processResponseEndOfBody + }, { + size () { + return 1 + } + }, { + size () { + return 1 + } + }) + + // 4. Set response’s body to the result of piping response’s body through transformStream. + response.body = { stream: response.body.stream.pipeThrough(transformStream) } + } + + // 6. If fetchParams’s process response consume body is non-null, then: + if (fetchParams.processResponseConsumeBody != null) { + // 1. Let processBody given nullOrBytes be this step: run fetchParams’s + // process response consume body given response and nullOrBytes. + const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes) + + // 2. Let processBodyError be this step: run fetchParams’s process + // response consume body given response and failure. + const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure) + + // 3. If response’s body is null, then queue a fetch task to run processBody + // given null, with fetchParams’s task destination. + if (response.body == null) { + queueMicrotask(() => processBody(null)) + } else { + // 4. Otherwise, fully read response’s body given processBody, processBodyError, + // and fetchParams’s task destination. + return fullyReadBody(response.body, processBody, processBodyError) + } + return Promise.resolve() + } +} + +// https://fetch.spec.whatwg.org/#http-fetch +async function httpFetch (fetchParams) { + // 1. Let request be fetchParams’s request. + const request = fetchParams.request + + // 2. Let response be null. + let response = null + + // 3. Let actualResponse be null. + let actualResponse = null + + // 4. Let timingInfo be fetchParams’s timing info. + const timingInfo = fetchParams.timingInfo + + // 5. If request’s service-workers mode is "all", then: + if (request.serviceWorkers === 'all') { + // TODO + } + + // 6. If response is null, then: + if (response === null) { + // 1. If makeCORSPreflight is true and one of these conditions is true: + // TODO + + // 2. If request’s redirect mode is "follow", then set request’s + // service-workers mode to "none". + if (request.redirect === 'follow') { + request.serviceWorkers = 'none' + } + + // 3. Set response and actualResponse to the result of running + // HTTP-network-or-cache fetch given fetchParams. + actualResponse = response = await httpNetworkOrCacheFetch(fetchParams) + + // 4. If request’s response tainting is "cors" and a CORS check + // for request and response returns failure, then return a network error. + if ( + request.responseTainting === 'cors' && + corsCheck(request, response) === 'failure' + ) { + return makeNetworkError('cors failure') + } + + // 5. If the TAO check for request and response returns failure, then set + // request’s timing allow failed flag. + if (TAOCheck(request, response) === 'failure') { + request.timingAllowFailed = true + } + } + + // 7. If either request’s response tainting or response’s type + // is "opaque", and the cross-origin resource policy check with + // request’s origin, request’s client, request’s destination, + // and actualResponse returns blocked, then return a network error. + if ( + (request.responseTainting === 'opaque' || response.type === 'opaque') && + crossOriginResourcePolicyCheck( + request.origin, + request.client, + request.destination, + actualResponse + ) === 'blocked' + ) { + return makeNetworkError('blocked') + } + + // 8. If actualResponse’s status is a redirect status, then: + if (redirectStatusSet.has(actualResponse.status)) { + // 1. If actualResponse’s status is not 303, request’s body is not null, + // and the connection uses HTTP/2, then user agents may, and are even + // encouraged to, transmit an RST_STREAM frame. + // See, https://github.com/whatwg/fetch/issues/1288 + if (request.redirect !== 'manual') { + fetchParams.controller.connection.destroy() + } + + // 2. Switch on request’s redirect mode: + if (request.redirect === 'error') { + // Set response to a network error. + response = makeNetworkError('unexpected redirect') + } else if (request.redirect === 'manual') { + // Set response to an opaque-redirect filtered response whose internal + // response is actualResponse. + // NOTE(spec): On the web this would return an `opaqueredirect` response, + // but that doesn't make sense server side. + // See https://github.com/nodejs/undici/issues/1193. + response = actualResponse + } else if (request.redirect === 'follow') { + // Set response to the result of running HTTP-redirect fetch given + // fetchParams and response. + response = await httpRedirectFetch(fetchParams, response) + } else { + assert(false) + } + } + + // 9. Set response’s timing info to timingInfo. + response.timingInfo = timingInfo + + // 10. Return response. + return response +} + +// https://fetch.spec.whatwg.org/#http-redirect-fetch +function httpRedirectFetch (fetchParams, response) { + // 1. Let request be fetchParams’s request. + const request = fetchParams.request + + // 2. Let actualResponse be response, if response is not a filtered response, + // and response’s internal response otherwise. + const actualResponse = response.internalResponse + ? response.internalResponse + : response + + // 3. Let locationURL be actualResponse’s location URL given request’s current + // URL’s fragment. + let locationURL + + try { + locationURL = responseLocationURL( + actualResponse, + requestCurrentURL(request).hash + ) + + // 4. If locationURL is null, then return response. + if (locationURL == null) { + return response + } + } catch (err) { + // 5. If locationURL is failure, then return a network error. + return Promise.resolve(makeNetworkError(err)) + } + + // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network + // error. + if (!urlIsHttpHttpsScheme(locationURL)) { + return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme')) + } + + // 7. If request’s redirect count is 20, then return a network error. + if (request.redirectCount === 20) { + return Promise.resolve(makeNetworkError('redirect count exceeded')) + } + + // 8. Increase request’s redirect count by 1. + request.redirectCount += 1 + + // 9. If request’s mode is "cors", locationURL includes credentials, and + // request’s origin is not same origin with locationURL’s origin, then return + // a network error. + if ( + request.mode === 'cors' && + (locationURL.username || locationURL.password) && + !sameOrigin(request, locationURL) + ) { + return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"')) + } + + // 10. If request’s response tainting is "cors" and locationURL includes + // credentials, then return a network error. + if ( + request.responseTainting === 'cors' && + (locationURL.username || locationURL.password) + ) { + return Promise.resolve(makeNetworkError( + 'URL cannot contain credentials for request mode "cors"' + )) + } + + // 11. If actualResponse’s status is not 303, request’s body is non-null, + // and request’s body’s source is null, then return a network error. + if ( + actualResponse.status !== 303 && + request.body != null && + request.body.source == null + ) { + return Promise.resolve(makeNetworkError()) + } + + // 12. If one of the following is true + // - actualResponse’s status is 301 or 302 and request’s method is `POST` + // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD` + if ( + ([301, 302].includes(actualResponse.status) && request.method === 'POST') || + (actualResponse.status === 303 && + !GET_OR_HEAD.includes(request.method)) + ) { + // then: + // 1. Set request’s method to `GET` and request’s body to null. + request.method = 'GET' + request.body = null + + // 2. For each headerName of request-body-header name, delete headerName from + // request’s header list. + for (const headerName of requestBodyHeader) { + request.headersList.delete(headerName) + } + } + + // 13. If request’s current URL’s origin is not same origin with locationURL’s + // origin, then for each headerName of CORS non-wildcard request-header name, + // delete headerName from request’s header list. + if (!sameOrigin(requestCurrentURL(request), locationURL)) { + // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name + request.headersList.delete('authorization') + + // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement. + request.headersList.delete('cookie') + request.headersList.delete('host') + } + + // 14. If request’s body is non-null, then set request’s body to the first return + // value of safely extracting request’s body’s source. + if (request.body != null) { + assert(request.body.source != null) + request.body = safelyExtractBody(request.body.source)[0] + } + + // 15. Let timingInfo be fetchParams’s timing info. + const timingInfo = fetchParams.timingInfo + + // 16. Set timingInfo’s redirect end time and post-redirect start time to the + // coarsened shared current time given fetchParams’s cross-origin isolated + // capability. + timingInfo.redirectEndTime = timingInfo.postRedirectStartTime = + coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability) + + // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s + // redirect start time to timingInfo’s start time. + if (timingInfo.redirectStartTime === 0) { + timingInfo.redirectStartTime = timingInfo.startTime + } + + // 18. Append locationURL to request’s URL list. + request.urlList.push(locationURL) + + // 19. Invoke set request’s referrer policy on redirect on request and + // actualResponse. + setRequestReferrerPolicyOnRedirect(request, actualResponse) + + // 20. Return the result of running main fetch given fetchParams and true. + return mainFetch(fetchParams, true) +} + +// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch +async function httpNetworkOrCacheFetch ( + fetchParams, + isAuthenticationFetch = false, + isNewConnectionFetch = false +) { + // 1. Let request be fetchParams’s request. + const request = fetchParams.request + + // 2. Let httpFetchParams be null. + let httpFetchParams = null + + // 3. Let httpRequest be null. + let httpRequest = null + + // 4. Let response be null. + let response = null + + // 5. Let storedResponse be null. + // TODO: cache + + // 6. Let httpCache be null. + const httpCache = null + + // 7. Let the revalidatingFlag be unset. + const revalidatingFlag = false + + // 8. Run these steps, but abort when the ongoing fetch is terminated: + + // 1. If request’s window is "no-window" and request’s redirect mode is + // "error", then set httpFetchParams to fetchParams and httpRequest to + // request. + if (request.window === 'no-window' && request.redirect === 'error') { + httpFetchParams = fetchParams + httpRequest = request + } else { + // Otherwise: + + // 1. Set httpRequest to a clone of request. + httpRequest = makeRequest(request) + + // 2. Set httpFetchParams to a copy of fetchParams. + httpFetchParams = { ...fetchParams } + + // 3. Set httpFetchParams’s request to httpRequest. + httpFetchParams.request = httpRequest + } + + // 3. Let includeCredentials be true if one of + const includeCredentials = + request.credentials === 'include' || + (request.credentials === 'same-origin' && + request.responseTainting === 'basic') + + // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s + // body is non-null; otherwise null. + const contentLength = httpRequest.body ? httpRequest.body.length : null + + // 5. Let contentLengthHeaderValue be null. + let contentLengthHeaderValue = null + + // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or + // `PUT`, then set contentLengthHeaderValue to `0`. + if ( + httpRequest.body == null && + ['POST', 'PUT'].includes(httpRequest.method) + ) { + contentLengthHeaderValue = '0' + } + + // 7. If contentLength is non-null, then set contentLengthHeaderValue to + // contentLength, serialized and isomorphic encoded. + if (contentLength != null) { + contentLengthHeaderValue = isomorphicEncode(`${contentLength}`) + } + + // 8. If contentLengthHeaderValue is non-null, then append + // `Content-Length`/contentLengthHeaderValue to httpRequest’s header + // list. + if (contentLengthHeaderValue != null) { + httpRequest.headersList.append('content-length', contentLengthHeaderValue) + } + + // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`, + // contentLengthHeaderValue) to httpRequest’s header list. + + // 10. If contentLength is non-null and httpRequest’s keepalive is true, + // then: + if (contentLength != null && httpRequest.keepalive) { + // NOTE: keepalive is a noop outside of browser context. + } + + // 11. If httpRequest’s referrer is a URL, then append + // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded, + // to httpRequest’s header list. + if (httpRequest.referrer instanceof URL) { + httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href)) + } + + // 12. Append a request `Origin` header for httpRequest. + appendRequestOriginHeader(httpRequest) + + // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA] + appendFetchMetadata(httpRequest) + + // 14. If httpRequest’s header list does not contain `User-Agent`, then + // user agents should append `User-Agent`/default `User-Agent` value to + // httpRequest’s header list. + if (!httpRequest.headersList.contains('user-agent')) { + httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node') + } + + // 15. If httpRequest’s cache mode is "default" and httpRequest’s header + // list contains `If-Modified-Since`, `If-None-Match`, + // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set + // httpRequest’s cache mode to "no-store". + if ( + httpRequest.cache === 'default' && + (httpRequest.headersList.contains('if-modified-since') || + httpRequest.headersList.contains('if-none-match') || + httpRequest.headersList.contains('if-unmodified-since') || + httpRequest.headersList.contains('if-match') || + httpRequest.headersList.contains('if-range')) + ) { + httpRequest.cache = 'no-store' + } + + // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent + // no-cache cache-control header modification flag is unset, and + // httpRequest’s header list does not contain `Cache-Control`, then append + // `Cache-Control`/`max-age=0` to httpRequest’s header list. + if ( + httpRequest.cache === 'no-cache' && + !httpRequest.preventNoCacheCacheControlHeaderModification && + !httpRequest.headersList.contains('cache-control') + ) { + httpRequest.headersList.append('cache-control', 'max-age=0') + } + + // 17. If httpRequest’s cache mode is "no-store" or "reload", then: + if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') { + // 1. If httpRequest’s header list does not contain `Pragma`, then append + // `Pragma`/`no-cache` to httpRequest’s header list. + if (!httpRequest.headersList.contains('pragma')) { + httpRequest.headersList.append('pragma', 'no-cache') + } + + // 2. If httpRequest’s header list does not contain `Cache-Control`, + // then append `Cache-Control`/`no-cache` to httpRequest’s header list. + if (!httpRequest.headersList.contains('cache-control')) { + httpRequest.headersList.append('cache-control', 'no-cache') + } + } + + // 18. If httpRequest’s header list contains `Range`, then append + // `Accept-Encoding`/`identity` to httpRequest’s header list. + if (httpRequest.headersList.contains('range')) { + httpRequest.headersList.append('accept-encoding', 'identity') + } + + // 19. Modify httpRequest’s header list per HTTP. Do not append a given + // header if httpRequest’s header list contains that header’s name. + // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129 + if (!httpRequest.headersList.contains('accept-encoding')) { + if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) { + httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate') + } else { + httpRequest.headersList.append('accept-encoding', 'gzip, deflate') + } + } + + httpRequest.headersList.delete('host') + + // 20. If includeCredentials is true, then: + if (includeCredentials) { + // 1. If the user agent is not configured to block cookies for httpRequest + // (see section 7 of [COOKIES]), then: + // TODO: credentials + // 2. If httpRequest’s header list does not contain `Authorization`, then: + // TODO: credentials + } + + // 21. If there’s a proxy-authentication entry, use it as appropriate. + // TODO: proxy-authentication + + // 22. Set httpCache to the result of determining the HTTP cache + // partition, given httpRequest. + // TODO: cache + + // 23. If httpCache is null, then set httpRequest’s cache mode to + // "no-store". + if (httpCache == null) { + httpRequest.cache = 'no-store' + } + + // 24. If httpRequest’s cache mode is neither "no-store" nor "reload", + // then: + if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') { + // TODO: cache + } + + // 9. If aborted, then return the appropriate network error for fetchParams. + // TODO + + // 10. If response is null, then: + if (response == null) { + // 1. If httpRequest’s cache mode is "only-if-cached", then return a + // network error. + if (httpRequest.mode === 'only-if-cached') { + return makeNetworkError('only if cached') + } + + // 2. Let forwardResponse be the result of running HTTP-network fetch + // given httpFetchParams, includeCredentials, and isNewConnectionFetch. + const forwardResponse = await httpNetworkFetch( + httpFetchParams, + includeCredentials, + isNewConnectionFetch + ) + + // 3. If httpRequest’s method is unsafe and forwardResponse’s status is + // in the range 200 to 399, inclusive, invalidate appropriate stored + // responses in httpCache, as per the "Invalidation" chapter of HTTP + // Caching, and set storedResponse to null. [HTTP-CACHING] + if ( + !safeMethodsSet.has(httpRequest.method) && + forwardResponse.status >= 200 && + forwardResponse.status <= 399 + ) { + // TODO: cache + } + + // 4. If the revalidatingFlag is set and forwardResponse’s status is 304, + // then: + if (revalidatingFlag && forwardResponse.status === 304) { + // TODO: cache + } + + // 5. If response is null, then: + if (response == null) { + // 1. Set response to forwardResponse. + response = forwardResponse + + // 2. Store httpRequest and forwardResponse in httpCache, as per the + // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING] + // TODO: cache + } + } + + // 11. Set response’s URL list to a clone of httpRequest’s URL list. + response.urlList = [...httpRequest.urlList] + + // 12. If httpRequest’s header list contains `Range`, then set response’s + // range-requested flag. + if (httpRequest.headersList.contains('range')) { + response.rangeRequested = true + } + + // 13. Set response’s request-includes-credentials to includeCredentials. + response.requestIncludesCredentials = includeCredentials + + // 14. If response’s status is 401, httpRequest’s response tainting is not + // "cors", includeCredentials is true, and request’s window is an environment + // settings object, then: + // TODO + + // 15. If response’s status is 407, then: + if (response.status === 407) { + // 1. If request’s window is "no-window", then return a network error. + if (request.window === 'no-window') { + return makeNetworkError() + } + + // 2. ??? + + // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams. + if (isCancelled(fetchParams)) { + return makeAppropriateNetworkError(fetchParams) + } + + // 4. Prompt the end user as appropriate in request’s window and store + // the result as a proxy-authentication entry. [HTTP-AUTH] + // TODO: Invoke some kind of callback? + + // 5. Set response to the result of running HTTP-network-or-cache fetch given + // fetchParams. + // TODO + return makeNetworkError('proxy authentication required') + } + + // 16. If all of the following are true + if ( + // response’s status is 421 + response.status === 421 && + // isNewConnectionFetch is false + !isNewConnectionFetch && + // request’s body is null, or request’s body is non-null and request’s body’s source is non-null + (request.body == null || request.body.source != null) + ) { + // then: + + // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams. + if (isCancelled(fetchParams)) { + return makeAppropriateNetworkError(fetchParams) + } + + // 2. Set response to the result of running HTTP-network-or-cache + // fetch given fetchParams, isAuthenticationFetch, and true. + + // TODO (spec): The spec doesn't specify this but we need to cancel + // the active response before we can start a new one. + // https://github.com/whatwg/fetch/issues/1293 + fetchParams.controller.connection.destroy() + + response = await httpNetworkOrCacheFetch( + fetchParams, + isAuthenticationFetch, + true + ) + } + + // 17. If isAuthenticationFetch is true, then create an authentication entry + if (isAuthenticationFetch) { + // TODO + } + + // 18. Return response. + return response +} + +// https://fetch.spec.whatwg.org/#http-network-fetch +async function httpNetworkFetch ( + fetchParams, + includeCredentials = false, + forceNewConnection = false +) { + assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed) + + fetchParams.controller.connection = { + abort: null, + destroyed: false, + destroy (err) { + if (!this.destroyed) { + this.destroyed = true + this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError')) + } + } + } + + // 1. Let request be fetchParams’s request. + const request = fetchParams.request + + // 2. Let response be null. + let response = null + + // 3. Let timingInfo be fetchParams’s timing info. + const timingInfo = fetchParams.timingInfo + + // 4. Let httpCache be the result of determining the HTTP cache partition, + // given request. + // TODO: cache + const httpCache = null + + // 5. If httpCache is null, then set request’s cache mode to "no-store". + if (httpCache == null) { + request.cache = 'no-store' + } + + // 6. Let networkPartitionKey be the result of determining the network + // partition key given request. + // TODO + + // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise + // "no". + const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars + + // 8. Switch on request’s mode: + if (request.mode === 'websocket') { + // Let connection be the result of obtaining a WebSocket connection, + // given request’s current URL. + // TODO + } else { + // Let connection be the result of obtaining a connection, given + // networkPartitionKey, request’s current URL’s origin, + // includeCredentials, and forceNewConnection. + // TODO + } + + // 9. Run these steps, but abort when the ongoing fetch is terminated: + + // 1. If connection is failure, then return a network error. + + // 2. Set timingInfo’s final connection timing info to the result of + // calling clamp and coarsen connection timing info with connection’s + // timing info, timingInfo’s post-redirect start time, and fetchParams’s + // cross-origin isolated capability. + + // 3. If connection is not an HTTP/2 connection, request’s body is non-null, + // and request’s body’s source is null, then append (`Transfer-Encoding`, + // `chunked`) to request’s header list. + + // 4. Set timingInfo’s final network-request start time to the coarsened + // shared current time given fetchParams’s cross-origin isolated + // capability. + + // 5. Set response to the result of making an HTTP request over connection + // using request with the following caveats: + + // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS] + // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH] + + // - If request’s body is non-null, and request’s body’s source is null, + // then the user agent may have a buffer of up to 64 kibibytes and store + // a part of request’s body in that buffer. If the user agent reads from + // request’s body beyond that buffer’s size and the user agent needs to + // resend request, then instead return a network error. + + // - Set timingInfo’s final network-response start time to the coarsened + // shared current time given fetchParams’s cross-origin isolated capability, + // immediately after the user agent’s HTTP parser receives the first byte + // of the response (e.g., frame header bytes for HTTP/2 or response status + // line for HTTP/1.x). + + // - Wait until all the headers are transmitted. + + // - Any responses whose status is in the range 100 to 199, inclusive, + // and is not 101, are to be ignored, except for the purposes of setting + // timingInfo’s final network-response start time above. + + // - If request’s header list contains `Transfer-Encoding`/`chunked` and + // response is transferred via HTTP/1.0 or older, then return a network + // error. + + // - If the HTTP request results in a TLS client certificate dialog, then: + + // 1. If request’s window is an environment settings object, make the + // dialog available in request’s window. + + // 2. Otherwise, return a network error. + + // To transmit request’s body body, run these steps: + let requestBody = null + // 1. If body is null and fetchParams’s process request end-of-body is + // non-null, then queue a fetch task given fetchParams’s process request + // end-of-body and fetchParams’s task destination. + if (request.body == null && fetchParams.processRequestEndOfBody) { + queueMicrotask(() => fetchParams.processRequestEndOfBody()) + } else if (request.body != null) { + // 2. Otherwise, if body is non-null: + + // 1. Let processBodyChunk given bytes be these steps: + const processBodyChunk = async function * (bytes) { + // 1. If the ongoing fetch is terminated, then abort these steps. + if (isCancelled(fetchParams)) { + return + } + + // 2. Run this step in parallel: transmit bytes. + yield bytes + + // 3. If fetchParams’s process request body is non-null, then run + // fetchParams’s process request body given bytes’s length. + fetchParams.processRequestBodyChunkLength?.(bytes.byteLength) + } + + // 2. Let processEndOfBody be these steps: + const processEndOfBody = () => { + // 1. If fetchParams is canceled, then abort these steps. + if (isCancelled(fetchParams)) { + return + } + + // 2. If fetchParams’s process request end-of-body is non-null, + // then run fetchParams’s process request end-of-body. + if (fetchParams.processRequestEndOfBody) { + fetchParams.processRequestEndOfBody() + } + } + + // 3. Let processBodyError given e be these steps: + const processBodyError = (e) => { + // 1. If fetchParams is canceled, then abort these steps. + if (isCancelled(fetchParams)) { + return + } + + // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller. + if (e.name === 'AbortError') { + fetchParams.controller.abort() + } else { + fetchParams.controller.terminate(e) + } + } + + // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody, + // processBodyError, and fetchParams’s task destination. + requestBody = (async function * () { + try { + for await (const bytes of request.body.stream) { + yield * processBodyChunk(bytes) + } + processEndOfBody() + } catch (err) { + processBodyError(err) + } + })() + } + + try { + // socket is only provided for websockets + const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody }) + + if (socket) { + response = makeResponse({ status, statusText, headersList, socket }) + } else { + const iterator = body[Symbol.asyncIterator]() + fetchParams.controller.next = () => iterator.next() + + response = makeResponse({ status, statusText, headersList }) + } + } catch (err) { + // 10. If aborted, then: + if (err.name === 'AbortError') { + // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame. + fetchParams.controller.connection.destroy() + + // 2. Return the appropriate network error for fetchParams. + return makeAppropriateNetworkError(fetchParams, err) + } + + return makeNetworkError(err) + } + + // 11. Let pullAlgorithm be an action that resumes the ongoing fetch + // if it is suspended. + const pullAlgorithm = () => { + fetchParams.controller.resume() + } + + // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s + // controller with reason, given reason. + const cancelAlgorithm = (reason) => { + fetchParams.controller.abort(reason) + } + + // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by + // the user agent. + // TODO + + // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object + // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent. + // TODO + + // 15. Let stream be a new ReadableStream. + // 16. Set up stream with pullAlgorithm set to pullAlgorithm, + // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to + // highWaterMark, and sizeAlgorithm set to sizeAlgorithm. + if (!ReadableStream) { + ReadableStream = (__nccwpck_require__(35356).ReadableStream) + } + + const stream = new ReadableStream( + { + async start (controller) { + fetchParams.controller.controller = controller + }, + async pull (controller) { + await pullAlgorithm(controller) + }, + async cancel (reason) { + await cancelAlgorithm(reason) + } + }, + { + highWaterMark: 0, + size () { + return 1 + } + } + ) + + // 17. Run these steps, but abort when the ongoing fetch is terminated: + + // 1. Set response’s body to a new body whose stream is stream. + response.body = { stream } + + // 2. If response is not a network error and request’s cache mode is + // not "no-store", then update response in httpCache for request. + // TODO + + // 3. If includeCredentials is true and the user agent is not configured + // to block cookies for request (see section 7 of [COOKIES]), then run the + // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on + // the value of each header whose name is a byte-case-insensitive match for + // `Set-Cookie` in response’s header list, if any, and request’s current URL. + // TODO + + // 18. If aborted, then: + // TODO + + // 19. Run these steps in parallel: + + // 1. Run these steps, but abort when fetchParams is canceled: + fetchParams.controller.on('terminated', onAborted) + fetchParams.controller.resume = async () => { + // 1. While true + while (true) { + // 1-3. See onData... + + // 4. Set bytes to the result of handling content codings given + // codings and bytes. + let bytes + let isFailure + try { + const { done, value } = await fetchParams.controller.next() + + if (isAborted(fetchParams)) { + break + } + + bytes = done ? undefined : value + } catch (err) { + if (fetchParams.controller.ended && !timingInfo.encodedBodySize) { + // zlib doesn't like empty streams. + bytes = undefined + } else { + bytes = err + + // err may be propagated from the result of calling readablestream.cancel, + // which might not be an error. https://github.com/nodejs/undici/issues/2009 + isFailure = true + } + } + + if (bytes === undefined) { + // 2. Otherwise, if the bytes transmission for response’s message + // body is done normally and stream is readable, then close + // stream, finalize response for fetchParams and response, and + // abort these in-parallel steps. + readableStreamClose(fetchParams.controller.controller) + + finalizeResponse(fetchParams, response) + + return + } + + // 5. Increase timingInfo’s decoded body size by bytes’s length. + timingInfo.decodedBodySize += bytes?.byteLength ?? 0 + + // 6. If bytes is failure, then terminate fetchParams’s controller. + if (isFailure) { + fetchParams.controller.terminate(bytes) + return + } + + // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes + // into stream. + fetchParams.controller.controller.enqueue(new Uint8Array(bytes)) + + // 8. If stream is errored, then terminate the ongoing fetch. + if (isErrored(stream)) { + fetchParams.controller.terminate() + return + } + + // 9. If stream doesn’t need more data ask the user agent to suspend + // the ongoing fetch. + if (!fetchParams.controller.controller.desiredSize) { + return + } + } + } + + // 2. If aborted, then: + function onAborted (reason) { + // 2. If fetchParams is aborted, then: + if (isAborted(fetchParams)) { + // 1. Set response’s aborted flag. + response.aborted = true + + // 2. If stream is readable, then error stream with the result of + // deserialize a serialized abort reason given fetchParams’s + // controller’s serialized abort reason and an + // implementation-defined realm. + if (isReadable(stream)) { + fetchParams.controller.controller.error( + fetchParams.controller.serializedAbortReason + ) + } + } else { + // 3. Otherwise, if stream is readable, error stream with a TypeError. + if (isReadable(stream)) { + fetchParams.controller.controller.error(new TypeError('terminated', { + cause: isErrorLike(reason) ? reason : undefined + })) + } + } + + // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame. + // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so. + fetchParams.controller.connection.destroy() + } + + // 20. Return response. + return response + + async function dispatch ({ body }) { + const url = requestCurrentURL(request) + /** @type {import('../..').Agent} */ + const agent = fetchParams.controller.dispatcher + + return new Promise((resolve, reject) => agent.dispatch( + { + path: url.pathname + url.search, + origin: url.origin, + method: request.method, + body: fetchParams.controller.dispatcher.isMockActive ? request.body && request.body.source : body, + headers: request.headersList.entries, + maxRedirections: 0, + upgrade: request.mode === 'websocket' ? 'websocket' : undefined + }, + { + body: null, + abort: null, + + onConnect (abort) { + // TODO (fix): Do we need connection here? + const { connection } = fetchParams.controller + + if (connection.destroyed) { + abort(new DOMException('The operation was aborted.', 'AbortError')) + } else { + fetchParams.controller.on('terminated', abort) + this.abort = connection.abort = abort + } + }, + + onHeaders (status, headersList, resume, statusText) { + if (status < 200) { + return + } + + let codings = [] + let location = '' + + const headers = new Headers() + + // For H2, the headers are a plain JS object + // We distinguish between them and iterate accordingly + if (Array.isArray(headersList)) { + for (let n = 0; n < headersList.length; n += 2) { + const key = headersList[n + 0].toString('latin1') + const val = headersList[n + 1].toString('latin1') + if (key.toLowerCase() === 'content-encoding') { + // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1 + // "All content-coding values are case-insensitive..." + codings = val.toLowerCase().split(',').map((x) => x.trim()) + } else if (key.toLowerCase() === 'location') { + location = val + } + + headers.append(key, val) + } + } else { + const keys = Object.keys(headersList) + for (const key of keys) { + const val = headersList[key] + if (key.toLowerCase() === 'content-encoding') { + // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1 + // "All content-coding values are case-insensitive..." + codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse() + } else if (key.toLowerCase() === 'location') { + location = val + } + + headers.append(key, val) + } + } + + this.body = new Readable({ read: resume }) + + const decoders = [] + + const willFollow = request.redirect === 'follow' && + location && + redirectStatusSet.has(status) + + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding + if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) { + for (const coding of codings) { + // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2 + if (coding === 'x-gzip' || coding === 'gzip') { + decoders.push(zlib.createGunzip({ + // Be less strict when decoding compressed responses, since sometimes + // servers send slightly invalid responses that are still accepted + // by common browsers. + // Always using Z_SYNC_FLUSH is what cURL does. + flush: zlib.constants.Z_SYNC_FLUSH, + finishFlush: zlib.constants.Z_SYNC_FLUSH + })) + } else if (coding === 'deflate') { + decoders.push(zlib.createInflate()) + } else if (coding === 'br') { + decoders.push(zlib.createBrotliDecompress()) + } else { + decoders.length = 0 + break + } + } + } + + resolve({ + status, + statusText, + headersList: headers[kHeadersList], + body: decoders.length + ? pipeline(this.body, ...decoders, () => { }) + : this.body.on('error', () => {}) + }) + + return true + }, + + onData (chunk) { + if (fetchParams.controller.dump) { + return + } + + // 1. If one or more bytes have been transmitted from response’s + // message body, then: + + // 1. Let bytes be the transmitted bytes. + const bytes = chunk + + // 2. Let codings be the result of extracting header list values + // given `Content-Encoding` and response’s header list. + // See pullAlgorithm. + + // 3. Increase timingInfo’s encoded body size by bytes’s length. + timingInfo.encodedBodySize += bytes.byteLength + + // 4. See pullAlgorithm... + + return this.body.push(bytes) + }, + + onComplete () { + if (this.abort) { + fetchParams.controller.off('terminated', this.abort) + } + + fetchParams.controller.ended = true + + this.body.push(null) + }, + + onError (error) { + if (this.abort) { + fetchParams.controller.off('terminated', this.abort) + } + + this.body?.destroy(error) + + fetchParams.controller.terminate(error) + + reject(error) + }, + + onUpgrade (status, headersList, socket) { + if (status !== 101) { + return + } + + const headers = new Headers() + + for (let n = 0; n < headersList.length; n += 2) { + const key = headersList[n + 0].toString('latin1') + const val = headersList[n + 1].toString('latin1') + + headers.append(key, val) + } + + resolve({ + status, + statusText: STATUS_CODES[status], + headersList: headers[kHeadersList], + socket + }) + + return true + } + } + )) + } +} + +module.exports = { + fetch, + Fetch, + fetching, + finalizeAndReportTiming +} + + +/***/ }), + +/***/ 48359: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +/* globals AbortController */ + + + +const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(41472) +const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(10554) +const { FinalizationRegistry } = __nccwpck_require__(56436)() +const util = __nccwpck_require__(83983) +const { + isValidHTTPToken, + sameOrigin, + normalizeMethod, + makePolicyContainer +} = __nccwpck_require__(52538) +const { + forbiddenMethodsSet, + corsSafeListedMethodsSet, + referrerPolicy, + requestRedirect, + requestMode, + requestCredentials, + requestCache, + requestDuplex +} = __nccwpck_require__(41037) +const { kEnumerableProperty } = util +const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(15861) +const { webidl } = __nccwpck_require__(21744) +const { getGlobalOrigin } = __nccwpck_require__(71246) +const { URLSerializer } = __nccwpck_require__(685) +const { kHeadersList } = __nccwpck_require__(72785) +const assert = __nccwpck_require__(39491) +const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(82361) + +let TransformStream = globalThis.TransformStream + +const kInit = Symbol('init') +const kAbortController = Symbol('abortController') + +const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { + signal.removeEventListener('abort', abort) +}) + +// https://fetch.spec.whatwg.org/#request-class +class Request { + // https://fetch.spec.whatwg.org/#dom-request + constructor (input, init = {}) { + if (input === kInit) { + return + } + + webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' }) + + input = webidl.converters.RequestInfo(input) + init = webidl.converters.RequestInit(init) + + // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object + this[kRealm] = { + settingsObject: { + baseUrl: getGlobalOrigin(), + get origin () { + return this.baseUrl?.origin + }, + policyContainer: makePolicyContainer() + } + } + + // 1. Let request be null. + let request = null + + // 2. Let fallbackMode be null. + let fallbackMode = null + + // 3. Let baseURL be this’s relevant settings object’s API base URL. + const baseUrl = this[kRealm].settingsObject.baseUrl + + // 4. Let signal be null. + let signal = null + + // 5. If input is a string, then: + if (typeof input === 'string') { + // 1. Let parsedURL be the result of parsing input with baseURL. + // 2. If parsedURL is failure, then throw a TypeError. + let parsedURL + try { + parsedURL = new URL(input, baseUrl) + } catch (err) { + throw new TypeError('Failed to parse URL from ' + input, { cause: err }) + } + + // 3. If parsedURL includes credentials, then throw a TypeError. + if (parsedURL.username || parsedURL.password) { + throw new TypeError( + 'Request cannot be constructed from a URL that includes credentials: ' + + input + ) + } + + // 4. Set request to a new request whose URL is parsedURL. + request = makeRequest({ urlList: [parsedURL] }) + + // 5. Set fallbackMode to "cors". + fallbackMode = 'cors' + } else { + // 6. Otherwise: + + // 7. Assert: input is a Request object. + assert(input instanceof Request) + + // 8. Set request to input’s request. + request = input[kState] + + // 9. Set signal to input’s signal. + signal = input[kSignal] + } + + // 7. Let origin be this’s relevant settings object’s origin. + const origin = this[kRealm].settingsObject.origin + + // 8. Let window be "client". + let window = 'client' + + // 9. If request’s window is an environment settings object and its origin + // is same origin with origin, then set window to request’s window. + if ( + request.window?.constructor?.name === 'EnvironmentSettingsObject' && + sameOrigin(request.window, origin) + ) { + window = request.window + } + + // 10. If init["window"] exists and is non-null, then throw a TypeError. + if (init.window != null) { + throw new TypeError(`'window' option '${window}' must be null`) + } + + // 11. If init["window"] exists, then set window to "no-window". + if ('window' in init) { + window = 'no-window' + } + + // 12. Set request to a new request with the following properties: + request = makeRequest({ + // URL request’s URL. + // undici implementation note: this is set as the first item in request's urlList in makeRequest + // method request’s method. + method: request.method, + // header list A copy of request’s header list. + // undici implementation note: headersList is cloned in makeRequest + headersList: request.headersList, + // unsafe-request flag Set. + unsafeRequest: request.unsafeRequest, + // client This’s relevant settings object. + client: this[kRealm].settingsObject, + // window window. + window, + // priority request’s priority. + priority: request.priority, + // origin request’s origin. The propagation of the origin is only significant for navigation requests + // being handled by a service worker. In this scenario a request can have an origin that is different + // from the current client. + origin: request.origin, + // referrer request’s referrer. + referrer: request.referrer, + // referrer policy request’s referrer policy. + referrerPolicy: request.referrerPolicy, + // mode request’s mode. + mode: request.mode, + // credentials mode request’s credentials mode. + credentials: request.credentials, + // cache mode request’s cache mode. + cache: request.cache, + // redirect mode request’s redirect mode. + redirect: request.redirect, + // integrity metadata request’s integrity metadata. + integrity: request.integrity, + // keepalive request’s keepalive. + keepalive: request.keepalive, + // reload-navigation flag request’s reload-navigation flag. + reloadNavigation: request.reloadNavigation, + // history-navigation flag request’s history-navigation flag. + historyNavigation: request.historyNavigation, + // URL list A clone of request’s URL list. + urlList: [...request.urlList] + }) + + // 13. If init is not empty, then: + if (Object.keys(init).length > 0) { + // 1. If request’s mode is "navigate", then set it to "same-origin". + if (request.mode === 'navigate') { + request.mode = 'same-origin' + } + + // 2. Unset request’s reload-navigation flag. + request.reloadNavigation = false + + // 3. Unset request’s history-navigation flag. + request.historyNavigation = false + + // 4. Set request’s origin to "client". + request.origin = 'client' + + // 5. Set request’s referrer to "client" + request.referrer = 'client' + + // 6. Set request’s referrer policy to the empty string. + request.referrerPolicy = '' + + // 7. Set request’s URL to request’s current URL. + request.url = request.urlList[request.urlList.length - 1] + + // 8. Set request’s URL list to « request’s URL ». + request.urlList = [request.url] + } + + // 14. If init["referrer"] exists, then: + if (init.referrer !== undefined) { + // 1. Let referrer be init["referrer"]. + const referrer = init.referrer + + // 2. If referrer is the empty string, then set request’s referrer to "no-referrer". + if (referrer === '') { + request.referrer = 'no-referrer' + } else { + // 1. Let parsedReferrer be the result of parsing referrer with + // baseURL. + // 2. If parsedReferrer is failure, then throw a TypeError. + let parsedReferrer + try { + parsedReferrer = new URL(referrer, baseUrl) + } catch (err) { + throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err }) + } + + // 3. If one of the following is true + // - parsedReferrer’s scheme is "about" and path is the string "client" + // - parsedReferrer’s origin is not same origin with origin + // then set request’s referrer to "client". + if ( + (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') || + (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl)) + ) { + request.referrer = 'client' + } else { + // 4. Otherwise, set request’s referrer to parsedReferrer. + request.referrer = parsedReferrer + } + } + } + + // 15. If init["referrerPolicy"] exists, then set request’s referrer policy + // to it. + if (init.referrerPolicy !== undefined) { + request.referrerPolicy = init.referrerPolicy + } + + // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise. + let mode + if (init.mode !== undefined) { + mode = init.mode + } else { + mode = fallbackMode + } + + // 17. If mode is "navigate", then throw a TypeError. + if (mode === 'navigate') { + throw webidl.errors.exception({ + header: 'Request constructor', + message: 'invalid request mode navigate.' + }) + } + + // 18. If mode is non-null, set request’s mode to mode. + if (mode != null) { + request.mode = mode + } + + // 19. If init["credentials"] exists, then set request’s credentials mode + // to it. + if (init.credentials !== undefined) { + request.credentials = init.credentials + } + + // 18. If init["cache"] exists, then set request’s cache mode to it. + if (init.cache !== undefined) { + request.cache = init.cache + } + + // 21. If request’s cache mode is "only-if-cached" and request’s mode is + // not "same-origin", then throw a TypeError. + if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') { + throw new TypeError( + "'only-if-cached' can be set only with 'same-origin' mode" + ) + } + + // 22. If init["redirect"] exists, then set request’s redirect mode to it. + if (init.redirect !== undefined) { + request.redirect = init.redirect + } + + // 23. If init["integrity"] exists, then set request’s integrity metadata to it. + if (init.integrity !== undefined && init.integrity != null) { + request.integrity = String(init.integrity) + } + + // 24. If init["keepalive"] exists, then set request’s keepalive to it. + if (init.keepalive !== undefined) { + request.keepalive = Boolean(init.keepalive) + } + + // 25. If init["method"] exists, then: + if (init.method !== undefined) { + // 1. Let method be init["method"]. + let method = init.method + + // 2. If method is not a method or method is a forbidden method, then + // throw a TypeError. + if (!isValidHTTPToken(init.method)) { + throw TypeError(`'${init.method}' is not a valid HTTP method.`) + } + + if (forbiddenMethodsSet.has(method.toUpperCase())) { + throw TypeError(`'${init.method}' HTTP method is unsupported.`) + } + + // 3. Normalize method. + method = normalizeMethod(init.method) + + // 4. Set request’s method to method. + request.method = method + } + + // 26. If init["signal"] exists, then set signal to it. + if (init.signal !== undefined) { + signal = init.signal + } + + // 27. Set this’s request to request. + this[kState] = request + + // 28. Set this’s signal to a new AbortSignal object with this’s relevant + // Realm. + // TODO: could this be simplified with AbortSignal.any + // (https://dom.spec.whatwg.org/#dom-abortsignal-any) + const ac = new AbortController() + this[kSignal] = ac.signal + this[kSignal][kRealm] = this[kRealm] + + // 29. If signal is not null, then make this’s signal follow signal. + if (signal != null) { + if ( + !signal || + typeof signal.aborted !== 'boolean' || + typeof signal.addEventListener !== 'function' + ) { + throw new TypeError( + "Failed to construct 'Request': member signal is not of type AbortSignal." + ) + } + + if (signal.aborted) { + ac.abort(signal.reason) + } else { + // Keep a strong ref to ac while request object + // is alive. This is needed to prevent AbortController + // from being prematurely garbage collected. + // See, https://github.com/nodejs/undici/issues/1926. + this[kAbortController] = ac + + const acRef = new WeakRef(ac) + const abort = function () { + const ac = acRef.deref() + if (ac !== undefined) { + ac.abort(this.reason) + } + } + + // Third-party AbortControllers may not work with these. + // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619. + try { + // If the max amount of listeners is equal to the default, increase it + // This is only available in node >= v19.9.0 + if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) { + setMaxListeners(100, signal) + } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) { + setMaxListeners(100, signal) + } + } catch {} + + util.addAbortListener(signal, abort) + requestFinalizer.register(ac, { signal, abort }) + } + } + + // 30. Set this’s headers to a new Headers object with this’s relevant + // Realm, whose header list is request’s header list and guard is + // "request". + this[kHeaders] = new Headers() + this[kHeaders][kHeadersList] = request.headersList + this[kHeaders][kGuard] = 'request' + this[kHeaders][kRealm] = this[kRealm] + + // 31. If this’s request’s mode is "no-cors", then: + if (mode === 'no-cors') { + // 1. If this’s request’s method is not a CORS-safelisted method, + // then throw a TypeError. + if (!corsSafeListedMethodsSet.has(request.method)) { + throw new TypeError( + `'${request.method} is unsupported in no-cors mode.` + ) + } + + // 2. Set this’s headers’s guard to "request-no-cors". + this[kHeaders][kGuard] = 'request-no-cors' + } + + // 32. If init is not empty, then: + if (Object.keys(init).length !== 0) { + // 1. Let headers be a copy of this’s headers and its associated header + // list. + let headers = new Headers(this[kHeaders]) + + // 2. If init["headers"] exists, then set headers to init["headers"]. + if (init.headers !== undefined) { + headers = init.headers + } + + // 3. Empty this’s headers’s header list. + this[kHeaders][kHeadersList].clear() + + // 4. If headers is a Headers object, then for each header in its header + // list, append header’s name/header’s value to this’s headers. + if (headers.constructor.name === 'Headers') { + for (const [key, val] of headers) { + this[kHeaders].append(key, val) + } + } else { + // 5. Otherwise, fill this’s headers with headers. + fillHeaders(this[kHeaders], headers) + } + } + + // 33. Let inputBody be input’s request’s body if input is a Request + // object; otherwise null. + const inputBody = input instanceof Request ? input[kState].body : null + + // 34. If either init["body"] exists and is non-null or inputBody is + // non-null, and request’s method is `GET` or `HEAD`, then throw a + // TypeError. + if ( + (init.body != null || inputBody != null) && + (request.method === 'GET' || request.method === 'HEAD') + ) { + throw new TypeError('Request with GET/HEAD method cannot have body.') + } + + // 35. Let initBody be null. + let initBody = null + + // 36. If init["body"] exists and is non-null, then: + if (init.body != null) { + // 1. Let Content-Type be null. + // 2. Set initBody and Content-Type to the result of extracting + // init["body"], with keepalive set to request’s keepalive. + const [extractedBody, contentType] = extractBody( + init.body, + request.keepalive + ) + initBody = extractedBody + + // 3, If Content-Type is non-null and this’s headers’s header list does + // not contain `Content-Type`, then append `Content-Type`/Content-Type to + // this’s headers. + if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) { + this[kHeaders].append('content-type', contentType) + } + } + + // 37. Let inputOrInitBody be initBody if it is non-null; otherwise + // inputBody. + const inputOrInitBody = initBody ?? inputBody + + // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is + // null, then: + if (inputOrInitBody != null && inputOrInitBody.source == null) { + // 1. If initBody is non-null and init["duplex"] does not exist, + // then throw a TypeError. + if (initBody != null && init.duplex == null) { + throw new TypeError('RequestInit: duplex option is required when sending a body.') + } + + // 2. If this’s request’s mode is neither "same-origin" nor "cors", + // then throw a TypeError. + if (request.mode !== 'same-origin' && request.mode !== 'cors') { + throw new TypeError( + 'If request is made from ReadableStream, mode should be "same-origin" or "cors"' + ) + } + + // 3. Set this’s request’s use-CORS-preflight flag. + request.useCORSPreflightFlag = true + } + + // 39. Let finalBody be inputOrInitBody. + let finalBody = inputOrInitBody + + // 40. If initBody is null and inputBody is non-null, then: + if (initBody == null && inputBody != null) { + // 1. If input is unusable, then throw a TypeError. + if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) { + throw new TypeError( + 'Cannot construct a Request with a Request object that has already been used.' + ) + } + + // 2. Set finalBody to the result of creating a proxy for inputBody. + if (!TransformStream) { + TransformStream = (__nccwpck_require__(35356).TransformStream) + } + + // https://streams.spec.whatwg.org/#readablestream-create-a-proxy + const identityTransform = new TransformStream() + inputBody.stream.pipeThrough(identityTransform) + finalBody = { + source: inputBody.source, + length: inputBody.length, + stream: identityTransform.readable + } + } + + // 41. Set this’s request’s body to finalBody. + this[kState].body = finalBody + } + + // Returns request’s HTTP method, which is "GET" by default. + get method () { + webidl.brandCheck(this, Request) + + // The method getter steps are to return this’s request’s method. + return this[kState].method + } + + // Returns the URL of request as a string. + get url () { + webidl.brandCheck(this, Request) + + // The url getter steps are to return this’s request’s URL, serialized. + return URLSerializer(this[kState].url) + } + + // Returns a Headers object consisting of the headers associated with request. + // Note that headers added in the network layer by the user agent will not + // be accounted for in this object, e.g., the "Host" header. + get headers () { + webidl.brandCheck(this, Request) + + // The headers getter steps are to return this’s headers. + return this[kHeaders] + } + + // Returns the kind of resource requested by request, e.g., "document" + // or "script". + get destination () { + webidl.brandCheck(this, Request) + + // The destination getter are to return this’s request’s destination. + return this[kState].destination + } + + // Returns the referrer of request. Its value can be a same-origin URL if + // explicitly set in init, the empty string to indicate no referrer, and + // "about:client" when defaulting to the global’s default. This is used + // during fetching to determine the value of the `Referer` header of the + // request being made. + get referrer () { + webidl.brandCheck(this, Request) + + // 1. If this’s request’s referrer is "no-referrer", then return the + // empty string. + if (this[kState].referrer === 'no-referrer') { + return '' + } + + // 2. If this’s request’s referrer is "client", then return + // "about:client". + if (this[kState].referrer === 'client') { + return 'about:client' + } + + // Return this’s request’s referrer, serialized. + return this[kState].referrer.toString() + } + + // Returns the referrer policy associated with request. + // This is used during fetching to compute the value of the request’s + // referrer. + get referrerPolicy () { + webidl.brandCheck(this, Request) + + // The referrerPolicy getter steps are to return this’s request’s referrer policy. + return this[kState].referrerPolicy + } + + // Returns the mode associated with request, which is a string indicating + // whether the request will use CORS, or will be restricted to same-origin + // URLs. + get mode () { + webidl.brandCheck(this, Request) + + // The mode getter steps are to return this’s request’s mode. + return this[kState].mode + } + + // Returns the credentials mode associated with request, + // which is a string indicating whether credentials will be sent with the + // request always, never, or only when sent to a same-origin URL. + get credentials () { + // The credentials getter steps are to return this’s request’s credentials mode. + return this[kState].credentials + } + + // Returns the cache mode associated with request, + // which is a string indicating how the request will + // interact with the browser’s cache when fetching. + get cache () { + webidl.brandCheck(this, Request) + + // The cache getter steps are to return this’s request’s cache mode. + return this[kState].cache + } + + // Returns the redirect mode associated with request, + // which is a string indicating how redirects for the + // request will be handled during fetching. A request + // will follow redirects by default. + get redirect () { + webidl.brandCheck(this, Request) + + // The redirect getter steps are to return this’s request’s redirect mode. + return this[kState].redirect + } + + // Returns request’s subresource integrity metadata, which is a + // cryptographic hash of the resource being fetched. Its value + // consists of multiple hashes separated by whitespace. [SRI] + get integrity () { + webidl.brandCheck(this, Request) + + // The integrity getter steps are to return this’s request’s integrity + // metadata. + return this[kState].integrity + } + + // Returns a boolean indicating whether or not request can outlive the + // global in which it was created. + get keepalive () { + webidl.brandCheck(this, Request) + + // The keepalive getter steps are to return this’s request’s keepalive. + return this[kState].keepalive + } + + // Returns a boolean indicating whether or not request is for a reload + // navigation. + get isReloadNavigation () { + webidl.brandCheck(this, Request) + + // The isReloadNavigation getter steps are to return true if this’s + // request’s reload-navigation flag is set; otherwise false. + return this[kState].reloadNavigation + } + + // Returns a boolean indicating whether or not request is for a history + // navigation (a.k.a. back-foward navigation). + get isHistoryNavigation () { + webidl.brandCheck(this, Request) + + // The isHistoryNavigation getter steps are to return true if this’s request’s + // history-navigation flag is set; otherwise false. + return this[kState].historyNavigation + } + + // Returns the signal associated with request, which is an AbortSignal + // object indicating whether or not request has been aborted, and its + // abort event handler. + get signal () { + webidl.brandCheck(this, Request) + + // The signal getter steps are to return this’s signal. + return this[kSignal] + } + + get body () { + webidl.brandCheck(this, Request) + + return this[kState].body ? this[kState].body.stream : null + } + + get bodyUsed () { + webidl.brandCheck(this, Request) + + return !!this[kState].body && util.isDisturbed(this[kState].body.stream) + } + + get duplex () { + webidl.brandCheck(this, Request) + + return 'half' + } + + // Returns a clone of request. + clone () { + webidl.brandCheck(this, Request) + + // 1. If this is unusable, then throw a TypeError. + if (this.bodyUsed || this.body?.locked) { + throw new TypeError('unusable') + } + + // 2. Let clonedRequest be the result of cloning this’s request. + const clonedRequest = cloneRequest(this[kState]) + + // 3. Let clonedRequestObject be the result of creating a Request object, + // given clonedRequest, this’s headers’s guard, and this’s relevant Realm. + const clonedRequestObject = new Request(kInit) + clonedRequestObject[kState] = clonedRequest + clonedRequestObject[kRealm] = this[kRealm] + clonedRequestObject[kHeaders] = new Headers() + clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList + clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard] + clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm] + + // 4. Make clonedRequestObject’s signal follow this’s signal. + const ac = new AbortController() + if (this.signal.aborted) { + ac.abort(this.signal.reason) + } else { + util.addAbortListener( + this.signal, + () => { + ac.abort(this.signal.reason) + } + ) + } + clonedRequestObject[kSignal] = ac.signal + + // 4. Return clonedRequestObject. + return clonedRequestObject + } +} + +mixinBody(Request) + +function makeRequest (init) { + // https://fetch.spec.whatwg.org/#requests + const request = { + method: 'GET', + localURLsOnly: false, + unsafeRequest: false, + body: null, + client: null, + reservedClient: null, + replacesClientId: '', + window: 'client', + keepalive: false, + serviceWorkers: 'all', + initiator: '', + destination: '', + priority: null, + origin: 'client', + policyContainer: 'client', + referrer: 'client', + referrerPolicy: '', + mode: 'no-cors', + useCORSPreflightFlag: false, + credentials: 'same-origin', + useCredentials: false, + cache: 'default', + redirect: 'follow', + integrity: '', + cryptoGraphicsNonceMetadata: '', + parserMetadata: '', + reloadNavigation: false, + historyNavigation: false, + userActivation: false, + taintedOrigin: false, + redirectCount: 0, + responseTainting: 'basic', + preventNoCacheCacheControlHeaderModification: false, + done: false, + timingAllowFailed: false, + ...init, + headersList: init.headersList + ? new HeadersList(init.headersList) + : new HeadersList() + } + request.url = request.urlList[0] + return request +} + +// https://fetch.spec.whatwg.org/#concept-request-clone +function cloneRequest (request) { + // To clone a request request, run these steps: + + // 1. Let newRequest be a copy of request, except for its body. + const newRequest = makeRequest({ ...request, body: null }) + + // 2. If request’s body is non-null, set newRequest’s body to the + // result of cloning request’s body. + if (request.body != null) { + newRequest.body = cloneBody(request.body) + } + + // 3. Return newRequest. + return newRequest +} + +Object.defineProperties(Request.prototype, { + method: kEnumerableProperty, + url: kEnumerableProperty, + headers: kEnumerableProperty, + redirect: kEnumerableProperty, + clone: kEnumerableProperty, + signal: kEnumerableProperty, + duplex: kEnumerableProperty, + destination: kEnumerableProperty, + body: kEnumerableProperty, + bodyUsed: kEnumerableProperty, + isHistoryNavigation: kEnumerableProperty, + isReloadNavigation: kEnumerableProperty, + keepalive: kEnumerableProperty, + integrity: kEnumerableProperty, + cache: kEnumerableProperty, + credentials: kEnumerableProperty, + attribute: kEnumerableProperty, + referrerPolicy: kEnumerableProperty, + referrer: kEnumerableProperty, + mode: kEnumerableProperty, + [Symbol.toStringTag]: { + value: 'Request', + configurable: true + } +}) + +webidl.converters.Request = webidl.interfaceConverter( + Request +) + +// https://fetch.spec.whatwg.org/#requestinfo +webidl.converters.RequestInfo = function (V) { + if (typeof V === 'string') { + return webidl.converters.USVString(V) + } + + if (V instanceof Request) { + return webidl.converters.Request(V) + } + + return webidl.converters.USVString(V) +} + +webidl.converters.AbortSignal = webidl.interfaceConverter( + AbortSignal +) + +// https://fetch.spec.whatwg.org/#requestinit +webidl.converters.RequestInit = webidl.dictionaryConverter([ + { + key: 'method', + converter: webidl.converters.ByteString + }, + { + key: 'headers', + converter: webidl.converters.HeadersInit + }, + { + key: 'body', + converter: webidl.nullableConverter( + webidl.converters.BodyInit + ) + }, + { + key: 'referrer', + converter: webidl.converters.USVString + }, + { + key: 'referrerPolicy', + converter: webidl.converters.DOMString, + // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy + allowedValues: referrerPolicy + }, + { + key: 'mode', + converter: webidl.converters.DOMString, + // https://fetch.spec.whatwg.org/#concept-request-mode + allowedValues: requestMode + }, + { + key: 'credentials', + converter: webidl.converters.DOMString, + // https://fetch.spec.whatwg.org/#requestcredentials + allowedValues: requestCredentials + }, + { + key: 'cache', + converter: webidl.converters.DOMString, + // https://fetch.spec.whatwg.org/#requestcache + allowedValues: requestCache + }, + { + key: 'redirect', + converter: webidl.converters.DOMString, + // https://fetch.spec.whatwg.org/#requestredirect + allowedValues: requestRedirect + }, + { + key: 'integrity', + converter: webidl.converters.DOMString + }, + { + key: 'keepalive', + converter: webidl.converters.boolean + }, + { + key: 'signal', + converter: webidl.nullableConverter( + (signal) => webidl.converters.AbortSignal( + signal, + { strict: false } + ) + ) + }, + { + key: 'window', + converter: webidl.converters.any + }, + { + key: 'duplex', + converter: webidl.converters.DOMString, + allowedValues: requestDuplex + } +]) + +module.exports = { Request, makeRequest } + + +/***/ }), + +/***/ 27823: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { Headers, HeadersList, fill } = __nccwpck_require__(10554) +const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(41472) +const util = __nccwpck_require__(83983) +const { kEnumerableProperty } = util +const { + isValidReasonPhrase, + isCancelled, + isAborted, + isBlobLike, + serializeJavascriptValueToJSONString, + isErrorLike, + isomorphicEncode +} = __nccwpck_require__(52538) +const { + redirectStatusSet, + nullBodyStatus, + DOMException +} = __nccwpck_require__(41037) +const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(15861) +const { webidl } = __nccwpck_require__(21744) +const { FormData } = __nccwpck_require__(72015) +const { getGlobalOrigin } = __nccwpck_require__(71246) +const { URLSerializer } = __nccwpck_require__(685) +const { kHeadersList } = __nccwpck_require__(72785) +const assert = __nccwpck_require__(39491) +const { types } = __nccwpck_require__(73837) + +const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(35356).ReadableStream) +const textEncoder = new TextEncoder('utf-8') + +// https://fetch.spec.whatwg.org/#response-class +class Response { + // Creates network error Response. + static error () { + // TODO + const relevantRealm = { settingsObject: {} } + + // The static error() method steps are to return the result of creating a + // Response object, given a new network error, "immutable", and this’s + // relevant Realm. + const responseObject = new Response() + responseObject[kState] = makeNetworkError() + responseObject[kRealm] = relevantRealm + responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList + responseObject[kHeaders][kGuard] = 'immutable' + responseObject[kHeaders][kRealm] = relevantRealm + return responseObject + } + + // https://fetch.spec.whatwg.org/#dom-response-json + static json (data, init = {}) { + webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' }) + + if (init !== null) { + init = webidl.converters.ResponseInit(init) + } + + // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data. + const bytes = textEncoder.encode( + serializeJavascriptValueToJSONString(data) + ) + + // 2. Let body be the result of extracting bytes. + const body = extractBody(bytes) + + // 3. Let responseObject be the result of creating a Response object, given a new response, + // "response", and this’s relevant Realm. + const relevantRealm = { settingsObject: {} } + const responseObject = new Response() + responseObject[kRealm] = relevantRealm + responseObject[kHeaders][kGuard] = 'response' + responseObject[kHeaders][kRealm] = relevantRealm + + // 4. Perform initialize a response given responseObject, init, and (body, "application/json"). + initializeResponse(responseObject, init, { body: body[0], type: 'application/json' }) + + // 5. Return responseObject. + return responseObject + } + + // Creates a redirect Response that redirects to url with status status. + static redirect (url, status = 302) { + const relevantRealm = { settingsObject: {} } + + webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' }) + + url = webidl.converters.USVString(url) + status = webidl.converters['unsigned short'](status) + + // 1. Let parsedURL be the result of parsing url with current settings + // object’s API base URL. + // 2. If parsedURL is failure, then throw a TypeError. + // TODO: base-URL? + let parsedURL + try { + parsedURL = new URL(url, getGlobalOrigin()) + } catch (err) { + throw Object.assign(new TypeError('Failed to parse URL from ' + url), { + cause: err + }) + } + + // 3. If status is not a redirect status, then throw a RangeError. + if (!redirectStatusSet.has(status)) { + throw new RangeError('Invalid status code ' + status) + } + + // 4. Let responseObject be the result of creating a Response object, + // given a new response, "immutable", and this’s relevant Realm. + const responseObject = new Response() + responseObject[kRealm] = relevantRealm + responseObject[kHeaders][kGuard] = 'immutable' + responseObject[kHeaders][kRealm] = relevantRealm + + // 5. Set responseObject’s response’s status to status. + responseObject[kState].status = status + + // 6. Let value be parsedURL, serialized and isomorphic encoded. + const value = isomorphicEncode(URLSerializer(parsedURL)) + + // 7. Append `Location`/value to responseObject’s response’s header list. + responseObject[kState].headersList.append('location', value) + + // 8. Return responseObject. + return responseObject + } + + // https://fetch.spec.whatwg.org/#dom-response + constructor (body = null, init = {}) { + if (body !== null) { + body = webidl.converters.BodyInit(body) + } + + init = webidl.converters.ResponseInit(init) + + // TODO + this[kRealm] = { settingsObject: {} } + + // 1. Set this’s response to a new response. + this[kState] = makeResponse({}) + + // 2. Set this’s headers to a new Headers object with this’s relevant + // Realm, whose header list is this’s response’s header list and guard + // is "response". + this[kHeaders] = new Headers() + this[kHeaders][kGuard] = 'response' + this[kHeaders][kHeadersList] = this[kState].headersList + this[kHeaders][kRealm] = this[kRealm] + + // 3. Let bodyWithType be null. + let bodyWithType = null + + // 4. If body is non-null, then set bodyWithType to the result of extracting body. + if (body != null) { + const [extractedBody, type] = extractBody(body) + bodyWithType = { body: extractedBody, type } + } + + // 5. Perform initialize a response given this, init, and bodyWithType. + initializeResponse(this, init, bodyWithType) + } + + // Returns response’s type, e.g., "cors". + get type () { + webidl.brandCheck(this, Response) + + // The type getter steps are to return this’s response’s type. + return this[kState].type + } + + // Returns response’s URL, if it has one; otherwise the empty string. + get url () { + webidl.brandCheck(this, Response) + + const urlList = this[kState].urlList + + // The url getter steps are to return the empty string if this’s + // response’s URL is null; otherwise this’s response’s URL, + // serialized with exclude fragment set to true. + const url = urlList[urlList.length - 1] ?? null + + if (url === null) { + return '' + } + + return URLSerializer(url, true) + } + + // Returns whether response was obtained through a redirect. + get redirected () { + webidl.brandCheck(this, Response) + + // The redirected getter steps are to return true if this’s response’s URL + // list has more than one item; otherwise false. + return this[kState].urlList.length > 1 + } + + // Returns response’s status. + get status () { + webidl.brandCheck(this, Response) + + // The status getter steps are to return this’s response’s status. + return this[kState].status + } + + // Returns whether response’s status is an ok status. + get ok () { + webidl.brandCheck(this, Response) + + // The ok getter steps are to return true if this’s response’s status is an + // ok status; otherwise false. + return this[kState].status >= 200 && this[kState].status <= 299 + } + + // Returns response’s status message. + get statusText () { + webidl.brandCheck(this, Response) + + // The statusText getter steps are to return this’s response’s status + // message. + return this[kState].statusText + } + + // Returns response’s headers as Headers. + get headers () { + webidl.brandCheck(this, Response) + + // The headers getter steps are to return this’s headers. + return this[kHeaders] + } + + get body () { + webidl.brandCheck(this, Response) + + return this[kState].body ? this[kState].body.stream : null + } + + get bodyUsed () { + webidl.brandCheck(this, Response) + + return !!this[kState].body && util.isDisturbed(this[kState].body.stream) + } + + // Returns a clone of response. + clone () { + webidl.brandCheck(this, Response) + + // 1. If this is unusable, then throw a TypeError. + if (this.bodyUsed || (this.body && this.body.locked)) { + throw webidl.errors.exception({ + header: 'Response.clone', + message: 'Body has already been consumed.' + }) + } + + // 2. Let clonedResponse be the result of cloning this’s response. + const clonedResponse = cloneResponse(this[kState]) + + // 3. Return the result of creating a Response object, given + // clonedResponse, this’s headers’s guard, and this’s relevant Realm. + const clonedResponseObject = new Response() + clonedResponseObject[kState] = clonedResponse + clonedResponseObject[kRealm] = this[kRealm] + clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList + clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard] + clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm] + + return clonedResponseObject + } +} + +mixinBody(Response) + +Object.defineProperties(Response.prototype, { + type: kEnumerableProperty, + url: kEnumerableProperty, + status: kEnumerableProperty, + ok: kEnumerableProperty, + redirected: kEnumerableProperty, + statusText: kEnumerableProperty, + headers: kEnumerableProperty, + clone: kEnumerableProperty, + body: kEnumerableProperty, + bodyUsed: kEnumerableProperty, + [Symbol.toStringTag]: { + value: 'Response', + configurable: true + } +}) + +Object.defineProperties(Response, { + json: kEnumerableProperty, + redirect: kEnumerableProperty, + error: kEnumerableProperty +}) + +// https://fetch.spec.whatwg.org/#concept-response-clone +function cloneResponse (response) { + // To clone a response response, run these steps: + + // 1. If response is a filtered response, then return a new identical + // filtered response whose internal response is a clone of response’s + // internal response. + if (response.internalResponse) { + return filterResponse( + cloneResponse(response.internalResponse), + response.type + ) + } + + // 2. Let newResponse be a copy of response, except for its body. + const newResponse = makeResponse({ ...response, body: null }) + + // 3. If response’s body is non-null, then set newResponse’s body to the + // result of cloning response’s body. + if (response.body != null) { + newResponse.body = cloneBody(response.body) + } + + // 4. Return newResponse. + return newResponse +} + +function makeResponse (init) { + return { + aborted: false, + rangeRequested: false, + timingAllowPassed: false, + requestIncludesCredentials: false, + type: 'default', + status: 200, + timingInfo: null, + cacheState: '', + statusText: '', + ...init, + headersList: init.headersList + ? new HeadersList(init.headersList) + : new HeadersList(), + urlList: init.urlList ? [...init.urlList] : [] + } +} + +function makeNetworkError (reason) { + const isError = isErrorLike(reason) + return makeResponse({ + type: 'error', + status: 0, + error: isError + ? reason + : new Error(reason ? String(reason) : reason), + aborted: reason && reason.name === 'AbortError' + }) +} + +function makeFilteredResponse (response, state) { + state = { + internalResponse: response, + ...state + } + + return new Proxy(response, { + get (target, p) { + return p in state ? state[p] : target[p] + }, + set (target, p, value) { + assert(!(p in state)) + target[p] = value + return true + } + }) +} + +// https://fetch.spec.whatwg.org/#concept-filtered-response +function filterResponse (response, type) { + // Set response to the following filtered response with response as its + // internal response, depending on request’s response tainting: + if (type === 'basic') { + // A basic filtered response is a filtered response whose type is "basic" + // and header list excludes any headers in internal response’s header list + // whose name is a forbidden response-header name. + + // Note: undici does not implement forbidden response-header names + return makeFilteredResponse(response, { + type: 'basic', + headersList: response.headersList + }) + } else if (type === 'cors') { + // A CORS filtered response is a filtered response whose type is "cors" + // and header list excludes any headers in internal response’s header + // list whose name is not a CORS-safelisted response-header name, given + // internal response’s CORS-exposed header-name list. + + // Note: undici does not implement CORS-safelisted response-header names + return makeFilteredResponse(response, { + type: 'cors', + headersList: response.headersList + }) + } else if (type === 'opaque') { + // An opaque filtered response is a filtered response whose type is + // "opaque", URL list is the empty list, status is 0, status message + // is the empty byte sequence, header list is empty, and body is null. + + return makeFilteredResponse(response, { + type: 'opaque', + urlList: Object.freeze([]), + status: 0, + statusText: '', + body: null + }) + } else if (type === 'opaqueredirect') { + // An opaque-redirect filtered response is a filtered response whose type + // is "opaqueredirect", status is 0, status message is the empty byte + // sequence, header list is empty, and body is null. + + return makeFilteredResponse(response, { + type: 'opaqueredirect', + status: 0, + statusText: '', + headersList: [], + body: null + }) + } else { + assert(false) + } +} + +// https://fetch.spec.whatwg.org/#appropriate-network-error +function makeAppropriateNetworkError (fetchParams, err = null) { + // 1. Assert: fetchParams is canceled. + assert(isCancelled(fetchParams)) + + // 2. Return an aborted network error if fetchParams is aborted; + // otherwise return a network error. + return isAborted(fetchParams) + ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err })) + : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err })) +} + +// https://whatpr.org/fetch/1392.html#initialize-a-response +function initializeResponse (response, init, body) { + // 1. If init["status"] is not in the range 200 to 599, inclusive, then + // throw a RangeError. + if (init.status !== null && (init.status < 200 || init.status > 599)) { + throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.') + } + + // 2. If init["statusText"] does not match the reason-phrase token production, + // then throw a TypeError. + if ('statusText' in init && init.statusText != null) { + // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2: + // reason-phrase = *( HTAB / SP / VCHAR / obs-text ) + if (!isValidReasonPhrase(String(init.statusText))) { + throw new TypeError('Invalid statusText') + } + } + + // 3. Set response’s response’s status to init["status"]. + if ('status' in init && init.status != null) { + response[kState].status = init.status + } + + // 4. Set response’s response’s status message to init["statusText"]. + if ('statusText' in init && init.statusText != null) { + response[kState].statusText = init.statusText + } + + // 5. If init["headers"] exists, then fill response’s headers with init["headers"]. + if ('headers' in init && init.headers != null) { + fill(response[kHeaders], init.headers) + } + + // 6. If body was given, then: + if (body) { + // 1. If response's status is a null body status, then throw a TypeError. + if (nullBodyStatus.includes(response.status)) { + throw webidl.errors.exception({ + header: 'Response constructor', + message: 'Invalid response status code ' + response.status + }) + } + + // 2. Set response's body to body's body. + response[kState].body = body.body + + // 3. If body's type is non-null and response's header list does not contain + // `Content-Type`, then append (`Content-Type`, body's type) to response's header list. + if (body.type != null && !response[kState].headersList.contains('Content-Type')) { + response[kState].headersList.append('content-type', body.type) + } + } +} + +webidl.converters.ReadableStream = webidl.interfaceConverter( + ReadableStream +) + +webidl.converters.FormData = webidl.interfaceConverter( + FormData +) + +webidl.converters.URLSearchParams = webidl.interfaceConverter( + URLSearchParams +) + +// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit +webidl.converters.XMLHttpRequestBodyInit = function (V) { + if (typeof V === 'string') { + return webidl.converters.USVString(V) + } + + if (isBlobLike(V)) { + return webidl.converters.Blob(V, { strict: false }) + } + + if ( + types.isAnyArrayBuffer(V) || + types.isTypedArray(V) || + types.isDataView(V) + ) { + return webidl.converters.BufferSource(V) + } + + if (util.isFormDataLike(V)) { + return webidl.converters.FormData(V, { strict: false }) + } + + if (V instanceof URLSearchParams) { + return webidl.converters.URLSearchParams(V) + } + + return webidl.converters.DOMString(V) +} + +// https://fetch.spec.whatwg.org/#bodyinit +webidl.converters.BodyInit = function (V) { + if (V instanceof ReadableStream) { + return webidl.converters.ReadableStream(V) + } + + // Note: the spec doesn't include async iterables, + // this is an undici extension. + if (V?.[Symbol.asyncIterator]) { + return V + } + + return webidl.converters.XMLHttpRequestBodyInit(V) +} + +webidl.converters.ResponseInit = webidl.dictionaryConverter([ + { + key: 'status', + converter: webidl.converters['unsigned short'], + defaultValue: 200 + }, + { + key: 'statusText', + converter: webidl.converters.ByteString, + defaultValue: '' + }, + { + key: 'headers', + converter: webidl.converters.HeadersInit + } +]) + +module.exports = { + makeNetworkError, + makeResponse, + makeAppropriateNetworkError, + filterResponse, + Response, + cloneResponse +} + + +/***/ }), + +/***/ 15861: +/***/ ((module) => { + +"use strict"; + + +module.exports = { + kUrl: Symbol('url'), + kHeaders: Symbol('headers'), + kSignal: Symbol('signal'), + kState: Symbol('state'), + kGuard: Symbol('guard'), + kRealm: Symbol('realm') +} + + +/***/ }), + +/***/ 52538: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(41037) +const { getGlobalOrigin } = __nccwpck_require__(71246) +const { performance } = __nccwpck_require__(4074) +const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(83983) +const assert = __nccwpck_require__(39491) +const { isUint8Array } = __nccwpck_require__(29830) + +// https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable +/** @type {import('crypto')|undefined} */ +let crypto + +try { + crypto = __nccwpck_require__(6113) +} catch { + +} + +function responseURL (response) { + // https://fetch.spec.whatwg.org/#responses + // A response has an associated URL. It is a pointer to the last URL + // in response’s URL list and null if response’s URL list is empty. + const urlList = response.urlList + const length = urlList.length + return length === 0 ? null : urlList[length - 1].toString() +} + +// https://fetch.spec.whatwg.org/#concept-response-location-url +function responseLocationURL (response, requestFragment) { + // 1. If response’s status is not a redirect status, then return null. + if (!redirectStatusSet.has(response.status)) { + return null + } + + // 2. Let location be the result of extracting header list values given + // `Location` and response’s header list. + let location = response.headersList.get('location') + + // 3. If location is a header value, then set location to the result of + // parsing location with response’s URL. + if (location !== null && isValidHeaderValue(location)) { + location = new URL(location, responseURL(response)) + } + + // 4. If location is a URL whose fragment is null, then set location’s + // fragment to requestFragment. + if (location && !location.hash) { + location.hash = requestFragment + } + + // 5. Return location. + return location +} + +/** @returns {URL} */ +function requestCurrentURL (request) { + return request.urlList[request.urlList.length - 1] +} + +function requestBadPort (request) { + // 1. Let url be request’s current URL. + const url = requestCurrentURL(request) + + // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port, + // then return blocked. + if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) { + return 'blocked' + } + + // 3. Return allowed. + return 'allowed' +} + +function isErrorLike (object) { + return object instanceof Error || ( + object?.constructor?.name === 'Error' || + object?.constructor?.name === 'DOMException' + ) +} + +// Check whether |statusText| is a ByteString and +// matches the Reason-Phrase token production. +// RFC 2616: https://tools.ietf.org/html/rfc2616 +// RFC 7230: https://tools.ietf.org/html/rfc7230 +// "reason-phrase = *( HTAB / SP / VCHAR / obs-text )" +// https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116 +function isValidReasonPhrase (statusText) { + for (let i = 0; i < statusText.length; ++i) { + const c = statusText.charCodeAt(i) + if ( + !( + ( + c === 0x09 || // HTAB + (c >= 0x20 && c <= 0x7e) || // SP / VCHAR + (c >= 0x80 && c <= 0xff) + ) // obs-text + ) + ) { + return false + } + } + return true +} + +function isTokenChar (c) { + return !( + c >= 0x7f || + c <= 0x20 || + c === '(' || + c === ')' || + c === '<' || + c === '>' || + c === '@' || + c === ',' || + c === ';' || + c === ':' || + c === '\\' || + c === '"' || + c === '/' || + c === '[' || + c === ']' || + c === '?' || + c === '=' || + c === '{' || + c === '}' + ) +} + +// See RFC 7230, Section 3.2.6. +// https://github.com/chromium/chromium/blob/d7da0240cae77824d1eda25745c4022757499131/third_party/blink/renderer/platform/network/http_parsers.cc#L321 +function isValidHTTPToken (characters) { + if (!characters || typeof characters !== 'string') { + return false + } + for (let i = 0; i < characters.length; ++i) { + const c = characters.charCodeAt(i) + if (c > 0x7f || !isTokenChar(c)) { + return false + } + } + return true +} + +// https://fetch.spec.whatwg.org/#header-name +// https://github.com/chromium/chromium/blob/b3d37e6f94f87d59e44662d6078f6a12de845d17/net/http/http_util.cc#L342 +function isValidHeaderName (potentialValue) { + if (potentialValue.length === 0) { + return false + } + + return isValidHTTPToken(potentialValue) +} + +/** + * @see https://fetch.spec.whatwg.org/#header-value + * @param {string} potentialValue + */ +function isValidHeaderValue (potentialValue) { + // - Has no leading or trailing HTTP tab or space bytes. + // - Contains no 0x00 (NUL) or HTTP newline bytes. + if ( + potentialValue.startsWith('\t') || + potentialValue.startsWith(' ') || + potentialValue.endsWith('\t') || + potentialValue.endsWith(' ') + ) { + return false + } + + if ( + potentialValue.includes('\0') || + potentialValue.includes('\r') || + potentialValue.includes('\n') + ) { + return false + } + + return true +} + +// https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect +function setRequestReferrerPolicyOnRedirect (request, actualResponse) { + // Given a request request and a response actualResponse, this algorithm + // updates request’s referrer policy according to the Referrer-Policy + // header (if any) in actualResponse. + + // 1. Let policy be the result of executing § 8.1 Parse a referrer policy + // from a Referrer-Policy header on actualResponse. + + // 8.1 Parse a referrer policy from a Referrer-Policy header + // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list. + const { headersList } = actualResponse + // 2. Let policy be the empty string. + // 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty string, then set policy to token. + // 4. Return policy. + const policyHeader = (headersList.get('referrer-policy') ?? '').split(',') + + // Note: As the referrer-policy can contain multiple policies + // separated by comma, we need to loop through all of them + // and pick the first valid one. + // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy + let policy = '' + if (policyHeader.length > 0) { + // The right-most policy takes precedence. + // The left-most policy is the fallback. + for (let i = policyHeader.length; i !== 0; i--) { + const token = policyHeader[i - 1].trim() + if (referrerPolicyTokens.has(token)) { + policy = token + break + } + } + } + + // 2. If policy is not the empty string, then set request’s referrer policy to policy. + if (policy !== '') { + request.referrerPolicy = policy + } +} + +// https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check +function crossOriginResourcePolicyCheck () { + // TODO + return 'allowed' +} + +// https://fetch.spec.whatwg.org/#concept-cors-check +function corsCheck () { + // TODO + return 'success' +} + +// https://fetch.spec.whatwg.org/#concept-tao-check +function TAOCheck () { + // TODO + return 'success' +} + +function appendFetchMetadata (httpRequest) { + // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header + // TODO + + // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header + + // 1. Assert: r’s url is a potentially trustworthy URL. + // TODO + + // 2. Let header be a Structured Header whose value is a token. + let header = null + + // 3. Set header’s value to r’s mode. + header = httpRequest.mode + + // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list. + httpRequest.headersList.set('sec-fetch-mode', header) + + // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header + // TODO + + // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header + // TODO +} + +// https://fetch.spec.whatwg.org/#append-a-request-origin-header +function appendRequestOriginHeader (request) { + // 1. Let serializedOrigin be the result of byte-serializing a request origin with request. + let serializedOrigin = request.origin + + // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list. + if (request.responseTainting === 'cors' || request.mode === 'websocket') { + if (serializedOrigin) { + request.headersList.append('origin', serializedOrigin) + } + + // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then: + } else if (request.method !== 'GET' && request.method !== 'HEAD') { + // 1. Switch on request’s referrer policy: + switch (request.referrerPolicy) { + case 'no-referrer': + // Set serializedOrigin to `null`. + serializedOrigin = null + break + case 'no-referrer-when-downgrade': + case 'strict-origin': + case 'strict-origin-when-cross-origin': + // If request’s origin is a tuple origin, its scheme is "https", and request’s current URL’s scheme is not "https", then set serializedOrigin to `null`. + if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) { + serializedOrigin = null + } + break + case 'same-origin': + // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`. + if (!sameOrigin(request, requestCurrentURL(request))) { + serializedOrigin = null + } + break + default: + // Do nothing. + } + + if (serializedOrigin) { + // 2. Append (`Origin`, serializedOrigin) to request’s header list. + request.headersList.append('origin', serializedOrigin) + } + } +} + +function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) { + // TODO + return performance.now() +} + +// https://fetch.spec.whatwg.org/#create-an-opaque-timing-info +function createOpaqueTimingInfo (timingInfo) { + return { + startTime: timingInfo.startTime ?? 0, + redirectStartTime: 0, + redirectEndTime: 0, + postRedirectStartTime: timingInfo.startTime ?? 0, + finalServiceWorkerStartTime: 0, + finalNetworkResponseStartTime: 0, + finalNetworkRequestStartTime: 0, + endTime: 0, + encodedBodySize: 0, + decodedBodySize: 0, + finalConnectionTimingInfo: null + } +} + +// https://html.spec.whatwg.org/multipage/origin.html#policy-container +function makePolicyContainer () { + // Note: the fetch spec doesn't make use of embedder policy or CSP list + return { + referrerPolicy: 'strict-origin-when-cross-origin' + } +} + +// https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container +function clonePolicyContainer (policyContainer) { + return { + referrerPolicy: policyContainer.referrerPolicy + } +} + +// https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer +function determineRequestsReferrer (request) { + // 1. Let policy be request's referrer policy. + const policy = request.referrerPolicy + + // Note: policy cannot (shouldn't) be null or an empty string. + assert(policy) + + // 2. Let environment be request’s client. + + let referrerSource = null + + // 3. Switch on request’s referrer: + if (request.referrer === 'client') { + // Note: node isn't a browser and doesn't implement document/iframes, + // so we bypass this step and replace it with our own. + + const globalOrigin = getGlobalOrigin() + + if (!globalOrigin || globalOrigin.origin === 'null') { + return 'no-referrer' + } + + // note: we need to clone it as it's mutated + referrerSource = new URL(globalOrigin) + } else if (request.referrer instanceof URL) { + // Let referrerSource be request’s referrer. + referrerSource = request.referrer + } + + // 4. Let request’s referrerURL be the result of stripping referrerSource for + // use as a referrer. + let referrerURL = stripURLForReferrer(referrerSource) + + // 5. Let referrerOrigin be the result of stripping referrerSource for use as + // a referrer, with the origin-only flag set to true. + const referrerOrigin = stripURLForReferrer(referrerSource, true) + + // 6. If the result of serializing referrerURL is a string whose length is + // greater than 4096, set referrerURL to referrerOrigin. + if (referrerURL.toString().length > 4096) { + referrerURL = referrerOrigin + } + + const areSameOrigin = sameOrigin(request, referrerURL) + const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) && + !isURLPotentiallyTrustworthy(request.url) + + // 8. Execute the switch statements corresponding to the value of policy: + switch (policy) { + case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true) + case 'unsafe-url': return referrerURL + case 'same-origin': + return areSameOrigin ? referrerOrigin : 'no-referrer' + case 'origin-when-cross-origin': + return areSameOrigin ? referrerURL : referrerOrigin + case 'strict-origin-when-cross-origin': { + const currentURL = requestCurrentURL(request) + + // 1. If the origin of referrerURL and the origin of request’s current + // URL are the same, then return referrerURL. + if (sameOrigin(referrerURL, currentURL)) { + return referrerURL + } + + // 2. If referrerURL is a potentially trustworthy URL and request’s + // current URL is not a potentially trustworthy URL, then return no + // referrer. + if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) { + return 'no-referrer' + } + + // 3. Return referrerOrigin. + return referrerOrigin + } + case 'strict-origin': // eslint-disable-line + /** + * 1. If referrerURL is a potentially trustworthy URL and + * request’s current URL is not a potentially trustworthy URL, + * then return no referrer. + * 2. Return referrerOrigin + */ + case 'no-referrer-when-downgrade': // eslint-disable-line + /** + * 1. If referrerURL is a potentially trustworthy URL and + * request’s current URL is not a potentially trustworthy URL, + * then return no referrer. + * 2. Return referrerOrigin + */ + + default: // eslint-disable-line + return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin + } +} + +/** + * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url + * @param {URL} url + * @param {boolean|undefined} originOnly + */ +function stripURLForReferrer (url, originOnly) { + // 1. Assert: url is a URL. + assert(url instanceof URL) + + // 2. If url’s scheme is a local scheme, then return no referrer. + if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') { + return 'no-referrer' + } + + // 3. Set url’s username to the empty string. + url.username = '' + + // 4. Set url’s password to the empty string. + url.password = '' + + // 5. Set url’s fragment to null. + url.hash = '' + + // 6. If the origin-only flag is true, then: + if (originOnly) { + // 1. Set url’s path to « the empty string ». + url.pathname = '' + + // 2. Set url’s query to null. + url.search = '' + } + + // 7. Return url. + return url +} + +function isURLPotentiallyTrustworthy (url) { + if (!(url instanceof URL)) { + return false + } + + // If child of about, return true + if (url.href === 'about:blank' || url.href === 'about:srcdoc') { + return true + } + + // If scheme is data, return true + if (url.protocol === 'data:') return true + + // If file, return true + if (url.protocol === 'file:') return true + + return isOriginPotentiallyTrustworthy(url.origin) + + function isOriginPotentiallyTrustworthy (origin) { + // If origin is explicitly null, return false + if (origin == null || origin === 'null') return false + + const originAsURL = new URL(origin) + + // If secure, return true + if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') { + return true + } + + // If localhost or variants, return true + if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) || + (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) || + (originAsURL.hostname.endsWith('.localhost'))) { + return true + } + + // If any other, return false + return false + } +} + +/** + * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist + * @param {Uint8Array} bytes + * @param {string} metadataList + */ +function bytesMatch (bytes, metadataList) { + // If node is not built with OpenSSL support, we cannot check + // a request's integrity, so allow it by default (the spec will + // allow requests if an invalid hash is given, as precedence). + /* istanbul ignore if: only if node is built with --without-ssl */ + if (crypto === undefined) { + return true + } + + // 1. Let parsedMetadata be the result of parsing metadataList. + const parsedMetadata = parseMetadata(metadataList) + + // 2. If parsedMetadata is no metadata, return true. + if (parsedMetadata === 'no metadata') { + return true + } + + // 3. If parsedMetadata is the empty set, return true. + if (parsedMetadata.length === 0) { + return true + } + + // 4. Let metadata be the result of getting the strongest + // metadata from parsedMetadata. + const list = parsedMetadata.sort((c, d) => d.algo.localeCompare(c.algo)) + // get the strongest algorithm + const strongest = list[0].algo + // get all entries that use the strongest algorithm; ignore weaker + const metadata = list.filter((item) => item.algo === strongest) + + // 5. For each item in metadata: + for (const item of metadata) { + // 1. Let algorithm be the alg component of item. + const algorithm = item.algo + + // 2. Let expectedValue be the val component of item. + let expectedValue = item.hash + + // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e + // "be liberal with padding". This is annoying, and it's not even in the spec. + + if (expectedValue.endsWith('==')) { + expectedValue = expectedValue.slice(0, -2) + } + + // 3. Let actualValue be the result of applying algorithm to bytes. + let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64') + + if (actualValue.endsWith('==')) { + actualValue = actualValue.slice(0, -2) + } + + // 4. If actualValue is a case-sensitive match for expectedValue, + // return true. + if (actualValue === expectedValue) { + return true + } + + let actualBase64URL = crypto.createHash(algorithm).update(bytes).digest('base64url') + + if (actualBase64URL.endsWith('==')) { + actualBase64URL = actualBase64URL.slice(0, -2) + } + + if (actualBase64URL === expectedValue) { + return true + } + } + + // 6. Return false. + return false +} + +// https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options +// https://www.w3.org/TR/CSP2/#source-list-syntax +// https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1 +const parseHashWithOptions = /((?sha256|sha384|sha512)-(?[A-z0-9+/]{1}.*={0,2}))( +[\x21-\x7e]?)?/i + +/** + * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata + * @param {string} metadata + */ +function parseMetadata (metadata) { + // 1. Let result be the empty set. + /** @type {{ algo: string, hash: string }[]} */ + const result = [] + + // 2. Let empty be equal to true. + let empty = true + + const supportedHashes = crypto.getHashes() + + // 3. For each token returned by splitting metadata on spaces: + for (const token of metadata.split(' ')) { + // 1. Set empty to false. + empty = false + + // 2. Parse token as a hash-with-options. + const parsedToken = parseHashWithOptions.exec(token) + + // 3. If token does not parse, continue to the next token. + if (parsedToken === null || parsedToken.groups === undefined) { + // Note: Chromium blocks the request at this point, but Firefox + // gives a warning that an invalid integrity was given. The + // correct behavior is to ignore these, and subsequently not + // check the integrity of the resource. + continue + } + + // 4. Let algorithm be the hash-algo component of token. + const algorithm = parsedToken.groups.algo + + // 5. If algorithm is a hash function recognized by the user + // agent, add the parsed token to result. + if (supportedHashes.includes(algorithm.toLowerCase())) { + result.push(parsedToken.groups) + } + } + + // 4. Return no metadata if empty is true, otherwise return result. + if (empty === true) { + return 'no metadata' + } + + return result +} + +// https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request +function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) { + // TODO +} + +/** + * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin} + * @param {URL} A + * @param {URL} B + */ +function sameOrigin (A, B) { + // 1. If A and B are the same opaque origin, then return true. + if (A.origin === B.origin && A.origin === 'null') { + return true + } + + // 2. If A and B are both tuple origins and their schemes, + // hosts, and port are identical, then return true. + if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) { + return true + } + + // 3. Return false. + return false +} + +function createDeferredPromise () { + let res + let rej + const promise = new Promise((resolve, reject) => { + res = resolve + rej = reject + }) + + return { promise, resolve: res, reject: rej } +} + +function isAborted (fetchParams) { + return fetchParams.controller.state === 'aborted' +} + +function isCancelled (fetchParams) { + return fetchParams.controller.state === 'aborted' || + fetchParams.controller.state === 'terminated' +} + +// https://fetch.spec.whatwg.org/#concept-method-normalize +function normalizeMethod (method) { + return /^(DELETE|GET|HEAD|OPTIONS|POST|PUT)$/i.test(method) + ? method.toUpperCase() + : method +} + +// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string +function serializeJavascriptValueToJSONString (value) { + // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »). + const result = JSON.stringify(value) + + // 2. If result is undefined, then throw a TypeError. + if (result === undefined) { + throw new TypeError('Value is not JSON serializable') + } + + // 3. Assert: result is a string. + assert(typeof result === 'string') + + // 4. Return result. + return result +} + +// https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object +const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())) + +/** + * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object + * @param {() => unknown[]} iterator + * @param {string} name name of the instance + * @param {'key'|'value'|'key+value'} kind + */ +function makeIterator (iterator, name, kind) { + const object = { + index: 0, + kind, + target: iterator + } + + const i = { + next () { + // 1. Let interface be the interface for which the iterator prototype object exists. + + // 2. Let thisValue be the this value. + + // 3. Let object be ? ToObject(thisValue). + + // 4. If object is a platform object, then perform a security + // check, passing: + + // 5. If object is not a default iterator object for interface, + // then throw a TypeError. + if (Object.getPrototypeOf(this) !== i) { + throw new TypeError( + `'next' called on an object that does not implement interface ${name} Iterator.` + ) + } + + // 6. Let index be object’s index. + // 7. Let kind be object’s kind. + // 8. Let values be object’s target's value pairs to iterate over. + const { index, kind, target } = object + const values = target() + + // 9. Let len be the length of values. + const len = values.length + + // 10. If index is greater than or equal to len, then return + // CreateIterResultObject(undefined, true). + if (index >= len) { + return { value: undefined, done: true } + } + + // 11. Let pair be the entry in values at index index. + const pair = values[index] + + // 12. Set object’s index to index + 1. + object.index = index + 1 + + // 13. Return the iterator result for pair and kind. + return iteratorResult(pair, kind) + }, + // The class string of an iterator prototype object for a given interface is the + // result of concatenating the identifier of the interface and the string " Iterator". + [Symbol.toStringTag]: `${name} Iterator` + } + + // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%. + Object.setPrototypeOf(i, esIteratorPrototype) + // esIteratorPrototype needs to be the prototype of i + // which is the prototype of an empty object. Yes, it's confusing. + return Object.setPrototypeOf({}, i) +} + +// https://webidl.spec.whatwg.org/#iterator-result +function iteratorResult (pair, kind) { + let result + + // 1. Let result be a value determined by the value of kind: + switch (kind) { + case 'key': { + // 1. Let idlKey be pair’s key. + // 2. Let key be the result of converting idlKey to an + // ECMAScript value. + // 3. result is key. + result = pair[0] + break + } + case 'value': { + // 1. Let idlValue be pair’s value. + // 2. Let value be the result of converting idlValue to + // an ECMAScript value. + // 3. result is value. + result = pair[1] + break + } + case 'key+value': { + // 1. Let idlKey be pair’s key. + // 2. Let idlValue be pair’s value. + // 3. Let key be the result of converting idlKey to an + // ECMAScript value. + // 4. Let value be the result of converting idlValue to + // an ECMAScript value. + // 5. Let array be ! ArrayCreate(2). + // 6. Call ! CreateDataProperty(array, "0", key). + // 7. Call ! CreateDataProperty(array, "1", value). + // 8. result is array. + result = pair + break + } + } + + // 2. Return CreateIterResultObject(result, false). + return { value: result, done: false } +} + +/** + * @see https://fetch.spec.whatwg.org/#body-fully-read + */ +async function fullyReadBody (body, processBody, processBodyError) { + // 1. If taskDestination is null, then set taskDestination to + // the result of starting a new parallel queue. + + // 2. Let successSteps given a byte sequence bytes be to queue a + // fetch task to run processBody given bytes, with taskDestination. + const successSteps = processBody + + // 3. Let errorSteps be to queue a fetch task to run processBodyError, + // with taskDestination. + const errorSteps = processBodyError + + // 4. Let reader be the result of getting a reader for body’s stream. + // If that threw an exception, then run errorSteps with that + // exception and return. + let reader + + try { + reader = body.stream.getReader() + } catch (e) { + errorSteps(e) + return + } + + // 5. Read all bytes from reader, given successSteps and errorSteps. + try { + const result = await readAllBytes(reader) + successSteps(result) + } catch (e) { + errorSteps(e) + } +} + +/** @type {ReadableStream} */ +let ReadableStream = globalThis.ReadableStream + +function isReadableStreamLike (stream) { + if (!ReadableStream) { + ReadableStream = (__nccwpck_require__(35356).ReadableStream) + } + + return stream instanceof ReadableStream || ( + stream[Symbol.toStringTag] === 'ReadableStream' && + typeof stream.tee === 'function' + ) +} + +const MAXIMUM_ARGUMENT_LENGTH = 65535 + +/** + * @see https://infra.spec.whatwg.org/#isomorphic-decode + * @param {number[]|Uint8Array} input + */ +function isomorphicDecode (input) { + // 1. To isomorphic decode a byte sequence input, return a string whose code point + // length is equal to input’s length and whose code points have the same values + // as the values of input’s bytes, in the same order. + + if (input.length < MAXIMUM_ARGUMENT_LENGTH) { + return String.fromCharCode(...input) + } + + return input.reduce((previous, current) => previous + String.fromCharCode(current), '') +} + +/** + * @param {ReadableStreamController} controller + */ +function readableStreamClose (controller) { + try { + controller.close() + } catch (err) { + // TODO: add comment explaining why this error occurs. + if (!err.message.includes('Controller is already closed')) { + throw err + } + } +} + +/** + * @see https://infra.spec.whatwg.org/#isomorphic-encode + * @param {string} input + */ +function isomorphicEncode (input) { + // 1. Assert: input contains no code points greater than U+00FF. + for (let i = 0; i < input.length; i++) { + assert(input.charCodeAt(i) <= 0xFF) + } + + // 2. Return a byte sequence whose length is equal to input’s code + // point length and whose bytes have the same values as the + // values of input’s code points, in the same order + return input +} + +/** + * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes + * @see https://streams.spec.whatwg.org/#read-loop + * @param {ReadableStreamDefaultReader} reader + */ +async function readAllBytes (reader) { + const bytes = [] + let byteLength = 0 + + while (true) { + const { done, value: chunk } = await reader.read() + + if (done) { + // 1. Call successSteps with bytes. + return Buffer.concat(bytes, byteLength) + } + + // 1. If chunk is not a Uint8Array object, call failureSteps + // with a TypeError and abort these steps. + if (!isUint8Array(chunk)) { + throw new TypeError('Received non-Uint8Array chunk') + } + + // 2. Append the bytes represented by chunk to bytes. + bytes.push(chunk) + byteLength += chunk.length + + // 3. Read-loop given reader, bytes, successSteps, and failureSteps. + } +} + +/** + * @see https://fetch.spec.whatwg.org/#is-local + * @param {URL} url + */ +function urlIsLocal (url) { + assert('protocol' in url) // ensure it's a url object + + const protocol = url.protocol + + return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:' +} + +/** + * @param {string|URL} url + */ +function urlHasHttpsScheme (url) { + if (typeof url === 'string') { + return url.startsWith('https:') + } + + return url.protocol === 'https:' +} + +/** + * @see https://fetch.spec.whatwg.org/#http-scheme + * @param {URL} url + */ +function urlIsHttpHttpsScheme (url) { + assert('protocol' in url) // ensure it's a url object + + const protocol = url.protocol + + return protocol === 'http:' || protocol === 'https:' +} + +/** + * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0. + */ +const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key)) + +module.exports = { + isAborted, + isCancelled, + createDeferredPromise, + ReadableStreamFrom, + toUSVString, + tryUpgradeRequestToAPotentiallyTrustworthyURL, + coarsenedSharedCurrentTime, + determineRequestsReferrer, + makePolicyContainer, + clonePolicyContainer, + appendFetchMetadata, + appendRequestOriginHeader, + TAOCheck, + corsCheck, + crossOriginResourcePolicyCheck, + createOpaqueTimingInfo, + setRequestReferrerPolicyOnRedirect, + isValidHTTPToken, + requestBadPort, + requestCurrentURL, + responseURL, + responseLocationURL, + isBlobLike, + isURLPotentiallyTrustworthy, + isValidReasonPhrase, + sameOrigin, + normalizeMethod, + serializeJavascriptValueToJSONString, + makeIterator, + isValidHeaderName, + isValidHeaderValue, + hasOwn, + isErrorLike, + fullyReadBody, + bytesMatch, + isReadableStreamLike, + readableStreamClose, + isomorphicEncode, + isomorphicDecode, + urlIsLocal, + urlHasHttpsScheme, + urlIsHttpHttpsScheme, + readAllBytes +} + + +/***/ }), + +/***/ 21744: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { types } = __nccwpck_require__(73837) +const { hasOwn, toUSVString } = __nccwpck_require__(52538) + +/** @type {import('../../types/webidl').Webidl} */ +const webidl = {} +webidl.converters = {} +webidl.util = {} +webidl.errors = {} + +webidl.errors.exception = function (message) { + return new TypeError(`${message.header}: ${message.message}`) +} + +webidl.errors.conversionFailed = function (context) { + const plural = context.types.length === 1 ? '' : ' one of' + const message = + `${context.argument} could not be converted to` + + `${plural}: ${context.types.join(', ')}.` + + return webidl.errors.exception({ + header: context.prefix, + message + }) +} + +webidl.errors.invalidArgument = function (context) { + return webidl.errors.exception({ + header: context.prefix, + message: `"${context.value}" is an invalid ${context.type}.` + }) +} + +// https://webidl.spec.whatwg.org/#implements +webidl.brandCheck = function (V, I, opts = undefined) { + if (opts?.strict !== false && !(V instanceof I)) { + throw new TypeError('Illegal invocation') + } else { + return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag] + } +} + +webidl.argumentLengthCheck = function ({ length }, min, ctx) { + if (length < min) { + throw webidl.errors.exception({ + message: `${min} argument${min !== 1 ? 's' : ''} required, ` + + `but${length ? ' only' : ''} ${length} found.`, + ...ctx + }) + } +} + +webidl.illegalConstructor = function () { + throw webidl.errors.exception({ + header: 'TypeError', + message: 'Illegal constructor' + }) +} + +// https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values +webidl.util.Type = function (V) { + switch (typeof V) { + case 'undefined': return 'Undefined' + case 'boolean': return 'Boolean' + case 'string': return 'String' + case 'symbol': return 'Symbol' + case 'number': return 'Number' + case 'bigint': return 'BigInt' + case 'function': + case 'object': { + if (V === null) { + return 'Null' + } + + return 'Object' + } + } +} + +// https://webidl.spec.whatwg.org/#abstract-opdef-converttoint +webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) { + let upperBound + let lowerBound + + // 1. If bitLength is 64, then: + if (bitLength === 64) { + // 1. Let upperBound be 2^53 − 1. + upperBound = Math.pow(2, 53) - 1 + + // 2. If signedness is "unsigned", then let lowerBound be 0. + if (signedness === 'unsigned') { + lowerBound = 0 + } else { + // 3. Otherwise let lowerBound be −2^53 + 1. + lowerBound = Math.pow(-2, 53) + 1 + } + } else if (signedness === 'unsigned') { + // 2. Otherwise, if signedness is "unsigned", then: + + // 1. Let lowerBound be 0. + lowerBound = 0 + + // 2. Let upperBound be 2^bitLength − 1. + upperBound = Math.pow(2, bitLength) - 1 + } else { + // 3. Otherwise: + + // 1. Let lowerBound be -2^bitLength − 1. + lowerBound = Math.pow(-2, bitLength) - 1 + + // 2. Let upperBound be 2^bitLength − 1 − 1. + upperBound = Math.pow(2, bitLength - 1) - 1 + } + + // 4. Let x be ? ToNumber(V). + let x = Number(V) + + // 5. If x is −0, then set x to +0. + if (x === 0) { + x = 0 + } + + // 6. If the conversion is to an IDL type associated + // with the [EnforceRange] extended attribute, then: + if (opts.enforceRange === true) { + // 1. If x is NaN, +∞, or −∞, then throw a TypeError. + if ( + Number.isNaN(x) || + x === Number.POSITIVE_INFINITY || + x === Number.NEGATIVE_INFINITY + ) { + throw webidl.errors.exception({ + header: 'Integer conversion', + message: `Could not convert ${V} to an integer.` + }) + } + + // 2. Set x to IntegerPart(x). + x = webidl.util.IntegerPart(x) + + // 3. If x < lowerBound or x > upperBound, then + // throw a TypeError. + if (x < lowerBound || x > upperBound) { + throw webidl.errors.exception({ + header: 'Integer conversion', + message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.` + }) + } + + // 4. Return x. + return x + } + + // 7. If x is not NaN and the conversion is to an IDL + // type associated with the [Clamp] extended + // attribute, then: + if (!Number.isNaN(x) && opts.clamp === true) { + // 1. Set x to min(max(x, lowerBound), upperBound). + x = Math.min(Math.max(x, lowerBound), upperBound) + + // 2. Round x to the nearest integer, choosing the + // even integer if it lies halfway between two, + // and choosing +0 rather than −0. + if (Math.floor(x) % 2 === 0) { + x = Math.floor(x) + } else { + x = Math.ceil(x) + } + + // 3. Return x. + return x + } + + // 8. If x is NaN, +0, +∞, or −∞, then return +0. + if ( + Number.isNaN(x) || + (x === 0 && Object.is(0, x)) || + x === Number.POSITIVE_INFINITY || + x === Number.NEGATIVE_INFINITY + ) { + return 0 + } + + // 9. Set x to IntegerPart(x). + x = webidl.util.IntegerPart(x) + + // 10. Set x to x modulo 2^bitLength. + x = x % Math.pow(2, bitLength) + + // 11. If signedness is "signed" and x ≥ 2^bitLength − 1, + // then return x − 2^bitLength. + if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) { + return x - Math.pow(2, bitLength) + } + + // 12. Otherwise, return x. + return x +} + +// https://webidl.spec.whatwg.org/#abstract-opdef-integerpart +webidl.util.IntegerPart = function (n) { + // 1. Let r be floor(abs(n)). + const r = Math.floor(Math.abs(n)) + + // 2. If n < 0, then return -1 × r. + if (n < 0) { + return -1 * r + } + + // 3. Otherwise, return r. + return r +} + +// https://webidl.spec.whatwg.org/#es-sequence +webidl.sequenceConverter = function (converter) { + return (V) => { + // 1. If Type(V) is not Object, throw a TypeError. + if (webidl.util.Type(V) !== 'Object') { + throw webidl.errors.exception({ + header: 'Sequence', + message: `Value of type ${webidl.util.Type(V)} is not an Object.` + }) + } + + // 2. Let method be ? GetMethod(V, @@iterator). + /** @type {Generator} */ + const method = V?.[Symbol.iterator]?.() + const seq = [] + + // 3. If method is undefined, throw a TypeError. + if ( + method === undefined || + typeof method.next !== 'function' + ) { + throw webidl.errors.exception({ + header: 'Sequence', + message: 'Object is not an iterator.' + }) + } + + // https://webidl.spec.whatwg.org/#create-sequence-from-iterable + while (true) { + const { done, value } = method.next() + + if (done) { + break + } + + seq.push(converter(value)) + } + + return seq + } +} + +// https://webidl.spec.whatwg.org/#es-to-record +webidl.recordConverter = function (keyConverter, valueConverter) { + return (O) => { + // 1. If Type(O) is not Object, throw a TypeError. + if (webidl.util.Type(O) !== 'Object') { + throw webidl.errors.exception({ + header: 'Record', + message: `Value of type ${webidl.util.Type(O)} is not an Object.` + }) + } + + // 2. Let result be a new empty instance of record. + const result = {} + + if (!types.isProxy(O)) { + // Object.keys only returns enumerable properties + const keys = Object.keys(O) + + for (const key of keys) { + // 1. Let typedKey be key converted to an IDL value of type K. + const typedKey = keyConverter(key) + + // 2. Let value be ? Get(O, key). + // 3. Let typedValue be value converted to an IDL value of type V. + const typedValue = valueConverter(O[key]) + + // 4. Set result[typedKey] to typedValue. + result[typedKey] = typedValue + } + + // 5. Return result. + return result + } + + // 3. Let keys be ? O.[[OwnPropertyKeys]](). + const keys = Reflect.ownKeys(O) + + // 4. For each key of keys. + for (const key of keys) { + // 1. Let desc be ? O.[[GetOwnProperty]](key). + const desc = Reflect.getOwnPropertyDescriptor(O, key) + + // 2. If desc is not undefined and desc.[[Enumerable]] is true: + if (desc?.enumerable) { + // 1. Let typedKey be key converted to an IDL value of type K. + const typedKey = keyConverter(key) + + // 2. Let value be ? Get(O, key). + // 3. Let typedValue be value converted to an IDL value of type V. + const typedValue = valueConverter(O[key]) + + // 4. Set result[typedKey] to typedValue. + result[typedKey] = typedValue + } + } + + // 5. Return result. + return result + } +} + +webidl.interfaceConverter = function (i) { + return (V, opts = {}) => { + if (opts.strict !== false && !(V instanceof i)) { + throw webidl.errors.exception({ + header: i.name, + message: `Expected ${V} to be an instance of ${i.name}.` + }) + } + + return V + } +} + +webidl.dictionaryConverter = function (converters) { + return (dictionary) => { + const type = webidl.util.Type(dictionary) + const dict = {} + + if (type === 'Null' || type === 'Undefined') { + return dict + } else if (type !== 'Object') { + throw webidl.errors.exception({ + header: 'Dictionary', + message: `Expected ${dictionary} to be one of: Null, Undefined, Object.` + }) + } + + for (const options of converters) { + const { key, defaultValue, required, converter } = options + + if (required === true) { + if (!hasOwn(dictionary, key)) { + throw webidl.errors.exception({ + header: 'Dictionary', + message: `Missing required key "${key}".` + }) + } + } + + let value = dictionary[key] + const hasDefault = hasOwn(options, 'defaultValue') + + // Only use defaultValue if value is undefined and + // a defaultValue options was provided. + if (hasDefault && value !== null) { + value = value ?? defaultValue + } + + // A key can be optional and have no default value. + // When this happens, do not perform a conversion, + // and do not assign the key a value. + if (required || hasDefault || value !== undefined) { + value = converter(value) + + if ( + options.allowedValues && + !options.allowedValues.includes(value) + ) { + throw webidl.errors.exception({ + header: 'Dictionary', + message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.` + }) + } + + dict[key] = value + } + } + + return dict + } +} + +webidl.nullableConverter = function (converter) { + return (V) => { + if (V === null) { + return V + } + + return converter(V) + } +} + +// https://webidl.spec.whatwg.org/#es-DOMString +webidl.converters.DOMString = function (V, opts = {}) { + // 1. If V is null and the conversion is to an IDL type + // associated with the [LegacyNullToEmptyString] + // extended attribute, then return the DOMString value + // that represents the empty string. + if (V === null && opts.legacyNullToEmptyString) { + return '' + } + + // 2. Let x be ? ToString(V). + if (typeof V === 'symbol') { + throw new TypeError('Could not convert argument of type symbol to string.') + } + + // 3. Return the IDL DOMString value that represents the + // same sequence of code units as the one the + // ECMAScript String value x represents. + return String(V) +} + +// https://webidl.spec.whatwg.org/#es-ByteString +webidl.converters.ByteString = function (V) { + // 1. Let x be ? ToString(V). + // Note: DOMString converter perform ? ToString(V) + const x = webidl.converters.DOMString(V) + + // 2. If the value of any element of x is greater than + // 255, then throw a TypeError. + for (let index = 0; index < x.length; index++) { + const charCode = x.charCodeAt(index) + + if (charCode > 255) { + throw new TypeError( + 'Cannot convert argument to a ByteString because the character at ' + + `index ${index} has a value of ${charCode} which is greater than 255.` + ) + } + } + + // 3. Return an IDL ByteString value whose length is the + // length of x, and where the value of each element is + // the value of the corresponding element of x. + return x +} + +// https://webidl.spec.whatwg.org/#es-USVString +webidl.converters.USVString = toUSVString + +// https://webidl.spec.whatwg.org/#es-boolean +webidl.converters.boolean = function (V) { + // 1. Let x be the result of computing ToBoolean(V). + const x = Boolean(V) + + // 2. Return the IDL boolean value that is the one that represents + // the same truth value as the ECMAScript Boolean value x. + return x +} + +// https://webidl.spec.whatwg.org/#es-any +webidl.converters.any = function (V) { + return V +} + +// https://webidl.spec.whatwg.org/#es-long-long +webidl.converters['long long'] = function (V) { + // 1. Let x be ? ConvertToInt(V, 64, "signed"). + const x = webidl.util.ConvertToInt(V, 64, 'signed') + + // 2. Return the IDL long long value that represents + // the same numeric value as x. + return x +} + +// https://webidl.spec.whatwg.org/#es-unsigned-long-long +webidl.converters['unsigned long long'] = function (V) { + // 1. Let x be ? ConvertToInt(V, 64, "unsigned"). + const x = webidl.util.ConvertToInt(V, 64, 'unsigned') + + // 2. Return the IDL unsigned long long value that + // represents the same numeric value as x. + return x +} + +// https://webidl.spec.whatwg.org/#es-unsigned-long +webidl.converters['unsigned long'] = function (V) { + // 1. Let x be ? ConvertToInt(V, 32, "unsigned"). + const x = webidl.util.ConvertToInt(V, 32, 'unsigned') + + // 2. Return the IDL unsigned long value that + // represents the same numeric value as x. + return x +} + +// https://webidl.spec.whatwg.org/#es-unsigned-short +webidl.converters['unsigned short'] = function (V, opts) { + // 1. Let x be ? ConvertToInt(V, 16, "unsigned"). + const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts) + + // 2. Return the IDL unsigned short value that represents + // the same numeric value as x. + return x +} + +// https://webidl.spec.whatwg.org/#idl-ArrayBuffer +webidl.converters.ArrayBuffer = function (V, opts = {}) { + // 1. If Type(V) is not Object, or V does not have an + // [[ArrayBufferData]] internal slot, then throw a + // TypeError. + // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances + // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances + if ( + webidl.util.Type(V) !== 'Object' || + !types.isAnyArrayBuffer(V) + ) { + throw webidl.errors.conversionFailed({ + prefix: `${V}`, + argument: `${V}`, + types: ['ArrayBuffer'] + }) + } + + // 2. If the conversion is not to an IDL type associated + // with the [AllowShared] extended attribute, and + // IsSharedArrayBuffer(V) is true, then throw a + // TypeError. + if (opts.allowShared === false && types.isSharedArrayBuffer(V)) { + throw webidl.errors.exception({ + header: 'ArrayBuffer', + message: 'SharedArrayBuffer is not allowed.' + }) + } + + // 3. If the conversion is not to an IDL type associated + // with the [AllowResizable] extended attribute, and + // IsResizableArrayBuffer(V) is true, then throw a + // TypeError. + // Note: resizable ArrayBuffers are currently a proposal. + + // 4. Return the IDL ArrayBuffer value that is a + // reference to the same object as V. + return V +} + +webidl.converters.TypedArray = function (V, T, opts = {}) { + // 1. Let T be the IDL type V is being converted to. + + // 2. If Type(V) is not Object, or V does not have a + // [[TypedArrayName]] internal slot with a value + // equal to T’s name, then throw a TypeError. + if ( + webidl.util.Type(V) !== 'Object' || + !types.isTypedArray(V) || + V.constructor.name !== T.name + ) { + throw webidl.errors.conversionFailed({ + prefix: `${T.name}`, + argument: `${V}`, + types: [T.name] + }) + } + + // 3. If the conversion is not to an IDL type associated + // with the [AllowShared] extended attribute, and + // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is + // true, then throw a TypeError. + if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) { + throw webidl.errors.exception({ + header: 'ArrayBuffer', + message: 'SharedArrayBuffer is not allowed.' + }) + } + + // 4. If the conversion is not to an IDL type associated + // with the [AllowResizable] extended attribute, and + // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is + // true, then throw a TypeError. + // Note: resizable array buffers are currently a proposal + + // 5. Return the IDL value of type T that is a reference + // to the same object as V. + return V +} + +webidl.converters.DataView = function (V, opts = {}) { + // 1. If Type(V) is not Object, or V does not have a + // [[DataView]] internal slot, then throw a TypeError. + if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) { + throw webidl.errors.exception({ + header: 'DataView', + message: 'Object is not a DataView.' + }) + } + + // 2. If the conversion is not to an IDL type associated + // with the [AllowShared] extended attribute, and + // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true, + // then throw a TypeError. + if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) { + throw webidl.errors.exception({ + header: 'ArrayBuffer', + message: 'SharedArrayBuffer is not allowed.' + }) + } + + // 3. If the conversion is not to an IDL type associated + // with the [AllowResizable] extended attribute, and + // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is + // true, then throw a TypeError. + // Note: resizable ArrayBuffers are currently a proposal + + // 4. Return the IDL DataView value that is a reference + // to the same object as V. + return V +} + +// https://webidl.spec.whatwg.org/#BufferSource +webidl.converters.BufferSource = function (V, opts = {}) { + if (types.isAnyArrayBuffer(V)) { + return webidl.converters.ArrayBuffer(V, opts) + } + + if (types.isTypedArray(V)) { + return webidl.converters.TypedArray(V, V.constructor) + } + + if (types.isDataView(V)) { + return webidl.converters.DataView(V, opts) + } + + throw new TypeError(`Could not convert ${V} to a BufferSource.`) +} + +webidl.converters['sequence'] = webidl.sequenceConverter( + webidl.converters.ByteString +) + +webidl.converters['sequence>'] = webidl.sequenceConverter( + webidl.converters['sequence'] +) + +webidl.converters['record'] = webidl.recordConverter( + webidl.converters.ByteString, + webidl.converters.ByteString +) + +module.exports = { + webidl +} + + +/***/ }), + +/***/ 84854: +/***/ ((module) => { + +"use strict"; + + +/** + * @see https://encoding.spec.whatwg.org/#concept-encoding-get + * @param {string|undefined} label + */ +function getEncoding (label) { + if (!label) { + return 'failure' + } + + // 1. Remove any leading and trailing ASCII whitespace from label. + // 2. If label is an ASCII case-insensitive match for any of the + // labels listed in the table below, then return the + // corresponding encoding; otherwise return failure. + switch (label.trim().toLowerCase()) { + case 'unicode-1-1-utf-8': + case 'unicode11utf8': + case 'unicode20utf8': + case 'utf-8': + case 'utf8': + case 'x-unicode20utf8': + return 'UTF-8' + case '866': + case 'cp866': + case 'csibm866': + case 'ibm866': + return 'IBM866' + case 'csisolatin2': + case 'iso-8859-2': + case 'iso-ir-101': + case 'iso8859-2': + case 'iso88592': + case 'iso_8859-2': + case 'iso_8859-2:1987': + case 'l2': + case 'latin2': + return 'ISO-8859-2' + case 'csisolatin3': + case 'iso-8859-3': + case 'iso-ir-109': + case 'iso8859-3': + case 'iso88593': + case 'iso_8859-3': + case 'iso_8859-3:1988': + case 'l3': + case 'latin3': + return 'ISO-8859-3' + case 'csisolatin4': + case 'iso-8859-4': + case 'iso-ir-110': + case 'iso8859-4': + case 'iso88594': + case 'iso_8859-4': + case 'iso_8859-4:1988': + case 'l4': + case 'latin4': + return 'ISO-8859-4' + case 'csisolatincyrillic': + case 'cyrillic': + case 'iso-8859-5': + case 'iso-ir-144': + case 'iso8859-5': + case 'iso88595': + case 'iso_8859-5': + case 'iso_8859-5:1988': + return 'ISO-8859-5' + case 'arabic': + case 'asmo-708': + case 'csiso88596e': + case 'csiso88596i': + case 'csisolatinarabic': + case 'ecma-114': + case 'iso-8859-6': + case 'iso-8859-6-e': + case 'iso-8859-6-i': + case 'iso-ir-127': + case 'iso8859-6': + case 'iso88596': + case 'iso_8859-6': + case 'iso_8859-6:1987': + return 'ISO-8859-6' + case 'csisolatingreek': + case 'ecma-118': + case 'elot_928': + case 'greek': + case 'greek8': + case 'iso-8859-7': + case 'iso-ir-126': + case 'iso8859-7': + case 'iso88597': + case 'iso_8859-7': + case 'iso_8859-7:1987': + case 'sun_eu_greek': + return 'ISO-8859-7' + case 'csiso88598e': + case 'csisolatinhebrew': + case 'hebrew': + case 'iso-8859-8': + case 'iso-8859-8-e': + case 'iso-ir-138': + case 'iso8859-8': + case 'iso88598': + case 'iso_8859-8': + case 'iso_8859-8:1988': + case 'visual': + return 'ISO-8859-8' + case 'csiso88598i': + case 'iso-8859-8-i': + case 'logical': + return 'ISO-8859-8-I' + case 'csisolatin6': + case 'iso-8859-10': + case 'iso-ir-157': + case 'iso8859-10': + case 'iso885910': + case 'l6': + case 'latin6': + return 'ISO-8859-10' + case 'iso-8859-13': + case 'iso8859-13': + case 'iso885913': + return 'ISO-8859-13' + case 'iso-8859-14': + case 'iso8859-14': + case 'iso885914': + return 'ISO-8859-14' + case 'csisolatin9': + case 'iso-8859-15': + case 'iso8859-15': + case 'iso885915': + case 'iso_8859-15': + case 'l9': + return 'ISO-8859-15' + case 'iso-8859-16': + return 'ISO-8859-16' + case 'cskoi8r': + case 'koi': + case 'koi8': + case 'koi8-r': + case 'koi8_r': + return 'KOI8-R' + case 'koi8-ru': + case 'koi8-u': + return 'KOI8-U' + case 'csmacintosh': + case 'mac': + case 'macintosh': + case 'x-mac-roman': + return 'macintosh' + case 'iso-8859-11': + case 'iso8859-11': + case 'iso885911': + case 'tis-620': + case 'windows-874': + return 'windows-874' + case 'cp1250': + case 'windows-1250': + case 'x-cp1250': + return 'windows-1250' + case 'cp1251': + case 'windows-1251': + case 'x-cp1251': + return 'windows-1251' + case 'ansi_x3.4-1968': + case 'ascii': + case 'cp1252': + case 'cp819': + case 'csisolatin1': + case 'ibm819': + case 'iso-8859-1': + case 'iso-ir-100': + case 'iso8859-1': + case 'iso88591': + case 'iso_8859-1': + case 'iso_8859-1:1987': + case 'l1': + case 'latin1': + case 'us-ascii': + case 'windows-1252': + case 'x-cp1252': + return 'windows-1252' + case 'cp1253': + case 'windows-1253': + case 'x-cp1253': + return 'windows-1253' + case 'cp1254': + case 'csisolatin5': + case 'iso-8859-9': + case 'iso-ir-148': + case 'iso8859-9': + case 'iso88599': + case 'iso_8859-9': + case 'iso_8859-9:1989': + case 'l5': + case 'latin5': + case 'windows-1254': + case 'x-cp1254': + return 'windows-1254' + case 'cp1255': + case 'windows-1255': + case 'x-cp1255': + return 'windows-1255' + case 'cp1256': + case 'windows-1256': + case 'x-cp1256': + return 'windows-1256' + case 'cp1257': + case 'windows-1257': + case 'x-cp1257': + return 'windows-1257' + case 'cp1258': + case 'windows-1258': + case 'x-cp1258': + return 'windows-1258' + case 'x-mac-cyrillic': + case 'x-mac-ukrainian': + return 'x-mac-cyrillic' + case 'chinese': + case 'csgb2312': + case 'csiso58gb231280': + case 'gb2312': + case 'gb_2312': + case 'gb_2312-80': + case 'gbk': + case 'iso-ir-58': + case 'x-gbk': + return 'GBK' + case 'gb18030': + return 'gb18030' + case 'big5': + case 'big5-hkscs': + case 'cn-big5': + case 'csbig5': + case 'x-x-big5': + return 'Big5' + case 'cseucpkdfmtjapanese': + case 'euc-jp': + case 'x-euc-jp': + return 'EUC-JP' + case 'csiso2022jp': + case 'iso-2022-jp': + return 'ISO-2022-JP' + case 'csshiftjis': + case 'ms932': + case 'ms_kanji': + case 'shift-jis': + case 'shift_jis': + case 'sjis': + case 'windows-31j': + case 'x-sjis': + return 'Shift_JIS' + case 'cseuckr': + case 'csksc56011987': + case 'euc-kr': + case 'iso-ir-149': + case 'korean': + case 'ks_c_5601-1987': + case 'ks_c_5601-1989': + case 'ksc5601': + case 'ksc_5601': + case 'windows-949': + return 'EUC-KR' + case 'csiso2022kr': + case 'hz-gb-2312': + case 'iso-2022-cn': + case 'iso-2022-cn-ext': + case 'iso-2022-kr': + case 'replacement': + return 'replacement' + case 'unicodefffe': + case 'utf-16be': + return 'UTF-16BE' + case 'csunicode': + case 'iso-10646-ucs-2': + case 'ucs-2': + case 'unicode': + case 'unicodefeff': + case 'utf-16': + case 'utf-16le': + return 'UTF-16LE' + case 'x-user-defined': + return 'x-user-defined' + default: return 'failure' + } +} + +module.exports = { + getEncoding +} + + +/***/ }), + +/***/ 1446: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { + staticPropertyDescriptors, + readOperation, + fireAProgressEvent +} = __nccwpck_require__(87530) +const { + kState, + kError, + kResult, + kEvents, + kAborted +} = __nccwpck_require__(29054) +const { webidl } = __nccwpck_require__(21744) +const { kEnumerableProperty } = __nccwpck_require__(83983) + +class FileReader extends EventTarget { + constructor () { + super() + + this[kState] = 'empty' + this[kResult] = null + this[kError] = null + this[kEvents] = { + loadend: null, + error: null, + abort: null, + load: null, + progress: null, + loadstart: null + } + } + + /** + * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer + * @param {import('buffer').Blob} blob + */ + readAsArrayBuffer (blob) { + webidl.brandCheck(this, FileReader) + + webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' }) + + blob = webidl.converters.Blob(blob, { strict: false }) + + // The readAsArrayBuffer(blob) method, when invoked, + // must initiate a read operation for blob with ArrayBuffer. + readOperation(this, blob, 'ArrayBuffer') + } + + /** + * @see https://w3c.github.io/FileAPI/#readAsBinaryString + * @param {import('buffer').Blob} blob + */ + readAsBinaryString (blob) { + webidl.brandCheck(this, FileReader) + + webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' }) + + blob = webidl.converters.Blob(blob, { strict: false }) + + // The readAsBinaryString(blob) method, when invoked, + // must initiate a read operation for blob with BinaryString. + readOperation(this, blob, 'BinaryString') + } + + /** + * @see https://w3c.github.io/FileAPI/#readAsDataText + * @param {import('buffer').Blob} blob + * @param {string?} encoding + */ + readAsText (blob, encoding = undefined) { + webidl.brandCheck(this, FileReader) + + webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' }) + + blob = webidl.converters.Blob(blob, { strict: false }) + + if (encoding !== undefined) { + encoding = webidl.converters.DOMString(encoding) + } + + // The readAsText(blob, encoding) method, when invoked, + // must initiate a read operation for blob with Text and encoding. + readOperation(this, blob, 'Text', encoding) + } + + /** + * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL + * @param {import('buffer').Blob} blob + */ + readAsDataURL (blob) { + webidl.brandCheck(this, FileReader) + + webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' }) + + blob = webidl.converters.Blob(blob, { strict: false }) + + // The readAsDataURL(blob) method, when invoked, must + // initiate a read operation for blob with DataURL. + readOperation(this, blob, 'DataURL') + } + + /** + * @see https://w3c.github.io/FileAPI/#dfn-abort + */ + abort () { + // 1. If this's state is "empty" or if this's state is + // "done" set this's result to null and terminate + // this algorithm. + if (this[kState] === 'empty' || this[kState] === 'done') { + this[kResult] = null + return + } + + // 2. If this's state is "loading" set this's state to + // "done" and set this's result to null. + if (this[kState] === 'loading') { + this[kState] = 'done' + this[kResult] = null + } + + // 3. If there are any tasks from this on the file reading + // task source in an affiliated task queue, then remove + // those tasks from that task queue. + this[kAborted] = true + + // 4. Terminate the algorithm for the read method being processed. + // TODO + + // 5. Fire a progress event called abort at this. + fireAProgressEvent('abort', this) + + // 6. If this's state is not "loading", fire a progress + // event called loadend at this. + if (this[kState] !== 'loading') { + fireAProgressEvent('loadend', this) + } + } + + /** + * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate + */ + get readyState () { + webidl.brandCheck(this, FileReader) + + switch (this[kState]) { + case 'empty': return this.EMPTY + case 'loading': return this.LOADING + case 'done': return this.DONE + } + } + + /** + * @see https://w3c.github.io/FileAPI/#dom-filereader-result + */ + get result () { + webidl.brandCheck(this, FileReader) + + // The result attribute’s getter, when invoked, must return + // this's result. + return this[kResult] + } + + /** + * @see https://w3c.github.io/FileAPI/#dom-filereader-error + */ + get error () { + webidl.brandCheck(this, FileReader) + + // The error attribute’s getter, when invoked, must return + // this's error. + return this[kError] + } + + get onloadend () { + webidl.brandCheck(this, FileReader) + + return this[kEvents].loadend + } + + set onloadend (fn) { + webidl.brandCheck(this, FileReader) + + if (this[kEvents].loadend) { + this.removeEventListener('loadend', this[kEvents].loadend) + } + + if (typeof fn === 'function') { + this[kEvents].loadend = fn + this.addEventListener('loadend', fn) + } else { + this[kEvents].loadend = null + } + } + + get onerror () { + webidl.brandCheck(this, FileReader) + + return this[kEvents].error + } + + set onerror (fn) { + webidl.brandCheck(this, FileReader) + + if (this[kEvents].error) { + this.removeEventListener('error', this[kEvents].error) + } + + if (typeof fn === 'function') { + this[kEvents].error = fn + this.addEventListener('error', fn) + } else { + this[kEvents].error = null + } + } + + get onloadstart () { + webidl.brandCheck(this, FileReader) + + return this[kEvents].loadstart + } + + set onloadstart (fn) { + webidl.brandCheck(this, FileReader) + + if (this[kEvents].loadstart) { + this.removeEventListener('loadstart', this[kEvents].loadstart) + } + + if (typeof fn === 'function') { + this[kEvents].loadstart = fn + this.addEventListener('loadstart', fn) + } else { + this[kEvents].loadstart = null + } + } + + get onprogress () { + webidl.brandCheck(this, FileReader) + + return this[kEvents].progress + } + + set onprogress (fn) { + webidl.brandCheck(this, FileReader) + + if (this[kEvents].progress) { + this.removeEventListener('progress', this[kEvents].progress) + } + + if (typeof fn === 'function') { + this[kEvents].progress = fn + this.addEventListener('progress', fn) + } else { + this[kEvents].progress = null + } + } + + get onload () { + webidl.brandCheck(this, FileReader) + + return this[kEvents].load + } + + set onload (fn) { + webidl.brandCheck(this, FileReader) + + if (this[kEvents].load) { + this.removeEventListener('load', this[kEvents].load) + } + + if (typeof fn === 'function') { + this[kEvents].load = fn + this.addEventListener('load', fn) + } else { + this[kEvents].load = null + } + } + + get onabort () { + webidl.brandCheck(this, FileReader) + + return this[kEvents].abort + } + + set onabort (fn) { + webidl.brandCheck(this, FileReader) + + if (this[kEvents].abort) { + this.removeEventListener('abort', this[kEvents].abort) + } + + if (typeof fn === 'function') { + this[kEvents].abort = fn + this.addEventListener('abort', fn) + } else { + this[kEvents].abort = null + } + } +} + +// https://w3c.github.io/FileAPI/#dom-filereader-empty +FileReader.EMPTY = FileReader.prototype.EMPTY = 0 +// https://w3c.github.io/FileAPI/#dom-filereader-loading +FileReader.LOADING = FileReader.prototype.LOADING = 1 +// https://w3c.github.io/FileAPI/#dom-filereader-done +FileReader.DONE = FileReader.prototype.DONE = 2 + +Object.defineProperties(FileReader.prototype, { + EMPTY: staticPropertyDescriptors, + LOADING: staticPropertyDescriptors, + DONE: staticPropertyDescriptors, + readAsArrayBuffer: kEnumerableProperty, + readAsBinaryString: kEnumerableProperty, + readAsText: kEnumerableProperty, + readAsDataURL: kEnumerableProperty, + abort: kEnumerableProperty, + readyState: kEnumerableProperty, + result: kEnumerableProperty, + error: kEnumerableProperty, + onloadstart: kEnumerableProperty, + onprogress: kEnumerableProperty, + onload: kEnumerableProperty, + onabort: kEnumerableProperty, + onerror: kEnumerableProperty, + onloadend: kEnumerableProperty, + [Symbol.toStringTag]: { + value: 'FileReader', + writable: false, + enumerable: false, + configurable: true + } +}) + +Object.defineProperties(FileReader, { + EMPTY: staticPropertyDescriptors, + LOADING: staticPropertyDescriptors, + DONE: staticPropertyDescriptors +}) + +module.exports = { + FileReader +} + + +/***/ }), + +/***/ 55504: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { webidl } = __nccwpck_require__(21744) + +const kState = Symbol('ProgressEvent state') + +/** + * @see https://xhr.spec.whatwg.org/#progressevent + */ +class ProgressEvent extends Event { + constructor (type, eventInitDict = {}) { + type = webidl.converters.DOMString(type) + eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {}) + + super(type, eventInitDict) + + this[kState] = { + lengthComputable: eventInitDict.lengthComputable, + loaded: eventInitDict.loaded, + total: eventInitDict.total + } + } + + get lengthComputable () { + webidl.brandCheck(this, ProgressEvent) + + return this[kState].lengthComputable + } + + get loaded () { + webidl.brandCheck(this, ProgressEvent) + + return this[kState].loaded + } + + get total () { + webidl.brandCheck(this, ProgressEvent) + + return this[kState].total + } +} + +webidl.converters.ProgressEventInit = webidl.dictionaryConverter([ + { + key: 'lengthComputable', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'loaded', + converter: webidl.converters['unsigned long long'], + defaultValue: 0 + }, + { + key: 'total', + converter: webidl.converters['unsigned long long'], + defaultValue: 0 + }, + { + key: 'bubbles', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'cancelable', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'composed', + converter: webidl.converters.boolean, + defaultValue: false + } +]) + +module.exports = { + ProgressEvent +} + + +/***/ }), + +/***/ 29054: +/***/ ((module) => { + +"use strict"; + + +module.exports = { + kState: Symbol('FileReader state'), + kResult: Symbol('FileReader result'), + kError: Symbol('FileReader error'), + kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'), + kEvents: Symbol('FileReader events'), + kAborted: Symbol('FileReader aborted') +} + + +/***/ }), + +/***/ 87530: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { + kState, + kError, + kResult, + kAborted, + kLastProgressEventFired +} = __nccwpck_require__(29054) +const { ProgressEvent } = __nccwpck_require__(55504) +const { getEncoding } = __nccwpck_require__(84854) +const { DOMException } = __nccwpck_require__(41037) +const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(685) +const { types } = __nccwpck_require__(73837) +const { StringDecoder } = __nccwpck_require__(71576) +const { btoa } = __nccwpck_require__(14300) + +/** @type {PropertyDescriptor} */ +const staticPropertyDescriptors = { + enumerable: true, + writable: false, + configurable: false +} + +/** + * @see https://w3c.github.io/FileAPI/#readOperation + * @param {import('./filereader').FileReader} fr + * @param {import('buffer').Blob} blob + * @param {string} type + * @param {string?} encodingName + */ +function readOperation (fr, blob, type, encodingName) { + // 1. If fr’s state is "loading", throw an InvalidStateError + // DOMException. + if (fr[kState] === 'loading') { + throw new DOMException('Invalid state', 'InvalidStateError') + } + + // 2. Set fr’s state to "loading". + fr[kState] = 'loading' + + // 3. Set fr’s result to null. + fr[kResult] = null + + // 4. Set fr’s error to null. + fr[kError] = null + + // 5. Let stream be the result of calling get stream on blob. + /** @type {import('stream/web').ReadableStream} */ + const stream = blob.stream() + + // 6. Let reader be the result of getting a reader from stream. + const reader = stream.getReader() + + // 7. Let bytes be an empty byte sequence. + /** @type {Uint8Array[]} */ + const bytes = [] + + // 8. Let chunkPromise be the result of reading a chunk from + // stream with reader. + let chunkPromise = reader.read() + + // 9. Let isFirstChunk be true. + let isFirstChunk = true + + // 10. In parallel, while true: + // Note: "In parallel" just means non-blocking + // Note 2: readOperation itself cannot be async as double + // reading the body would then reject the promise, instead + // of throwing an error. + ;(async () => { + while (!fr[kAborted]) { + // 1. Wait for chunkPromise to be fulfilled or rejected. + try { + const { done, value } = await chunkPromise + + // 2. If chunkPromise is fulfilled, and isFirstChunk is + // true, queue a task to fire a progress event called + // loadstart at fr. + if (isFirstChunk && !fr[kAborted]) { + queueMicrotask(() => { + fireAProgressEvent('loadstart', fr) + }) + } + + // 3. Set isFirstChunk to false. + isFirstChunk = false + + // 4. If chunkPromise is fulfilled with an object whose + // done property is false and whose value property is + // a Uint8Array object, run these steps: + if (!done && types.isUint8Array(value)) { + // 1. Let bs be the byte sequence represented by the + // Uint8Array object. + + // 2. Append bs to bytes. + bytes.push(value) + + // 3. If roughly 50ms have passed since these steps + // were last invoked, queue a task to fire a + // progress event called progress at fr. + if ( + ( + fr[kLastProgressEventFired] === undefined || + Date.now() - fr[kLastProgressEventFired] >= 50 + ) && + !fr[kAborted] + ) { + fr[kLastProgressEventFired] = Date.now() + queueMicrotask(() => { + fireAProgressEvent('progress', fr) + }) + } + + // 4. Set chunkPromise to the result of reading a + // chunk from stream with reader. + chunkPromise = reader.read() + } else if (done) { + // 5. Otherwise, if chunkPromise is fulfilled with an + // object whose done property is true, queue a task + // to run the following steps and abort this algorithm: + queueMicrotask(() => { + // 1. Set fr’s state to "done". + fr[kState] = 'done' + + // 2. Let result be the result of package data given + // bytes, type, blob’s type, and encodingName. + try { + const result = packageData(bytes, type, blob.type, encodingName) + + // 4. Else: + + if (fr[kAborted]) { + return + } + + // 1. Set fr’s result to result. + fr[kResult] = result + + // 2. Fire a progress event called load at the fr. + fireAProgressEvent('load', fr) + } catch (error) { + // 3. If package data threw an exception error: + + // 1. Set fr’s error to error. + fr[kError] = error + + // 2. Fire a progress event called error at fr. + fireAProgressEvent('error', fr) + } + + // 5. If fr’s state is not "loading", fire a progress + // event called loadend at the fr. + if (fr[kState] !== 'loading') { + fireAProgressEvent('loadend', fr) + } + }) + + break + } + } catch (error) { + if (fr[kAborted]) { + return + } + + // 6. Otherwise, if chunkPromise is rejected with an + // error error, queue a task to run the following + // steps and abort this algorithm: + queueMicrotask(() => { + // 1. Set fr’s state to "done". + fr[kState] = 'done' + + // 2. Set fr’s error to error. + fr[kError] = error + + // 3. Fire a progress event called error at fr. + fireAProgressEvent('error', fr) + + // 4. If fr’s state is not "loading", fire a progress + // event called loadend at fr. + if (fr[kState] !== 'loading') { + fireAProgressEvent('loadend', fr) + } + }) + + break + } + } + })() +} + +/** + * @see https://w3c.github.io/FileAPI/#fire-a-progress-event + * @see https://dom.spec.whatwg.org/#concept-event-fire + * @param {string} e The name of the event + * @param {import('./filereader').FileReader} reader + */ +function fireAProgressEvent (e, reader) { + // The progress event e does not bubble. e.bubbles must be false + // The progress event e is NOT cancelable. e.cancelable must be false + const event = new ProgressEvent(e, { + bubbles: false, + cancelable: false + }) + + reader.dispatchEvent(event) +} + +/** + * @see https://w3c.github.io/FileAPI/#blob-package-data + * @param {Uint8Array[]} bytes + * @param {string} type + * @param {string?} mimeType + * @param {string?} encodingName + */ +function packageData (bytes, type, mimeType, encodingName) { + // 1. A Blob has an associated package data algorithm, given + // bytes, a type, a optional mimeType, and a optional + // encodingName, which switches on type and runs the + // associated steps: + + switch (type) { + case 'DataURL': { + // 1. Return bytes as a DataURL [RFC2397] subject to + // the considerations below: + // * Use mimeType as part of the Data URL if it is + // available in keeping with the Data URL + // specification [RFC2397]. + // * If mimeType is not available return a Data URL + // without a media-type. [RFC2397]. + + // https://datatracker.ietf.org/doc/html/rfc2397#section-3 + // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data + // mediatype := [ type "/" subtype ] *( ";" parameter ) + // data := *urlchar + // parameter := attribute "=" value + let dataURL = 'data:' + + const parsed = parseMIMEType(mimeType || 'application/octet-stream') + + if (parsed !== 'failure') { + dataURL += serializeAMimeType(parsed) + } + + dataURL += ';base64,' + + const decoder = new StringDecoder('latin1') + + for (const chunk of bytes) { + dataURL += btoa(decoder.write(chunk)) + } + + dataURL += btoa(decoder.end()) + + return dataURL + } + case 'Text': { + // 1. Let encoding be failure + let encoding = 'failure' + + // 2. If the encodingName is present, set encoding to the + // result of getting an encoding from encodingName. + if (encodingName) { + encoding = getEncoding(encodingName) + } + + // 3. If encoding is failure, and mimeType is present: + if (encoding === 'failure' && mimeType) { + // 1. Let type be the result of parse a MIME type + // given mimeType. + const type = parseMIMEType(mimeType) + + // 2. If type is not failure, set encoding to the result + // of getting an encoding from type’s parameters["charset"]. + if (type !== 'failure') { + encoding = getEncoding(type.parameters.get('charset')) + } + } + + // 4. If encoding is failure, then set encoding to UTF-8. + if (encoding === 'failure') { + encoding = 'UTF-8' + } + + // 5. Decode bytes using fallback encoding encoding, and + // return the result. + return decode(bytes, encoding) + } + case 'ArrayBuffer': { + // Return a new ArrayBuffer whose contents are bytes. + const sequence = combineByteSequences(bytes) + + return sequence.buffer + } + case 'BinaryString': { + // Return bytes as a binary string, in which every byte + // is represented by a code unit of equal value [0..255]. + let binaryString = '' + + const decoder = new StringDecoder('latin1') + + for (const chunk of bytes) { + binaryString += decoder.write(chunk) + } + + binaryString += decoder.end() + + return binaryString + } + } +} + +/** + * @see https://encoding.spec.whatwg.org/#decode + * @param {Uint8Array[]} ioQueue + * @param {string} encoding + */ +function decode (ioQueue, encoding) { + const bytes = combineByteSequences(ioQueue) + + // 1. Let BOMEncoding be the result of BOM sniffing ioQueue. + const BOMEncoding = BOMSniffing(bytes) + + let slice = 0 + + // 2. If BOMEncoding is non-null: + if (BOMEncoding !== null) { + // 1. Set encoding to BOMEncoding. + encoding = BOMEncoding + + // 2. Read three bytes from ioQueue, if BOMEncoding is + // UTF-8; otherwise read two bytes. + // (Do nothing with those bytes.) + slice = BOMEncoding === 'UTF-8' ? 3 : 2 + } + + // 3. Process a queue with an instance of encoding’s + // decoder, ioQueue, output, and "replacement". + + // 4. Return output. + + const sliced = bytes.slice(slice) + return new TextDecoder(encoding).decode(sliced) +} + +/** + * @see https://encoding.spec.whatwg.org/#bom-sniff + * @param {Uint8Array} ioQueue + */ +function BOMSniffing (ioQueue) { + // 1. Let BOM be the result of peeking 3 bytes from ioQueue, + // converted to a byte sequence. + const [a, b, c] = ioQueue + + // 2. For each of the rows in the table below, starting with + // the first one and going down, if BOM starts with the + // bytes given in the first column, then return the + // encoding given in the cell in the second column of that + // row. Otherwise, return null. + if (a === 0xEF && b === 0xBB && c === 0xBF) { + return 'UTF-8' + } else if (a === 0xFE && b === 0xFF) { + return 'UTF-16BE' + } else if (a === 0xFF && b === 0xFE) { + return 'UTF-16LE' + } + + return null +} + +/** + * @param {Uint8Array[]} sequences + */ +function combineByteSequences (sequences) { + const size = sequences.reduce((a, b) => { + return a + b.byteLength + }, 0) + + let offset = 0 + + return sequences.reduce((a, b) => { + a.set(b, offset) + offset += b.byteLength + return a + }, new Uint8Array(size)) +} + +module.exports = { + staticPropertyDescriptors, + readOperation, + fireAProgressEvent +} + + +/***/ }), + +/***/ 21892: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +// We include a version number for the Dispatcher API. In case of breaking changes, +// this version number must be increased to avoid conflicts. +const globalDispatcher = Symbol.for('undici.globalDispatcher.1') +const { InvalidArgumentError } = __nccwpck_require__(48045) +const Agent = __nccwpck_require__(7890) + +if (getGlobalDispatcher() === undefined) { + setGlobalDispatcher(new Agent()) +} + +function setGlobalDispatcher (agent) { + if (!agent || typeof agent.dispatch !== 'function') { + throw new InvalidArgumentError('Argument agent must implement Agent') + } + Object.defineProperty(globalThis, globalDispatcher, { + value: agent, + writable: true, + enumerable: false, + configurable: false + }) +} + +function getGlobalDispatcher () { + return globalThis[globalDispatcher] +} + +module.exports = { + setGlobalDispatcher, + getGlobalDispatcher +} + + +/***/ }), + +/***/ 46930: +/***/ ((module) => { + +"use strict"; + + +module.exports = class DecoratorHandler { + constructor (handler) { + this.handler = handler + } + + onConnect (...args) { + return this.handler.onConnect(...args) + } + + onError (...args) { + return this.handler.onError(...args) + } + + onUpgrade (...args) { + return this.handler.onUpgrade(...args) + } + + onHeaders (...args) { + return this.handler.onHeaders(...args) + } + + onData (...args) { + return this.handler.onData(...args) + } + + onComplete (...args) { + return this.handler.onComplete(...args) + } + + onBodySent (...args) { + return this.handler.onBodySent(...args) + } +} + + +/***/ }), + +/***/ 72860: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const util = __nccwpck_require__(83983) +const { kBodyUsed } = __nccwpck_require__(72785) +const assert = __nccwpck_require__(39491) +const { InvalidArgumentError } = __nccwpck_require__(48045) +const EE = __nccwpck_require__(82361) + +const redirectableStatusCodes = [300, 301, 302, 303, 307, 308] + +const kBody = Symbol('body') + +class BodyAsyncIterable { + constructor (body) { + this[kBody] = body + this[kBodyUsed] = false + } + + async * [Symbol.asyncIterator] () { + assert(!this[kBodyUsed], 'disturbed') + this[kBodyUsed] = true + yield * this[kBody] + } +} + +class RedirectHandler { + constructor (dispatch, maxRedirections, opts, handler) { + if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { + throw new InvalidArgumentError('maxRedirections must be a positive number') + } + + util.validateHandler(handler, opts.method, opts.upgrade) + + this.dispatch = dispatch + this.location = null + this.abort = null + this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy + this.maxRedirections = maxRedirections + this.handler = handler + this.history = [] + + if (util.isStream(this.opts.body)) { + // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp + // so that it can be dispatched again? + // TODO (fix): Do we need 100-expect support to provide a way to do this properly? + if (util.bodyLength(this.opts.body) === 0) { + this.opts.body + .on('data', function () { + assert(false) + }) + } + + if (typeof this.opts.body.readableDidRead !== 'boolean') { + this.opts.body[kBodyUsed] = false + EE.prototype.on.call(this.opts.body, 'data', function () { + this[kBodyUsed] = true + }) + } + } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') { + // TODO (fix): We can't access ReadableStream internal state + // to determine whether or not it has been disturbed. This is just + // a workaround. + this.opts.body = new BodyAsyncIterable(this.opts.body) + } else if ( + this.opts.body && + typeof this.opts.body !== 'string' && + !ArrayBuffer.isView(this.opts.body) && + util.isIterable(this.opts.body) + ) { + // TODO: Should we allow re-using iterable if !this.opts.idempotent + // or through some other flag? + this.opts.body = new BodyAsyncIterable(this.opts.body) + } + } + + onConnect (abort) { + this.abort = abort + this.handler.onConnect(abort, { history: this.history }) + } + + onUpgrade (statusCode, headers, socket) { + this.handler.onUpgrade(statusCode, headers, socket) + } + + onError (error) { + this.handler.onError(error) + } + + onHeaders (statusCode, headers, resume, statusText) { + this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) + ? null + : parseLocation(statusCode, headers) + + if (this.opts.origin) { + this.history.push(new URL(this.opts.path, this.opts.origin)) + } + + if (!this.location) { + return this.handler.onHeaders(statusCode, headers, resume, statusText) + } + + const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))) + const path = search ? `${pathname}${search}` : pathname + + // Remove headers referring to the original URL. + // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers. + // https://tools.ietf.org/html/rfc7231#section-6.4 + this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin) + this.opts.path = path + this.opts.origin = origin + this.opts.maxRedirections = 0 + this.opts.query = null + + // https://tools.ietf.org/html/rfc7231#section-6.4.4 + // In case of HTTP 303, always replace method to be either HEAD or GET + if (statusCode === 303 && this.opts.method !== 'HEAD') { + this.opts.method = 'GET' + this.opts.body = null + } + } + + onData (chunk) { + if (this.location) { + /* + https://tools.ietf.org/html/rfc7231#section-6.4 + + TLDR: undici always ignores 3xx response bodies. + + Redirection is used to serve the requested resource from another URL, so it is assumes that + no body is generated (and thus can be ignored). Even though generating a body is not prohibited. + + For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually + (which means it's optional and not mandated) contain just an hyperlink to the value of + the Location response header, so the body can be ignored safely. + + For status 300, which is "Multiple Choices", the spec mentions both generating a Location + response header AND a response body with the other possible location to follow. + Since the spec explicitily chooses not to specify a format for such body and leave it to + servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it. + */ + } else { + return this.handler.onData(chunk) + } + } + + onComplete (trailers) { + if (this.location) { + /* + https://tools.ietf.org/html/rfc7231#section-6.4 + + TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections + and neither are useful if present. + + See comment on onData method above for more detailed informations. + */ + + this.location = null + this.abort = null + + this.dispatch(this.opts, this) + } else { + this.handler.onComplete(trailers) + } + } + + onBodySent (chunk) { + if (this.handler.onBodySent) { + this.handler.onBodySent(chunk) + } + } +} + +function parseLocation (statusCode, headers) { + if (redirectableStatusCodes.indexOf(statusCode) === -1) { + return null + } + + for (let i = 0; i < headers.length; i += 2) { + if (headers[i].toString().toLowerCase() === 'location') { + return headers[i + 1] + } + } +} + +// https://tools.ietf.org/html/rfc7231#section-6.4.4 +function shouldRemoveHeader (header, removeContent, unknownOrigin) { + return ( + (header.length === 4 && header.toString().toLowerCase() === 'host') || + (removeContent && header.toString().toLowerCase().indexOf('content-') === 0) || + (unknownOrigin && header.length === 13 && header.toString().toLowerCase() === 'authorization') || + (unknownOrigin && header.length === 6 && header.toString().toLowerCase() === 'cookie') + ) +} + +// https://tools.ietf.org/html/rfc7231#section-6.4 +function cleanRequestHeaders (headers, removeContent, unknownOrigin) { + const ret = [] + if (Array.isArray(headers)) { + for (let i = 0; i < headers.length; i += 2) { + if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) { + ret.push(headers[i], headers[i + 1]) + } + } + } else if (headers && typeof headers === 'object') { + for (const key of Object.keys(headers)) { + if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) { + ret.push(key, headers[key]) + } + } + } else { + assert(headers == null, 'headers must be an object or an array') + } + return ret +} + +module.exports = RedirectHandler + + +/***/ }), + +/***/ 38861: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const RedirectHandler = __nccwpck_require__(72860) + +function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) { + return (dispatch) => { + return function Intercept (opts, handler) { + const { maxRedirections = defaultMaxRedirections } = opts + + if (!maxRedirections) { + return dispatch(opts, handler) + } + + const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler) + opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting. + return dispatch(opts, redirectHandler) + } + } +} + +module.exports = createRedirectInterceptor + + +/***/ }), + +/***/ 30953: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; +const utils_1 = __nccwpck_require__(41891); +// C headers +var ERROR; +(function (ERROR) { + ERROR[ERROR["OK"] = 0] = "OK"; + ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL"; + ERROR[ERROR["STRICT"] = 2] = "STRICT"; + ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED"; + ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH"; + ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION"; + ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD"; + ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL"; + ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT"; + ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION"; + ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN"; + ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH"; + ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE"; + ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS"; + ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE"; + ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING"; + ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN"; + ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE"; + ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE"; + ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER"; + ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE"; + ERROR[ERROR["PAUSED"] = 21] = "PAUSED"; + ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE"; + ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE"; + ERROR[ERROR["USER"] = 24] = "USER"; +})(ERROR = exports.ERROR || (exports.ERROR = {})); +var TYPE; +(function (TYPE) { + TYPE[TYPE["BOTH"] = 0] = "BOTH"; + TYPE[TYPE["REQUEST"] = 1] = "REQUEST"; + TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE"; +})(TYPE = exports.TYPE || (exports.TYPE = {})); +var FLAGS; +(function (FLAGS) { + FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE"; + FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE"; + FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE"; + FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED"; + FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE"; + FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH"; + FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY"; + FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING"; + // 1 << 8 is unused + FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING"; +})(FLAGS = exports.FLAGS || (exports.FLAGS = {})); +var LENIENT_FLAGS; +(function (LENIENT_FLAGS) { + LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS"; + LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH"; + LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE"; +})(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {})); +var METHODS; +(function (METHODS) { + METHODS[METHODS["DELETE"] = 0] = "DELETE"; + METHODS[METHODS["GET"] = 1] = "GET"; + METHODS[METHODS["HEAD"] = 2] = "HEAD"; + METHODS[METHODS["POST"] = 3] = "POST"; + METHODS[METHODS["PUT"] = 4] = "PUT"; + /* pathological */ + METHODS[METHODS["CONNECT"] = 5] = "CONNECT"; + METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS"; + METHODS[METHODS["TRACE"] = 7] = "TRACE"; + /* WebDAV */ + METHODS[METHODS["COPY"] = 8] = "COPY"; + METHODS[METHODS["LOCK"] = 9] = "LOCK"; + METHODS[METHODS["MKCOL"] = 10] = "MKCOL"; + METHODS[METHODS["MOVE"] = 11] = "MOVE"; + METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND"; + METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH"; + METHODS[METHODS["SEARCH"] = 14] = "SEARCH"; + METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK"; + METHODS[METHODS["BIND"] = 16] = "BIND"; + METHODS[METHODS["REBIND"] = 17] = "REBIND"; + METHODS[METHODS["UNBIND"] = 18] = "UNBIND"; + METHODS[METHODS["ACL"] = 19] = "ACL"; + /* subversion */ + METHODS[METHODS["REPORT"] = 20] = "REPORT"; + METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY"; + METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT"; + METHODS[METHODS["MERGE"] = 23] = "MERGE"; + /* upnp */ + METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH"; + METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY"; + METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE"; + METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE"; + /* RFC-5789 */ + METHODS[METHODS["PATCH"] = 28] = "PATCH"; + METHODS[METHODS["PURGE"] = 29] = "PURGE"; + /* CalDAV */ + METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR"; + /* RFC-2068, section 19.6.1.2 */ + METHODS[METHODS["LINK"] = 31] = "LINK"; + METHODS[METHODS["UNLINK"] = 32] = "UNLINK"; + /* icecast */ + METHODS[METHODS["SOURCE"] = 33] = "SOURCE"; + /* RFC-7540, section 11.6 */ + METHODS[METHODS["PRI"] = 34] = "PRI"; + /* RFC-2326 RTSP */ + METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE"; + METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE"; + METHODS[METHODS["SETUP"] = 37] = "SETUP"; + METHODS[METHODS["PLAY"] = 38] = "PLAY"; + METHODS[METHODS["PAUSE"] = 39] = "PAUSE"; + METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN"; + METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER"; + METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER"; + METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT"; + METHODS[METHODS["RECORD"] = 44] = "RECORD"; + /* RAOP */ + METHODS[METHODS["FLUSH"] = 45] = "FLUSH"; +})(METHODS = exports.METHODS || (exports.METHODS = {})); +exports.METHODS_HTTP = [ + METHODS.DELETE, + METHODS.GET, + METHODS.HEAD, + METHODS.POST, + METHODS.PUT, + METHODS.CONNECT, + METHODS.OPTIONS, + METHODS.TRACE, + METHODS.COPY, + METHODS.LOCK, + METHODS.MKCOL, + METHODS.MOVE, + METHODS.PROPFIND, + METHODS.PROPPATCH, + METHODS.SEARCH, + METHODS.UNLOCK, + METHODS.BIND, + METHODS.REBIND, + METHODS.UNBIND, + METHODS.ACL, + METHODS.REPORT, + METHODS.MKACTIVITY, + METHODS.CHECKOUT, + METHODS.MERGE, + METHODS['M-SEARCH'], + METHODS.NOTIFY, + METHODS.SUBSCRIBE, + METHODS.UNSUBSCRIBE, + METHODS.PATCH, + METHODS.PURGE, + METHODS.MKCALENDAR, + METHODS.LINK, + METHODS.UNLINK, + METHODS.PRI, + // TODO(indutny): should we allow it with HTTP? + METHODS.SOURCE, +]; +exports.METHODS_ICE = [ + METHODS.SOURCE, +]; +exports.METHODS_RTSP = [ + METHODS.OPTIONS, + METHODS.DESCRIBE, + METHODS.ANNOUNCE, + METHODS.SETUP, + METHODS.PLAY, + METHODS.PAUSE, + METHODS.TEARDOWN, + METHODS.GET_PARAMETER, + METHODS.SET_PARAMETER, + METHODS.REDIRECT, + METHODS.RECORD, + METHODS.FLUSH, + // For AirPlay + METHODS.GET, + METHODS.POST, +]; +exports.METHOD_MAP = utils_1.enumToMap(METHODS); +exports.H_METHOD_MAP = {}; +Object.keys(exports.METHOD_MAP).forEach((key) => { + if (/^H/.test(key)) { + exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key]; + } +}); +var FINISH; +(function (FINISH) { + FINISH[FINISH["SAFE"] = 0] = "SAFE"; + FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB"; + FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE"; +})(FINISH = exports.FINISH || (exports.FINISH = {})); +exports.ALPHA = []; +for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) { + // Upper case + exports.ALPHA.push(String.fromCharCode(i)); + // Lower case + exports.ALPHA.push(String.fromCharCode(i + 0x20)); +} +exports.NUM_MAP = { + 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, + 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, +}; +exports.HEX_MAP = { + 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, + 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, + A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF, + a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf, +}; +exports.NUM = [ + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', +]; +exports.ALPHANUM = exports.ALPHA.concat(exports.NUM); +exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')']; +exports.USERINFO_CHARS = exports.ALPHANUM + .concat(exports.MARK) + .concat(['%', ';', ':', '&', '=', '+', '$', ',']); +// TODO(indutny): use RFC +exports.STRICT_URL_CHAR = [ + '!', '"', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + ':', ';', '<', '=', '>', + '@', '[', '\\', ']', '^', '_', + '`', + '{', '|', '}', '~', +].concat(exports.ALPHANUM); +exports.URL_CHAR = exports.STRICT_URL_CHAR + .concat(['\t', '\f']); +// All characters with 0x80 bit set to 1 +for (let i = 0x80; i <= 0xff; i++) { + exports.URL_CHAR.push(i); +} +exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']); +/* Tokens as defined by rfc 2616. Also lowercases them. + * token = 1* + * separators = "(" | ")" | "<" | ">" | "@" + * | "," | ";" | ":" | "\" | <"> + * | "/" | "[" | "]" | "?" | "=" + * | "{" | "}" | SP | HT + */ +exports.STRICT_TOKEN = [ + '!', '#', '$', '%', '&', '\'', + '*', '+', '-', '.', + '^', '_', '`', + '|', '~', +].concat(exports.ALPHANUM); +exports.TOKEN = exports.STRICT_TOKEN.concat([' ']); +/* + * Verify that a char is a valid visible (printable) US-ASCII + * character or %x80-FF + */ +exports.HEADER_CHARS = ['\t']; +for (let i = 32; i <= 255; i++) { + if (i !== 127) { + exports.HEADER_CHARS.push(i); + } +} +// ',' = \x44 +exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44); +exports.MAJOR = exports.NUM_MAP; +exports.MINOR = exports.MAJOR; +var HEADER_STATE; +(function (HEADER_STATE) { + HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL"; + HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION"; + HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH"; + HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING"; + HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE"; + HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE"; + HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE"; + HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE"; + HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED"; +})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {})); +exports.SPECIAL_HEADERS = { + 'connection': HEADER_STATE.CONNECTION, + 'content-length': HEADER_STATE.CONTENT_LENGTH, + 'proxy-connection': HEADER_STATE.CONNECTION, + 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING, + 'upgrade': HEADER_STATE.UPGRADE, +}; +//# sourceMappingURL=constants.js.map + +/***/ }), + +/***/ 61145: +/***/ ((module) => { + +module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfbWFqb3IADxVsbGh0dHBfZ2V0X2h0dHBfbWlub3IAEBFsbGh0dHBfZ2V0X21ldGhvZAARFmxsaHR0cF9nZXRfc3RhdHVzX2NvZGUAEhJsbGh0dHBfZ2V0X3VwZ3JhZGUAEwxsbGh0dHBfcmVzZXQAFA5sbGh0dHBfZXhlY3V0ZQAVFGxsaHR0cF9zZXR0aW5nc19pbml0ABYNbGxodHRwX2ZpbmlzaAAXDGxsaHR0cF9wYXVzZQAYDWxsaHR0cF9yZXN1bWUAGRtsbGh0dHBfcmVzdW1lX2FmdGVyX3VwZ3JhZGUAGhBsbGh0dHBfZ2V0X2Vycm5vABsXbGxodHRwX2dldF9lcnJvcl9yZWFzb24AHBdsbGh0dHBfc2V0X2Vycm9yX3JlYXNvbgAdFGxsaHR0cF9nZXRfZXJyb3JfcG9zAB4RbGxodHRwX2Vycm5vX25hbWUAHxJsbGh0dHBfbWV0aG9kX25hbWUAIBJsbGh0dHBfc3RhdHVzX25hbWUAIRpsbGh0dHBfc2V0X2xlbmllbnRfaGVhZGVycwAiIWxsaHR0cF9zZXRfbGVuaWVudF9jaHVua2VkX2xlbmd0aAAjHWxsaHR0cF9zZXRfbGVuaWVudF9rZWVwX2FsaXZlACQkbGxodHRwX3NldF9sZW5pZW50X3RyYW5zZmVyX2VuY29kaW5nACUYbGxodHRwX21lc3NhZ2VfbmVlZHNfZW9mAD8JFwEAQQELEQECAwQFCwYHNTk3MS8tJyspCsLgAkUCAAsIABCIgICAAAsZACAAEMKAgIAAGiAAIAI2AjggACABOgAoCxwAIAAgAC8BMiAALQAuIAAQwYCAgAAQgICAgAALKgEBf0HAABDGgICAACIBEMKAgIAAGiABQYCIgIAANgI4IAEgADoAKCABCwoAIAAQyICAgAALBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LRQEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABDCgICAABogACAENgI4IAAgAzoAKCAAIAI6AC0gACABNgIYCxEAIAAgASABIAJqEMOAgIAACxAAIABBAEHcABDMgICAABoLZwEBf0EAIQECQCAAKAIMDQACQAJAAkACQCAALQAvDgMBAAMCCyAAKAI4IgFFDQAgASgCLCIBRQ0AIAAgARGAgICAAAAiAQ0DC0EADwsQyoCAgAAACyAAQcOWgIAANgIQQQ4hAQsgAQseAAJAIAAoAgwNACAAQdGbgIAANgIQIABBFTYCDAsLFgACQCAAKAIMQRVHDQAgAEEANgIMCwsWAAJAIAAoAgxBFkcNACAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsiAAJAIABBJEkNABDKgICAAAALIABBAnRBoLOAgABqKAIACyIAAkAgAEEuSQ0AEMqAgIAAAAsgAEECdEGwtICAAGooAgAL7gsBAX9B66iAgAAhAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABBnH9qDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0Hhp4CAAA8LQaShgIAADwtBy6yAgAAPC0H+sYCAAA8LQcCkgIAADwtBq6SAgAAPC0GNqICAAA8LQeKmgIAADwtBgLCAgAAPC0G5r4CAAA8LQdekgIAADwtB75+AgAAPC0Hhn4CAAA8LQfqfgIAADwtB8qCAgAAPC0Gor4CAAA8LQa6ygIAADwtBiLCAgAAPC0Hsp4CAAA8LQYKigIAADwtBjp2AgAAPC0HQroCAAA8LQcqjgIAADwtBxbKAgAAPC0HfnICAAA8LQdKcgIAADwtBxKCAgAAPC0HXoICAAA8LQaKfgIAADwtB7a6AgAAPC0GrsICAAA8LQdSlgIAADwtBzK6AgAAPC0H6roCAAA8LQfyrgIAADwtB0rCAgAAPC0HxnYCAAA8LQbuggIAADwtB96uAgAAPC0GQsYCAAA8LQdexgIAADwtBoq2AgAAPC0HUp4CAAA8LQeCrgIAADwtBn6yAgAAPC0HrsYCAAA8LQdWfgIAADwtByrGAgAAPC0HepYCAAA8LQdSegIAADwtB9JyAgAAPC0GnsoCAAA8LQbGdgIAADwtBoJ2AgAAPC0G5sYCAAA8LQbywgIAADwtBkqGAgAAPC0GzpoCAAA8LQemsgIAADwtBrJ6AgAAPC0HUq4CAAA8LQfemgIAADwtBgKaAgAAPC0GwoYCAAA8LQf6egIAADwtBjaOAgAAPC0GJrYCAAA8LQfeigIAADwtBoLGAgAAPC0Gun4CAAA8LQcalgIAADwtB6J6AgAAPC0GTooCAAA8LQcKvgIAADwtBw52AgAAPC0GLrICAAA8LQeGdgIAADwtBja+AgAAPC0HqoYCAAA8LQbStgIAADwtB0q+AgAAPC0HfsoCAAA8LQdKygIAADwtB8LCAgAAPC0GpooCAAA8LQfmjgIAADwtBmZ6AgAAPC0G1rICAAA8LQZuwgIAADwtBkrKAgAAPC0G2q4CAAA8LQcKigIAADwtB+LKAgAAPC0GepYCAAA8LQdCigIAADwtBup6AgAAPC0GBnoCAAA8LEMqAgIAAAAtB1qGAgAAhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAgAiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCBCIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQcaRgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIwIgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAggiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEH2ioCAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCNCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIMIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABB7ZqAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAjgiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCECIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQZWQgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAI8IgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAhQiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEGqm4CAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCQCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIYIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABB7ZOAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAkQiBEUNACAAIAQRgICAgAAAIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCJCIERQ0AIAAgBBGAgICAAAAhAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIsIgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAigiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEH2iICAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCUCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIcIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABBwpmAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAkgiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCICIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQZSUgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAJMIgRFDQAgACAEEYCAgIAAACEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAlQiBEUNACAAIAQRgICAgAAAIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCWCIERQ0AIAAgBBGAgICAAAAhAwsgAwtFAQF/AkACQCAALwEwQRRxQRRHDQBBASEDIAAtAChBAUYNASAALwEyQeUARiEDDAELIAAtAClBBUYhAwsgACADOgAuQQAL/gEBA39BASEDAkAgAC8BMCIEQQhxDQAgACkDIEIAUiEDCwJAAkAgAC0ALkUNAEEBIQUgAC0AKUEFRg0BQQEhBSAEQcAAcUUgA3FBAUcNAQtBACEFIARBwABxDQBBAiEFIARB//8DcSIDQQhxDQACQCADQYAEcUUNAAJAIAAtAChBAUcNACAALQAtQQpxDQBBBQ8LQQQPCwJAIANBIHENAAJAIAAtAChBAUYNACAALwEyQf//A3EiAEGcf2pB5ABJDQAgAEHMAUYNACAAQbACRg0AQQQhBSAEQShxRQ0CIANBiARxQYAERg0CC0EADwtBAEEDIAApAyBQGyEFCyAFC2IBAn9BACEBAkAgAC0AKEEBRg0AIAAvATJB//8DcSICQZx/akHkAEkNACACQcwBRg0AIAJBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhASAAQYgEcUGABEYNACAAQShxRSEBCyABC6cBAQN/AkACQAJAIAAtACpFDQAgAC0AK0UNAEEAIQMgAC8BMCIEQQJxRQ0BDAILQQAhAyAALwEwIgRBAXFFDQELQQEhAyAALQAoQQFGDQAgAC8BMkH//wNxIgVBnH9qQeQASQ0AIAVBzAFGDQAgBUGwAkYNACAEQcAAcQ0AQQAhAyAEQYgEcUGABEYNACAEQShxQQBHIQMLIABBADsBMCAAQQA6AC8gAwuZAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQBBACEBIAAvATAiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC1kAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEHdATYCHEEAC3sBAX8CQCAAKAIMIgMNAAJAIAAoAgRFDQAgACABNgIECwJAIAAgASACEMSAgIAAIgMNACAAKAIMDwsgACADNgIcQQAhAyAAKAIEIgFFDQAgACABIAIgACgCCBGBgICAAAAiAUUNACAAIAI2AhQgACABNgIMIAEhAwsgAwvk8wEDDn8DfgR/I4CAgIAAQRBrIgMkgICAgAAgASEEIAEhBSABIQYgASEHIAEhCCABIQkgASEKIAEhCyABIQwgASENIAEhDiABIQ8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgACgCHCIQQX9qDt0B2gEB2QECAwQFBgcICQoLDA0O2AEPENcBERLWARMUFRYXGBkaG+AB3wEcHR7VAR8gISIjJCXUASYnKCkqKyzTAdIBLS7RAdABLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVG2wFHSElKzwHOAUvNAUzMAU1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXp7fH1+f4ABgQGCAYMBhAGFAYYBhwGIAYkBigGLAYwBjQGOAY8BkAGRAZIBkwGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0BrgGvAbABsQGyAbMBtAG1AbYBtwHLAcoBuAHJAbkByAG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAQDcAQtBACEQDMYBC0EOIRAMxQELQQ0hEAzEAQtBDyEQDMMBC0EQIRAMwgELQRMhEAzBAQtBFCEQDMABC0EVIRAMvwELQRYhEAy+AQtBFyEQDL0BC0EYIRAMvAELQRkhEAy7AQtBGiEQDLoBC0EbIRAMuQELQRwhEAy4AQtBCCEQDLcBC0EdIRAMtgELQSAhEAy1AQtBHyEQDLQBC0EHIRAMswELQSEhEAyyAQtBIiEQDLEBC0EeIRAMsAELQSMhEAyvAQtBEiEQDK4BC0ERIRAMrQELQSQhEAysAQtBJSEQDKsBC0EmIRAMqgELQSchEAypAQtBwwEhEAyoAQtBKSEQDKcBC0ErIRAMpgELQSwhEAylAQtBLSEQDKQBC0EuIRAMowELQS8hEAyiAQtBxAEhEAyhAQtBMCEQDKABC0E0IRAMnwELQQwhEAyeAQtBMSEQDJ0BC0EyIRAMnAELQTMhEAybAQtBOSEQDJoBC0E1IRAMmQELQcUBIRAMmAELQQshEAyXAQtBOiEQDJYBC0E2IRAMlQELQQohEAyUAQtBNyEQDJMBC0E4IRAMkgELQTwhEAyRAQtBOyEQDJABC0E9IRAMjwELQQkhEAyOAQtBKCEQDI0BC0E+IRAMjAELQT8hEAyLAQtBwAAhEAyKAQtBwQAhEAyJAQtBwgAhEAyIAQtBwwAhEAyHAQtBxAAhEAyGAQtBxQAhEAyFAQtBxgAhEAyEAQtBKiEQDIMBC0HHACEQDIIBC0HIACEQDIEBC0HJACEQDIABC0HKACEQDH8LQcsAIRAMfgtBzQAhEAx9C0HMACEQDHwLQc4AIRAMewtBzwAhEAx6C0HQACEQDHkLQdEAIRAMeAtB0gAhEAx3C0HTACEQDHYLQdQAIRAMdQtB1gAhEAx0C0HVACEQDHMLQQYhEAxyC0HXACEQDHELQQUhEAxwC0HYACEQDG8LQQQhEAxuC0HZACEQDG0LQdoAIRAMbAtB2wAhEAxrC0HcACEQDGoLQQMhEAxpC0HdACEQDGgLQd4AIRAMZwtB3wAhEAxmC0HhACEQDGULQeAAIRAMZAtB4gAhEAxjC0HjACEQDGILQQIhEAxhC0HkACEQDGALQeUAIRAMXwtB5gAhEAxeC0HnACEQDF0LQegAIRAMXAtB6QAhEAxbC0HqACEQDFoLQesAIRAMWQtB7AAhEAxYC0HtACEQDFcLQe4AIRAMVgtB7wAhEAxVC0HwACEQDFQLQfEAIRAMUwtB8gAhEAxSC0HzACEQDFELQfQAIRAMUAtB9QAhEAxPC0H2ACEQDE4LQfcAIRAMTQtB+AAhEAxMC0H5ACEQDEsLQfoAIRAMSgtB+wAhEAxJC0H8ACEQDEgLQf0AIRAMRwtB/gAhEAxGC0H/ACEQDEULQYABIRAMRAtBgQEhEAxDC0GCASEQDEILQYMBIRAMQQtBhAEhEAxAC0GFASEQDD8LQYYBIRAMPgtBhwEhEAw9C0GIASEQDDwLQYkBIRAMOwtBigEhEAw6C0GLASEQDDkLQYwBIRAMOAtBjQEhEAw3C0GOASEQDDYLQY8BIRAMNQtBkAEhEAw0C0GRASEQDDMLQZIBIRAMMgtBkwEhEAwxC0GUASEQDDALQZUBIRAMLwtBlgEhEAwuC0GXASEQDC0LQZgBIRAMLAtBmQEhEAwrC0GaASEQDCoLQZsBIRAMKQtBnAEhEAwoC0GdASEQDCcLQZ4BIRAMJgtBnwEhEAwlC0GgASEQDCQLQaEBIRAMIwtBogEhEAwiC0GjASEQDCELQaQBIRAMIAtBpQEhEAwfC0GmASEQDB4LQacBIRAMHQtBqAEhEAwcC0GpASEQDBsLQaoBIRAMGgtBqwEhEAwZC0GsASEQDBgLQa0BIRAMFwtBrgEhEAwWC0EBIRAMFQtBrwEhEAwUC0GwASEQDBMLQbEBIRAMEgtBswEhEAwRC0GyASEQDBALQbQBIRAMDwtBtQEhEAwOC0G2ASEQDA0LQbcBIRAMDAtBuAEhEAwLC0G5ASEQDAoLQboBIRAMCQtBuwEhEAwIC0HGASEQDAcLQbwBIRAMBgtBvQEhEAwFC0G+ASEQDAQLQb8BIRAMAwtBwAEhEAwCC0HCASEQDAELQcEBIRALA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQDscBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxweHyAhIyUoP0BBREVGR0hJSktMTU9QUVJT3gNXWVtcXWBiZWZnaGlqa2xtb3BxcnN0dXZ3eHl6e3x9foABggGFAYYBhwGJAYsBjAGNAY4BjwGQAZEBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBxwHIAckBygHLAcwBzQHOAc8B0AHRAdIB0wHUAdUB1gHXAdgB2QHaAdsB3AHdAd4B4AHhAeIB4wHkAeUB5gHnAegB6QHqAesB7AHtAe4B7wHwAfEB8gHzAZkCpAKwAv4C/gILIAEiBCACRw3zAUHdASEQDP8DCyABIhAgAkcN3QFBwwEhEAz+AwsgASIBIAJHDZABQfcAIRAM/QMLIAEiASACRw2GAUHvACEQDPwDCyABIgEgAkcNf0HqACEQDPsDCyABIgEgAkcNe0HoACEQDPoDCyABIgEgAkcNeEHmACEQDPkDCyABIgEgAkcNGkEYIRAM+AMLIAEiASACRw0UQRIhEAz3AwsgASIBIAJHDVlBxQAhEAz2AwsgASIBIAJHDUpBPyEQDPUDCyABIgEgAkcNSEE8IRAM9AMLIAEiASACRw1BQTEhEAzzAwsgAC0ALkEBRg3rAwyHAgsgACABIgEgAhDAgICAAEEBRw3mASAAQgA3AyAM5wELIAAgASIBIAIQtICAgAAiEA3nASABIQEM9QILAkAgASIBIAJHDQBBBiEQDPADCyAAIAFBAWoiASACELuAgIAAIhAN6AEgASEBDDELIABCADcDIEESIRAM1QMLIAEiECACRw0rQR0hEAztAwsCQCABIgEgAkYNACABQQFqIQFBECEQDNQDC0EHIRAM7AMLIABCACAAKQMgIhEgAiABIhBrrSISfSITIBMgEVYbNwMgIBEgElYiFEUN5QFBCCEQDOsDCwJAIAEiASACRg0AIABBiYCAgAA2AgggACABNgIEIAEhAUEUIRAM0gMLQQkhEAzqAwsgASEBIAApAyBQDeQBIAEhAQzyAgsCQCABIgEgAkcNAEELIRAM6QMLIAAgAUEBaiIBIAIQtoCAgAAiEA3lASABIQEM8gILIAAgASIBIAIQuICAgAAiEA3lASABIQEM8gILIAAgASIBIAIQuICAgAAiEA3mASABIQEMDQsgACABIgEgAhC6gICAACIQDecBIAEhAQzwAgsCQCABIgEgAkcNAEEPIRAM5QMLIAEtAAAiEEE7Rg0IIBBBDUcN6AEgAUEBaiEBDO8CCyAAIAEiASACELqAgIAAIhAN6AEgASEBDPICCwNAAkAgAS0AAEHwtYCAAGotAAAiEEEBRg0AIBBBAkcN6wEgACgCBCEQIABBADYCBCAAIBAgAUEBaiIBELmAgIAAIhAN6gEgASEBDPQCCyABQQFqIgEgAkcNAAtBEiEQDOIDCyAAIAEiASACELqAgIAAIhAN6QEgASEBDAoLIAEiASACRw0GQRshEAzgAwsCQCABIgEgAkcNAEEWIRAM4AMLIABBioCAgAA2AgggACABNgIEIAAgASACELiAgIAAIhAN6gEgASEBQSAhEAzGAwsCQCABIgEgAkYNAANAAkAgAS0AAEHwt4CAAGotAAAiEEECRg0AAkAgEEF/ag4E5QHsAQDrAewBCyABQQFqIQFBCCEQDMgDCyABQQFqIgEgAkcNAAtBFSEQDN8DC0EVIRAM3gMLA0ACQCABLQAAQfC5gIAAai0AACIQQQJGDQAgEEF/ag4E3gHsAeAB6wHsAQsgAUEBaiIBIAJHDQALQRghEAzdAwsCQCABIgEgAkYNACAAQYuAgIAANgIIIAAgATYCBCABIQFBByEQDMQDC0EZIRAM3AMLIAFBAWohAQwCCwJAIAEiFCACRw0AQRohEAzbAwsgFCEBAkAgFC0AAEFzag4U3QLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gIA7gILQQAhECAAQQA2AhwgAEGvi4CAADYCECAAQQI2AgwgACAUQQFqNgIUDNoDCwJAIAEtAAAiEEE7Rg0AIBBBDUcN6AEgAUEBaiEBDOUCCyABQQFqIQELQSIhEAy/AwsCQCABIhAgAkcNAEEcIRAM2AMLQgAhESAQIQEgEC0AAEFQag435wHmAQECAwQFBgcIAAAAAAAAAAkKCwwNDgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADxAREhMUAAtBHiEQDL0DC0ICIREM5QELQgMhEQzkAQtCBCERDOMBC0IFIREM4gELQgYhEQzhAQtCByERDOABC0IIIREM3wELQgkhEQzeAQtCCiERDN0BC0ILIREM3AELQgwhEQzbAQtCDSERDNoBC0IOIREM2QELQg8hEQzYAQtCCiERDNcBC0ILIREM1gELQgwhEQzVAQtCDSERDNQBC0IOIREM0wELQg8hEQzSAQtCACERAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQLQAAQVBqDjflAeQBAAECAwQFBgfmAeYB5gHmAeYB5gHmAQgJCgsMDeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gEODxAREhPmAQtCAiERDOQBC0IDIREM4wELQgQhEQziAQtCBSERDOEBC0IGIREM4AELQgchEQzfAQtCCCERDN4BC0IJIREM3QELQgohEQzcAQtCCyERDNsBC0IMIREM2gELQg0hEQzZAQtCDiERDNgBC0IPIREM1wELQgohEQzWAQtCCyERDNUBC0IMIREM1AELQg0hEQzTAQtCDiERDNIBC0IPIREM0QELIABCACAAKQMgIhEgAiABIhBrrSISfSITIBMgEVYbNwMgIBEgElYiFEUN0gFBHyEQDMADCwJAIAEiASACRg0AIABBiYCAgAA2AgggACABNgIEIAEhAUEkIRAMpwMLQSAhEAy/AwsgACABIhAgAhC+gICAAEF/ag4FtgEAxQIB0QHSAQtBESEQDKQDCyAAQQE6AC8gECEBDLsDCyABIgEgAkcN0gFBJCEQDLsDCyABIg0gAkcNHkHGACEQDLoDCyAAIAEiASACELKAgIAAIhAN1AEgASEBDLUBCyABIhAgAkcNJkHQACEQDLgDCwJAIAEiASACRw0AQSghEAy4AwsgAEEANgIEIABBjICAgAA2AgggACABIAEQsYCAgAAiEA3TASABIQEM2AELAkAgASIQIAJHDQBBKSEQDLcDCyAQLQAAIgFBIEYNFCABQQlHDdMBIBBBAWohAQwVCwJAIAEiASACRg0AIAFBAWohAQwXC0EqIRAMtQMLAkAgASIQIAJHDQBBKyEQDLUDCwJAIBAtAAAiAUEJRg0AIAFBIEcN1QELIAAtACxBCEYN0wEgECEBDJEDCwJAIAEiASACRw0AQSwhEAy0AwsgAS0AAEEKRw3VASABQQFqIQEMyQILIAEiDiACRw3VAUEvIRAMsgMLA0ACQCABLQAAIhBBIEYNAAJAIBBBdmoOBADcAdwBANoBCyABIQEM4AELIAFBAWoiASACRw0AC0ExIRAMsQMLQTIhECABIhQgAkYNsAMgAiAUayAAKAIAIgFqIRUgFCABa0EDaiEWAkADQCAULQAAIhdBIHIgFyAXQb9/akH/AXFBGkkbQf8BcSABQfC7gIAAai0AAEcNAQJAIAFBA0cNAEEGIQEMlgMLIAFBAWohASAUQQFqIhQgAkcNAAsgACAVNgIADLEDCyAAQQA2AgAgFCEBDNkBC0EzIRAgASIUIAJGDa8DIAIgFGsgACgCACIBaiEVIBQgAWtBCGohFgJAA0AgFC0AACIXQSByIBcgF0G/f2pB/wFxQRpJG0H/AXEgAUH0u4CAAGotAABHDQECQCABQQhHDQBBBSEBDJUDCyABQQFqIQEgFEEBaiIUIAJHDQALIAAgFTYCAAywAwsgAEEANgIAIBQhAQzYAQtBNCEQIAEiFCACRg2uAyACIBRrIAAoAgAiAWohFSAUIAFrQQVqIRYCQANAIBQtAAAiF0EgciAXIBdBv39qQf8BcUEaSRtB/wFxIAFB0MKAgABqLQAARw0BAkAgAUEFRw0AQQchAQyUAwsgAUEBaiEBIBRBAWoiFCACRw0ACyAAIBU2AgAMrwMLIABBADYCACAUIQEM1wELAkAgASIBIAJGDQADQAJAIAEtAABBgL6AgABqLQAAIhBBAUYNACAQQQJGDQogASEBDN0BCyABQQFqIgEgAkcNAAtBMCEQDK4DC0EwIRAMrQMLAkAgASIBIAJGDQADQAJAIAEtAAAiEEEgRg0AIBBBdmoOBNkB2gHaAdkB2gELIAFBAWoiASACRw0AC0E4IRAMrQMLQTghEAysAwsDQAJAIAEtAAAiEEEgRg0AIBBBCUcNAwsgAUEBaiIBIAJHDQALQTwhEAyrAwsDQAJAIAEtAAAiEEEgRg0AAkACQCAQQXZqDgTaAQEB2gEACyAQQSxGDdsBCyABIQEMBAsgAUEBaiIBIAJHDQALQT8hEAyqAwsgASEBDNsBC0HAACEQIAEiFCACRg2oAyACIBRrIAAoAgAiAWohFiAUIAFrQQZqIRcCQANAIBQtAABBIHIgAUGAwICAAGotAABHDQEgAUEGRg2OAyABQQFqIQEgFEEBaiIUIAJHDQALIAAgFjYCAAypAwsgAEEANgIAIBQhAQtBNiEQDI4DCwJAIAEiDyACRw0AQcEAIRAMpwMLIABBjICAgAA2AgggACAPNgIEIA8hASAALQAsQX9qDgTNAdUB1wHZAYcDCyABQQFqIQEMzAELAkAgASIBIAJGDQADQAJAIAEtAAAiEEEgciAQIBBBv39qQf8BcUEaSRtB/wFxIhBBCUYNACAQQSBGDQACQAJAAkACQCAQQZ1/ag4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIRAMkQMLIAFBAWohAUEyIRAMkAMLIAFBAWohAUEzIRAMjwMLIAEhAQzQAQsgAUEBaiIBIAJHDQALQTUhEAylAwtBNSEQDKQDCwJAIAEiASACRg0AA0ACQCABLQAAQYC8gIAAai0AAEEBRg0AIAEhAQzTAQsgAUEBaiIBIAJHDQALQT0hEAykAwtBPSEQDKMDCyAAIAEiASACELCAgIAAIhAN1gEgASEBDAELIBBBAWohAQtBPCEQDIcDCwJAIAEiASACRw0AQcIAIRAMoAMLAkADQAJAIAEtAABBd2oOGAAC/gL+AoQD/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4CAP4CCyABQQFqIgEgAkcNAAtBwgAhEAygAwsgAUEBaiEBIAAtAC1BAXFFDb0BIAEhAQtBLCEQDIUDCyABIgEgAkcN0wFBxAAhEAydAwsDQAJAIAEtAABBkMCAgABqLQAAQQFGDQAgASEBDLcCCyABQQFqIgEgAkcNAAtBxQAhEAycAwsgDS0AACIQQSBGDbMBIBBBOkcNgQMgACgCBCEBIABBADYCBCAAIAEgDRCvgICAACIBDdABIA1BAWohAQyzAgtBxwAhECABIg0gAkYNmgMgAiANayAAKAIAIgFqIRYgDSABa0EFaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUGQwoCAAGotAABHDYADIAFBBUYN9AIgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMmgMLQcgAIRAgASINIAJGDZkDIAIgDWsgACgCACIBaiEWIA0gAWtBCWohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFBlsKAgABqLQAARw3/AgJAIAFBCUcNAEECIQEM9QILIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJkDCwJAIAEiDSACRw0AQckAIRAMmQMLAkACQCANLQAAIgFBIHIgASABQb9/akH/AXFBGkkbQf8BcUGSf2oOBwCAA4ADgAOAA4ADAYADCyANQQFqIQFBPiEQDIADCyANQQFqIQFBPyEQDP8CC0HKACEQIAEiDSACRg2XAyACIA1rIAAoAgAiAWohFiANIAFrQQFqIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQaDCgIAAai0AAEcN/QIgAUEBRg3wAiABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyXAwtBywAhECABIg0gAkYNlgMgAiANayAAKAIAIgFqIRYgDSABa0EOaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUGiwoCAAGotAABHDfwCIAFBDkYN8AIgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMlgMLQcwAIRAgASINIAJGDZUDIAIgDWsgACgCACIBaiEWIA0gAWtBD2ohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFBwMKAgABqLQAARw37AgJAIAFBD0cNAEEDIQEM8QILIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJUDC0HNACEQIAEiDSACRg2UAyACIA1rIAAoAgAiAWohFiANIAFrQQVqIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQdDCgIAAai0AAEcN+gICQCABQQVHDQBBBCEBDPACCyABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyUAwsCQCABIg0gAkcNAEHOACEQDJQDCwJAAkACQAJAIA0tAAAiAUEgciABIAFBv39qQf8BcUEaSRtB/wFxQZ1/ag4TAP0C/QL9Av0C/QL9Av0C/QL9Av0C/QL9AgH9Av0C/QICA/0CCyANQQFqIQFBwQAhEAz9AgsgDUEBaiEBQcIAIRAM/AILIA1BAWohAUHDACEQDPsCCyANQQFqIQFBxAAhEAz6AgsCQCABIgEgAkYNACAAQY2AgIAANgIIIAAgATYCBCABIQFBxQAhEAz6AgtBzwAhEAySAwsgECEBAkACQCAQLQAAQXZqDgQBqAKoAgCoAgsgEEEBaiEBC0EnIRAM+AILAkAgASIBIAJHDQBB0QAhEAyRAwsCQCABLQAAQSBGDQAgASEBDI0BCyABQQFqIQEgAC0ALUEBcUUNxwEgASEBDIwBCyABIhcgAkcNyAFB0gAhEAyPAwtB0wAhECABIhQgAkYNjgMgAiAUayAAKAIAIgFqIRYgFCABa0EBaiEXA0AgFC0AACABQdbCgIAAai0AAEcNzAEgAUEBRg3HASABQQFqIQEgFEEBaiIUIAJHDQALIAAgFjYCAAyOAwsCQCABIgEgAkcNAEHVACEQDI4DCyABLQAAQQpHDcwBIAFBAWohAQzHAQsCQCABIgEgAkcNAEHWACEQDI0DCwJAAkAgAS0AAEF2ag4EAM0BzQEBzQELIAFBAWohAQzHAQsgAUEBaiEBQcoAIRAM8wILIAAgASIBIAIQroCAgAAiEA3LASABIQFBzQAhEAzyAgsgAC0AKUEiRg2FAwymAgsCQCABIgEgAkcNAEHbACEQDIoDC0EAIRRBASEXQQEhFkEAIRACQAJAAkACQAJAAkACQAJAAkAgAS0AAEFQag4K1AHTAQABAgMEBQYI1QELQQIhEAwGC0EDIRAMBQtBBCEQDAQLQQUhEAwDC0EGIRAMAgtBByEQDAELQQghEAtBACEXQQAhFkEAIRQMzAELQQkhEEEBIRRBACEXQQAhFgzLAQsCQCABIgEgAkcNAEHdACEQDIkDCyABLQAAQS5HDcwBIAFBAWohAQymAgsgASIBIAJHDcwBQd8AIRAMhwMLAkAgASIBIAJGDQAgAEGOgICAADYCCCAAIAE2AgQgASEBQdAAIRAM7gILQeAAIRAMhgMLQeEAIRAgASIBIAJGDYUDIAIgAWsgACgCACIUaiEWIAEgFGtBA2ohFwNAIAEtAAAgFEHiwoCAAGotAABHDc0BIBRBA0YNzAEgFEEBaiEUIAFBAWoiASACRw0ACyAAIBY2AgAMhQMLQeIAIRAgASIBIAJGDYQDIAIgAWsgACgCACIUaiEWIAEgFGtBAmohFwNAIAEtAAAgFEHmwoCAAGotAABHDcwBIBRBAkYNzgEgFEEBaiEUIAFBAWoiASACRw0ACyAAIBY2AgAMhAMLQeMAIRAgASIBIAJGDYMDIAIgAWsgACgCACIUaiEWIAEgFGtBA2ohFwNAIAEtAAAgFEHpwoCAAGotAABHDcsBIBRBA0YNzgEgFEEBaiEUIAFBAWoiASACRw0ACyAAIBY2AgAMgwMLAkAgASIBIAJHDQBB5QAhEAyDAwsgACABQQFqIgEgAhCogICAACIQDc0BIAEhAUHWACEQDOkCCwJAIAEiASACRg0AA0ACQCABLQAAIhBBIEYNAAJAAkACQCAQQbh/ag4LAAHPAc8BzwHPAc8BzwHPAc8BAs8BCyABQQFqIQFB0gAhEAztAgsgAUEBaiEBQdMAIRAM7AILIAFBAWohAUHUACEQDOsCCyABQQFqIgEgAkcNAAtB5AAhEAyCAwtB5AAhEAyBAwsDQAJAIAEtAABB8MKAgABqLQAAIhBBAUYNACAQQX5qDgPPAdAB0QHSAQsgAUEBaiIBIAJHDQALQeYAIRAMgAMLAkAgASIBIAJGDQAgAUEBaiEBDAMLQecAIRAM/wILA0ACQCABLQAAQfDEgIAAai0AACIQQQFGDQACQCAQQX5qDgTSAdMB1AEA1QELIAEhAUHXACEQDOcCCyABQQFqIgEgAkcNAAtB6AAhEAz+AgsCQCABIgEgAkcNAEHpACEQDP4CCwJAIAEtAAAiEEF2ag4augHVAdUBvAHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHKAdUB1QEA0wELIAFBAWohAQtBBiEQDOMCCwNAAkAgAS0AAEHwxoCAAGotAABBAUYNACABIQEMngILIAFBAWoiASACRw0AC0HqACEQDPsCCwJAIAEiASACRg0AIAFBAWohAQwDC0HrACEQDPoCCwJAIAEiASACRw0AQewAIRAM+gILIAFBAWohAQwBCwJAIAEiASACRw0AQe0AIRAM+QILIAFBAWohAQtBBCEQDN4CCwJAIAEiFCACRw0AQe4AIRAM9wILIBQhAQJAAkACQCAULQAAQfDIgIAAai0AAEF/ag4H1AHVAdYBAJwCAQLXAQsgFEEBaiEBDAoLIBRBAWohAQzNAQtBACEQIABBADYCHCAAQZuSgIAANgIQIABBBzYCDCAAIBRBAWo2AhQM9gILAkADQAJAIAEtAABB8MiAgABqLQAAIhBBBEYNAAJAAkAgEEF/ag4H0gHTAdQB2QEABAHZAQsgASEBQdoAIRAM4AILIAFBAWohAUHcACEQDN8CCyABQQFqIgEgAkcNAAtB7wAhEAz2AgsgAUEBaiEBDMsBCwJAIAEiFCACRw0AQfAAIRAM9QILIBQtAABBL0cN1AEgFEEBaiEBDAYLAkAgASIUIAJHDQBB8QAhEAz0AgsCQCAULQAAIgFBL0cNACAUQQFqIQFB3QAhEAzbAgsgAUF2aiIEQRZLDdMBQQEgBHRBiYCAAnFFDdMBDMoCCwJAIAEiASACRg0AIAFBAWohAUHeACEQDNoCC0HyACEQDPICCwJAIAEiFCACRw0AQfQAIRAM8gILIBQhAQJAIBQtAABB8MyAgABqLQAAQX9qDgPJApQCANQBC0HhACEQDNgCCwJAIAEiFCACRg0AA0ACQCAULQAAQfDKgIAAai0AACIBQQNGDQACQCABQX9qDgLLAgDVAQsgFCEBQd8AIRAM2gILIBRBAWoiFCACRw0AC0HzACEQDPECC0HzACEQDPACCwJAIAEiASACRg0AIABBj4CAgAA2AgggACABNgIEIAEhAUHgACEQDNcCC0H1ACEQDO8CCwJAIAEiASACRw0AQfYAIRAM7wILIABBj4CAgAA2AgggACABNgIEIAEhAQtBAyEQDNQCCwNAIAEtAABBIEcNwwIgAUEBaiIBIAJHDQALQfcAIRAM7AILAkAgASIBIAJHDQBB+AAhEAzsAgsgAS0AAEEgRw3OASABQQFqIQEM7wELIAAgASIBIAIQrICAgAAiEA3OASABIQEMjgILAkAgASIEIAJHDQBB+gAhEAzqAgsgBC0AAEHMAEcN0QEgBEEBaiEBQRMhEAzPAQsCQCABIgQgAkcNAEH7ACEQDOkCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRADQCAELQAAIAFB8M6AgABqLQAARw3QASABQQVGDc4BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQfsAIRAM6AILAkAgASIEIAJHDQBB/AAhEAzoAgsCQAJAIAQtAABBvX9qDgwA0QHRAdEB0QHRAdEB0QHRAdEB0QEB0QELIARBAWohAUHmACEQDM8CCyAEQQFqIQFB5wAhEAzOAgsCQCABIgQgAkcNAEH9ACEQDOcCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDc8BIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEH9ACEQDOcCCyAAQQA2AgAgEEEBaiEBQRAhEAzMAQsCQCABIgQgAkcNAEH+ACEQDOYCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUH2zoCAAGotAABHDc4BIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEH+ACEQDOYCCyAAQQA2AgAgEEEBaiEBQRYhEAzLAQsCQCABIgQgAkcNAEH/ACEQDOUCCyACIARrIAAoAgAiAWohFCAEIAFrQQNqIRACQANAIAQtAAAgAUH8zoCAAGotAABHDc0BIAFBA0YNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEH/ACEQDOUCCyAAQQA2AgAgEEEBaiEBQQUhEAzKAQsCQCABIgQgAkcNAEGAASEQDOQCCyAELQAAQdkARw3LASAEQQFqIQFBCCEQDMkBCwJAIAEiBCACRw0AQYEBIRAM4wILAkACQCAELQAAQbJ/ag4DAMwBAcwBCyAEQQFqIQFB6wAhEAzKAgsgBEEBaiEBQewAIRAMyQILAkAgASIEIAJHDQBBggEhEAziAgsCQAJAIAQtAABBuH9qDggAywHLAcsBywHLAcsBAcsBCyAEQQFqIQFB6gAhEAzJAgsgBEEBaiEBQe0AIRAMyAILAkAgASIEIAJHDQBBgwEhEAzhAgsgAiAEayAAKAIAIgFqIRAgBCABa0ECaiEUAkADQCAELQAAIAFBgM+AgABqLQAARw3JASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBA2AgBBgwEhEAzhAgtBACEQIABBADYCACAUQQFqIQEMxgELAkAgASIEIAJHDQBBhAEhEAzgAgsgAiAEayAAKAIAIgFqIRQgBCABa0EEaiEQAkADQCAELQAAIAFBg8+AgABqLQAARw3IASABQQRGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBhAEhEAzgAgsgAEEANgIAIBBBAWohAUEjIRAMxQELAkAgASIEIAJHDQBBhQEhEAzfAgsCQAJAIAQtAABBtH9qDggAyAHIAcgByAHIAcgBAcgBCyAEQQFqIQFB7wAhEAzGAgsgBEEBaiEBQfAAIRAMxQILAkAgASIEIAJHDQBBhgEhEAzeAgsgBC0AAEHFAEcNxQEgBEEBaiEBDIMCCwJAIAEiBCACRw0AQYcBIRAM3QILIAIgBGsgACgCACIBaiEUIAQgAWtBA2ohEAJAA0AgBC0AACABQYjPgIAAai0AAEcNxQEgAUEDRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYcBIRAM3QILIABBADYCACAQQQFqIQFBLSEQDMIBCwJAIAEiBCACRw0AQYgBIRAM3AILIAIgBGsgACgCACIBaiEUIAQgAWtBCGohEAJAA0AgBC0AACABQdDPgIAAai0AAEcNxAEgAUEIRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYgBIRAM3AILIABBADYCACAQQQFqIQFBKSEQDMEBCwJAIAEiASACRw0AQYkBIRAM2wILQQEhECABLQAAQd8ARw3AASABQQFqIQEMgQILAkAgASIEIAJHDQBBigEhEAzaAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQA0AgBC0AACABQYzPgIAAai0AAEcNwQEgAUEBRg2vAiABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGKASEQDNkCCwJAIAEiBCACRw0AQYsBIRAM2QILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQY7PgIAAai0AAEcNwQEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYsBIRAM2QILIABBADYCACAQQQFqIQFBAiEQDL4BCwJAIAEiBCACRw0AQYwBIRAM2AILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfDPgIAAai0AAEcNwAEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYwBIRAM2AILIABBADYCACAQQQFqIQFBHyEQDL0BCwJAIAEiBCACRw0AQY0BIRAM1wILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfLPgIAAai0AAEcNvwEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQY0BIRAM1wILIABBADYCACAQQQFqIQFBCSEQDLwBCwJAIAEiBCACRw0AQY4BIRAM1gILAkACQCAELQAAQbd/ag4HAL8BvwG/Ab8BvwEBvwELIARBAWohAUH4ACEQDL0CCyAEQQFqIQFB+QAhEAy8AgsCQCABIgQgAkcNAEGPASEQDNUCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUGRz4CAAGotAABHDb0BIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGPASEQDNUCCyAAQQA2AgAgEEEBaiEBQRghEAy6AQsCQCABIgQgAkcNAEGQASEQDNQCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUGXz4CAAGotAABHDbwBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGQASEQDNQCCyAAQQA2AgAgEEEBaiEBQRchEAy5AQsCQCABIgQgAkcNAEGRASEQDNMCCyACIARrIAAoAgAiAWohFCAEIAFrQQZqIRACQANAIAQtAAAgAUGaz4CAAGotAABHDbsBIAFBBkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGRASEQDNMCCyAAQQA2AgAgEEEBaiEBQRUhEAy4AQsCQCABIgQgAkcNAEGSASEQDNICCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUGhz4CAAGotAABHDboBIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGSASEQDNICCyAAQQA2AgAgEEEBaiEBQR4hEAy3AQsCQCABIgQgAkcNAEGTASEQDNECCyAELQAAQcwARw24ASAEQQFqIQFBCiEQDLYBCwJAIAQgAkcNAEGUASEQDNACCwJAAkAgBC0AAEG/f2oODwC5AbkBuQG5AbkBuQG5AbkBuQG5AbkBuQG5AQG5AQsgBEEBaiEBQf4AIRAMtwILIARBAWohAUH/ACEQDLYCCwJAIAQgAkcNAEGVASEQDM8CCwJAAkAgBC0AAEG/f2oOAwC4AQG4AQsgBEEBaiEBQf0AIRAMtgILIARBAWohBEGAASEQDLUCCwJAIAQgAkcNAEGWASEQDM4CCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUGnz4CAAGotAABHDbYBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGWASEQDM4CCyAAQQA2AgAgEEEBaiEBQQshEAyzAQsCQCAEIAJHDQBBlwEhEAzNAgsCQAJAAkACQCAELQAAQVNqDiMAuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AQG4AbgBuAG4AbgBArgBuAG4AQO4AQsgBEEBaiEBQfsAIRAMtgILIARBAWohAUH8ACEQDLUCCyAEQQFqIQRBgQEhEAy0AgsgBEEBaiEEQYIBIRAMswILAkAgBCACRw0AQZgBIRAMzAILIAIgBGsgACgCACIBaiEUIAQgAWtBBGohEAJAA0AgBC0AACABQanPgIAAai0AAEcNtAEgAUEERg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZgBIRAMzAILIABBADYCACAQQQFqIQFBGSEQDLEBCwJAIAQgAkcNAEGZASEQDMsCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUGuz4CAAGotAABHDbMBIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGZASEQDMsCCyAAQQA2AgAgEEEBaiEBQQYhEAywAQsCQCAEIAJHDQBBmgEhEAzKAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBtM+AgABqLQAARw2yASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBmgEhEAzKAgsgAEEANgIAIBBBAWohAUEcIRAMrwELAkAgBCACRw0AQZsBIRAMyQILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQbbPgIAAai0AAEcNsQEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZsBIRAMyQILIABBADYCACAQQQFqIQFBJyEQDK4BCwJAIAQgAkcNAEGcASEQDMgCCwJAAkAgBC0AAEGsf2oOAgABsQELIARBAWohBEGGASEQDK8CCyAEQQFqIQRBhwEhEAyuAgsCQCAEIAJHDQBBnQEhEAzHAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBuM+AgABqLQAARw2vASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBnQEhEAzHAgsgAEEANgIAIBBBAWohAUEmIRAMrAELAkAgBCACRw0AQZ4BIRAMxgILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQbrPgIAAai0AAEcNrgEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZ4BIRAMxgILIABBADYCACAQQQFqIQFBAyEQDKsBCwJAIAQgAkcNAEGfASEQDMUCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDa0BIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGfASEQDMUCCyAAQQA2AgAgEEEBaiEBQQwhEAyqAQsCQCAEIAJHDQBBoAEhEAzEAgsgAiAEayAAKAIAIgFqIRQgBCABa0EDaiEQAkADQCAELQAAIAFBvM+AgABqLQAARw2sASABQQNGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBoAEhEAzEAgsgAEEANgIAIBBBAWohAUENIRAMqQELAkAgBCACRw0AQaEBIRAMwwILAkACQCAELQAAQbp/ag4LAKwBrAGsAawBrAGsAawBrAGsAQGsAQsgBEEBaiEEQYsBIRAMqgILIARBAWohBEGMASEQDKkCCwJAIAQgAkcNAEGiASEQDMICCyAELQAAQdAARw2pASAEQQFqIQQM6QELAkAgBCACRw0AQaMBIRAMwQILAkACQCAELQAAQbd/ag4HAaoBqgGqAaoBqgEAqgELIARBAWohBEGOASEQDKgCCyAEQQFqIQFBIiEQDKYBCwJAIAQgAkcNAEGkASEQDMACCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUHAz4CAAGotAABHDagBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGkASEQDMACCyAAQQA2AgAgEEEBaiEBQR0hEAylAQsCQCAEIAJHDQBBpQEhEAy/AgsCQAJAIAQtAABBrn9qDgMAqAEBqAELIARBAWohBEGQASEQDKYCCyAEQQFqIQFBBCEQDKQBCwJAIAQgAkcNAEGmASEQDL4CCwJAAkACQAJAAkAgBC0AAEG/f2oOFQCqAaoBqgGqAaoBqgGqAaoBqgGqAQGqAaoBAqoBqgEDqgGqAQSqAQsgBEEBaiEEQYgBIRAMqAILIARBAWohBEGJASEQDKcCCyAEQQFqIQRBigEhEAymAgsgBEEBaiEEQY8BIRAMpQILIARBAWohBEGRASEQDKQCCwJAIAQgAkcNAEGnASEQDL0CCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDaUBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGnASEQDL0CCyAAQQA2AgAgEEEBaiEBQREhEAyiAQsCQCAEIAJHDQBBqAEhEAy8AgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFBws+AgABqLQAARw2kASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBqAEhEAy8AgsgAEEANgIAIBBBAWohAUEsIRAMoQELAkAgBCACRw0AQakBIRAMuwILIAIgBGsgACgCACIBaiEUIAQgAWtBBGohEAJAA0AgBC0AACABQcXPgIAAai0AAEcNowEgAUEERg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQakBIRAMuwILIABBADYCACAQQQFqIQFBKyEQDKABCwJAIAQgAkcNAEGqASEQDLoCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHKz4CAAGotAABHDaIBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGqASEQDLoCCyAAQQA2AgAgEEEBaiEBQRQhEAyfAQsCQCAEIAJHDQBBqwEhEAy5AgsCQAJAAkACQCAELQAAQb5/ag4PAAECpAGkAaQBpAGkAaQBpAGkAaQBpAGkAQOkAQsgBEEBaiEEQZMBIRAMogILIARBAWohBEGUASEQDKECCyAEQQFqIQRBlQEhEAygAgsgBEEBaiEEQZYBIRAMnwILAkAgBCACRw0AQawBIRAMuAILIAQtAABBxQBHDZ8BIARBAWohBAzgAQsCQCAEIAJHDQBBrQEhEAy3AgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFBzc+AgABqLQAARw2fASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBrQEhEAy3AgsgAEEANgIAIBBBAWohAUEOIRAMnAELAkAgBCACRw0AQa4BIRAMtgILIAQtAABB0ABHDZ0BIARBAWohAUElIRAMmwELAkAgBCACRw0AQa8BIRAMtQILIAIgBGsgACgCACIBaiEUIAQgAWtBCGohEAJAA0AgBC0AACABQdDPgIAAai0AAEcNnQEgAUEIRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQa8BIRAMtQILIABBADYCACAQQQFqIQFBKiEQDJoBCwJAIAQgAkcNAEGwASEQDLQCCwJAAkAgBC0AAEGrf2oOCwCdAZ0BnQGdAZ0BnQGdAZ0BnQEBnQELIARBAWohBEGaASEQDJsCCyAEQQFqIQRBmwEhEAyaAgsCQCAEIAJHDQBBsQEhEAyzAgsCQAJAIAQtAABBv39qDhQAnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBAZwBCyAEQQFqIQRBmQEhEAyaAgsgBEEBaiEEQZwBIRAMmQILAkAgBCACRw0AQbIBIRAMsgILIAIgBGsgACgCACIBaiEUIAQgAWtBA2ohEAJAA0AgBC0AACABQdnPgIAAai0AAEcNmgEgAUEDRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbIBIRAMsgILIABBADYCACAQQQFqIQFBISEQDJcBCwJAIAQgAkcNAEGzASEQDLECCyACIARrIAAoAgAiAWohFCAEIAFrQQZqIRACQANAIAQtAAAgAUHdz4CAAGotAABHDZkBIAFBBkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGzASEQDLECCyAAQQA2AgAgEEEBaiEBQRohEAyWAQsCQCAEIAJHDQBBtAEhEAywAgsCQAJAAkAgBC0AAEG7f2oOEQCaAZoBmgGaAZoBmgGaAZoBmgEBmgGaAZoBmgGaAQKaAQsgBEEBaiEEQZ0BIRAMmAILIARBAWohBEGeASEQDJcCCyAEQQFqIQRBnwEhEAyWAgsCQCAEIAJHDQBBtQEhEAyvAgsgAiAEayAAKAIAIgFqIRQgBCABa0EFaiEQAkADQCAELQAAIAFB5M+AgABqLQAARw2XASABQQVGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBtQEhEAyvAgsgAEEANgIAIBBBAWohAUEoIRAMlAELAkAgBCACRw0AQbYBIRAMrgILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQerPgIAAai0AAEcNlgEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbYBIRAMrgILIABBADYCACAQQQFqIQFBByEQDJMBCwJAIAQgAkcNAEG3ASEQDK0CCwJAAkAgBC0AAEG7f2oODgCWAZYBlgGWAZYBlgGWAZYBlgGWAZYBlgEBlgELIARBAWohBEGhASEQDJQCCyAEQQFqIQRBogEhEAyTAgsCQCAEIAJHDQBBuAEhEAysAgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFB7c+AgABqLQAARw2UASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBuAEhEAysAgsgAEEANgIAIBBBAWohAUESIRAMkQELAkAgBCACRw0AQbkBIRAMqwILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfDPgIAAai0AAEcNkwEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbkBIRAMqwILIABBADYCACAQQQFqIQFBICEQDJABCwJAIAQgAkcNAEG6ASEQDKoCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUHyz4CAAGotAABHDZIBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG6ASEQDKoCCyAAQQA2AgAgEEEBaiEBQQ8hEAyPAQsCQCAEIAJHDQBBuwEhEAypAgsCQAJAIAQtAABBt39qDgcAkgGSAZIBkgGSAQGSAQsgBEEBaiEEQaUBIRAMkAILIARBAWohBEGmASEQDI8CCwJAIAQgAkcNAEG8ASEQDKgCCyACIARrIAAoAgAiAWohFCAEIAFrQQdqIRACQANAIAQtAAAgAUH0z4CAAGotAABHDZABIAFBB0YNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG8ASEQDKgCCyAAQQA2AgAgEEEBaiEBQRshEAyNAQsCQCAEIAJHDQBBvQEhEAynAgsCQAJAAkAgBC0AAEG+f2oOEgCRAZEBkQGRAZEBkQGRAZEBkQEBkQGRAZEBkQGRAZEBApEBCyAEQQFqIQRBpAEhEAyPAgsgBEEBaiEEQacBIRAMjgILIARBAWohBEGoASEQDI0CCwJAIAQgAkcNAEG+ASEQDKYCCyAELQAAQc4ARw2NASAEQQFqIQQMzwELAkAgBCACRw0AQb8BIRAMpQILAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgBC0AAEG/f2oOFQABAgOcAQQFBpwBnAGcAQcICQoLnAEMDQ4PnAELIARBAWohAUHoACEQDJoCCyAEQQFqIQFB6QAhEAyZAgsgBEEBaiEBQe4AIRAMmAILIARBAWohAUHyACEQDJcCCyAEQQFqIQFB8wAhEAyWAgsgBEEBaiEBQfYAIRAMlQILIARBAWohAUH3ACEQDJQCCyAEQQFqIQFB+gAhEAyTAgsgBEEBaiEEQYMBIRAMkgILIARBAWohBEGEASEQDJECCyAEQQFqIQRBhQEhEAyQAgsgBEEBaiEEQZIBIRAMjwILIARBAWohBEGYASEQDI4CCyAEQQFqIQRBoAEhEAyNAgsgBEEBaiEEQaMBIRAMjAILIARBAWohBEGqASEQDIsCCwJAIAQgAkYNACAAQZCAgIAANgIIIAAgBDYCBEGrASEQDIsCC0HAASEQDKMCCyAAIAUgAhCqgICAACIBDYsBIAUhAQxcCwJAIAYgAkYNACAGQQFqIQUMjQELQcIBIRAMoQILA0ACQCAQLQAAQXZqDgSMAQAAjwEACyAQQQFqIhAgAkcNAAtBwwEhEAygAgsCQCAHIAJGDQAgAEGRgICAADYCCCAAIAc2AgQgByEBQQEhEAyHAgtBxAEhEAyfAgsCQCAHIAJHDQBBxQEhEAyfAgsCQAJAIActAABBdmoOBAHOAc4BAM4BCyAHQQFqIQYMjQELIAdBAWohBQyJAQsCQCAHIAJHDQBBxgEhEAyeAgsCQAJAIActAABBdmoOFwGPAY8BAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAQCPAQsgB0EBaiEHC0GwASEQDIQCCwJAIAggAkcNAEHIASEQDJ0CCyAILQAAQSBHDY0BIABBADsBMiAIQQFqIQFBswEhEAyDAgsgASEXAkADQCAXIgcgAkYNASAHLQAAQVBqQf8BcSIQQQpPDcwBAkAgAC8BMiIUQZkzSw0AIAAgFEEKbCIUOwEyIBBB//8DcyAUQf7/A3FJDQAgB0EBaiEXIAAgFCAQaiIQOwEyIBBB//8DcUHoB0kNAQsLQQAhECAAQQA2AhwgAEHBiYCAADYCECAAQQ02AgwgACAHQQFqNgIUDJwCC0HHASEQDJsCCyAAIAggAhCugICAACIQRQ3KASAQQRVHDYwBIABByAE2AhwgACAINgIUIABByZeAgAA2AhAgAEEVNgIMQQAhEAyaAgsCQCAJIAJHDQBBzAEhEAyaAgtBACEUQQEhF0EBIRZBACEQAkACQAJAAkACQAJAAkACQAJAIAktAABBUGoOCpYBlQEAAQIDBAUGCJcBC0ECIRAMBgtBAyEQDAULQQQhEAwEC0EFIRAMAwtBBiEQDAILQQchEAwBC0EIIRALQQAhF0EAIRZBACEUDI4BC0EJIRBBASEUQQAhF0EAIRYMjQELAkAgCiACRw0AQc4BIRAMmQILIAotAABBLkcNjgEgCkEBaiEJDMoBCyALIAJHDY4BQdABIRAMlwILAkAgCyACRg0AIABBjoCAgAA2AgggACALNgIEQbcBIRAM/gELQdEBIRAMlgILAkAgBCACRw0AQdIBIRAMlgILIAIgBGsgACgCACIQaiEUIAQgEGtBBGohCwNAIAQtAAAgEEH8z4CAAGotAABHDY4BIBBBBEYN6QEgEEEBaiEQIARBAWoiBCACRw0ACyAAIBQ2AgBB0gEhEAyVAgsgACAMIAIQrICAgAAiAQ2NASAMIQEMuAELAkAgBCACRw0AQdQBIRAMlAILIAIgBGsgACgCACIQaiEUIAQgEGtBAWohDANAIAQtAAAgEEGB0ICAAGotAABHDY8BIBBBAUYNjgEgEEEBaiEQIARBAWoiBCACRw0ACyAAIBQ2AgBB1AEhEAyTAgsCQCAEIAJHDQBB1gEhEAyTAgsgAiAEayAAKAIAIhBqIRQgBCAQa0ECaiELA0AgBC0AACAQQYPQgIAAai0AAEcNjgEgEEECRg2QASAQQQFqIRAgBEEBaiIEIAJHDQALIAAgFDYCAEHWASEQDJICCwJAIAQgAkcNAEHXASEQDJICCwJAAkAgBC0AAEG7f2oOEACPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BAY8BCyAEQQFqIQRBuwEhEAz5AQsgBEEBaiEEQbwBIRAM+AELAkAgBCACRw0AQdgBIRAMkQILIAQtAABByABHDYwBIARBAWohBAzEAQsCQCAEIAJGDQAgAEGQgICAADYCCCAAIAQ2AgRBvgEhEAz3AQtB2QEhEAyPAgsCQCAEIAJHDQBB2gEhEAyPAgsgBC0AAEHIAEYNwwEgAEEBOgAoDLkBCyAAQQI6AC8gACAEIAIQpoCAgAAiEA2NAUHCASEQDPQBCyAALQAoQX9qDgK3AbkBuAELA0ACQCAELQAAQXZqDgQAjgGOAQCOAQsgBEEBaiIEIAJHDQALQd0BIRAMiwILIABBADoALyAALQAtQQRxRQ2EAgsgAEEAOgAvIABBAToANCABIQEMjAELIBBBFUYN2gEgAEEANgIcIAAgATYCFCAAQaeOgIAANgIQIABBEjYCDEEAIRAMiAILAkAgACAQIAIQtICAgAAiBA0AIBAhAQyBAgsCQCAEQRVHDQAgAEEDNgIcIAAgEDYCFCAAQbCYgIAANgIQIABBFTYCDEEAIRAMiAILIABBADYCHCAAIBA2AhQgAEGnjoCAADYCECAAQRI2AgxBACEQDIcCCyAQQRVGDdYBIABBADYCHCAAIAE2AhQgAEHajYCAADYCECAAQRQ2AgxBACEQDIYCCyAAKAIEIRcgAEEANgIEIBAgEadqIhYhASAAIBcgECAWIBQbIhAQtYCAgAAiFEUNjQEgAEEHNgIcIAAgEDYCFCAAIBQ2AgxBACEQDIUCCyAAIAAvATBBgAFyOwEwIAEhAQtBKiEQDOoBCyAQQRVGDdEBIABBADYCHCAAIAE2AhQgAEGDjICAADYCECAAQRM2AgxBACEQDIICCyAQQRVGDc8BIABBADYCHCAAIAE2AhQgAEGaj4CAADYCECAAQSI2AgxBACEQDIECCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQt4CAgAAiEA0AIAFBAWohAQyNAQsgAEEMNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDIACCyAQQRVGDcwBIABBADYCHCAAIAE2AhQgAEGaj4CAADYCECAAQSI2AgxBACEQDP8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQt4CAgAAiEA0AIAFBAWohAQyMAQsgAEENNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDP4BCyAQQRVGDckBIABBADYCHCAAIAE2AhQgAEHGjICAADYCECAAQSM2AgxBACEQDP0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQuYCAgAAiEA0AIAFBAWohAQyLAQsgAEEONgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDPwBCyAAQQA2AhwgACABNgIUIABBwJWAgAA2AhAgAEECNgIMQQAhEAz7AQsgEEEVRg3FASAAQQA2AhwgACABNgIUIABBxoyAgAA2AhAgAEEjNgIMQQAhEAz6AQsgAEEQNgIcIAAgATYCFCAAIBA2AgxBACEQDPkBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQuYCAgAAiBA0AIAFBAWohAQzxAQsgAEERNgIcIAAgBDYCDCAAIAFBAWo2AhRBACEQDPgBCyAQQRVGDcEBIABBADYCHCAAIAE2AhQgAEHGjICAADYCECAAQSM2AgxBACEQDPcBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQuYCAgAAiEA0AIAFBAWohAQyIAQsgAEETNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDPYBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQuYCAgAAiBA0AIAFBAWohAQztAQsgAEEUNgIcIAAgBDYCDCAAIAFBAWo2AhRBACEQDPUBCyAQQRVGDb0BIABBADYCHCAAIAE2AhQgAEGaj4CAADYCECAAQSI2AgxBACEQDPQBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQt4CAgAAiEA0AIAFBAWohAQyGAQsgAEEWNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDPMBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQt4CAgAAiBA0AIAFBAWohAQzpAQsgAEEXNgIcIAAgBDYCDCAAIAFBAWo2AhRBACEQDPIBCyAAQQA2AhwgACABNgIUIABBzZOAgAA2AhAgAEEMNgIMQQAhEAzxAQtCASERCyAQQQFqIQECQCAAKQMgIhJC//////////8PVg0AIAAgEkIEhiARhDcDICABIQEMhAELIABBADYCHCAAIAE2AhQgAEGtiYCAADYCECAAQQw2AgxBACEQDO8BCyAAQQA2AhwgACAQNgIUIABBzZOAgAA2AhAgAEEMNgIMQQAhEAzuAQsgACgCBCEXIABBADYCBCAQIBGnaiIWIQEgACAXIBAgFiAUGyIQELWAgIAAIhRFDXMgAEEFNgIcIAAgEDYCFCAAIBQ2AgxBACEQDO0BCyAAQQA2AhwgACAQNgIUIABBqpyAgAA2AhAgAEEPNgIMQQAhEAzsAQsgACAQIAIQtICAgAAiAQ0BIBAhAQtBDiEQDNEBCwJAIAFBFUcNACAAQQI2AhwgACAQNgIUIABBsJiAgAA2AhAgAEEVNgIMQQAhEAzqAQsgAEEANgIcIAAgEDYCFCAAQaeOgIAANgIQIABBEjYCDEEAIRAM6QELIAFBAWohEAJAIAAvATAiAUGAAXFFDQACQCAAIBAgAhC7gICAACIBDQAgECEBDHALIAFBFUcNugEgAEEFNgIcIAAgEDYCFCAAQfmXgIAANgIQIABBFTYCDEEAIRAM6QELAkAgAUGgBHFBoARHDQAgAC0ALUECcQ0AIABBADYCHCAAIBA2AhQgAEGWk4CAADYCECAAQQQ2AgxBACEQDOkBCyAAIBAgAhC9gICAABogECEBAkACQAJAAkACQCAAIBAgAhCzgICAAA4WAgEABAQEBAQEBAQEBAQEBAQEBAQEAwQLIABBAToALgsgACAALwEwQcAAcjsBMCAQIQELQSYhEAzRAQsgAEEjNgIcIAAgEDYCFCAAQaWWgIAANgIQIABBFTYCDEEAIRAM6QELIABBADYCHCAAIBA2AhQgAEHVi4CAADYCECAAQRE2AgxBACEQDOgBCyAALQAtQQFxRQ0BQcMBIRAMzgELAkAgDSACRg0AA0ACQCANLQAAQSBGDQAgDSEBDMQBCyANQQFqIg0gAkcNAAtBJSEQDOcBC0ElIRAM5gELIAAoAgQhBCAAQQA2AgQgACAEIA0Qr4CAgAAiBEUNrQEgAEEmNgIcIAAgBDYCDCAAIA1BAWo2AhRBACEQDOUBCyAQQRVGDasBIABBADYCHCAAIAE2AhQgAEH9jYCAADYCECAAQR02AgxBACEQDOQBCyAAQSc2AhwgACABNgIUIAAgEDYCDEEAIRAM4wELIBAhAUEBIRQCQAJAAkACQAJAAkACQCAALQAsQX5qDgcGBQUDAQIABQsgACAALwEwQQhyOwEwDAMLQQIhFAwBC0EEIRQLIABBAToALCAAIAAvATAgFHI7ATALIBAhAQtBKyEQDMoBCyAAQQA2AhwgACAQNgIUIABBq5KAgAA2AhAgAEELNgIMQQAhEAziAQsgAEEANgIcIAAgATYCFCAAQeGPgIAANgIQIABBCjYCDEEAIRAM4QELIABBADoALCAQIQEMvQELIBAhAUEBIRQCQAJAAkACQAJAIAAtACxBe2oOBAMBAgAFCyAAIAAvATBBCHI7ATAMAwtBAiEUDAELQQQhFAsgAEEBOgAsIAAgAC8BMCAUcjsBMAsgECEBC0EpIRAMxQELIABBADYCHCAAIAE2AhQgAEHwlICAADYCECAAQQM2AgxBACEQDN0BCwJAIA4tAABBDUcNACAAKAIEIQEgAEEANgIEAkAgACABIA4QsYCAgAAiAQ0AIA5BAWohAQx1CyAAQSw2AhwgACABNgIMIAAgDkEBajYCFEEAIRAM3QELIAAtAC1BAXFFDQFBxAEhEAzDAQsCQCAOIAJHDQBBLSEQDNwBCwJAAkADQAJAIA4tAABBdmoOBAIAAAMACyAOQQFqIg4gAkcNAAtBLSEQDN0BCyAAKAIEIQEgAEEANgIEAkAgACABIA4QsYCAgAAiAQ0AIA4hAQx0CyAAQSw2AhwgACAONgIUIAAgATYCDEEAIRAM3AELIAAoAgQhASAAQQA2AgQCQCAAIAEgDhCxgICAACIBDQAgDkEBaiEBDHMLIABBLDYCHCAAIAE2AgwgACAOQQFqNgIUQQAhEAzbAQsgACgCBCEEIABBADYCBCAAIAQgDhCxgICAACIEDaABIA4hAQzOAQsgEEEsRw0BIAFBAWohEEEBIQECQAJAAkACQAJAIAAtACxBe2oOBAMBAgQACyAQIQEMBAtBAiEBDAELQQQhAQsgAEEBOgAsIAAgAC8BMCABcjsBMCAQIQEMAQsgACAALwEwQQhyOwEwIBAhAQtBOSEQDL8BCyAAQQA6ACwgASEBC0E0IRAMvQELIAAgAC8BMEEgcjsBMCABIQEMAgsgACgCBCEEIABBADYCBAJAIAAgBCABELGAgIAAIgQNACABIQEMxwELIABBNzYCHCAAIAE2AhQgACAENgIMQQAhEAzUAQsgAEEIOgAsIAEhAQtBMCEQDLkBCwJAIAAtAChBAUYNACABIQEMBAsgAC0ALUEIcUUNkwEgASEBDAMLIAAtADBBIHENlAFBxQEhEAy3AQsCQCAPIAJGDQACQANAAkAgDy0AAEFQaiIBQf8BcUEKSQ0AIA8hAUE1IRAMugELIAApAyAiEUKZs+bMmbPmzBlWDQEgACARQgp+IhE3AyAgESABrUL/AYMiEkJ/hVYNASAAIBEgEnw3AyAgD0EBaiIPIAJHDQALQTkhEAzRAQsgACgCBCECIABBADYCBCAAIAIgD0EBaiIEELGAgIAAIgINlQEgBCEBDMMBC0E5IRAMzwELAkAgAC8BMCIBQQhxRQ0AIAAtAChBAUcNACAALQAtQQhxRQ2QAQsgACABQff7A3FBgARyOwEwIA8hAQtBNyEQDLQBCyAAIAAvATBBEHI7ATAMqwELIBBBFUYNiwEgAEEANgIcIAAgATYCFCAAQfCOgIAANgIQIABBHDYCDEEAIRAMywELIABBwwA2AhwgACABNgIMIAAgDUEBajYCFEEAIRAMygELAkAgAS0AAEE6Rw0AIAAoAgQhECAAQQA2AgQCQCAAIBAgARCvgICAACIQDQAgAUEBaiEBDGMLIABBwwA2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAMygELIABBADYCHCAAIAE2AhQgAEGxkYCAADYCECAAQQo2AgxBACEQDMkBCyAAQQA2AhwgACABNgIUIABBoJmAgAA2AhAgAEEeNgIMQQAhEAzIAQsgAEEANgIACyAAQYASOwEqIAAgF0EBaiIBIAIQqICAgAAiEA0BIAEhAQtBxwAhEAysAQsgEEEVRw2DASAAQdEANgIcIAAgATYCFCAAQeOXgIAANgIQIABBFTYCDEEAIRAMxAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDF4LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMwwELIABBADYCHCAAIBQ2AhQgAEHBqICAADYCECAAQQc2AgwgAEEANgIAQQAhEAzCAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMXQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAzBAQtBACEQIABBADYCHCAAIAE2AhQgAEGAkYCAADYCECAAQQk2AgwMwAELIBBBFUYNfSAAQQA2AhwgACABNgIUIABBlI2AgAA2AhAgAEEhNgIMQQAhEAy/AQtBASEWQQAhF0EAIRRBASEQCyAAIBA6ACsgAUEBaiEBAkACQCAALQAtQRBxDQACQAJAAkAgAC0AKg4DAQACBAsgFkUNAwwCCyAUDQEMAgsgF0UNAQsgACgCBCEQIABBADYCBAJAIAAgECABEK2AgIAAIhANACABIQEMXAsgAEHYADYCHCAAIAE2AhQgACAQNgIMQQAhEAy+AQsgACgCBCEEIABBADYCBAJAIAAgBCABEK2AgIAAIgQNACABIQEMrQELIABB2QA2AhwgACABNgIUIAAgBDYCDEEAIRAMvQELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKsBCyAAQdoANgIcIAAgATYCFCAAIAQ2AgxBACEQDLwBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQrYCAgAAiBA0AIAEhAQypAQsgAEHcADYCHCAAIAE2AhQgACAENgIMQQAhEAy7AQsCQCABLQAAQVBqIhBB/wFxQQpPDQAgACAQOgAqIAFBAWohAUHPACEQDKIBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQrYCAgAAiBA0AIAEhAQynAQsgAEHeADYCHCAAIAE2AhQgACAENgIMQQAhEAy6AQsgAEEANgIAIBdBAWohAQJAIAAtAClBI08NACABIQEMWQsgAEEANgIcIAAgATYCFCAAQdOJgIAANgIQIABBCDYCDEEAIRAMuQELIABBADYCAAtBACEQIABBADYCHCAAIAE2AhQgAEGQs4CAADYCECAAQQg2AgwMtwELIABBADYCACAXQQFqIQECQCAALQApQSFHDQAgASEBDFYLIABBADYCHCAAIAE2AhQgAEGbioCAADYCECAAQQg2AgxBACEQDLYBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKSIQQV1qQQtPDQAgASEBDFULAkAgEEEGSw0AQQEgEHRBygBxRQ0AIAEhAQxVC0EAIRAgAEEANgIcIAAgATYCFCAAQfeJgIAANgIQIABBCDYCDAy1AQsgEEEVRg1xIABBADYCHCAAIAE2AhQgAEG5jYCAADYCECAAQRo2AgxBACEQDLQBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxUCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLMBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDLIBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDLEBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxRCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLABCyAAQQA2AhwgACABNgIUIABBxoqAgAA2AhAgAEEHNgIMQQAhEAyvAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDEMLIABB5QA2AhwgACAUNgIUIAAgATYCDEEAIRAMogELIABBADYCHCAAIBQ2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKEBCyAAQQA2AhwgACABNgIUIABBw4+AgAA2AhAgAEEHNgIMQQAhEAygAQtBACEQIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgwMnwELIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgxBACEQDJ4BCyAAQQA2AhwgACAUNgIUIABB/pGAgAA2AhAgAEEHNgIMQQAhEAydAQsgAEEANgIcIAAgATYCFCAAQY6bgIAANgIQIABBBjYCDEEAIRAMnAELIBBBFUYNVyAAQQA2AhwgACABNgIUIABBzI6AgAA2AhAgAEEgNgIMQQAhEAybAQsgAEEANgIAIBBBAWohAUEkIRALIAAgEDoAKSAAKAIEIRAgAEEANgIEIAAgECABEKuAgIAAIhANVCABIQEMPgsgAEEANgIAC0EAIRAgAEEANgIcIAAgBDYCFCAAQfGbgIAANgIQIABBBjYCDAyXAQsgAUEVRg1QIABBADYCHCAAIAU2AhQgAEHwjICAADYCECAAQRs2AgxBACEQDJYBCyAAKAIEIQUgAEEANgIEIAAgBSAQEKmAgIAAIgUNASAQQQFqIQULQa0BIRAMewsgAEHBATYCHCAAIAU2AgwgACAQQQFqNgIUQQAhEAyTAQsgACgCBCEGIABBADYCBCAAIAYgEBCpgICAACIGDQEgEEEBaiEGC0GuASEQDHgLIABBwgE2AhwgACAGNgIMIAAgEEEBajYCFEEAIRAMkAELIABBADYCHCAAIAc2AhQgAEGXi4CAADYCECAAQQ02AgxBACEQDI8BCyAAQQA2AhwgACAINgIUIABB45CAgAA2AhAgAEEJNgIMQQAhEAyOAQsgAEEANgIcIAAgCDYCFCAAQZSNgIAANgIQIABBITYCDEEAIRAMjQELQQEhFkEAIRdBACEUQQEhEAsgACAQOgArIAlBAWohCAJAAkAgAC0ALUEQcQ0AAkACQAJAIAAtACoOAwEAAgQLIBZFDQMMAgsgFA0BDAILIBdFDQELIAAoAgQhECAAQQA2AgQgACAQIAgQrYCAgAAiEEUNPSAAQckBNgIcIAAgCDYCFCAAIBA2AgxBACEQDIwBCyAAKAIEIQQgAEEANgIEIAAgBCAIEK2AgIAAIgRFDXYgAEHKATYCHCAAIAg2AhQgACAENgIMQQAhEAyLAQsgACgCBCEEIABBADYCBCAAIAQgCRCtgICAACIERQ10IABBywE2AhwgACAJNgIUIAAgBDYCDEEAIRAMigELIAAoAgQhBCAAQQA2AgQgACAEIAoQrYCAgAAiBEUNciAAQc0BNgIcIAAgCjYCFCAAIAQ2AgxBACEQDIkBCwJAIAstAABBUGoiEEH/AXFBCk8NACAAIBA6ACogC0EBaiEKQbYBIRAMcAsgACgCBCEEIABBADYCBCAAIAQgCxCtgICAACIERQ1wIABBzwE2AhwgACALNgIUIAAgBDYCDEEAIRAMiAELIABBADYCHCAAIAQ2AhQgAEGQs4CAADYCECAAQQg2AgwgAEEANgIAQQAhEAyHAQsgAUEVRg0/IABBADYCHCAAIAw2AhQgAEHMjoCAADYCECAAQSA2AgxBACEQDIYBCyAAQYEEOwEoIAAoAgQhECAAQgA3AwAgACAQIAxBAWoiDBCrgICAACIQRQ04IABB0wE2AhwgACAMNgIUIAAgEDYCDEEAIRAMhQELIABBADYCAAtBACEQIABBADYCHCAAIAQ2AhQgAEHYm4CAADYCECAAQQg2AgwMgwELIAAoAgQhECAAQgA3AwAgACAQIAtBAWoiCxCrgICAACIQDQFBxgEhEAxpCyAAQQI6ACgMVQsgAEHVATYCHCAAIAs2AhQgACAQNgIMQQAhEAyAAQsgEEEVRg03IABBADYCHCAAIAQ2AhQgAEGkjICAADYCECAAQRA2AgxBACEQDH8LIAAtADRBAUcNNCAAIAQgAhC8gICAACIQRQ00IBBBFUcNNSAAQdwBNgIcIAAgBDYCFCAAQdWWgIAANgIQIABBFTYCDEEAIRAMfgtBACEQIABBADYCHCAAQa+LgIAANgIQIABBAjYCDCAAIBRBAWo2AhQMfQtBACEQDGMLQQIhEAxiC0ENIRAMYQtBDyEQDGALQSUhEAxfC0ETIRAMXgtBFSEQDF0LQRYhEAxcC0EXIRAMWwtBGCEQDFoLQRkhEAxZC0EaIRAMWAtBGyEQDFcLQRwhEAxWC0EdIRAMVQtBHyEQDFQLQSEhEAxTC0EjIRAMUgtBxgAhEAxRC0EuIRAMUAtBLyEQDE8LQTshEAxOC0E9IRAMTQtByAAhEAxMC0HJACEQDEsLQcsAIRAMSgtBzAAhEAxJC0HOACEQDEgLQdEAIRAMRwtB1QAhEAxGC0HYACEQDEULQdkAIRAMRAtB2wAhEAxDC0HkACEQDEILQeUAIRAMQQtB8QAhEAxAC0H0ACEQDD8LQY0BIRAMPgtBlwEhEAw9C0GpASEQDDwLQawBIRAMOwtBwAEhEAw6C0G5ASEQDDkLQa8BIRAMOAtBsQEhEAw3C0GyASEQDDYLQbQBIRAMNQtBtQEhEAw0C0G6ASEQDDMLQb0BIRAMMgtBvwEhEAwxC0HBASEQDDALIABBADYCHCAAIAQ2AhQgAEHpi4CAADYCECAAQR82AgxBACEQDEgLIABB2wE2AhwgACAENgIUIABB+paAgAA2AhAgAEEVNgIMQQAhEAxHCyAAQfgANgIcIAAgDDYCFCAAQcqYgIAANgIQIABBFTYCDEEAIRAMRgsgAEHRADYCHCAAIAU2AhQgAEGwl4CAADYCECAAQRU2AgxBACEQDEULIABB+QA2AhwgACABNgIUIAAgEDYCDEEAIRAMRAsgAEH4ADYCHCAAIAE2AhQgAEHKmICAADYCECAAQRU2AgxBACEQDEMLIABB5AA2AhwgACABNgIUIABB45eAgAA2AhAgAEEVNgIMQQAhEAxCCyAAQdcANgIcIAAgATYCFCAAQcmXgIAANgIQIABBFTYCDEEAIRAMQQsgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMQAsgAEHCADYCHCAAIAE2AhQgAEHjmICAADYCECAAQRU2AgxBACEQDD8LIABBADYCBCAAIA8gDxCxgICAACIERQ0BIABBOjYCHCAAIAQ2AgwgACAPQQFqNgIUQQAhEAw+CyAAKAIEIQQgAEEANgIEAkAgACAEIAEQsYCAgAAiBEUNACAAQTs2AhwgACAENgIMIAAgAUEBajYCFEEAIRAMPgsgAUEBaiEBDC0LIA9BAWohAQwtCyAAQQA2AhwgACAPNgIUIABB5JKAgAA2AhAgAEEENgIMQQAhEAw7CyAAQTY2AhwgACAENgIUIAAgAjYCDEEAIRAMOgsgAEEuNgIcIAAgDjYCFCAAIAQ2AgxBACEQDDkLIABB0AA2AhwgACABNgIUIABBkZiAgAA2AhAgAEEVNgIMQQAhEAw4CyANQQFqIQEMLAsgAEEVNgIcIAAgATYCFCAAQYKZgIAANgIQIABBFTYCDEEAIRAMNgsgAEEbNgIcIAAgATYCFCAAQZGXgIAANgIQIABBFTYCDEEAIRAMNQsgAEEPNgIcIAAgATYCFCAAQZGXgIAANgIQIABBFTYCDEEAIRAMNAsgAEELNgIcIAAgATYCFCAAQZGXgIAANgIQIABBFTYCDEEAIRAMMwsgAEEaNgIcIAAgATYCFCAAQYKZgIAANgIQIABBFTYCDEEAIRAMMgsgAEELNgIcIAAgATYCFCAAQYKZgIAANgIQIABBFTYCDEEAIRAMMQsgAEEKNgIcIAAgATYCFCAAQeSWgIAANgIQIABBFTYCDEEAIRAMMAsgAEEeNgIcIAAgATYCFCAAQfmXgIAANgIQIABBFTYCDEEAIRAMLwsgAEEANgIcIAAgEDYCFCAAQdqNgIAANgIQIABBFDYCDEEAIRAMLgsgAEEENgIcIAAgATYCFCAAQbCYgIAANgIQIABBFTYCDEEAIRAMLQsgAEEANgIAIAtBAWohCwtBuAEhEAwSCyAAQQA2AgAgEEEBaiEBQfUAIRAMEQsgASEBAkAgAC0AKUEFRw0AQeMAIRAMEQtB4gAhEAwQC0EAIRAgAEEANgIcIABB5JGAgAA2AhAgAEEHNgIMIAAgFEEBajYCFAwoCyAAQQA2AgAgF0EBaiEBQcAAIRAMDgtBASEBCyAAIAE6ACwgAEEANgIAIBdBAWohAQtBKCEQDAsLIAEhAQtBOCEQDAkLAkAgASIPIAJGDQADQAJAIA8tAABBgL6AgABqLQAAIgFBAUYNACABQQJHDQMgD0EBaiEBDAQLIA9BAWoiDyACRw0AC0E+IRAMIgtBPiEQDCELIABBADoALCAPIQEMAQtBCyEQDAYLQTohEAwFCyABQQFqIQFBLSEQDAQLIAAgAToALCAAQQA2AgAgFkEBaiEBQQwhEAwDCyAAQQA2AgAgF0EBaiEBQQohEAwCCyAAQQA2AgALIABBADoALCANIQFBCSEQDAALC0EAIRAgAEEANgIcIAAgCzYCFCAAQc2QgIAANgIQIABBCTYCDAwXC0EAIRAgAEEANgIcIAAgCjYCFCAAQemKgIAANgIQIABBCTYCDAwWC0EAIRAgAEEANgIcIAAgCTYCFCAAQbeQgIAANgIQIABBCTYCDAwVC0EAIRAgAEEANgIcIAAgCDYCFCAAQZyRgIAANgIQIABBCTYCDAwUC0EAIRAgAEEANgIcIAAgATYCFCAAQc2QgIAANgIQIABBCTYCDAwTC0EAIRAgAEEANgIcIAAgATYCFCAAQemKgIAANgIQIABBCTYCDAwSC0EAIRAgAEEANgIcIAAgATYCFCAAQbeQgIAANgIQIABBCTYCDAwRC0EAIRAgAEEANgIcIAAgATYCFCAAQZyRgIAANgIQIABBCTYCDAwQC0EAIRAgAEEANgIcIAAgATYCFCAAQZeVgIAANgIQIABBDzYCDAwPC0EAIRAgAEEANgIcIAAgATYCFCAAQZeVgIAANgIQIABBDzYCDAwOC0EAIRAgAEEANgIcIAAgATYCFCAAQcCSgIAANgIQIABBCzYCDAwNC0EAIRAgAEEANgIcIAAgATYCFCAAQZWJgIAANgIQIABBCzYCDAwMC0EAIRAgAEEANgIcIAAgATYCFCAAQeGPgIAANgIQIABBCjYCDAwLC0EAIRAgAEEANgIcIAAgATYCFCAAQfuPgIAANgIQIABBCjYCDAwKC0EAIRAgAEEANgIcIAAgATYCFCAAQfGZgIAANgIQIABBAjYCDAwJC0EAIRAgAEEANgIcIAAgATYCFCAAQcSUgIAANgIQIABBAjYCDAwIC0EAIRAgAEEANgIcIAAgATYCFCAAQfKVgIAANgIQIABBAjYCDAwHCyAAQQI2AhwgACABNgIUIABBnJqAgAA2AhAgAEEWNgIMQQAhEAwGC0EBIRAMBQtB1AAhECABIgQgAkYNBCADQQhqIAAgBCACQdjCgIAAQQoQxYCAgAAgAygCDCEEIAMoAggOAwEEAgALEMqAgIAAAAsgAEEANgIcIABBtZqAgAA2AhAgAEEXNgIMIAAgBEEBajYCFEEAIRAMAgsgAEEANgIcIAAgBDYCFCAAQcqagIAANgIQIABBCTYCDEEAIRAMAQsCQCABIgQgAkcNAEEiIRAMAQsgAEGJgICAADYCCCAAIAQ2AgRBISEQCyADQRBqJICAgIAAIBALrwEBAn8gASgCACEGAkACQCACIANGDQAgBCAGaiEEIAYgA2ogAmshByACIAZBf3MgBWoiBmohBQNAAkAgAi0AACAELQAARg0AQQIhBAwDCwJAIAYNAEEAIQQgBSECDAMLIAZBf2ohBiAEQQFqIQQgAkEBaiICIANHDQALIAchBiADIQILIABBATYCACABIAY2AgAgACACNgIEDwsgAUEANgIAIAAgBDYCACAAIAI2AgQLCgAgABDHgICAAAvyNgELfyOAgICAAEEQayIBJICAgIAAAkBBACgCoNCAgAANAEEAEMuAgIAAQYDUhIAAayICQdkASQ0AQQAhAwJAQQAoAuDTgIAAIgQNAEEAQn83AuzTgIAAQQBCgICEgICAwAA3AuTTgIAAQQAgAUEIakFwcUHYqtWqBXMiBDYC4NOAgABBAEEANgL004CAAEEAQQA2AsTTgIAAC0EAIAI2AszTgIAAQQBBgNSEgAA2AsjTgIAAQQBBgNSEgAA2ApjQgIAAQQAgBDYCrNCAgABBAEF/NgKo0ICAAANAIANBxNCAgABqIANBuNCAgABqIgQ2AgAgBCADQbDQgIAAaiIFNgIAIANBvNCAgABqIAU2AgAgA0HM0ICAAGogA0HA0ICAAGoiBTYCACAFIAQ2AgAgA0HU0ICAAGogA0HI0ICAAGoiBDYCACAEIAU2AgAgA0HQ0ICAAGogBDYCACADQSBqIgNBgAJHDQALQYDUhIAAQXhBgNSEgABrQQ9xQQBBgNSEgABBCGpBD3EbIgNqIgRBBGogAkFIaiIFIANrIgNBAXI2AgBBAEEAKALw04CAADYCpNCAgABBACADNgKU0ICAAEEAIAQ2AqDQgIAAQYDUhIAAIAVqQTg2AgQLAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB7AFLDQACQEEAKAKI0ICAACIGQRAgAEETakFwcSAAQQtJGyICQQN2IgR2IgNBA3FFDQACQAJAIANBAXEgBHJBAXMiBUEDdCIEQbDQgIAAaiIDIARBuNCAgABqKAIAIgQoAggiAkcNAEEAIAZBfiAFd3E2AojQgIAADAELIAMgAjYCCCACIAM2AgwLIARBCGohAyAEIAVBA3QiBUEDcjYCBCAEIAVqIgQgBCgCBEEBcjYCBAwMCyACQQAoApDQgIAAIgdNDQECQCADRQ0AAkACQCADIAR0QQIgBHQiA0EAIANrcnEiA0EAIANrcUF/aiIDIANBDHZBEHEiA3YiBEEFdkEIcSIFIANyIAQgBXYiA0ECdkEEcSIEciADIAR2IgNBAXZBAnEiBHIgAyAEdiIDQQF2QQFxIgRyIAMgBHZqIgRBA3QiA0Gw0ICAAGoiBSADQbjQgIAAaigCACIDKAIIIgBHDQBBACAGQX4gBHdxIgY2AojQgIAADAELIAUgADYCCCAAIAU2AgwLIAMgAkEDcjYCBCADIARBA3QiBGogBCACayIFNgIAIAMgAmoiACAFQQFyNgIEAkAgB0UNACAHQXhxQbDQgIAAaiECQQAoApzQgIAAIQQCQAJAIAZBASAHQQN2dCIIcQ0AQQAgBiAIcjYCiNCAgAAgAiEIDAELIAIoAgghCAsgCCAENgIMIAIgBDYCCCAEIAI2AgwgBCAINgIICyADQQhqIQNBACAANgKc0ICAAEEAIAU2ApDQgIAADAwLQQAoAozQgIAAIglFDQEgCUEAIAlrcUF/aiIDIANBDHZBEHEiA3YiBEEFdkEIcSIFIANyIAQgBXYiA0ECdkEEcSIEciADIAR2IgNBAXZBAnEiBHIgAyAEdiIDQQF2QQFxIgRyIAMgBHZqQQJ0QbjSgIAAaigCACIAKAIEQXhxIAJrIQQgACEFAkADQAJAIAUoAhAiAw0AIAVBFGooAgAiA0UNAgsgAygCBEF4cSACayIFIAQgBSAESSIFGyEEIAMgACAFGyEAIAMhBQwACwsgACgCGCEKAkAgACgCDCIIIABGDQAgACgCCCIDQQAoApjQgIAASRogCCADNgIIIAMgCDYCDAwLCwJAIABBFGoiBSgCACIDDQAgACgCECIDRQ0DIABBEGohBQsDQCAFIQsgAyIIQRRqIgUoAgAiAw0AIAhBEGohBSAIKAIQIgMNAAsgC0EANgIADAoLQX8hAiAAQb9/Sw0AIABBE2oiA0FwcSECQQAoAozQgIAAIgdFDQBBACELAkAgAkGAAkkNAEEfIQsgAkH///8HSw0AIANBCHYiAyADQYD+P2pBEHZBCHEiA3QiBCAEQYDgH2pBEHZBBHEiBHQiBSAFQYCAD2pBEHZBAnEiBXRBD3YgAyAEciAFcmsiA0EBdCACIANBFWp2QQFxckEcaiELC0EAIAJrIQQCQAJAAkACQCALQQJ0QbjSgIAAaigCACIFDQBBACEDQQAhCAwBC0EAIQMgAkEAQRkgC0EBdmsgC0EfRht0IQBBACEIA0ACQCAFKAIEQXhxIAJrIgYgBE8NACAGIQQgBSEIIAYNAEEAIQQgBSEIIAUhAwwDCyADIAVBFGooAgAiBiAGIAUgAEEddkEEcWpBEGooAgAiBUYbIAMgBhshAyAAQQF0IQAgBQ0ACwsCQCADIAhyDQBBACEIQQIgC3QiA0EAIANrciAHcSIDRQ0DIANBACADa3FBf2oiAyADQQx2QRBxIgN2IgVBBXZBCHEiACADciAFIAB2IgNBAnZBBHEiBXIgAyAFdiIDQQF2QQJxIgVyIAMgBXYiA0EBdkEBcSIFciADIAV2akECdEG40oCAAGooAgAhAwsgA0UNAQsDQCADKAIEQXhxIAJrIgYgBEkhAAJAIAMoAhAiBQ0AIANBFGooAgAhBQsgBiAEIAAbIQQgAyAIIAAbIQggBSEDIAUNAAsLIAhFDQAgBEEAKAKQ0ICAACACa08NACAIKAIYIQsCQCAIKAIMIgAgCEYNACAIKAIIIgNBACgCmNCAgABJGiAAIAM2AgggAyAANgIMDAkLAkAgCEEUaiIFKAIAIgMNACAIKAIQIgNFDQMgCEEQaiEFCwNAIAUhBiADIgBBFGoiBSgCACIDDQAgAEEQaiEFIAAoAhAiAw0ACyAGQQA2AgAMCAsCQEEAKAKQ0ICAACIDIAJJDQBBACgCnNCAgAAhBAJAAkAgAyACayIFQRBJDQAgBCACaiIAIAVBAXI2AgRBACAFNgKQ0ICAAEEAIAA2ApzQgIAAIAQgA2ogBTYCACAEIAJBA3I2AgQMAQsgBCADQQNyNgIEIAQgA2oiAyADKAIEQQFyNgIEQQBBADYCnNCAgABBAEEANgKQ0ICAAAsgBEEIaiEDDAoLAkBBACgClNCAgAAiACACTQ0AQQAoAqDQgIAAIgMgAmoiBCAAIAJrIgVBAXI2AgRBACAFNgKU0ICAAEEAIAQ2AqDQgIAAIAMgAkEDcjYCBCADQQhqIQMMCgsCQAJAQQAoAuDTgIAARQ0AQQAoAujTgIAAIQQMAQtBAEJ/NwLs04CAAEEAQoCAhICAgMAANwLk04CAAEEAIAFBDGpBcHFB2KrVqgVzNgLg04CAAEEAQQA2AvTTgIAAQQBBADYCxNOAgABBgIAEIQQLQQAhAwJAIAQgAkHHAGoiB2oiBkEAIARrIgtxIgggAksNAEEAQTA2AvjTgIAADAoLAkBBACgCwNOAgAAiA0UNAAJAQQAoArjTgIAAIgQgCGoiBSAETQ0AIAUgA00NAQtBACEDQQBBMDYC+NOAgAAMCgtBAC0AxNOAgABBBHENBAJAAkACQEEAKAKg0ICAACIERQ0AQcjTgIAAIQMDQAJAIAMoAgAiBSAESw0AIAUgAygCBGogBEsNAwsgAygCCCIDDQALC0EAEMuAgIAAIgBBf0YNBSAIIQYCQEEAKALk04CAACIDQX9qIgQgAHFFDQAgCCAAayAEIABqQQAgA2txaiEGCyAGIAJNDQUgBkH+////B0sNBQJAQQAoAsDTgIAAIgNFDQBBACgCuNOAgAAiBCAGaiIFIARNDQYgBSADSw0GCyAGEMuAgIAAIgMgAEcNAQwHCyAGIABrIAtxIgZB/v///wdLDQQgBhDLgICAACIAIAMoAgAgAygCBGpGDQMgACEDCwJAIANBf0YNACACQcgAaiAGTQ0AAkAgByAGa0EAKALo04CAACIEakEAIARrcSIEQf7///8HTQ0AIAMhAAwHCwJAIAQQy4CAgABBf0YNACAEIAZqIQYgAyEADAcLQQAgBmsQy4CAgAAaDAQLIAMhACADQX9HDQUMAwtBACEIDAcLQQAhAAwFCyAAQX9HDQILQQBBACgCxNOAgABBBHI2AsTTgIAACyAIQf7///8HSw0BIAgQy4CAgAAhAEEAEMuAgIAAIQMgAEF/Rg0BIANBf0YNASAAIANPDQEgAyAAayIGIAJBOGpNDQELQQBBACgCuNOAgAAgBmoiAzYCuNOAgAACQCADQQAoArzTgIAATQ0AQQAgAzYCvNOAgAALAkACQAJAAkBBACgCoNCAgAAiBEUNAEHI04CAACEDA0AgACADKAIAIgUgAygCBCIIakYNAiADKAIIIgMNAAwDCwsCQAJAQQAoApjQgIAAIgNFDQAgACADTw0BC0EAIAA2ApjQgIAAC0EAIQNBACAGNgLM04CAAEEAIAA2AsjTgIAAQQBBfzYCqNCAgABBAEEAKALg04CAADYCrNCAgABBAEEANgLU04CAAANAIANBxNCAgABqIANBuNCAgABqIgQ2AgAgBCADQbDQgIAAaiIFNgIAIANBvNCAgABqIAU2AgAgA0HM0ICAAGogA0HA0ICAAGoiBTYCACAFIAQ2AgAgA0HU0ICAAGogA0HI0ICAAGoiBDYCACAEIAU2AgAgA0HQ0ICAAGogBDYCACADQSBqIgNBgAJHDQALIABBeCAAa0EPcUEAIABBCGpBD3EbIgNqIgQgBkFIaiIFIANrIgNBAXI2AgRBAEEAKALw04CAADYCpNCAgABBACADNgKU0ICAAEEAIAQ2AqDQgIAAIAAgBWpBODYCBAwCCyADLQAMQQhxDQAgBCAFSQ0AIAQgAE8NACAEQXggBGtBD3FBACAEQQhqQQ9xGyIFaiIAQQAoApTQgIAAIAZqIgsgBWsiBUEBcjYCBCADIAggBmo2AgRBAEEAKALw04CAADYCpNCAgABBACAFNgKU0ICAAEEAIAA2AqDQgIAAIAQgC2pBODYCBAwBCwJAIABBACgCmNCAgAAiCE8NAEEAIAA2ApjQgIAAIAAhCAsgACAGaiEFQcjTgIAAIQMCQAJAAkACQAJAAkACQANAIAMoAgAgBUYNASADKAIIIgMNAAwCCwsgAy0ADEEIcUUNAQtByNOAgAAhAwNAAkAgAygCACIFIARLDQAgBSADKAIEaiIFIARLDQMLIAMoAgghAwwACwsgAyAANgIAIAMgAygCBCAGajYCBCAAQXggAGtBD3FBACAAQQhqQQ9xG2oiCyACQQNyNgIEIAVBeCAFa0EPcUEAIAVBCGpBD3EbaiIGIAsgAmoiAmshAwJAIAYgBEcNAEEAIAI2AqDQgIAAQQBBACgClNCAgAAgA2oiAzYClNCAgAAgAiADQQFyNgIEDAMLAkAgBkEAKAKc0ICAAEcNAEEAIAI2ApzQgIAAQQBBACgCkNCAgAAgA2oiAzYCkNCAgAAgAiADQQFyNgIEIAIgA2ogAzYCAAwDCwJAIAYoAgQiBEEDcUEBRw0AIARBeHEhBwJAAkAgBEH/AUsNACAGKAIIIgUgBEEDdiIIQQN0QbDQgIAAaiIARhoCQCAGKAIMIgQgBUcNAEEAQQAoAojQgIAAQX4gCHdxNgKI0ICAAAwCCyAEIABGGiAEIAU2AgggBSAENgIMDAELIAYoAhghCQJAAkAgBigCDCIAIAZGDQAgBigCCCIEIAhJGiAAIAQ2AgggBCAANgIMDAELAkAgBkEUaiIEKAIAIgUNACAGQRBqIgQoAgAiBQ0AQQAhAAwBCwNAIAQhCCAFIgBBFGoiBCgCACIFDQAgAEEQaiEEIAAoAhAiBQ0ACyAIQQA2AgALIAlFDQACQAJAIAYgBigCHCIFQQJ0QbjSgIAAaiIEKAIARw0AIAQgADYCACAADQFBAEEAKAKM0ICAAEF+IAV3cTYCjNCAgAAMAgsgCUEQQRQgCSgCECAGRhtqIAA2AgAgAEUNAQsgACAJNgIYAkAgBigCECIERQ0AIAAgBDYCECAEIAA2AhgLIAYoAhQiBEUNACAAQRRqIAQ2AgAgBCAANgIYCyAHIANqIQMgBiAHaiIGKAIEIQQLIAYgBEF+cTYCBCACIANqIAM2AgAgAiADQQFyNgIEAkAgA0H/AUsNACADQXhxQbDQgIAAaiEEAkACQEEAKAKI0ICAACIFQQEgA0EDdnQiA3ENAEEAIAUgA3I2AojQgIAAIAQhAwwBCyAEKAIIIQMLIAMgAjYCDCAEIAI2AgggAiAENgIMIAIgAzYCCAwDC0EfIQQCQCADQf///wdLDQAgA0EIdiIEIARBgP4/akEQdkEIcSIEdCIFIAVBgOAfakEQdkEEcSIFdCIAIABBgIAPakEQdkECcSIAdEEPdiAEIAVyIAByayIEQQF0IAMgBEEVanZBAXFyQRxqIQQLIAIgBDYCHCACQgA3AhAgBEECdEG40oCAAGohBQJAQQAoAozQgIAAIgBBASAEdCIIcQ0AIAUgAjYCAEEAIAAgCHI2AozQgIAAIAIgBTYCGCACIAI2AgggAiACNgIMDAMLIANBAEEZIARBAXZrIARBH0YbdCEEIAUoAgAhAANAIAAiBSgCBEF4cSADRg0CIARBHXYhACAEQQF0IQQgBSAAQQRxakEQaiIIKAIAIgANAAsgCCACNgIAIAIgBTYCGCACIAI2AgwgAiACNgIIDAILIABBeCAAa0EPcUEAIABBCGpBD3EbIgNqIgsgBkFIaiIIIANrIgNBAXI2AgQgACAIakE4NgIEIAQgBUE3IAVrQQ9xQQAgBUFJakEPcRtqQUFqIgggCCAEQRBqSRsiCEEjNgIEQQBBACgC8NOAgAA2AqTQgIAAQQAgAzYClNCAgABBACALNgKg0ICAACAIQRBqQQApAtDTgIAANwIAIAhBACkCyNOAgAA3AghBACAIQQhqNgLQ04CAAEEAIAY2AszTgIAAQQAgADYCyNOAgABBAEEANgLU04CAACAIQSRqIQMDQCADQQc2AgAgA0EEaiIDIAVJDQALIAggBEYNAyAIIAgoAgRBfnE2AgQgCCAIIARrIgA2AgAgBCAAQQFyNgIEAkAgAEH/AUsNACAAQXhxQbDQgIAAaiEDAkACQEEAKAKI0ICAACIFQQEgAEEDdnQiAHENAEEAIAUgAHI2AojQgIAAIAMhBQwBCyADKAIIIQULIAUgBDYCDCADIAQ2AgggBCADNgIMIAQgBTYCCAwEC0EfIQMCQCAAQf///wdLDQAgAEEIdiIDIANBgP4/akEQdkEIcSIDdCIFIAVBgOAfakEQdkEEcSIFdCIIIAhBgIAPakEQdkECcSIIdEEPdiADIAVyIAhyayIDQQF0IAAgA0EVanZBAXFyQRxqIQMLIAQgAzYCHCAEQgA3AhAgA0ECdEG40oCAAGohBQJAQQAoAozQgIAAIghBASADdCIGcQ0AIAUgBDYCAEEAIAggBnI2AozQgIAAIAQgBTYCGCAEIAQ2AgggBCAENgIMDAQLIABBAEEZIANBAXZrIANBH0YbdCEDIAUoAgAhCANAIAgiBSgCBEF4cSAARg0DIANBHXYhCCADQQF0IQMgBSAIQQRxakEQaiIGKAIAIggNAAsgBiAENgIAIAQgBTYCGCAEIAQ2AgwgBCAENgIIDAMLIAUoAggiAyACNgIMIAUgAjYCCCACQQA2AhggAiAFNgIMIAIgAzYCCAsgC0EIaiEDDAULIAUoAggiAyAENgIMIAUgBDYCCCAEQQA2AhggBCAFNgIMIAQgAzYCCAtBACgClNCAgAAiAyACTQ0AQQAoAqDQgIAAIgQgAmoiBSADIAJrIgNBAXI2AgRBACADNgKU0ICAAEEAIAU2AqDQgIAAIAQgAkEDcjYCBCAEQQhqIQMMAwtBACEDQQBBMDYC+NOAgAAMAgsCQCALRQ0AAkACQCAIIAgoAhwiBUECdEG40oCAAGoiAygCAEcNACADIAA2AgAgAA0BQQAgB0F+IAV3cSIHNgKM0ICAAAwCCyALQRBBFCALKAIQIAhGG2ogADYCACAARQ0BCyAAIAs2AhgCQCAIKAIQIgNFDQAgACADNgIQIAMgADYCGAsgCEEUaigCACIDRQ0AIABBFGogAzYCACADIAA2AhgLAkACQCAEQQ9LDQAgCCAEIAJqIgNBA3I2AgQgCCADaiIDIAMoAgRBAXI2AgQMAQsgCCACaiIAIARBAXI2AgQgCCACQQNyNgIEIAAgBGogBDYCAAJAIARB/wFLDQAgBEF4cUGw0ICAAGohAwJAAkBBACgCiNCAgAAiBUEBIARBA3Z0IgRxDQBBACAFIARyNgKI0ICAACADIQQMAQsgAygCCCEECyAEIAA2AgwgAyAANgIIIAAgAzYCDCAAIAQ2AggMAQtBHyEDAkAgBEH///8HSw0AIARBCHYiAyADQYD+P2pBEHZBCHEiA3QiBSAFQYDgH2pBEHZBBHEiBXQiAiACQYCAD2pBEHZBAnEiAnRBD3YgAyAFciACcmsiA0EBdCAEIANBFWp2QQFxckEcaiEDCyAAIAM2AhwgAEIANwIQIANBAnRBuNKAgABqIQUCQCAHQQEgA3QiAnENACAFIAA2AgBBACAHIAJyNgKM0ICAACAAIAU2AhggACAANgIIIAAgADYCDAwBCyAEQQBBGSADQQF2ayADQR9GG3QhAyAFKAIAIQICQANAIAIiBSgCBEF4cSAERg0BIANBHXYhAiADQQF0IQMgBSACQQRxakEQaiIGKAIAIgINAAsgBiAANgIAIAAgBTYCGCAAIAA2AgwgACAANgIIDAELIAUoAggiAyAANgIMIAUgADYCCCAAQQA2AhggACAFNgIMIAAgAzYCCAsgCEEIaiEDDAELAkAgCkUNAAJAAkAgACAAKAIcIgVBAnRBuNKAgABqIgMoAgBHDQAgAyAINgIAIAgNAUEAIAlBfiAFd3E2AozQgIAADAILIApBEEEUIAooAhAgAEYbaiAINgIAIAhFDQELIAggCjYCGAJAIAAoAhAiA0UNACAIIAM2AhAgAyAINgIYCyAAQRRqKAIAIgNFDQAgCEEUaiADNgIAIAMgCDYCGAsCQAJAIARBD0sNACAAIAQgAmoiA0EDcjYCBCAAIANqIgMgAygCBEEBcjYCBAwBCyAAIAJqIgUgBEEBcjYCBCAAIAJBA3I2AgQgBSAEaiAENgIAAkAgB0UNACAHQXhxQbDQgIAAaiECQQAoApzQgIAAIQMCQAJAQQEgB0EDdnQiCCAGcQ0AQQAgCCAGcjYCiNCAgAAgAiEIDAELIAIoAgghCAsgCCADNgIMIAIgAzYCCCADIAI2AgwgAyAINgIIC0EAIAU2ApzQgIAAQQAgBDYCkNCAgAALIABBCGohAwsgAUEQaiSAgICAACADCwoAIAAQyYCAgAAL4g0BB38CQCAARQ0AIABBeGoiASAAQXxqKAIAIgJBeHEiAGohAwJAIAJBAXENACACQQNxRQ0BIAEgASgCACICayIBQQAoApjQgIAAIgRJDQEgAiAAaiEAAkAgAUEAKAKc0ICAAEYNAAJAIAJB/wFLDQAgASgCCCIEIAJBA3YiBUEDdEGw0ICAAGoiBkYaAkAgASgCDCICIARHDQBBAEEAKAKI0ICAAEF+IAV3cTYCiNCAgAAMAwsgAiAGRhogAiAENgIIIAQgAjYCDAwCCyABKAIYIQcCQAJAIAEoAgwiBiABRg0AIAEoAggiAiAESRogBiACNgIIIAIgBjYCDAwBCwJAIAFBFGoiAigCACIEDQAgAUEQaiICKAIAIgQNAEEAIQYMAQsDQCACIQUgBCIGQRRqIgIoAgAiBA0AIAZBEGohAiAGKAIQIgQNAAsgBUEANgIACyAHRQ0BAkACQCABIAEoAhwiBEECdEG40oCAAGoiAigCAEcNACACIAY2AgAgBg0BQQBBACgCjNCAgABBfiAEd3E2AozQgIAADAMLIAdBEEEUIAcoAhAgAUYbaiAGNgIAIAZFDQILIAYgBzYCGAJAIAEoAhAiAkUNACAGIAI2AhAgAiAGNgIYCyABKAIUIgJFDQEgBkEUaiACNgIAIAIgBjYCGAwBCyADKAIEIgJBA3FBA0cNACADIAJBfnE2AgRBACAANgKQ0ICAACABIABqIAA2AgAgASAAQQFyNgIEDwsgASADTw0AIAMoAgQiAkEBcUUNAAJAAkAgAkECcQ0AAkAgA0EAKAKg0ICAAEcNAEEAIAE2AqDQgIAAQQBBACgClNCAgAAgAGoiADYClNCAgAAgASAAQQFyNgIEIAFBACgCnNCAgABHDQNBAEEANgKQ0ICAAEEAQQA2ApzQgIAADwsCQCADQQAoApzQgIAARw0AQQAgATYCnNCAgABBAEEAKAKQ0ICAACAAaiIANgKQ0ICAACABIABBAXI2AgQgASAAaiAANgIADwsgAkF4cSAAaiEAAkACQCACQf8BSw0AIAMoAggiBCACQQN2IgVBA3RBsNCAgABqIgZGGgJAIAMoAgwiAiAERw0AQQBBACgCiNCAgABBfiAFd3E2AojQgIAADAILIAIgBkYaIAIgBDYCCCAEIAI2AgwMAQsgAygCGCEHAkACQCADKAIMIgYgA0YNACADKAIIIgJBACgCmNCAgABJGiAGIAI2AgggAiAGNgIMDAELAkAgA0EUaiICKAIAIgQNACADQRBqIgIoAgAiBA0AQQAhBgwBCwNAIAIhBSAEIgZBFGoiAigCACIEDQAgBkEQaiECIAYoAhAiBA0ACyAFQQA2AgALIAdFDQACQAJAIAMgAygCHCIEQQJ0QbjSgIAAaiICKAIARw0AIAIgBjYCACAGDQFBAEEAKAKM0ICAAEF+IAR3cTYCjNCAgAAMAgsgB0EQQRQgBygCECADRhtqIAY2AgAgBkUNAQsgBiAHNgIYAkAgAygCECICRQ0AIAYgAjYCECACIAY2AhgLIAMoAhQiAkUNACAGQRRqIAI2AgAgAiAGNgIYCyABIABqIAA2AgAgASAAQQFyNgIEIAFBACgCnNCAgABHDQFBACAANgKQ0ICAAA8LIAMgAkF+cTYCBCABIABqIAA2AgAgASAAQQFyNgIECwJAIABB/wFLDQAgAEF4cUGw0ICAAGohAgJAAkBBACgCiNCAgAAiBEEBIABBA3Z0IgBxDQBBACAEIAByNgKI0ICAACACIQAMAQsgAigCCCEACyAAIAE2AgwgAiABNgIIIAEgAjYCDCABIAA2AggPC0EfIQICQCAAQf///wdLDQAgAEEIdiICIAJBgP4/akEQdkEIcSICdCIEIARBgOAfakEQdkEEcSIEdCIGIAZBgIAPakEQdkECcSIGdEEPdiACIARyIAZyayICQQF0IAAgAkEVanZBAXFyQRxqIQILIAEgAjYCHCABQgA3AhAgAkECdEG40oCAAGohBAJAAkBBACgCjNCAgAAiBkEBIAJ0IgNxDQAgBCABNgIAQQAgBiADcjYCjNCAgAAgASAENgIYIAEgATYCCCABIAE2AgwMAQsgAEEAQRkgAkEBdmsgAkEfRht0IQIgBCgCACEGAkADQCAGIgQoAgRBeHEgAEYNASACQR12IQYgAkEBdCECIAQgBkEEcWpBEGoiAygCACIGDQALIAMgATYCACABIAQ2AhggASABNgIMIAEgATYCCAwBCyAEKAIIIgAgATYCDCAEIAE2AgggAUEANgIYIAEgBDYCDCABIAA2AggLQQBBACgCqNCAgABBf2oiAUF/IAEbNgKo0ICAAAsLBAAAAAtOAAJAIAANAD8AQRB0DwsCQCAAQf//A3ENACAAQX9MDQACQCAAQRB2QAAiAEF/Rw0AQQBBMDYC+NOAgABBfw8LIABBEHQPCxDKgICAAAAL8gICA38BfgJAIAJFDQAgACABOgAAIAIgAGoiA0F/aiABOgAAIAJBA0kNACAAIAE6AAIgACABOgABIANBfWogAToAACADQX5qIAE6AAAgAkEHSQ0AIAAgAToAAyADQXxqIAE6AAAgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIFayICQSBJDQAgAa1CgYCAgBB+IQYgAyAFaiEBA0AgASAGNwMYIAEgBjcDECABIAY3AwggASAGNwMAIAFBIGohASACQWBqIgJBH0sNAAsLIAALC45IAQBBgAgLhkgBAAAAAgAAAAMAAAAAAAAAAAAAAAQAAAAFAAAAAAAAAAAAAAAGAAAABwAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEludmFsaWQgY2hhciBpbiB1cmwgcXVlcnkAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9ib2R5AENvbnRlbnQtTGVuZ3RoIG92ZXJmbG93AENodW5rIHNpemUgb3ZlcmZsb3cAUmVzcG9uc2Ugb3ZlcmZsb3cASW52YWxpZCBtZXRob2QgZm9yIEhUVFAveC54IHJlcXVlc3QASW52YWxpZCBtZXRob2QgZm9yIFJUU1AveC54IHJlcXVlc3QARXhwZWN0ZWQgU09VUkNFIG1ldGhvZCBmb3IgSUNFL3gueCByZXF1ZXN0AEludmFsaWQgY2hhciBpbiB1cmwgZnJhZ21lbnQgc3RhcnQARXhwZWN0ZWQgZG90AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fc3RhdHVzAEludmFsaWQgcmVzcG9uc2Ugc3RhdHVzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21ldGhvZF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lYCBjYWxsYmFjayBlcnJvcgBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNlcnZlcgBJbnZhbGlkIGhlYWRlciB2YWx1ZSBjaGFyAEludmFsaWQgaGVhZGVyIGZpZWxkIGNoYXIAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl92ZXJzaW9uAEludmFsaWQgbWlub3IgdmVyc2lvbgBJbnZhbGlkIG1ham9yIHZlcnNpb24ARXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgdmVyc2lvbgBFeHBlY3RlZCBDUkxGIGFmdGVyIHZlcnNpb24ASW52YWxpZCBIVFRQIHZlcnNpb24ASW52YWxpZCBoZWFkZXIgdG9rZW4AU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl91cmwASW52YWxpZCBjaGFyYWN0ZXJzIGluIHVybABVbmV4cGVjdGVkIHN0YXJ0IGNoYXIgaW4gdXJsAERvdWJsZSBAIGluIHVybABFbXB0eSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXJhY3RlciBpbiBDb250ZW50LUxlbmd0aABEdXBsaWNhdGUgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyIGluIHVybCBwYXRoAENvbnRlbnQtTGVuZ3RoIGNhbid0IGJlIHByZXNlbnQgd2l0aCBUcmFuc2Zlci1FbmNvZGluZwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBzaXplAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25faGVhZGVyX3ZhbHVlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgdmFsdWUATWlzc2luZyBleHBlY3RlZCBMRiBhZnRlciBoZWFkZXIgdmFsdWUASW52YWxpZCBgVHJhbnNmZXItRW5jb2RpbmdgIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fbmFtZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIG5hbWUAUGF1c2Ugb24gQ09OTkVDVC9VcGdyYWRlAFBhdXNlIG9uIFBSSS9VcGdyYWRlAEV4cGVjdGVkIEhUVFAvMiBDb25uZWN0aW9uIFByZWZhY2UAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9tZXRob2QARXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgbWV0aG9kAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25faGVhZGVyX2ZpZWxkAFBhdXNlZABJbnZhbGlkIHdvcmQgZW5jb3VudGVyZWQASW52YWxpZCBtZXRob2QgZW5jb3VudGVyZWQAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzY2hlbWEAUmVxdWVzdCBoYXMgaW52YWxpZCBgVHJhbnNmZXItRW5jb2RpbmdgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX0NIVU5LX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX05BTUVfQ09NUExFVEUASFBFX0NCX01FU1NBR0VfQ09NUExFVEUASFBFX0NCX01FVEhPRF9DT01QTEVURQBIUEVfQ0JfSEVBREVSX0ZJRUxEX0NPTVBMRVRFAERFTEVURQBIUEVfSU5WQUxJRF9FT0ZfU1RBVEUASU5WQUxJRF9TU0xfQ0VSVElGSUNBVEUAUEFVU0UATk9fUkVTUE9OU0UAVU5TVVBQT1JURURfTUVESUFfVFlQRQBHT05FAE5PVF9BQ0NFUFRBQkxFAFNFUlZJQ0VfVU5BVkFJTEFCTEUAUkFOR0VfTk9UX1NBVElTRklBQkxFAE9SSUdJTl9JU19VTlJFQUNIQUJMRQBSRVNQT05TRV9JU19TVEFMRQBQVVJHRQBNRVJHRQBSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFAFJFUVVFU1RfSEVBREVSX1RPT19MQVJHRQBQQVlMT0FEX1RPT19MQVJHRQBJTlNVRkZJQ0lFTlRfU1RPUkFHRQBIUEVfUEFVU0VEX1VQR1JBREUASFBFX1BBVVNFRF9IMl9VUEdSQURFAFNPVVJDRQBBTk5PVU5DRQBUUkFDRQBIUEVfVU5FWFBFQ1RFRF9TUEFDRQBERVNDUklCRQBVTlNVQlNDUklCRQBSRUNPUkQASFBFX0lOVkFMSURfTUVUSE9EAE5PVF9GT1VORABQUk9QRklORABVTkJJTkQAUkVCSU5EAFVOQVVUSE9SSVpFRABNRVRIT0RfTk9UX0FMTE9XRUQASFRUUF9WRVJTSU9OX05PVF9TVVBQT1JURUQAQUxSRUFEWV9SRVBPUlRFRABBQ0NFUFRFRABOT1RfSU1QTEVNRU5URUQATE9PUF9ERVRFQ1RFRABIUEVfQ1JfRVhQRUNURUQASFBFX0xGX0VYUEVDVEVEAENSRUFURUQASU1fVVNFRABIUEVfUEFVU0VEAFRJTUVPVVRfT0NDVVJFRABQQVlNRU5UX1JFUVVJUkVEAFBSRUNPTkRJVElPTl9SRVFVSVJFRABQUk9YWV9BVVRIRU5USUNBVElPTl9SRVFVSVJFRABORVRXT1JLX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAExFTkdUSF9SRVFVSVJFRABTU0xfQ0VSVElGSUNBVEVfUkVRVUlSRUQAVVBHUkFERV9SRVFVSVJFRABQQUdFX0VYUElSRUQAUFJFQ09ORElUSU9OX0ZBSUxFRABFWFBFQ1RBVElPTl9GQUlMRUQAUkVWQUxJREFUSU9OX0ZBSUxFRABTU0xfSEFORFNIQUtFX0ZBSUxFRABMT0NLRUQAVFJBTlNGT1JNQVRJT05fQVBQTElFRABOT1RfTU9ESUZJRUQATk9UX0VYVEVOREVEAEJBTkRXSURUSF9MSU1JVF9FWENFRURFRABTSVRFX0lTX09WRVJMT0FERUQASEVBRABFeHBlY3RlZCBIVFRQLwAAXhMAACYTAAAwEAAA8BcAAJ0TAAAVEgAAORcAAPASAAAKEAAAdRIAAK0SAACCEwAATxQAAH8QAACgFQAAIxQAAIkSAACLFAAATRUAANQRAADPFAAAEBgAAMkWAADcFgAAwREAAOAXAAC7FAAAdBQAAHwVAADlFAAACBcAAB8QAABlFQAAoxQAACgVAAACFQAAmRUAACwQAACLGQAATw8AANQOAABqEAAAzhAAAAIXAACJDgAAbhMAABwTAABmFAAAVhcAAMETAADNEwAAbBMAAGgXAABmFwAAXxcAACITAADODwAAaQ4AANgOAABjFgAAyxMAAKoOAAAoFwAAJhcAAMUTAABdFgAA6BEAAGcTAABlEwAA8hYAAHMTAAAdFwAA+RYAAPMRAADPDgAAzhUAAAwSAACzEQAApREAAGEQAAAyFwAAuxMAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIDAgICAgIAAAICAAICAAICAgICAgICAgIABAAAAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAACAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbG9zZWVlcC1hbGl2ZQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAQEBAQEAAAEBAAEBAAEBAQEBAQEBAQEAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AAAAAAAAAAAAAAAAAAAByYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AAAAAAAAAAAAAAAABAgABAwAAAAAAAAAAAAAAAAAAAAAAAAQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAQIAAQMAAAAAAAAAAAAAAAAAAAAAAAAEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAQAAAgAAAAAAAAAAAAAAAAAAAAAAAAMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAIAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABOT1VOQ0VFQ0tPVVRORUNURVRFQ1JJQkVMVVNIRVRFQURTRUFSQ0hSR0VDVElWSVRZTEVOREFSVkVPVElGWVBUSU9OU0NIU0VBWVNUQVRDSEdFT1JESVJFQ1RPUlRSQ0hQQVJBTUVURVJVUkNFQlNDUklCRUFSRE9XTkFDRUlORE5LQ0tVQlNDUklCRUhUVFAvQURUUC8=' + + +/***/ }), + +/***/ 95627: +/***/ ((module) => { + +module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfbWFqb3IADxVsbGh0dHBfZ2V0X2h0dHBfbWlub3IAEBFsbGh0dHBfZ2V0X21ldGhvZAARFmxsaHR0cF9nZXRfc3RhdHVzX2NvZGUAEhJsbGh0dHBfZ2V0X3VwZ3JhZGUAEwxsbGh0dHBfcmVzZXQAFA5sbGh0dHBfZXhlY3V0ZQAVFGxsaHR0cF9zZXR0aW5nc19pbml0ABYNbGxodHRwX2ZpbmlzaAAXDGxsaHR0cF9wYXVzZQAYDWxsaHR0cF9yZXN1bWUAGRtsbGh0dHBfcmVzdW1lX2FmdGVyX3VwZ3JhZGUAGhBsbGh0dHBfZ2V0X2Vycm5vABsXbGxodHRwX2dldF9lcnJvcl9yZWFzb24AHBdsbGh0dHBfc2V0X2Vycm9yX3JlYXNvbgAdFGxsaHR0cF9nZXRfZXJyb3JfcG9zAB4RbGxodHRwX2Vycm5vX25hbWUAHxJsbGh0dHBfbWV0aG9kX25hbWUAIBJsbGh0dHBfc3RhdHVzX25hbWUAIRpsbGh0dHBfc2V0X2xlbmllbnRfaGVhZGVycwAiIWxsaHR0cF9zZXRfbGVuaWVudF9jaHVua2VkX2xlbmd0aAAjHWxsaHR0cF9zZXRfbGVuaWVudF9rZWVwX2FsaXZlACQkbGxodHRwX3NldF9sZW5pZW50X3RyYW5zZmVyX2VuY29kaW5nACUYbGxodHRwX21lc3NhZ2VfbmVlZHNfZW9mAD8JFwEAQQELEQECAwQFCwYHNTk3MS8tJyspCrLgAkUCAAsIABCIgICAAAsZACAAEMKAgIAAGiAAIAI2AjggACABOgAoCxwAIAAgAC8BMiAALQAuIAAQwYCAgAAQgICAgAALKgEBf0HAABDGgICAACIBEMKAgIAAGiABQYCIgIAANgI4IAEgADoAKCABCwoAIAAQyICAgAALBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LRQEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABDCgICAABogACAENgI4IAAgAzoAKCAAIAI6AC0gACABNgIYCxEAIAAgASABIAJqEMOAgIAACxAAIABBAEHcABDMgICAABoLZwEBf0EAIQECQCAAKAIMDQACQAJAAkACQCAALQAvDgMBAAMCCyAAKAI4IgFFDQAgASgCLCIBRQ0AIAAgARGAgICAAAAiAQ0DC0EADwsQyoCAgAAACyAAQcOWgIAANgIQQQ4hAQsgAQseAAJAIAAoAgwNACAAQdGbgIAANgIQIABBFTYCDAsLFgACQCAAKAIMQRVHDQAgAEEANgIMCwsWAAJAIAAoAgxBFkcNACAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsiAAJAIABBJEkNABDKgICAAAALIABBAnRBoLOAgABqKAIACyIAAkAgAEEuSQ0AEMqAgIAAAAsgAEECdEGwtICAAGooAgAL7gsBAX9B66iAgAAhAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABBnH9qDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0Hhp4CAAA8LQaShgIAADwtBy6yAgAAPC0H+sYCAAA8LQcCkgIAADwtBq6SAgAAPC0GNqICAAA8LQeKmgIAADwtBgLCAgAAPC0G5r4CAAA8LQdekgIAADwtB75+AgAAPC0Hhn4CAAA8LQfqfgIAADwtB8qCAgAAPC0Gor4CAAA8LQa6ygIAADwtBiLCAgAAPC0Hsp4CAAA8LQYKigIAADwtBjp2AgAAPC0HQroCAAA8LQcqjgIAADwtBxbKAgAAPC0HfnICAAA8LQdKcgIAADwtBxKCAgAAPC0HXoICAAA8LQaKfgIAADwtB7a6AgAAPC0GrsICAAA8LQdSlgIAADwtBzK6AgAAPC0H6roCAAA8LQfyrgIAADwtB0rCAgAAPC0HxnYCAAA8LQbuggIAADwtB96uAgAAPC0GQsYCAAA8LQdexgIAADwtBoq2AgAAPC0HUp4CAAA8LQeCrgIAADwtBn6yAgAAPC0HrsYCAAA8LQdWfgIAADwtByrGAgAAPC0HepYCAAA8LQdSegIAADwtB9JyAgAAPC0GnsoCAAA8LQbGdgIAADwtBoJ2AgAAPC0G5sYCAAA8LQbywgIAADwtBkqGAgAAPC0GzpoCAAA8LQemsgIAADwtBrJ6AgAAPC0HUq4CAAA8LQfemgIAADwtBgKaAgAAPC0GwoYCAAA8LQf6egIAADwtBjaOAgAAPC0GJrYCAAA8LQfeigIAADwtBoLGAgAAPC0Gun4CAAA8LQcalgIAADwtB6J6AgAAPC0GTooCAAA8LQcKvgIAADwtBw52AgAAPC0GLrICAAA8LQeGdgIAADwtBja+AgAAPC0HqoYCAAA8LQbStgIAADwtB0q+AgAAPC0HfsoCAAA8LQdKygIAADwtB8LCAgAAPC0GpooCAAA8LQfmjgIAADwtBmZ6AgAAPC0G1rICAAA8LQZuwgIAADwtBkrKAgAAPC0G2q4CAAA8LQcKigIAADwtB+LKAgAAPC0GepYCAAA8LQdCigIAADwtBup6AgAAPC0GBnoCAAA8LEMqAgIAAAAtB1qGAgAAhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAgAiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCBCIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQcaRgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIwIgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAggiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEH2ioCAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCNCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIMIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABB7ZqAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAjgiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCECIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQZWQgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAI8IgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAhQiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEGqm4CAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCQCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIYIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABB7ZOAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAkQiBEUNACAAIAQRgICAgAAAIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCJCIERQ0AIAAgBBGAgICAAAAhAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIsIgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAigiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEH2iICAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCUCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIcIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABBwpmAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAkgiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCICIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQZSUgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAJMIgRFDQAgACAEEYCAgIAAACEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAlQiBEUNACAAIAQRgICAgAAAIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCWCIERQ0AIAAgBBGAgICAAAAhAwsgAwtFAQF/AkACQCAALwEwQRRxQRRHDQBBASEDIAAtAChBAUYNASAALwEyQeUARiEDDAELIAAtAClBBUYhAwsgACADOgAuQQAL/gEBA39BASEDAkAgAC8BMCIEQQhxDQAgACkDIEIAUiEDCwJAAkAgAC0ALkUNAEEBIQUgAC0AKUEFRg0BQQEhBSAEQcAAcUUgA3FBAUcNAQtBACEFIARBwABxDQBBAiEFIARB//8DcSIDQQhxDQACQCADQYAEcUUNAAJAIAAtAChBAUcNACAALQAtQQpxDQBBBQ8LQQQPCwJAIANBIHENAAJAIAAtAChBAUYNACAALwEyQf//A3EiAEGcf2pB5ABJDQAgAEHMAUYNACAAQbACRg0AQQQhBSAEQShxRQ0CIANBiARxQYAERg0CC0EADwtBAEEDIAApAyBQGyEFCyAFC2IBAn9BACEBAkAgAC0AKEEBRg0AIAAvATJB//8DcSICQZx/akHkAEkNACACQcwBRg0AIAJBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhASAAQYgEcUGABEYNACAAQShxRSEBCyABC6cBAQN/AkACQAJAIAAtACpFDQAgAC0AK0UNAEEAIQMgAC8BMCIEQQJxRQ0BDAILQQAhAyAALwEwIgRBAXFFDQELQQEhAyAALQAoQQFGDQAgAC8BMkH//wNxIgVBnH9qQeQASQ0AIAVBzAFGDQAgBUGwAkYNACAEQcAAcQ0AQQAhAyAEQYgEcUGABEYNACAEQShxQQBHIQMLIABBADsBMCAAQQA6AC8gAwuZAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQBBACEBIAAvATAiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC0kBAXsgAEEQav0MAAAAAAAAAAAAAAAAAAAAACIB/QsDACAAIAH9CwMAIABBMGogAf0LAwAgAEEgaiAB/QsDACAAQd0BNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAKAIcIhBBf2oO3QHaAQHZAQIDBAUGBwgJCgsMDQ7YAQ8Q1wEREtYBExQVFhcYGRob4AHfARwdHtUBHyAhIiMkJdQBJicoKSorLNMB0gEtLtEB0AEvMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUbbAUdISUrPAc4BS80BTMwBTU5PUFFSU1RVVldYWVpbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AcsBygG4AckBuQHIAboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBANwBC0EAIRAMxgELQQ4hEAzFAQtBDSEQDMQBC0EPIRAMwwELQRAhEAzCAQtBEyEQDMEBC0EUIRAMwAELQRUhEAy/AQtBFiEQDL4BC0EXIRAMvQELQRghEAy8AQtBGSEQDLsBC0EaIRAMugELQRshEAy5AQtBHCEQDLgBC0EIIRAMtwELQR0hEAy2AQtBICEQDLUBC0EfIRAMtAELQQchEAyzAQtBISEQDLIBC0EiIRAMsQELQR4hEAywAQtBIyEQDK8BC0ESIRAMrgELQREhEAytAQtBJCEQDKwBC0ElIRAMqwELQSYhEAyqAQtBJyEQDKkBC0HDASEQDKgBC0EpIRAMpwELQSshEAymAQtBLCEQDKUBC0EtIRAMpAELQS4hEAyjAQtBLyEQDKIBC0HEASEQDKEBC0EwIRAMoAELQTQhEAyfAQtBDCEQDJ4BC0ExIRAMnQELQTIhEAycAQtBMyEQDJsBC0E5IRAMmgELQTUhEAyZAQtBxQEhEAyYAQtBCyEQDJcBC0E6IRAMlgELQTYhEAyVAQtBCiEQDJQBC0E3IRAMkwELQTghEAySAQtBPCEQDJEBC0E7IRAMkAELQT0hEAyPAQtBCSEQDI4BC0EoIRAMjQELQT4hEAyMAQtBPyEQDIsBC0HAACEQDIoBC0HBACEQDIkBC0HCACEQDIgBC0HDACEQDIcBC0HEACEQDIYBC0HFACEQDIUBC0HGACEQDIQBC0EqIRAMgwELQccAIRAMggELQcgAIRAMgQELQckAIRAMgAELQcoAIRAMfwtBywAhEAx+C0HNACEQDH0LQcwAIRAMfAtBzgAhEAx7C0HPACEQDHoLQdAAIRAMeQtB0QAhEAx4C0HSACEQDHcLQdMAIRAMdgtB1AAhEAx1C0HWACEQDHQLQdUAIRAMcwtBBiEQDHILQdcAIRAMcQtBBSEQDHALQdgAIRAMbwtBBCEQDG4LQdkAIRAMbQtB2gAhEAxsC0HbACEQDGsLQdwAIRAMagtBAyEQDGkLQd0AIRAMaAtB3gAhEAxnC0HfACEQDGYLQeEAIRAMZQtB4AAhEAxkC0HiACEQDGMLQeMAIRAMYgtBAiEQDGELQeQAIRAMYAtB5QAhEAxfC0HmACEQDF4LQecAIRAMXQtB6AAhEAxcC0HpACEQDFsLQeoAIRAMWgtB6wAhEAxZC0HsACEQDFgLQe0AIRAMVwtB7gAhEAxWC0HvACEQDFULQfAAIRAMVAtB8QAhEAxTC0HyACEQDFILQfMAIRAMUQtB9AAhEAxQC0H1ACEQDE8LQfYAIRAMTgtB9wAhEAxNC0H4ACEQDEwLQfkAIRAMSwtB+gAhEAxKC0H7ACEQDEkLQfwAIRAMSAtB/QAhEAxHC0H+ACEQDEYLQf8AIRAMRQtBgAEhEAxEC0GBASEQDEMLQYIBIRAMQgtBgwEhEAxBC0GEASEQDEALQYUBIRAMPwtBhgEhEAw+C0GHASEQDD0LQYgBIRAMPAtBiQEhEAw7C0GKASEQDDoLQYsBIRAMOQtBjAEhEAw4C0GNASEQDDcLQY4BIRAMNgtBjwEhEAw1C0GQASEQDDQLQZEBIRAMMwtBkgEhEAwyC0GTASEQDDELQZQBIRAMMAtBlQEhEAwvC0GWASEQDC4LQZcBIRAMLQtBmAEhEAwsC0GZASEQDCsLQZoBIRAMKgtBmwEhEAwpC0GcASEQDCgLQZ0BIRAMJwtBngEhEAwmC0GfASEQDCULQaABIRAMJAtBoQEhEAwjC0GiASEQDCILQaMBIRAMIQtBpAEhEAwgC0GlASEQDB8LQaYBIRAMHgtBpwEhEAwdC0GoASEQDBwLQakBIRAMGwtBqgEhEAwaC0GrASEQDBkLQawBIRAMGAtBrQEhEAwXC0GuASEQDBYLQQEhEAwVC0GvASEQDBQLQbABIRAMEwtBsQEhEAwSC0GzASEQDBELQbIBIRAMEAtBtAEhEAwPC0G1ASEQDA4LQbYBIRAMDQtBtwEhEAwMC0G4ASEQDAsLQbkBIRAMCgtBugEhEAwJC0G7ASEQDAgLQcYBIRAMBwtBvAEhEAwGC0G9ASEQDAULQb4BIRAMBAtBvwEhEAwDC0HAASEQDAILQcIBIRAMAQtBwQEhEAsDQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIBAOxwEAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB4fICEjJSg/QEFERUZHSElKS0xNT1BRUlPeA1dZW1xdYGJlZmdoaWprbG1vcHFyc3R1dnd4eXp7fH1+gAGCAYUBhgGHAYkBiwGMAY0BjgGPAZABkQGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0BrgGvAbABsQGyAbMBtAG1AbYBtwG4AbkBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgHHAcgByQHKAcsBzAHNAc4BzwHQAdEB0gHTAdQB1QHWAdcB2AHZAdoB2wHcAd0B3gHgAeEB4gHjAeQB5QHmAecB6AHpAeoB6wHsAe0B7gHvAfAB8QHyAfMBmQKkArAC/gL+AgsgASIEIAJHDfMBQd0BIRAM/wMLIAEiECACRw3dAUHDASEQDP4DCyABIgEgAkcNkAFB9wAhEAz9AwsgASIBIAJHDYYBQe8AIRAM/AMLIAEiASACRw1/QeoAIRAM+wMLIAEiASACRw17QegAIRAM+gMLIAEiASACRw14QeYAIRAM+QMLIAEiASACRw0aQRghEAz4AwsgASIBIAJHDRRBEiEQDPcDCyABIgEgAkcNWUHFACEQDPYDCyABIgEgAkcNSkE/IRAM9QMLIAEiASACRw1IQTwhEAz0AwsgASIBIAJHDUFBMSEQDPMDCyAALQAuQQFGDesDDIcCCyAAIAEiASACEMCAgIAAQQFHDeYBIABCADcDIAznAQsgACABIgEgAhC0gICAACIQDecBIAEhAQz1AgsCQCABIgEgAkcNAEEGIRAM8AMLIAAgAUEBaiIBIAIQu4CAgAAiEA3oASABIQEMMQsgAEIANwMgQRIhEAzVAwsgASIQIAJHDStBHSEQDO0DCwJAIAEiASACRg0AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAiEA3pASABIQEMCgsgASIBIAJHDQZBGyEQDOADCwJAIAEiASACRw0AQRYhEAzgAwsgAEGKgICAADYCCCAAIAE2AgQgACABIAIQuICAgAAiEA3qASABIQFBICEQDMYDCwJAIAEiASACRg0AA0ACQCABLQAAQfC3gIAAai0AACIQQQJGDQACQCAQQX9qDgTlAewBAOsB7AELIAFBAWohAUEIIRAMyAMLIAFBAWoiASACRw0AC0EVIRAM3wMLQRUhEAzeAwsDQAJAIAEtAABB8LmAgABqLQAAIhBBAkYNACAQQX9qDgTeAewB4AHrAewBCyABQQFqIgEgAkcNAAtBGCEQDN0DCwJAIAEiASACRg0AIABBi4CAgAA2AgggACABNgIEIAEhAUEHIRAMxAMLQRkhEAzcAwsgAUEBaiEBDAILAkAgASIUIAJHDQBBGiEQDNsDCyAUIQECQCAULQAAQXNqDhTdAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAgDuAgtBACEQIABBADYCHCAAQa+LgIAANgIQIABBAjYCDCAAIBRBAWo2AhQM2gMLAkAgAS0AACIQQTtGDQAgEEENRw3oASABQQFqIQEM5QILIAFBAWohAQtBIiEQDL8DCwJAIAEiECACRw0AQRwhEAzYAwtCACERIBAhASAQLQAAQVBqDjfnAeYBAQIDBAUGBwgAAAAAAAAACQoLDA0OAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPEBESExQAC0EeIRAMvQMLQgIhEQzlAQtCAyERDOQBC0IEIREM4wELQgUhEQziAQtCBiERDOEBC0IHIREM4AELQgghEQzfAQtCCSERDN4BC0IKIREM3QELQgshEQzcAQtCDCERDNsBC0INIREM2gELQg4hEQzZAQtCDyERDNgBC0IKIREM1wELQgshEQzWAQtCDCERDNUBC0INIREM1AELQg4hEQzTAQtCDyERDNIBC0IAIRECQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIBAtAABBUGoON+UB5AEAAQIDBAUGB+YB5gHmAeYB5gHmAeYBCAkKCwwN5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAQ4PEBESE+YBC0ICIREM5AELQgMhEQzjAQtCBCERDOIBC0IFIREM4QELQgYhEQzgAQtCByERDN8BC0IIIREM3gELQgkhEQzdAQtCCiERDNwBC0ILIREM2wELQgwhEQzaAQtCDSERDNkBC0IOIREM2AELQg8hEQzXAQtCCiERDNYBC0ILIREM1QELQgwhEQzUAQtCDSERDNMBC0IOIREM0gELQg8hEQzRAQsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3SAUEfIRAMwAMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQSQhEAynAwtBICEQDL8DCyAAIAEiECACEL6AgIAAQX9qDgW2AQDFAgHRAdIBC0ERIRAMpAMLIABBAToALyAQIQEMuwMLIAEiASACRw3SAUEkIRAMuwMLIAEiDSACRw0eQcYAIRAMugMLIAAgASIBIAIQsoCAgAAiEA3UASABIQEMtQELIAEiECACRw0mQdAAIRAMuAMLAkAgASIBIAJHDQBBKCEQDLgDCyAAQQA2AgQgAEGMgICAADYCCCAAIAEgARCxgICAACIQDdMBIAEhAQzYAQsCQCABIhAgAkcNAEEpIRAMtwMLIBAtAAAiAUEgRg0UIAFBCUcN0wEgEEEBaiEBDBULAkAgASIBIAJGDQAgAUEBaiEBDBcLQSohEAy1AwsCQCABIhAgAkcNAEErIRAMtQMLAkAgEC0AACIBQQlGDQAgAUEgRw3VAQsgAC0ALEEIRg3TASAQIQEMkQMLAkAgASIBIAJHDQBBLCEQDLQDCyABLQAAQQpHDdUBIAFBAWohAQzJAgsgASIOIAJHDdUBQS8hEAyyAwsDQAJAIAEtAAAiEEEgRg0AAkAgEEF2ag4EANwB3AEA2gELIAEhAQzgAQsgAUEBaiIBIAJHDQALQTEhEAyxAwtBMiEQIAEiFCACRg2wAyACIBRrIAAoAgAiAWohFSAUIAFrQQNqIRYCQANAIBQtAAAiF0EgciAXIBdBv39qQf8BcUEaSRtB/wFxIAFB8LuAgABqLQAARw0BAkAgAUEDRw0AQQYhAQyWAwsgAUEBaiEBIBRBAWoiFCACRw0ACyAAIBU2AgAMsQMLIABBADYCACAUIQEM2QELQTMhECABIhQgAkYNrwMgAiAUayAAKAIAIgFqIRUgFCABa0EIaiEWAkADQCAULQAAIhdBIHIgFyAXQb9/akH/AXFBGkkbQf8BcSABQfS7gIAAai0AAEcNAQJAIAFBCEcNAEEFIQEMlQMLIAFBAWohASAUQQFqIhQgAkcNAAsgACAVNgIADLADCyAAQQA2AgAgFCEBDNgBC0E0IRAgASIUIAJGDa4DIAIgFGsgACgCACIBaiEVIBQgAWtBBWohFgJAA0AgFC0AACIXQSByIBcgF0G/f2pB/wFxQRpJG0H/AXEgAUHQwoCAAGotAABHDQECQCABQQVHDQBBByEBDJQDCyABQQFqIQEgFEEBaiIUIAJHDQALIAAgFTYCAAyvAwsgAEEANgIAIBQhAQzXAQsCQCABIgEgAkYNAANAAkAgAS0AAEGAvoCAAGotAAAiEEEBRg0AIBBBAkYNCiABIQEM3QELIAFBAWoiASACRw0AC0EwIRAMrgMLQTAhEAytAwsCQCABIgEgAkYNAANAAkAgAS0AACIQQSBGDQAgEEF2ag4E2QHaAdoB2QHaAQsgAUEBaiIBIAJHDQALQTghEAytAwtBOCEQDKwDCwNAAkAgAS0AACIQQSBGDQAgEEEJRw0DCyABQQFqIgEgAkcNAAtBPCEQDKsDCwNAAkAgAS0AACIQQSBGDQACQAJAIBBBdmoOBNoBAQHaAQALIBBBLEYN2wELIAEhAQwECyABQQFqIgEgAkcNAAtBPyEQDKoDCyABIQEM2wELQcAAIRAgASIUIAJGDagDIAIgFGsgACgCACIBaiEWIBQgAWtBBmohFwJAA0AgFC0AAEEgciABQYDAgIAAai0AAEcNASABQQZGDY4DIAFBAWohASAUQQFqIhQgAkcNAAsgACAWNgIADKkDCyAAQQA2AgAgFCEBC0E2IRAMjgMLAkAgASIPIAJHDQBBwQAhEAynAwsgAEGMgICAADYCCCAAIA82AgQgDyEBIAAtACxBf2oOBM0B1QHXAdkBhwMLIAFBAWohAQzMAQsCQCABIgEgAkYNAANAAkAgAS0AACIQQSByIBAgEEG/f2pB/wFxQRpJG0H/AXEiEEEJRg0AIBBBIEYNAAJAAkACQAJAIBBBnX9qDhMAAwMDAwMDAwEDAwMDAwMDAwMCAwsgAUEBaiEBQTEhEAyRAwsgAUEBaiEBQTIhEAyQAwsgAUEBaiEBQTMhEAyPAwsgASEBDNABCyABQQFqIgEgAkcNAAtBNSEQDKUDC0E1IRAMpAMLAkAgASIBIAJGDQADQAJAIAEtAABBgLyAgABqLQAAQQFGDQAgASEBDNMBCyABQQFqIgEgAkcNAAtBPSEQDKQDC0E9IRAMowMLIAAgASIBIAIQsICAgAAiEA3WASABIQEMAQsgEEEBaiEBC0E8IRAMhwMLAkAgASIBIAJHDQBBwgAhEAygAwsCQANAAkAgAS0AAEF3ag4YAAL+Av4ChAP+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gIA/gILIAFBAWoiASACRw0AC0HCACEQDKADCyABQQFqIQEgAC0ALUEBcUUNvQEgASEBC0EsIRAMhQMLIAEiASACRw3TAUHEACEQDJ0DCwNAAkAgAS0AAEGQwICAAGotAABBAUYNACABIQEMtwILIAFBAWoiASACRw0AC0HFACEQDJwDCyANLQAAIhBBIEYNswEgEEE6Rw2BAyAAKAIEIQEgAEEANgIEIAAgASANEK+AgIAAIgEN0AEgDUEBaiEBDLMCC0HHACEQIAEiDSACRg2aAyACIA1rIAAoAgAiAWohFiANIAFrQQVqIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQZDCgIAAai0AAEcNgAMgAUEFRg30AiABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyaAwtByAAhECABIg0gAkYNmQMgAiANayAAKAIAIgFqIRYgDSABa0EJaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUGWwoCAAGotAABHDf8CAkAgAUEJRw0AQQIhAQz1AgsgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMmQMLAkAgASINIAJHDQBByQAhEAyZAwsCQAJAIA0tAAAiAUEgciABIAFBv39qQf8BcUEaSRtB/wFxQZJ/ag4HAIADgAOAA4ADgAMBgAMLIA1BAWohAUE+IRAMgAMLIA1BAWohAUE/IRAM/wILQcoAIRAgASINIAJGDZcDIAIgDWsgACgCACIBaiEWIA0gAWtBAWohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFBoMKAgABqLQAARw39AiABQQFGDfACIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJcDC0HLACEQIAEiDSACRg2WAyACIA1rIAAoAgAiAWohFiANIAFrQQ5qIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQaLCgIAAai0AAEcN/AIgAUEORg3wAiABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyWAwtBzAAhECABIg0gAkYNlQMgAiANayAAKAIAIgFqIRYgDSABa0EPaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUHAwoCAAGotAABHDfsCAkAgAUEPRw0AQQMhAQzxAgsgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMlQMLQc0AIRAgASINIAJGDZQDIAIgDWsgACgCACIBaiEWIA0gAWtBBWohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFB0MKAgABqLQAARw36AgJAIAFBBUcNAEEEIQEM8AILIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJQDCwJAIAEiDSACRw0AQc4AIRAMlAMLAkACQAJAAkAgDS0AACIBQSByIAEgAUG/f2pB/wFxQRpJG0H/AXFBnX9qDhMA/QL9Av0C/QL9Av0C/QL9Av0C/QL9Av0CAf0C/QL9AgID/QILIA1BAWohAUHBACEQDP0CCyANQQFqIQFBwgAhEAz8AgsgDUEBaiEBQcMAIRAM+wILIA1BAWohAUHEACEQDPoCCwJAIAEiASACRg0AIABBjYCAgAA2AgggACABNgIEIAEhAUHFACEQDPoCC0HPACEQDJIDCyAQIQECQAJAIBAtAABBdmoOBAGoAqgCAKgCCyAQQQFqIQELQSchEAz4AgsCQCABIgEgAkcNAEHRACEQDJEDCwJAIAEtAABBIEYNACABIQEMjQELIAFBAWohASAALQAtQQFxRQ3HASABIQEMjAELIAEiFyACRw3IAUHSACEQDI8DC0HTACEQIAEiFCACRg2OAyACIBRrIAAoAgAiAWohFiAUIAFrQQFqIRcDQCAULQAAIAFB1sKAgABqLQAARw3MASABQQFGDccBIAFBAWohASAUQQFqIhQgAkcNAAsgACAWNgIADI4DCwJAIAEiASACRw0AQdUAIRAMjgMLIAEtAABBCkcNzAEgAUEBaiEBDMcBCwJAIAEiASACRw0AQdYAIRAMjQMLAkACQCABLQAAQXZqDgQAzQHNAQHNAQsgAUEBaiEBDMcBCyABQQFqIQFBygAhEAzzAgsgACABIgEgAhCugICAACIQDcsBIAEhAUHNACEQDPICCyAALQApQSJGDYUDDKYCCwJAIAEiASACRw0AQdsAIRAMigMLQQAhFEEBIRdBASEWQQAhEAJAAkACQAJAAkACQAJAAkACQCABLQAAQVBqDgrUAdMBAAECAwQFBgjVAQtBAiEQDAYLQQMhEAwFC0EEIRAMBAtBBSEQDAMLQQYhEAwCC0EHIRAMAQtBCCEQC0EAIRdBACEWQQAhFAzMAQtBCSEQQQEhFEEAIRdBACEWDMsBCwJAIAEiASACRw0AQd0AIRAMiQMLIAEtAABBLkcNzAEgAUEBaiEBDKYCCyABIgEgAkcNzAFB3wAhEAyHAwsCQCABIgEgAkYNACAAQY6AgIAANgIIIAAgATYCBCABIQFB0AAhEAzuAgtB4AAhEAyGAwtB4QAhECABIgEgAkYNhQMgAiABayAAKAIAIhRqIRYgASAUa0EDaiEXA0AgAS0AACAUQeLCgIAAai0AAEcNzQEgFEEDRg3MASAUQQFqIRQgAUEBaiIBIAJHDQALIAAgFjYCAAyFAwtB4gAhECABIgEgAkYNhAMgAiABayAAKAIAIhRqIRYgASAUa0ECaiEXA0AgAS0AACAUQebCgIAAai0AAEcNzAEgFEECRg3OASAUQQFqIRQgAUEBaiIBIAJHDQALIAAgFjYCAAyEAwtB4wAhECABIgEgAkYNgwMgAiABayAAKAIAIhRqIRYgASAUa0EDaiEXA0AgAS0AACAUQenCgIAAai0AAEcNywEgFEEDRg3OASAUQQFqIRQgAUEBaiIBIAJHDQALIAAgFjYCAAyDAwsCQCABIgEgAkcNAEHlACEQDIMDCyAAIAFBAWoiASACEKiAgIAAIhANzQEgASEBQdYAIRAM6QILAkAgASIBIAJGDQADQAJAIAEtAAAiEEEgRg0AAkACQAJAIBBBuH9qDgsAAc8BzwHPAc8BzwHPAc8BzwECzwELIAFBAWohAUHSACEQDO0CCyABQQFqIQFB0wAhEAzsAgsgAUEBaiEBQdQAIRAM6wILIAFBAWoiASACRw0AC0HkACEQDIIDC0HkACEQDIEDCwNAAkAgAS0AAEHwwoCAAGotAAAiEEEBRg0AIBBBfmoOA88B0AHRAdIBCyABQQFqIgEgAkcNAAtB5gAhEAyAAwsCQCABIgEgAkYNACABQQFqIQEMAwtB5wAhEAz/AgsDQAJAIAEtAABB8MSAgABqLQAAIhBBAUYNAAJAIBBBfmoOBNIB0wHUAQDVAQsgASEBQdcAIRAM5wILIAFBAWoiASACRw0AC0HoACEQDP4CCwJAIAEiASACRw0AQekAIRAM/gILAkAgAS0AACIQQXZqDhq6AdUB1QG8AdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAcoB1QHVAQDTAQsgAUEBaiEBC0EGIRAM4wILA0ACQCABLQAAQfDGgIAAai0AAEEBRg0AIAEhAQyeAgsgAUEBaiIBIAJHDQALQeoAIRAM+wILAkAgASIBIAJGDQAgAUEBaiEBDAMLQesAIRAM+gILAkAgASIBIAJHDQBB7AAhEAz6AgsgAUEBaiEBDAELAkAgASIBIAJHDQBB7QAhEAz5AgsgAUEBaiEBC0EEIRAM3gILAkAgASIUIAJHDQBB7gAhEAz3AgsgFCEBAkACQAJAIBQtAABB8MiAgABqLQAAQX9qDgfUAdUB1gEAnAIBAtcBCyAUQQFqIQEMCgsgFEEBaiEBDM0BC0EAIRAgAEEANgIcIABBm5KAgAA2AhAgAEEHNgIMIAAgFEEBajYCFAz2AgsCQANAAkAgAS0AAEHwyICAAGotAAAiEEEERg0AAkACQCAQQX9qDgfSAdMB1AHZAQAEAdkBCyABIQFB2gAhEAzgAgsgAUEBaiEBQdwAIRAM3wILIAFBAWoiASACRw0AC0HvACEQDPYCCyABQQFqIQEMywELAkAgASIUIAJHDQBB8AAhEAz1AgsgFC0AAEEvRw3UASAUQQFqIQEMBgsCQCABIhQgAkcNAEHxACEQDPQCCwJAIBQtAAAiAUEvRw0AIBRBAWohAUHdACEQDNsCCyABQXZqIgRBFksN0wFBASAEdEGJgIACcUUN0wEMygILAkAgASIBIAJGDQAgAUEBaiEBQd4AIRAM2gILQfIAIRAM8gILAkAgASIUIAJHDQBB9AAhEAzyAgsgFCEBAkAgFC0AAEHwzICAAGotAABBf2oOA8kClAIA1AELQeEAIRAM2AILAkAgASIUIAJGDQADQAJAIBQtAABB8MqAgABqLQAAIgFBA0YNAAJAIAFBf2oOAssCANUBCyAUIQFB3wAhEAzaAgsgFEEBaiIUIAJHDQALQfMAIRAM8QILQfMAIRAM8AILAkAgASIBIAJGDQAgAEGPgICAADYCCCAAIAE2AgQgASEBQeAAIRAM1wILQfUAIRAM7wILAkAgASIBIAJHDQBB9gAhEAzvAgsgAEGPgICAADYCCCAAIAE2AgQgASEBC0EDIRAM1AILA0AgAS0AAEEgRw3DAiABQQFqIgEgAkcNAAtB9wAhEAzsAgsCQCABIgEgAkcNAEH4ACEQDOwCCyABLQAAQSBHDc4BIAFBAWohAQzvAQsgACABIgEgAhCsgICAACIQDc4BIAEhAQyOAgsCQCABIgQgAkcNAEH6ACEQDOoCCyAELQAAQcwARw3RASAEQQFqIQFBEyEQDM8BCwJAIAEiBCACRw0AQfsAIRAM6QILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEANAIAQtAAAgAUHwzoCAAGotAABHDdABIAFBBUYNzgEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBB+wAhEAzoAgsCQCABIgQgAkcNAEH8ACEQDOgCCwJAAkAgBC0AAEG9f2oODADRAdEB0QHRAdEB0QHRAdEB0QHRAQHRAQsgBEEBaiEBQeYAIRAMzwILIARBAWohAUHnACEQDM4CCwJAIAEiBCACRw0AQf0AIRAM5wILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQe3PgIAAai0AAEcNzwEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf0AIRAM5wILIABBADYCACAQQQFqIQFBECEQDMwBCwJAIAEiBCACRw0AQf4AIRAM5gILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQfbOgIAAai0AAEcNzgEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf4AIRAM5gILIABBADYCACAQQQFqIQFBFiEQDMsBCwJAIAEiBCACRw0AQf8AIRAM5QILIAIgBGsgACgCACIBaiEUIAQgAWtBA2ohEAJAA0AgBC0AACABQfzOgIAAai0AAEcNzQEgAUEDRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf8AIRAM5QILIABBADYCACAQQQFqIQFBBSEQDMoBCwJAIAEiBCACRw0AQYABIRAM5AILIAQtAABB2QBHDcsBIARBAWohAUEIIRAMyQELAkAgASIEIAJHDQBBgQEhEAzjAgsCQAJAIAQtAABBsn9qDgMAzAEBzAELIARBAWohAUHrACEQDMoCCyAEQQFqIQFB7AAhEAzJAgsCQCABIgQgAkcNAEGCASEQDOICCwJAAkAgBC0AAEG4f2oOCADLAcsBywHLAcsBywEBywELIARBAWohAUHqACEQDMkCCyAEQQFqIQFB7QAhEAzIAgsCQCABIgQgAkcNAEGDASEQDOECCyACIARrIAAoAgAiAWohECAEIAFrQQJqIRQCQANAIAQtAAAgAUGAz4CAAGotAABHDckBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgEDYCAEGDASEQDOECC0EAIRAgAEEANgIAIBRBAWohAQzGAQsCQCABIgQgAkcNAEGEASEQDOACCyACIARrIAAoAgAiAWohFCAEIAFrQQRqIRACQANAIAQtAAAgAUGDz4CAAGotAABHDcgBIAFBBEYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGEASEQDOACCyAAQQA2AgAgEEEBaiEBQSMhEAzFAQsCQCABIgQgAkcNAEGFASEQDN8CCwJAAkAgBC0AAEG0f2oOCADIAcgByAHIAcgByAEByAELIARBAWohAUHvACEQDMYCCyAEQQFqIQFB8AAhEAzFAgsCQCABIgQgAkcNAEGGASEQDN4CCyAELQAAQcUARw3FASAEQQFqIQEMgwILAkAgASIEIAJHDQBBhwEhEAzdAgsgAiAEayAAKAIAIgFqIRQgBCABa0EDaiEQAkADQCAELQAAIAFBiM+AgABqLQAARw3FASABQQNGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBhwEhEAzdAgsgAEEANgIAIBBBAWohAUEtIRAMwgELAkAgASIEIAJHDQBBiAEhEAzcAgsgAiAEayAAKAIAIgFqIRQgBCABa0EIaiEQAkADQCAELQAAIAFB0M+AgABqLQAARw3EASABQQhGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBiAEhEAzcAgsgAEEANgIAIBBBAWohAUEpIRAMwQELAkAgASIBIAJHDQBBiQEhEAzbAgtBASEQIAEtAABB3wBHDcABIAFBAWohAQyBAgsCQCABIgQgAkcNAEGKASEQDNoCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRADQCAELQAAIAFBjM+AgABqLQAARw3BASABQQFGDa8CIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYoBIRAM2QILAkAgASIEIAJHDQBBiwEhEAzZAgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFBjs+AgABqLQAARw3BASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBiwEhEAzZAgsgAEEANgIAIBBBAWohAUECIRAMvgELAkAgASIEIAJHDQBBjAEhEAzYAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFB8M+AgABqLQAARw3AASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBjAEhEAzYAgsgAEEANgIAIBBBAWohAUEfIRAMvQELAkAgASIEIAJHDQBBjQEhEAzXAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFB8s+AgABqLQAARw2/ASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBjQEhEAzXAgsgAEEANgIAIBBBAWohAUEJIRAMvAELAkAgASIEIAJHDQBBjgEhEAzWAgsCQAJAIAQtAABBt39qDgcAvwG/Ab8BvwG/AQG/AQsgBEEBaiEBQfgAIRAMvQILIARBAWohAUH5ACEQDLwCCwJAIAEiBCACRw0AQY8BIRAM1QILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQZHPgIAAai0AAEcNvQEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQY8BIRAM1QILIABBADYCACAQQQFqIQFBGCEQDLoBCwJAIAEiBCACRw0AQZABIRAM1AILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQZfPgIAAai0AAEcNvAEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZABIRAM1AILIABBADYCACAQQQFqIQFBFyEQDLkBCwJAIAEiBCACRw0AQZEBIRAM0wILIAIgBGsgACgCACIBaiEUIAQgAWtBBmohEAJAA0AgBC0AACABQZrPgIAAai0AAEcNuwEgAUEGRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZEBIRAM0wILIABBADYCACAQQQFqIQFBFSEQDLgBCwJAIAEiBCACRw0AQZIBIRAM0gILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQaHPgIAAai0AAEcNugEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZIBIRAM0gILIABBADYCACAQQQFqIQFBHiEQDLcBCwJAIAEiBCACRw0AQZMBIRAM0QILIAQtAABBzABHDbgBIARBAWohAUEKIRAMtgELAkAgBCACRw0AQZQBIRAM0AILAkACQCAELQAAQb9/ag4PALkBuQG5AbkBuQG5AbkBuQG5AbkBuQG5AbkBAbkBCyAEQQFqIQFB/gAhEAy3AgsgBEEBaiEBQf8AIRAMtgILAkAgBCACRw0AQZUBIRAMzwILAkACQCAELQAAQb9/ag4DALgBAbgBCyAEQQFqIQFB/QAhEAy2AgsgBEEBaiEEQYABIRAMtQILAkAgBCACRw0AQZYBIRAMzgILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQafPgIAAai0AAEcNtgEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZYBIRAMzgILIABBADYCACAQQQFqIQFBCyEQDLMBCwJAIAQgAkcNAEGXASEQDM0CCwJAAkACQAJAIAQtAABBU2oOIwC4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBAbgBuAG4AbgBuAECuAG4AbgBA7gBCyAEQQFqIQFB+wAhEAy2AgsgBEEBaiEBQfwAIRAMtQILIARBAWohBEGBASEQDLQCCyAEQQFqIQRBggEhEAyzAgsCQCAEIAJHDQBBmAEhEAzMAgsgAiAEayAAKAIAIgFqIRQgBCABa0EEaiEQAkADQCAELQAAIAFBqc+AgABqLQAARw20ASABQQRGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBmAEhEAzMAgsgAEEANgIAIBBBAWohAUEZIRAMsQELAkAgBCACRw0AQZkBIRAMywILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQa7PgIAAai0AAEcNswEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZkBIRAMywILIABBADYCACAQQQFqIQFBBiEQDLABCwJAIAQgAkcNAEGaASEQDMoCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUG0z4CAAGotAABHDbIBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGaASEQDMoCCyAAQQA2AgAgEEEBaiEBQRwhEAyvAQsCQCAEIAJHDQBBmwEhEAzJAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBts+AgABqLQAARw2xASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBmwEhEAzJAgsgAEEANgIAIBBBAWohAUEnIRAMrgELAkAgBCACRw0AQZwBIRAMyAILAkACQCAELQAAQax/ag4CAAGxAQsgBEEBaiEEQYYBIRAMrwILIARBAWohBEGHASEQDK4CCwJAIAQgAkcNAEGdASEQDMcCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUG4z4CAAGotAABHDa8BIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGdASEQDMcCCyAAQQA2AgAgEEEBaiEBQSYhEAysAQsCQCAEIAJHDQBBngEhEAzGAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBus+AgABqLQAARw2uASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBngEhEAzGAgsgAEEANgIAIBBBAWohAUEDIRAMqwELAkAgBCACRw0AQZ8BIRAMxQILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQe3PgIAAai0AAEcNrQEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZ8BIRAMxQILIABBADYCACAQQQFqIQFBDCEQDKoBCwJAIAQgAkcNAEGgASEQDMQCCyACIARrIAAoAgAiAWohFCAEIAFrQQNqIRACQANAIAQtAAAgAUG8z4CAAGotAABHDawBIAFBA0YNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGgASEQDMQCCyAAQQA2AgAgEEEBaiEBQQ0hEAypAQsCQCAEIAJHDQBBoQEhEAzDAgsCQAJAIAQtAABBun9qDgsArAGsAawBrAGsAawBrAGsAawBAawBCyAEQQFqIQRBiwEhEAyqAgsgBEEBaiEEQYwBIRAMqQILAkAgBCACRw0AQaIBIRAMwgILIAQtAABB0ABHDakBIARBAWohBAzpAQsCQCAEIAJHDQBBowEhEAzBAgsCQAJAIAQtAABBt39qDgcBqgGqAaoBqgGqAQCqAQsgBEEBaiEEQY4BIRAMqAILIARBAWohAUEiIRAMpgELAkAgBCACRw0AQaQBIRAMwAILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQcDPgIAAai0AAEcNqAEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQaQBIRAMwAILIABBADYCACAQQQFqIQFBHSEQDKUBCwJAIAQgAkcNAEGlASEQDL8CCwJAAkAgBC0AAEGuf2oOAwCoAQGoAQsgBEEBaiEEQZABIRAMpgILIARBAWohAUEEIRAMpAELAkAgBCACRw0AQaYBIRAMvgILAkACQAJAAkACQCAELQAAQb9/ag4VAKoBqgGqAaoBqgGqAaoBqgGqAaoBAaoBqgECqgGqAQOqAaoBBKoBCyAEQQFqIQRBiAEhEAyoAgsgBEEBaiEEQYkBIRAMpwILIARBAWohBEGKASEQDKYCCyAEQQFqIQRBjwEhEAylAgsgBEEBaiEEQZEBIRAMpAILAkAgBCACRw0AQacBIRAMvQILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQe3PgIAAai0AAEcNpQEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQacBIRAMvQILIABBADYCACAQQQFqIQFBESEQDKIBCwJAIAQgAkcNAEGoASEQDLwCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHCz4CAAGotAABHDaQBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGoASEQDLwCCyAAQQA2AgAgEEEBaiEBQSwhEAyhAQsCQCAEIAJHDQBBqQEhEAy7AgsgAiAEayAAKAIAIgFqIRQgBCABa0EEaiEQAkADQCAELQAAIAFBxc+AgABqLQAARw2jASABQQRGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBqQEhEAy7AgsgAEEANgIAIBBBAWohAUErIRAMoAELAkAgBCACRw0AQaoBIRAMugILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQcrPgIAAai0AAEcNogEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQaoBIRAMugILIABBADYCACAQQQFqIQFBFCEQDJ8BCwJAIAQgAkcNAEGrASEQDLkCCwJAAkACQAJAIAQtAABBvn9qDg8AAQKkAaQBpAGkAaQBpAGkAaQBpAGkAaQBA6QBCyAEQQFqIQRBkwEhEAyiAgsgBEEBaiEEQZQBIRAMoQILIARBAWohBEGVASEQDKACCyAEQQFqIQRBlgEhEAyfAgsCQCAEIAJHDQBBrAEhEAy4AgsgBC0AAEHFAEcNnwEgBEEBaiEEDOABCwJAIAQgAkcNAEGtASEQDLcCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHNz4CAAGotAABHDZ8BIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGtASEQDLcCCyAAQQA2AgAgEEEBaiEBQQ4hEAycAQsCQCAEIAJHDQBBrgEhEAy2AgsgBC0AAEHQAEcNnQEgBEEBaiEBQSUhEAybAQsCQCAEIAJHDQBBrwEhEAy1AgsgAiAEayAAKAIAIgFqIRQgBCABa0EIaiEQAkADQCAELQAAIAFB0M+AgABqLQAARw2dASABQQhGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBrwEhEAy1AgsgAEEANgIAIBBBAWohAUEqIRAMmgELAkAgBCACRw0AQbABIRAMtAILAkACQCAELQAAQat/ag4LAJ0BnQGdAZ0BnQGdAZ0BnQGdAQGdAQsgBEEBaiEEQZoBIRAMmwILIARBAWohBEGbASEQDJoCCwJAIAQgAkcNAEGxASEQDLMCCwJAAkAgBC0AAEG/f2oOFACcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAEBnAELIARBAWohBEGZASEQDJoCCyAEQQFqIQRBnAEhEAyZAgsCQCAEIAJHDQBBsgEhEAyyAgsgAiAEayAAKAIAIgFqIRQgBCABa0EDaiEQAkADQCAELQAAIAFB2c+AgABqLQAARw2aASABQQNGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBsgEhEAyyAgsgAEEANgIAIBBBAWohAUEhIRAMlwELAkAgBCACRw0AQbMBIRAMsQILIAIgBGsgACgCACIBaiEUIAQgAWtBBmohEAJAA0AgBC0AACABQd3PgIAAai0AAEcNmQEgAUEGRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbMBIRAMsQILIABBADYCACAQQQFqIQFBGiEQDJYBCwJAIAQgAkcNAEG0ASEQDLACCwJAAkACQCAELQAAQbt/ag4RAJoBmgGaAZoBmgGaAZoBmgGaAQGaAZoBmgGaAZoBApoBCyAEQQFqIQRBnQEhEAyYAgsgBEEBaiEEQZ4BIRAMlwILIARBAWohBEGfASEQDJYCCwJAIAQgAkcNAEG1ASEQDK8CCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUHkz4CAAGotAABHDZcBIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG1ASEQDK8CCyAAQQA2AgAgEEEBaiEBQSghEAyUAQsCQCAEIAJHDQBBtgEhEAyuAgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFB6s+AgABqLQAARw2WASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBtgEhEAyuAgsgAEEANgIAIBBBAWohAUEHIRAMkwELAkAgBCACRw0AQbcBIRAMrQILAkACQCAELQAAQbt/ag4OAJYBlgGWAZYBlgGWAZYBlgGWAZYBlgGWAQGWAQsgBEEBaiEEQaEBIRAMlAILIARBAWohBEGiASEQDJMCCwJAIAQgAkcNAEG4ASEQDKwCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDZQBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG4ASEQDKwCCyAAQQA2AgAgEEEBaiEBQRIhEAyRAQsCQCAEIAJHDQBBuQEhEAyrAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFB8M+AgABqLQAARw2TASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBuQEhEAyrAgsgAEEANgIAIBBBAWohAUEgIRAMkAELAkAgBCACRw0AQboBIRAMqgILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfLPgIAAai0AAEcNkgEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQboBIRAMqgILIABBADYCACAQQQFqIQFBDyEQDI8BCwJAIAQgAkcNAEG7ASEQDKkCCwJAAkAgBC0AAEG3f2oOBwCSAZIBkgGSAZIBAZIBCyAEQQFqIQRBpQEhEAyQAgsgBEEBaiEEQaYBIRAMjwILAkAgBCACRw0AQbwBIRAMqAILIAIgBGsgACgCACIBaiEUIAQgAWtBB2ohEAJAA0AgBC0AACABQfTPgIAAai0AAEcNkAEgAUEHRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbwBIRAMqAILIABBADYCACAQQQFqIQFBGyEQDI0BCwJAIAQgAkcNAEG9ASEQDKcCCwJAAkACQCAELQAAQb5/ag4SAJEBkQGRAZEBkQGRAZEBkQGRAQGRAZEBkQGRAZEBkQECkQELIARBAWohBEGkASEQDI8CCyAEQQFqIQRBpwEhEAyOAgsgBEEBaiEEQagBIRAMjQILAkAgBCACRw0AQb4BIRAMpgILIAQtAABBzgBHDY0BIARBAWohBAzPAQsCQCAEIAJHDQBBvwEhEAylAgsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAELQAAQb9/ag4VAAECA5wBBAUGnAGcAZwBBwgJCgucAQwNDg+cAQsgBEEBaiEBQegAIRAMmgILIARBAWohAUHpACEQDJkCCyAEQQFqIQFB7gAhEAyYAgsgBEEBaiEBQfIAIRAMlwILIARBAWohAUHzACEQDJYCCyAEQQFqIQFB9gAhEAyVAgsgBEEBaiEBQfcAIRAMlAILIARBAWohAUH6ACEQDJMCCyAEQQFqIQRBgwEhEAySAgsgBEEBaiEEQYQBIRAMkQILIARBAWohBEGFASEQDJACCyAEQQFqIQRBkgEhEAyPAgsgBEEBaiEEQZgBIRAMjgILIARBAWohBEGgASEQDI0CCyAEQQFqIQRBowEhEAyMAgsgBEEBaiEEQaoBIRAMiwILAkAgBCACRg0AIABBkICAgAA2AgggACAENgIEQasBIRAMiwILQcABIRAMowILIAAgBSACEKqAgIAAIgENiwEgBSEBDFwLAkAgBiACRg0AIAZBAWohBQyNAQtBwgEhEAyhAgsDQAJAIBAtAABBdmoOBIwBAACPAQALIBBBAWoiECACRw0AC0HDASEQDKACCwJAIAcgAkYNACAAQZGAgIAANgIIIAAgBzYCBCAHIQFBASEQDIcCC0HEASEQDJ8CCwJAIAcgAkcNAEHFASEQDJ8CCwJAAkAgBy0AAEF2ag4EAc4BzgEAzgELIAdBAWohBgyNAQsgB0EBaiEFDIkBCwJAIAcgAkcNAEHGASEQDJ4CCwJAAkAgBy0AAEF2ag4XAY8BjwEBjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BAI8BCyAHQQFqIQcLQbABIRAMhAILAkAgCCACRw0AQcgBIRAMnQILIAgtAABBIEcNjQEgAEEAOwEyIAhBAWohAUGzASEQDIMCCyABIRcCQANAIBciByACRg0BIActAABBUGpB/wFxIhBBCk8NzAECQCAALwEyIhRBmTNLDQAgACAUQQpsIhQ7ATIgEEH//wNzIBRB/v8DcUkNACAHQQFqIRcgACAUIBBqIhA7ATIgEEH//wNxQegHSQ0BCwtBACEQIABBADYCHCAAQcGJgIAANgIQIABBDTYCDCAAIAdBAWo2AhQMnAILQccBIRAMmwILIAAgCCACEK6AgIAAIhBFDcoBIBBBFUcNjAEgAEHIATYCHCAAIAg2AhQgAEHJl4CAADYCECAAQRU2AgxBACEQDJoCCwJAIAkgAkcNAEHMASEQDJoCC0EAIRRBASEXQQEhFkEAIRACQAJAAkACQAJAAkACQAJAAkAgCS0AAEFQag4KlgGVAQABAgMEBQYIlwELQQIhEAwGC0EDIRAMBQtBBCEQDAQLQQUhEAwDC0EGIRAMAgtBByEQDAELQQghEAtBACEXQQAhFkEAIRQMjgELQQkhEEEBIRRBACEXQQAhFgyNAQsCQCAKIAJHDQBBzgEhEAyZAgsgCi0AAEEuRw2OASAKQQFqIQkMygELIAsgAkcNjgFB0AEhEAyXAgsCQCALIAJGDQAgAEGOgICAADYCCCAAIAs2AgRBtwEhEAz+AQtB0QEhEAyWAgsCQCAEIAJHDQBB0gEhEAyWAgsgAiAEayAAKAIAIhBqIRQgBCAQa0EEaiELA0AgBC0AACAQQfzPgIAAai0AAEcNjgEgEEEERg3pASAQQQFqIRAgBEEBaiIEIAJHDQALIAAgFDYCAEHSASEQDJUCCyAAIAwgAhCsgICAACIBDY0BIAwhAQy4AQsCQCAEIAJHDQBB1AEhEAyUAgsgAiAEayAAKAIAIhBqIRQgBCAQa0EBaiEMA0AgBC0AACAQQYHQgIAAai0AAEcNjwEgEEEBRg2OASAQQQFqIRAgBEEBaiIEIAJHDQALIAAgFDYCAEHUASEQDJMCCwJAIAQgAkcNAEHWASEQDJMCCyACIARrIAAoAgAiEGohFCAEIBBrQQJqIQsDQCAELQAAIBBBg9CAgABqLQAARw2OASAQQQJGDZABIBBBAWohECAEQQFqIgQgAkcNAAsgACAUNgIAQdYBIRAMkgILAkAgBCACRw0AQdcBIRAMkgILAkACQCAELQAAQbt/ag4QAI8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwEBjwELIARBAWohBEG7ASEQDPkBCyAEQQFqIQRBvAEhEAz4AQsCQCAEIAJHDQBB2AEhEAyRAgsgBC0AAEHIAEcNjAEgBEEBaiEEDMQBCwJAIAQgAkYNACAAQZCAgIAANgIIIAAgBDYCBEG+ASEQDPcBC0HZASEQDI8CCwJAIAQgAkcNAEHaASEQDI8CCyAELQAAQcgARg3DASAAQQE6ACgMuQELIABBAjoALyAAIAQgAhCmgICAACIQDY0BQcIBIRAM9AELIAAtAChBf2oOArcBuQG4AQsDQAJAIAQtAABBdmoOBACOAY4BAI4BCyAEQQFqIgQgAkcNAAtB3QEhEAyLAgsgAEEAOgAvIAAtAC1BBHFFDYQCCyAAQQA6AC8gAEEBOgA0IAEhAQyMAQsgEEEVRg3aASAAQQA2AhwgACABNgIUIABBp46AgAA2AhAgAEESNgIMQQAhEAyIAgsCQCAAIBAgAhC0gICAACIEDQAgECEBDIECCwJAIARBFUcNACAAQQM2AhwgACAQNgIUIABBsJiAgAA2AhAgAEEVNgIMQQAhEAyIAgsgAEEANgIcIAAgEDYCFCAAQaeOgIAANgIQIABBEjYCDEEAIRAMhwILIBBBFUYN1gEgAEEANgIcIAAgATYCFCAAQdqNgIAANgIQIABBFDYCDEEAIRAMhgILIAAoAgQhFyAAQQA2AgQgECARp2oiFiEBIAAgFyAQIBYgFBsiEBC1gICAACIURQ2NASAAQQc2AhwgACAQNgIUIAAgFDYCDEEAIRAMhQILIAAgAC8BMEGAAXI7ATAgASEBC0EqIRAM6gELIBBBFUYN0QEgAEEANgIcIAAgATYCFCAAQYOMgIAANgIQIABBEzYCDEEAIRAMggILIBBBFUYNzwEgAEEANgIcIAAgATYCFCAAQZqPgIAANgIQIABBIjYCDEEAIRAMgQILIAAoAgQhECAAQQA2AgQCQCAAIBAgARC3gICAACIQDQAgAUEBaiEBDI0BCyAAQQw2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAMgAILIBBBFUYNzAEgAEEANgIcIAAgATYCFCAAQZqPgIAANgIQIABBIjYCDEEAIRAM/wELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC3gICAACIQDQAgAUEBaiEBDIwBCyAAQQ02AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM/gELIBBBFUYNyQEgAEEANgIcIAAgATYCFCAAQcaMgIAANgIQIABBIzYCDEEAIRAM/QELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC5gICAACIQDQAgAUEBaiEBDIsBCyAAQQ42AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM/AELIABBADYCHCAAIAE2AhQgAEHAlYCAADYCECAAQQI2AgxBACEQDPsBCyAQQRVGDcUBIABBADYCHCAAIAE2AhQgAEHGjICAADYCECAAQSM2AgxBACEQDPoBCyAAQRA2AhwgACABNgIUIAAgEDYCDEEAIRAM+QELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARC5gICAACIEDQAgAUEBaiEBDPEBCyAAQRE2AhwgACAENgIMIAAgAUEBajYCFEEAIRAM+AELIBBBFUYNwQEgAEEANgIcIAAgATYCFCAAQcaMgIAANgIQIABBIzYCDEEAIRAM9wELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC5gICAACIQDQAgAUEBaiEBDIgBCyAAQRM2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM9gELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARC5gICAACIEDQAgAUEBaiEBDO0BCyAAQRQ2AhwgACAENgIMIAAgAUEBajYCFEEAIRAM9QELIBBBFUYNvQEgAEEANgIcIAAgATYCFCAAQZqPgIAANgIQIABBIjYCDEEAIRAM9AELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC3gICAACIQDQAgAUEBaiEBDIYBCyAAQRY2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM8wELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARC3gICAACIEDQAgAUEBaiEBDOkBCyAAQRc2AhwgACAENgIMIAAgAUEBajYCFEEAIRAM8gELIABBADYCHCAAIAE2AhQgAEHNk4CAADYCECAAQQw2AgxBACEQDPEBC0IBIRELIBBBAWohAQJAIAApAyAiEkL//////////w9WDQAgACASQgSGIBGENwMgIAEhAQyEAQsgAEEANgIcIAAgATYCFCAAQa2JgIAANgIQIABBDDYCDEEAIRAM7wELIABBADYCHCAAIBA2AhQgAEHNk4CAADYCECAAQQw2AgxBACEQDO4BCyAAKAIEIRcgAEEANgIEIBAgEadqIhYhASAAIBcgECAWIBQbIhAQtYCAgAAiFEUNcyAAQQU2AhwgACAQNgIUIAAgFDYCDEEAIRAM7QELIABBADYCHCAAIBA2AhQgAEGqnICAADYCECAAQQ82AgxBACEQDOwBCyAAIBAgAhC0gICAACIBDQEgECEBC0EOIRAM0QELAkAgAUEVRw0AIABBAjYCHCAAIBA2AhQgAEGwmICAADYCECAAQRU2AgxBACEQDOoBCyAAQQA2AhwgACAQNgIUIABBp46AgAA2AhAgAEESNgIMQQAhEAzpAQsgAUEBaiEQAkAgAC8BMCIBQYABcUUNAAJAIAAgECACELuAgIAAIgENACAQIQEMcAsgAUEVRw26ASAAQQU2AhwgACAQNgIUIABB+ZeAgAA2AhAgAEEVNgIMQQAhEAzpAQsCQCABQaAEcUGgBEcNACAALQAtQQJxDQAgAEEANgIcIAAgEDYCFCAAQZaTgIAANgIQIABBBDYCDEEAIRAM6QELIAAgECACEL2AgIAAGiAQIQECQAJAAkACQAJAIAAgECACELOAgIAADhYCAQAEBAQEBAQEBAQEBAQEBAQEBAQDBAsgAEEBOgAuCyAAIAAvATBBwAByOwEwIBAhAQtBJiEQDNEBCyAAQSM2AhwgACAQNgIUIABBpZaAgAA2AhAgAEEVNgIMQQAhEAzpAQsgAEEANgIcIAAgEDYCFCAAQdWLgIAANgIQIABBETYCDEEAIRAM6AELIAAtAC1BAXFFDQFBwwEhEAzOAQsCQCANIAJGDQADQAJAIA0tAABBIEYNACANIQEMxAELIA1BAWoiDSACRw0AC0ElIRAM5wELQSUhEAzmAQsgACgCBCEEIABBADYCBCAAIAQgDRCvgICAACIERQ2tASAAQSY2AhwgACAENgIMIAAgDUEBajYCFEEAIRAM5QELIBBBFUYNqwEgAEEANgIcIAAgATYCFCAAQf2NgIAANgIQIABBHTYCDEEAIRAM5AELIABBJzYCHCAAIAE2AhQgACAQNgIMQQAhEAzjAQsgECEBQQEhFAJAAkACQAJAAkACQAJAIAAtACxBfmoOBwYFBQMBAgAFCyAAIAAvATBBCHI7ATAMAwtBAiEUDAELQQQhFAsgAEEBOgAsIAAgAC8BMCAUcjsBMAsgECEBC0ErIRAMygELIABBADYCHCAAIBA2AhQgAEGrkoCAADYCECAAQQs2AgxBACEQDOIBCyAAQQA2AhwgACABNgIUIABB4Y+AgAA2AhAgAEEKNgIMQQAhEAzhAQsgAEEAOgAsIBAhAQy9AQsgECEBQQEhFAJAAkACQAJAAkAgAC0ALEF7ag4EAwECAAULIAAgAC8BMEEIcjsBMAwDC0ECIRQMAQtBBCEUCyAAQQE6ACwgACAALwEwIBRyOwEwCyAQIQELQSkhEAzFAQsgAEEANgIcIAAgATYCFCAAQfCUgIAANgIQIABBAzYCDEEAIRAM3QELAkAgDi0AAEENRw0AIAAoAgQhASAAQQA2AgQCQCAAIAEgDhCxgICAACIBDQAgDkEBaiEBDHULIABBLDYCHCAAIAE2AgwgACAOQQFqNgIUQQAhEAzdAQsgAC0ALUEBcUUNAUHEASEQDMMBCwJAIA4gAkcNAEEtIRAM3AELAkACQANAAkAgDi0AAEF2ag4EAgAAAwALIA5BAWoiDiACRw0AC0EtIRAM3QELIAAoAgQhASAAQQA2AgQCQCAAIAEgDhCxgICAACIBDQAgDiEBDHQLIABBLDYCHCAAIA42AhQgACABNgIMQQAhEAzcAQsgACgCBCEBIABBADYCBAJAIAAgASAOELGAgIAAIgENACAOQQFqIQEMcwsgAEEsNgIcIAAgATYCDCAAIA5BAWo2AhRBACEQDNsBCyAAKAIEIQQgAEEANgIEIAAgBCAOELGAgIAAIgQNoAEgDiEBDM4BCyAQQSxHDQEgAUEBaiEQQQEhAQJAAkACQAJAAkAgAC0ALEF7ag4EAwECBAALIBAhAQwEC0ECIQEMAQtBBCEBCyAAQQE6ACwgACAALwEwIAFyOwEwIBAhAQwBCyAAIAAvATBBCHI7ATAgECEBC0E5IRAMvwELIABBADoALCABIQELQTQhEAy9AQsgACAALwEwQSByOwEwIAEhAQwCCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQsYCAgAAiBA0AIAEhAQzHAQsgAEE3NgIcIAAgATYCFCAAIAQ2AgxBACEQDNQBCyAAQQg6ACwgASEBC0EwIRAMuQELAkAgAC0AKEEBRg0AIAEhAQwECyAALQAtQQhxRQ2TASABIQEMAwsgAC0AMEEgcQ2UAUHFASEQDLcBCwJAIA8gAkYNAAJAA0ACQCAPLQAAQVBqIgFB/wFxQQpJDQAgDyEBQTUhEAy6AQsgACkDICIRQpmz5syZs+bMGVYNASAAIBFCCn4iETcDICARIAGtQv8BgyISQn+FVg0BIAAgESASfDcDICAPQQFqIg8gAkcNAAtBOSEQDNEBCyAAKAIEIQIgAEEANgIEIAAgAiAPQQFqIgQQsYCAgAAiAg2VASAEIQEMwwELQTkhEAzPAQsCQCAALwEwIgFBCHFFDQAgAC0AKEEBRw0AIAAtAC1BCHFFDZABCyAAIAFB9/sDcUGABHI7ATAgDyEBC0E3IRAMtAELIAAgAC8BMEEQcjsBMAyrAQsgEEEVRg2LASAAQQA2AhwgACABNgIUIABB8I6AgAA2AhAgAEEcNgIMQQAhEAzLAQsgAEHDADYCHCAAIAE2AgwgACANQQFqNgIUQQAhEAzKAQsCQCABLQAAQTpHDQAgACgCBCEQIABBADYCBAJAIAAgECABEK+AgIAAIhANACABQQFqIQEMYwsgAEHDADYCHCAAIBA2AgwgACABQQFqNgIUQQAhEAzKAQsgAEEANgIcIAAgATYCFCAAQbGRgIAANgIQIABBCjYCDEEAIRAMyQELIABBADYCHCAAIAE2AhQgAEGgmYCAADYCECAAQR42AgxBACEQDMgBCyAAQQA2AgALIABBgBI7ASogACAXQQFqIgEgAhCogICAACIQDQEgASEBC0HHACEQDKwBCyAQQRVHDYMBIABB0QA2AhwgACABNgIUIABB45eAgAA2AhAgAEEVNgIMQQAhEAzEAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMXgsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAzDAQsgAEEANgIcIAAgFDYCFCAAQcGogIAANgIQIABBBzYCDCAAQQA2AgBBACEQDMIBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxdCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDMEBC0EAIRAgAEEANgIcIAAgATYCFCAAQYCRgIAANgIQIABBCTYCDAzAAQsgEEEVRg19IABBADYCHCAAIAE2AhQgAEGUjYCAADYCECAAQSE2AgxBACEQDL8BC0EBIRZBACEXQQAhFEEBIRALIAAgEDoAKyABQQFqIQECQAJAIAAtAC1BEHENAAJAAkACQCAALQAqDgMBAAIECyAWRQ0DDAILIBQNAQwCCyAXRQ0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQrYCAgAAiEA0AIAEhAQxcCyAAQdgANgIcIAAgATYCFCAAIBA2AgxBACEQDL4BCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQrYCAgAAiBA0AIAEhAQytAQsgAEHZADYCHCAAIAE2AhQgACAENgIMQQAhEAy9AQsgACgCBCEEIABBADYCBAJAIAAgBCABEK2AgIAAIgQNACABIQEMqwELIABB2gA2AhwgACABNgIUIAAgBDYCDEEAIRAMvAELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKkBCyAAQdwANgIcIAAgATYCFCAAIAQ2AgxBACEQDLsBCwJAIAEtAABBUGoiEEH/AXFBCk8NACAAIBA6ACogAUEBaiEBQc8AIRAMogELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKcBCyAAQd4ANgIcIAAgATYCFCAAIAQ2AgxBACEQDLoBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKUEjTw0AIAEhAQxZCyAAQQA2AhwgACABNgIUIABB04mAgAA2AhAgAEEINgIMQQAhEAy5AQsgAEEANgIAC0EAIRAgAEEANgIcIAAgATYCFCAAQZCzgIAANgIQIABBCDYCDAy3AQsgAEEANgIAIBdBAWohAQJAIAAtAClBIUcNACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDK0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDKwBCyAAQQA2AhwgACABNgIUIABB3IiAgAA2AhAgAEEHNgIMQQAhEAyrAQsgEEE/Rw0BIAFBAWohAQtBBSEQDJABC0EAIRAgAEEANgIcIAAgATYCFCAAQf2SgIAANgIQIABBBzYCDAyoAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAynAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAymAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMRgsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAylAQsgACgCBCEBIABBADYCBAJAIAAgASAUEKeAgIAAIgENACAUIQEMPwsgAEHSADYCHCAAIBQ2AhQgACABNgIMQQAhEAykAQsgACgCBCEBIABBADYCBAJAIAAgASAUEKeAgIAAIgENACAUIQEMPwsgAEHTADYCHCAAIBQ2AhQgACABNgIMQQAhEAyjAQsgACgCBCEBIABBADYCBAJAIAAgASAUEKeAgIAAIgENACAUIQEMQwsgAEHlADYCHCAAIBQ2AhQgACABNgIMQQAhEAyiAQsgAEEANgIcIAAgFDYCFCAAQcOPgIAANgIQIABBBzYCDEEAIRAMoQELIABBADYCHCAAIAE2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKABC0EAIRAgAEEANgIcIAAgFDYCFCAAQYycgIAANgIQIABBBzYCDAyfAQsgAEEANgIcIAAgFDYCFCAAQYycgIAANgIQIABBBzYCDEEAIRAMngELIABBADYCHCAAIBQ2AhQgAEH+kYCAADYCECAAQQc2AgxBACEQDJ0BCyAAQQA2AhwgACABNgIUIABBjpuAgAA2AhAgAEEGNgIMQQAhEAycAQsgEEEVRg1XIABBADYCHCAAIAE2AhQgAEHMjoCAADYCECAAQSA2AgxBACEQDJsBCyAAQQA2AgAgEEEBaiEBQSQhEAsgACAQOgApIAAoAgQhECAAQQA2AgQgACAQIAEQq4CAgAAiEA1UIAEhAQw+CyAAQQA2AgALQQAhECAAQQA2AhwgACAENgIUIABB8ZuAgAA2AhAgAEEGNgIMDJcBCyABQRVGDVAgAEEANgIcIAAgBTYCFCAAQfCMgIAANgIQIABBGzYCDEEAIRAMlgELIAAoAgQhBSAAQQA2AgQgACAFIBAQqYCAgAAiBQ0BIBBBAWohBQtBrQEhEAx7CyAAQcEBNgIcIAAgBTYCDCAAIBBBAWo2AhRBACEQDJMBCyAAKAIEIQYgAEEANgIEIAAgBiAQEKmAgIAAIgYNASAQQQFqIQYLQa4BIRAMeAsgAEHCATYCHCAAIAY2AgwgACAQQQFqNgIUQQAhEAyQAQsgAEEANgIcIAAgBzYCFCAAQZeLgIAANgIQIABBDTYCDEEAIRAMjwELIABBADYCHCAAIAg2AhQgAEHjkICAADYCECAAQQk2AgxBACEQDI4BCyAAQQA2AhwgACAINgIUIABBlI2AgAA2AhAgAEEhNgIMQQAhEAyNAQtBASEWQQAhF0EAIRRBASEQCyAAIBA6ACsgCUEBaiEIAkACQCAALQAtQRBxDQACQAJAAkAgAC0AKg4DAQACBAsgFkUNAwwCCyAUDQEMAgsgF0UNAQsgACgCBCEQIABBADYCBCAAIBAgCBCtgICAACIQRQ09IABByQE2AhwgACAINgIUIAAgEDYCDEEAIRAMjAELIAAoAgQhBCAAQQA2AgQgACAEIAgQrYCAgAAiBEUNdiAAQcoBNgIcIAAgCDYCFCAAIAQ2AgxBACEQDIsBCyAAKAIEIQQgAEEANgIEIAAgBCAJEK2AgIAAIgRFDXQgAEHLATYCHCAAIAk2AhQgACAENgIMQQAhEAyKAQsgACgCBCEEIABBADYCBCAAIAQgChCtgICAACIERQ1yIABBzQE2AhwgACAKNgIUIAAgBDYCDEEAIRAMiQELAkAgCy0AAEFQaiIQQf8BcUEKTw0AIAAgEDoAKiALQQFqIQpBtgEhEAxwCyAAKAIEIQQgAEEANgIEIAAgBCALEK2AgIAAIgRFDXAgAEHPATYCHCAAIAs2AhQgACAENgIMQQAhEAyIAQsgAEEANgIcIAAgBDYCFCAAQZCzgIAANgIQIABBCDYCDCAAQQA2AgBBACEQDIcBCyABQRVGDT8gAEEANgIcIAAgDDYCFCAAQcyOgIAANgIQIABBIDYCDEEAIRAMhgELIABBgQQ7ASggACgCBCEQIABCADcDACAAIBAgDEEBaiIMEKuAgIAAIhBFDTggAEHTATYCHCAAIAw2AhQgACAQNgIMQQAhEAyFAQsgAEEANgIAC0EAIRAgAEEANgIcIAAgBDYCFCAAQdibgIAANgIQIABBCDYCDAyDAQsgACgCBCEQIABCADcDACAAIBAgC0EBaiILEKuAgIAAIhANAUHGASEQDGkLIABBAjoAKAxVCyAAQdUBNgIcIAAgCzYCFCAAIBA2AgxBACEQDIABCyAQQRVGDTcgAEEANgIcIAAgBDYCFCAAQaSMgIAANgIQIABBEDYCDEEAIRAMfwsgAC0ANEEBRw00IAAgBCACELyAgIAAIhBFDTQgEEEVRw01IABB3AE2AhwgACAENgIUIABB1ZaAgAA2AhAgAEEVNgIMQQAhEAx+C0EAIRAgAEEANgIcIABBr4uAgAA2AhAgAEECNgIMIAAgFEEBajYCFAx9C0EAIRAMYwtBAiEQDGILQQ0hEAxhC0EPIRAMYAtBJSEQDF8LQRMhEAxeC0EVIRAMXQtBFiEQDFwLQRchEAxbC0EYIRAMWgtBGSEQDFkLQRohEAxYC0EbIRAMVwtBHCEQDFYLQR0hEAxVC0EfIRAMVAtBISEQDFMLQSMhEAxSC0HGACEQDFELQS4hEAxQC0EvIRAMTwtBOyEQDE4LQT0hEAxNC0HIACEQDEwLQckAIRAMSwtBywAhEAxKC0HMACEQDEkLQc4AIRAMSAtB0QAhEAxHC0HVACEQDEYLQdgAIRAMRQtB2QAhEAxEC0HbACEQDEMLQeQAIRAMQgtB5QAhEAxBC0HxACEQDEALQfQAIRAMPwtBjQEhEAw+C0GXASEQDD0LQakBIRAMPAtBrAEhEAw7C0HAASEQDDoLQbkBIRAMOQtBrwEhEAw4C0GxASEQDDcLQbIBIRAMNgtBtAEhEAw1C0G1ASEQDDQLQboBIRAMMwtBvQEhEAwyC0G/ASEQDDELQcEBIRAMMAsgAEEANgIcIAAgBDYCFCAAQemLgIAANgIQIABBHzYCDEEAIRAMSAsgAEHbATYCHCAAIAQ2AhQgAEH6loCAADYCECAAQRU2AgxBACEQDEcLIABB+AA2AhwgACAMNgIUIABBypiAgAA2AhAgAEEVNgIMQQAhEAxGCyAAQdEANgIcIAAgBTYCFCAAQbCXgIAANgIQIABBFTYCDEEAIRAMRQsgAEH5ADYCHCAAIAE2AhQgACAQNgIMQQAhEAxECyAAQfgANgIcIAAgATYCFCAAQcqYgIAANgIQIABBFTYCDEEAIRAMQwsgAEHkADYCHCAAIAE2AhQgAEHjl4CAADYCECAAQRU2AgxBACEQDEILIABB1wA2AhwgACABNgIUIABByZeAgAA2AhAgAEEVNgIMQQAhEAxBCyAAQQA2AhwgACABNgIUIABBuY2AgAA2AhAgAEEaNgIMQQAhEAxACyAAQcIANgIcIAAgATYCFCAAQeOYgIAANgIQIABBFTYCDEEAIRAMPwsgAEEANgIEIAAgDyAPELGAgIAAIgRFDQEgAEE6NgIcIAAgBDYCDCAAIA9BAWo2AhRBACEQDD4LIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCxgICAACIERQ0AIABBOzYCHCAAIAQ2AgwgACABQQFqNgIUQQAhEAw+CyABQQFqIQEMLQsgD0EBaiEBDC0LIABBADYCHCAAIA82AhQgAEHkkoCAADYCECAAQQQ2AgxBACEQDDsLIABBNjYCHCAAIAQ2AhQgACACNgIMQQAhEAw6CyAAQS42AhwgACAONgIUIAAgBDYCDEEAIRAMOQsgAEHQADYCHCAAIAE2AhQgAEGRmICAADYCECAAQRU2AgxBACEQDDgLIA1BAWohAQwsCyAAQRU2AhwgACABNgIUIABBgpmAgAA2AhAgAEEVNgIMQQAhEAw2CyAAQRs2AhwgACABNgIUIABBkZeAgAA2AhAgAEEVNgIMQQAhEAw1CyAAQQ82AhwgACABNgIUIABBkZeAgAA2AhAgAEEVNgIMQQAhEAw0CyAAQQs2AhwgACABNgIUIABBkZeAgAA2AhAgAEEVNgIMQQAhEAwzCyAAQRo2AhwgACABNgIUIABBgpmAgAA2AhAgAEEVNgIMQQAhEAwyCyAAQQs2AhwgACABNgIUIABBgpmAgAA2AhAgAEEVNgIMQQAhEAwxCyAAQQo2AhwgACABNgIUIABB5JaAgAA2AhAgAEEVNgIMQQAhEAwwCyAAQR42AhwgACABNgIUIABB+ZeAgAA2AhAgAEEVNgIMQQAhEAwvCyAAQQA2AhwgACAQNgIUIABB2o2AgAA2AhAgAEEUNgIMQQAhEAwuCyAAQQQ2AhwgACABNgIUIABBsJiAgAA2AhAgAEEVNgIMQQAhEAwtCyAAQQA2AgAgC0EBaiELC0G4ASEQDBILIABBADYCACAQQQFqIQFB9QAhEAwRCyABIQECQCAALQApQQVHDQBB4wAhEAwRC0HiACEQDBALQQAhECAAQQA2AhwgAEHkkYCAADYCECAAQQc2AgwgACAUQQFqNgIUDCgLIABBADYCACAXQQFqIQFBwAAhEAwOC0EBIQELIAAgAToALCAAQQA2AgAgF0EBaiEBC0EoIRAMCwsgASEBC0E4IRAMCQsCQCABIg8gAkYNAANAAkAgDy0AAEGAvoCAAGotAAAiAUEBRg0AIAFBAkcNAyAPQQFqIQEMBAsgD0EBaiIPIAJHDQALQT4hEAwiC0E+IRAMIQsgAEEAOgAsIA8hAQwBC0ELIRAMBgtBOiEQDAULIAFBAWohAUEtIRAMBAsgACABOgAsIABBADYCACAWQQFqIQFBDCEQDAMLIABBADYCACAXQQFqIQFBCiEQDAILIABBADYCAAsgAEEAOgAsIA0hAUEJIRAMAAsLQQAhECAAQQA2AhwgACALNgIUIABBzZCAgAA2AhAgAEEJNgIMDBcLQQAhECAAQQA2AhwgACAKNgIUIABB6YqAgAA2AhAgAEEJNgIMDBYLQQAhECAAQQA2AhwgACAJNgIUIABBt5CAgAA2AhAgAEEJNgIMDBULQQAhECAAQQA2AhwgACAINgIUIABBnJGAgAA2AhAgAEEJNgIMDBQLQQAhECAAQQA2AhwgACABNgIUIABBzZCAgAA2AhAgAEEJNgIMDBMLQQAhECAAQQA2AhwgACABNgIUIABB6YqAgAA2AhAgAEEJNgIMDBILQQAhECAAQQA2AhwgACABNgIUIABBt5CAgAA2AhAgAEEJNgIMDBELQQAhECAAQQA2AhwgACABNgIUIABBnJGAgAA2AhAgAEEJNgIMDBALQQAhECAAQQA2AhwgACABNgIUIABBl5WAgAA2AhAgAEEPNgIMDA8LQQAhECAAQQA2AhwgACABNgIUIABBl5WAgAA2AhAgAEEPNgIMDA4LQQAhECAAQQA2AhwgACABNgIUIABBwJKAgAA2AhAgAEELNgIMDA0LQQAhECAAQQA2AhwgACABNgIUIABBlYmAgAA2AhAgAEELNgIMDAwLQQAhECAAQQA2AhwgACABNgIUIABB4Y+AgAA2AhAgAEEKNgIMDAsLQQAhECAAQQA2AhwgACABNgIUIABB+4+AgAA2AhAgAEEKNgIMDAoLQQAhECAAQQA2AhwgACABNgIUIABB8ZmAgAA2AhAgAEECNgIMDAkLQQAhECAAQQA2AhwgACABNgIUIABBxJSAgAA2AhAgAEECNgIMDAgLQQAhECAAQQA2AhwgACABNgIUIABB8pWAgAA2AhAgAEECNgIMDAcLIABBAjYCHCAAIAE2AhQgAEGcmoCAADYCECAAQRY2AgxBACEQDAYLQQEhEAwFC0HUACEQIAEiBCACRg0EIANBCGogACAEIAJB2MKAgABBChDFgICAACADKAIMIQQgAygCCA4DAQQCAAsQyoCAgAAACyAAQQA2AhwgAEG1moCAADYCECAAQRc2AgwgACAEQQFqNgIUQQAhEAwCCyAAQQA2AhwgACAENgIUIABBypqAgAA2AhAgAEEJNgIMQQAhEAwBCwJAIAEiBCACRw0AQSIhEAwBCyAAQYmAgIAANgIIIAAgBDYCBEEhIRALIANBEGokgICAgAAgEAuvAQECfyABKAIAIQYCQAJAIAIgA0YNACAEIAZqIQQgBiADaiACayEHIAIgBkF/cyAFaiIGaiEFA0ACQCACLQAAIAQtAABGDQBBAiEEDAMLAkAgBg0AQQAhBCAFIQIMAwsgBkF/aiEGIARBAWohBCACQQFqIgIgA0cNAAsgByEGIAMhAgsgAEEBNgIAIAEgBjYCACAAIAI2AgQPCyABQQA2AgAgACAENgIAIAAgAjYCBAsKACAAEMeAgIAAC/I2AQt/I4CAgIAAQRBrIgEkgICAgAACQEEAKAKg0ICAAA0AQQAQy4CAgABBgNSEgABrIgJB2QBJDQBBACEDAkBBACgC4NOAgAAiBA0AQQBCfzcC7NOAgABBAEKAgISAgIDAADcC5NOAgABBACABQQhqQXBxQdiq1aoFcyIENgLg04CAAEEAQQA2AvTTgIAAQQBBADYCxNOAgAALQQAgAjYCzNOAgABBAEGA1ISAADYCyNOAgABBAEGA1ISAADYCmNCAgABBACAENgKs0ICAAEEAQX82AqjQgIAAA0AgA0HE0ICAAGogA0G40ICAAGoiBDYCACAEIANBsNCAgABqIgU2AgAgA0G80ICAAGogBTYCACADQczQgIAAaiADQcDQgIAAaiIFNgIAIAUgBDYCACADQdTQgIAAaiADQcjQgIAAaiIENgIAIAQgBTYCACADQdDQgIAAaiAENgIAIANBIGoiA0GAAkcNAAtBgNSEgABBeEGA1ISAAGtBD3FBAEGA1ISAAEEIakEPcRsiA2oiBEEEaiACQUhqIgUgA2siA0EBcjYCAEEAQQAoAvDTgIAANgKk0ICAAEEAIAM2ApTQgIAAQQAgBDYCoNCAgABBgNSEgAAgBWpBODYCBAsCQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAUsNAAJAQQAoAojQgIAAIgZBECAAQRNqQXBxIABBC0kbIgJBA3YiBHYiA0EDcUUNAAJAAkAgA0EBcSAEckEBcyIFQQN0IgRBsNCAgABqIgMgBEG40ICAAGooAgAiBCgCCCICRw0AQQAgBkF+IAV3cTYCiNCAgAAMAQsgAyACNgIIIAIgAzYCDAsgBEEIaiEDIAQgBUEDdCIFQQNyNgIEIAQgBWoiBCAEKAIEQQFyNgIEDAwLIAJBACgCkNCAgAAiB00NAQJAIANFDQACQAJAIAMgBHRBAiAEdCIDQQAgA2tycSIDQQAgA2txQX9qIgMgA0EMdkEQcSIDdiIEQQV2QQhxIgUgA3IgBCAFdiIDQQJ2QQRxIgRyIAMgBHYiA0EBdkECcSIEciADIAR2IgNBAXZBAXEiBHIgAyAEdmoiBEEDdCIDQbDQgIAAaiIFIANBuNCAgABqKAIAIgMoAggiAEcNAEEAIAZBfiAEd3EiBjYCiNCAgAAMAQsgBSAANgIIIAAgBTYCDAsgAyACQQNyNgIEIAMgBEEDdCIEaiAEIAJrIgU2AgAgAyACaiIAIAVBAXI2AgQCQCAHRQ0AIAdBeHFBsNCAgABqIQJBACgCnNCAgAAhBAJAAkAgBkEBIAdBA3Z0IghxDQBBACAGIAhyNgKI0ICAACACIQgMAQsgAigCCCEICyAIIAQ2AgwgAiAENgIIIAQgAjYCDCAEIAg2AggLIANBCGohA0EAIAA2ApzQgIAAQQAgBTYCkNCAgAAMDAtBACgCjNCAgAAiCUUNASAJQQAgCWtxQX9qIgMgA0EMdkEQcSIDdiIEQQV2QQhxIgUgA3IgBCAFdiIDQQJ2QQRxIgRyIAMgBHYiA0EBdkECcSIEciADIAR2IgNBAXZBAXEiBHIgAyAEdmpBAnRBuNKAgABqKAIAIgAoAgRBeHEgAmshBCAAIQUCQANAAkAgBSgCECIDDQAgBUEUaigCACIDRQ0CCyADKAIEQXhxIAJrIgUgBCAFIARJIgUbIQQgAyAAIAUbIQAgAyEFDAALCyAAKAIYIQoCQCAAKAIMIgggAEYNACAAKAIIIgNBACgCmNCAgABJGiAIIAM2AgggAyAINgIMDAsLAkAgAEEUaiIFKAIAIgMNACAAKAIQIgNFDQMgAEEQaiEFCwNAIAUhCyADIghBFGoiBSgCACIDDQAgCEEQaiEFIAgoAhAiAw0ACyALQQA2AgAMCgtBfyECIABBv39LDQAgAEETaiIDQXBxIQJBACgCjNCAgAAiB0UNAEEAIQsCQCACQYACSQ0AQR8hCyACQf///wdLDQAgA0EIdiIDIANBgP4/akEQdkEIcSIDdCIEIARBgOAfakEQdkEEcSIEdCIFIAVBgIAPakEQdkECcSIFdEEPdiADIARyIAVyayIDQQF0IAIgA0EVanZBAXFyQRxqIQsLQQAgAmshBAJAAkACQAJAIAtBAnRBuNKAgABqKAIAIgUNAEEAIQNBACEIDAELQQAhAyACQQBBGSALQQF2ayALQR9GG3QhAEEAIQgDQAJAIAUoAgRBeHEgAmsiBiAETw0AIAYhBCAFIQggBg0AQQAhBCAFIQggBSEDDAMLIAMgBUEUaigCACIGIAYgBSAAQR12QQRxakEQaigCACIFRhsgAyAGGyEDIABBAXQhACAFDQALCwJAIAMgCHINAEEAIQhBAiALdCIDQQAgA2tyIAdxIgNFDQMgA0EAIANrcUF/aiIDIANBDHZBEHEiA3YiBUEFdkEIcSIAIANyIAUgAHYiA0ECdkEEcSIFciADIAV2IgNBAXZBAnEiBXIgAyAFdiIDQQF2QQFxIgVyIAMgBXZqQQJ0QbjSgIAAaigCACEDCyADRQ0BCwNAIAMoAgRBeHEgAmsiBiAESSEAAkAgAygCECIFDQAgA0EUaigCACEFCyAGIAQgABshBCADIAggABshCCAFIQMgBQ0ACwsgCEUNACAEQQAoApDQgIAAIAJrTw0AIAgoAhghCwJAIAgoAgwiACAIRg0AIAgoAggiA0EAKAKY0ICAAEkaIAAgAzYCCCADIAA2AgwMCQsCQCAIQRRqIgUoAgAiAw0AIAgoAhAiA0UNAyAIQRBqIQULA0AgBSEGIAMiAEEUaiIFKAIAIgMNACAAQRBqIQUgACgCECIDDQALIAZBADYCAAwICwJAQQAoApDQgIAAIgMgAkkNAEEAKAKc0ICAACEEAkACQCADIAJrIgVBEEkNACAEIAJqIgAgBUEBcjYCBEEAIAU2ApDQgIAAQQAgADYCnNCAgAAgBCADaiAFNgIAIAQgAkEDcjYCBAwBCyAEIANBA3I2AgQgBCADaiIDIAMoAgRBAXI2AgRBAEEANgKc0ICAAEEAQQA2ApDQgIAACyAEQQhqIQMMCgsCQEEAKAKU0ICAACIAIAJNDQBBACgCoNCAgAAiAyACaiIEIAAgAmsiBUEBcjYCBEEAIAU2ApTQgIAAQQAgBDYCoNCAgAAgAyACQQNyNgIEIANBCGohAwwKCwJAAkBBACgC4NOAgABFDQBBACgC6NOAgAAhBAwBC0EAQn83AuzTgIAAQQBCgICEgICAwAA3AuTTgIAAQQAgAUEMakFwcUHYqtWqBXM2AuDTgIAAQQBBADYC9NOAgABBAEEANgLE04CAAEGAgAQhBAtBACEDAkAgBCACQccAaiIHaiIGQQAgBGsiC3EiCCACSw0AQQBBMDYC+NOAgAAMCgsCQEEAKALA04CAACIDRQ0AAkBBACgCuNOAgAAiBCAIaiIFIARNDQAgBSADTQ0BC0EAIQNBAEEwNgL404CAAAwKC0EALQDE04CAAEEEcQ0EAkACQAJAQQAoAqDQgIAAIgRFDQBByNOAgAAhAwNAAkAgAygCACIFIARLDQAgBSADKAIEaiAESw0DCyADKAIIIgMNAAsLQQAQy4CAgAAiAEF/Rg0FIAghBgJAQQAoAuTTgIAAIgNBf2oiBCAAcUUNACAIIABrIAQgAGpBACADa3FqIQYLIAYgAk0NBSAGQf7///8HSw0FAkBBACgCwNOAgAAiA0UNAEEAKAK404CAACIEIAZqIgUgBE0NBiAFIANLDQYLIAYQy4CAgAAiAyAARw0BDAcLIAYgAGsgC3EiBkH+////B0sNBCAGEMuAgIAAIgAgAygCACADKAIEakYNAyAAIQMLAkAgA0F/Rg0AIAJByABqIAZNDQACQCAHIAZrQQAoAujTgIAAIgRqQQAgBGtxIgRB/v///wdNDQAgAyEADAcLAkAgBBDLgICAAEF/Rg0AIAQgBmohBiADIQAMBwtBACAGaxDLgICAABoMBAsgAyEAIANBf0cNBQwDC0EAIQgMBwtBACEADAULIABBf0cNAgtBAEEAKALE04CAAEEEcjYCxNOAgAALIAhB/v///wdLDQEgCBDLgICAACEAQQAQy4CAgAAhAyAAQX9GDQEgA0F/Rg0BIAAgA08NASADIABrIgYgAkE4ak0NAQtBAEEAKAK404CAACAGaiIDNgK404CAAAJAIANBACgCvNOAgABNDQBBACADNgK804CAAAsCQAJAAkACQEEAKAKg0ICAACIERQ0AQcjTgIAAIQMDQCAAIAMoAgAiBSADKAIEIghqRg0CIAMoAggiAw0ADAMLCwJAAkBBACgCmNCAgAAiA0UNACAAIANPDQELQQAgADYCmNCAgAALQQAhA0EAIAY2AszTgIAAQQAgADYCyNOAgABBAEF/NgKo0ICAAEEAQQAoAuDTgIAANgKs0ICAAEEAQQA2AtTTgIAAA0AgA0HE0ICAAGogA0G40ICAAGoiBDYCACAEIANBsNCAgABqIgU2AgAgA0G80ICAAGogBTYCACADQczQgIAAaiADQcDQgIAAaiIFNgIAIAUgBDYCACADQdTQgIAAaiADQcjQgIAAaiIENgIAIAQgBTYCACADQdDQgIAAaiAENgIAIANBIGoiA0GAAkcNAAsgAEF4IABrQQ9xQQAgAEEIakEPcRsiA2oiBCAGQUhqIgUgA2siA0EBcjYCBEEAQQAoAvDTgIAANgKk0ICAAEEAIAM2ApTQgIAAQQAgBDYCoNCAgAAgACAFakE4NgIEDAILIAMtAAxBCHENACAEIAVJDQAgBCAATw0AIARBeCAEa0EPcUEAIARBCGpBD3EbIgVqIgBBACgClNCAgAAgBmoiCyAFayIFQQFyNgIEIAMgCCAGajYCBEEAQQAoAvDTgIAANgKk0ICAAEEAIAU2ApTQgIAAQQAgADYCoNCAgAAgBCALakE4NgIEDAELAkAgAEEAKAKY0ICAACIITw0AQQAgADYCmNCAgAAgACEICyAAIAZqIQVByNOAgAAhAwJAAkACQAJAAkACQAJAA0AgAygCACAFRg0BIAMoAggiAw0ADAILCyADLQAMQQhxRQ0BC0HI04CAACEDA0ACQCADKAIAIgUgBEsNACAFIAMoAgRqIgUgBEsNAwsgAygCCCEDDAALCyADIAA2AgAgAyADKAIEIAZqNgIEIABBeCAAa0EPcUEAIABBCGpBD3EbaiILIAJBA3I2AgQgBUF4IAVrQQ9xQQAgBUEIakEPcRtqIgYgCyACaiICayEDAkAgBiAERw0AQQAgAjYCoNCAgABBAEEAKAKU0ICAACADaiIDNgKU0ICAACACIANBAXI2AgQMAwsCQCAGQQAoApzQgIAARw0AQQAgAjYCnNCAgABBAEEAKAKQ0ICAACADaiIDNgKQ0ICAACACIANBAXI2AgQgAiADaiADNgIADAMLAkAgBigCBCIEQQNxQQFHDQAgBEF4cSEHAkACQCAEQf8BSw0AIAYoAggiBSAEQQN2IghBA3RBsNCAgABqIgBGGgJAIAYoAgwiBCAFRw0AQQBBACgCiNCAgABBfiAId3E2AojQgIAADAILIAQgAEYaIAQgBTYCCCAFIAQ2AgwMAQsgBigCGCEJAkACQCAGKAIMIgAgBkYNACAGKAIIIgQgCEkaIAAgBDYCCCAEIAA2AgwMAQsCQCAGQRRqIgQoAgAiBQ0AIAZBEGoiBCgCACIFDQBBACEADAELA0AgBCEIIAUiAEEUaiIEKAIAIgUNACAAQRBqIQQgACgCECIFDQALIAhBADYCAAsgCUUNAAJAAkAgBiAGKAIcIgVBAnRBuNKAgABqIgQoAgBHDQAgBCAANgIAIAANAUEAQQAoAozQgIAAQX4gBXdxNgKM0ICAAAwCCyAJQRBBFCAJKAIQIAZGG2ogADYCACAARQ0BCyAAIAk2AhgCQCAGKAIQIgRFDQAgACAENgIQIAQgADYCGAsgBigCFCIERQ0AIABBFGogBDYCACAEIAA2AhgLIAcgA2ohAyAGIAdqIgYoAgQhBAsgBiAEQX5xNgIEIAIgA2ogAzYCACACIANBAXI2AgQCQCADQf8BSw0AIANBeHFBsNCAgABqIQQCQAJAQQAoAojQgIAAIgVBASADQQN2dCIDcQ0AQQAgBSADcjYCiNCAgAAgBCEDDAELIAQoAgghAwsgAyACNgIMIAQgAjYCCCACIAQ2AgwgAiADNgIIDAMLQR8hBAJAIANB////B0sNACADQQh2IgQgBEGA/j9qQRB2QQhxIgR0IgUgBUGA4B9qQRB2QQRxIgV0IgAgAEGAgA9qQRB2QQJxIgB0QQ92IAQgBXIgAHJrIgRBAXQgAyAEQRVqdkEBcXJBHGohBAsgAiAENgIcIAJCADcCECAEQQJ0QbjSgIAAaiEFAkBBACgCjNCAgAAiAEEBIAR0IghxDQAgBSACNgIAQQAgACAIcjYCjNCAgAAgAiAFNgIYIAIgAjYCCCACIAI2AgwMAwsgA0EAQRkgBEEBdmsgBEEfRht0IQQgBSgCACEAA0AgACIFKAIEQXhxIANGDQIgBEEddiEAIARBAXQhBCAFIABBBHFqQRBqIggoAgAiAA0ACyAIIAI2AgAgAiAFNgIYIAIgAjYCDCACIAI2AggMAgsgAEF4IABrQQ9xQQAgAEEIakEPcRsiA2oiCyAGQUhqIgggA2siA0EBcjYCBCAAIAhqQTg2AgQgBCAFQTcgBWtBD3FBACAFQUlqQQ9xG2pBQWoiCCAIIARBEGpJGyIIQSM2AgRBAEEAKALw04CAADYCpNCAgABBACADNgKU0ICAAEEAIAs2AqDQgIAAIAhBEGpBACkC0NOAgAA3AgAgCEEAKQLI04CAADcCCEEAIAhBCGo2AtDTgIAAQQAgBjYCzNOAgABBACAANgLI04CAAEEAQQA2AtTTgIAAIAhBJGohAwNAIANBBzYCACADQQRqIgMgBUkNAAsgCCAERg0DIAggCCgCBEF+cTYCBCAIIAggBGsiADYCACAEIABBAXI2AgQCQCAAQf8BSw0AIABBeHFBsNCAgABqIQMCQAJAQQAoAojQgIAAIgVBASAAQQN2dCIAcQ0AQQAgBSAAcjYCiNCAgAAgAyEFDAELIAMoAgghBQsgBSAENgIMIAMgBDYCCCAEIAM2AgwgBCAFNgIIDAQLQR8hAwJAIABB////B0sNACAAQQh2IgMgA0GA/j9qQRB2QQhxIgN0IgUgBUGA4B9qQRB2QQRxIgV0IgggCEGAgA9qQRB2QQJxIgh0QQ92IAMgBXIgCHJrIgNBAXQgACADQRVqdkEBcXJBHGohAwsgBCADNgIcIARCADcCECADQQJ0QbjSgIAAaiEFAkBBACgCjNCAgAAiCEEBIAN0IgZxDQAgBSAENgIAQQAgCCAGcjYCjNCAgAAgBCAFNgIYIAQgBDYCCCAEIAQ2AgwMBAsgAEEAQRkgA0EBdmsgA0EfRht0IQMgBSgCACEIA0AgCCIFKAIEQXhxIABGDQMgA0EddiEIIANBAXQhAyAFIAhBBHFqQRBqIgYoAgAiCA0ACyAGIAQ2AgAgBCAFNgIYIAQgBDYCDCAEIAQ2AggMAwsgBSgCCCIDIAI2AgwgBSACNgIIIAJBADYCGCACIAU2AgwgAiADNgIICyALQQhqIQMMBQsgBSgCCCIDIAQ2AgwgBSAENgIIIARBADYCGCAEIAU2AgwgBCADNgIIC0EAKAKU0ICAACIDIAJNDQBBACgCoNCAgAAiBCACaiIFIAMgAmsiA0EBcjYCBEEAIAM2ApTQgIAAQQAgBTYCoNCAgAAgBCACQQNyNgIEIARBCGohAwwDC0EAIQNBAEEwNgL404CAAAwCCwJAIAtFDQACQAJAIAggCCgCHCIFQQJ0QbjSgIAAaiIDKAIARw0AIAMgADYCACAADQFBACAHQX4gBXdxIgc2AozQgIAADAILIAtBEEEUIAsoAhAgCEYbaiAANgIAIABFDQELIAAgCzYCGAJAIAgoAhAiA0UNACAAIAM2AhAgAyAANgIYCyAIQRRqKAIAIgNFDQAgAEEUaiADNgIAIAMgADYCGAsCQAJAIARBD0sNACAIIAQgAmoiA0EDcjYCBCAIIANqIgMgAygCBEEBcjYCBAwBCyAIIAJqIgAgBEEBcjYCBCAIIAJBA3I2AgQgACAEaiAENgIAAkAgBEH/AUsNACAEQXhxQbDQgIAAaiEDAkACQEEAKAKI0ICAACIFQQEgBEEDdnQiBHENAEEAIAUgBHI2AojQgIAAIAMhBAwBCyADKAIIIQQLIAQgADYCDCADIAA2AgggACADNgIMIAAgBDYCCAwBC0EfIQMCQCAEQf///wdLDQAgBEEIdiIDIANBgP4/akEQdkEIcSIDdCIFIAVBgOAfakEQdkEEcSIFdCICIAJBgIAPakEQdkECcSICdEEPdiADIAVyIAJyayIDQQF0IAQgA0EVanZBAXFyQRxqIQMLIAAgAzYCHCAAQgA3AhAgA0ECdEG40oCAAGohBQJAIAdBASADdCICcQ0AIAUgADYCAEEAIAcgAnI2AozQgIAAIAAgBTYCGCAAIAA2AgggACAANgIMDAELIARBAEEZIANBAXZrIANBH0YbdCEDIAUoAgAhAgJAA0AgAiIFKAIEQXhxIARGDQEgA0EddiECIANBAXQhAyAFIAJBBHFqQRBqIgYoAgAiAg0ACyAGIAA2AgAgACAFNgIYIAAgADYCDCAAIAA2AggMAQsgBSgCCCIDIAA2AgwgBSAANgIIIABBADYCGCAAIAU2AgwgACADNgIICyAIQQhqIQMMAQsCQCAKRQ0AAkACQCAAIAAoAhwiBUECdEG40oCAAGoiAygCAEcNACADIAg2AgAgCA0BQQAgCUF+IAV3cTYCjNCAgAAMAgsgCkEQQRQgCigCECAARhtqIAg2AgAgCEUNAQsgCCAKNgIYAkAgACgCECIDRQ0AIAggAzYCECADIAg2AhgLIABBFGooAgAiA0UNACAIQRRqIAM2AgAgAyAINgIYCwJAAkAgBEEPSw0AIAAgBCACaiIDQQNyNgIEIAAgA2oiAyADKAIEQQFyNgIEDAELIAAgAmoiBSAEQQFyNgIEIAAgAkEDcjYCBCAFIARqIAQ2AgACQCAHRQ0AIAdBeHFBsNCAgABqIQJBACgCnNCAgAAhAwJAAkBBASAHQQN2dCIIIAZxDQBBACAIIAZyNgKI0ICAACACIQgMAQsgAigCCCEICyAIIAM2AgwgAiADNgIIIAMgAjYCDCADIAg2AggLQQAgBTYCnNCAgABBACAENgKQ0ICAAAsgAEEIaiEDCyABQRBqJICAgIAAIAMLCgAgABDJgICAAAviDQEHfwJAIABFDQAgAEF4aiIBIABBfGooAgAiAkF4cSIAaiEDAkAgAkEBcQ0AIAJBA3FFDQEgASABKAIAIgJrIgFBACgCmNCAgAAiBEkNASACIABqIQACQCABQQAoApzQgIAARg0AAkAgAkH/AUsNACABKAIIIgQgAkEDdiIFQQN0QbDQgIAAaiIGRhoCQCABKAIMIgIgBEcNAEEAQQAoAojQgIAAQX4gBXdxNgKI0ICAAAwDCyACIAZGGiACIAQ2AgggBCACNgIMDAILIAEoAhghBwJAAkAgASgCDCIGIAFGDQAgASgCCCICIARJGiAGIAI2AgggAiAGNgIMDAELAkAgAUEUaiICKAIAIgQNACABQRBqIgIoAgAiBA0AQQAhBgwBCwNAIAIhBSAEIgZBFGoiAigCACIEDQAgBkEQaiECIAYoAhAiBA0ACyAFQQA2AgALIAdFDQECQAJAIAEgASgCHCIEQQJ0QbjSgIAAaiICKAIARw0AIAIgBjYCACAGDQFBAEEAKAKM0ICAAEF+IAR3cTYCjNCAgAAMAwsgB0EQQRQgBygCECABRhtqIAY2AgAgBkUNAgsgBiAHNgIYAkAgASgCECICRQ0AIAYgAjYCECACIAY2AhgLIAEoAhQiAkUNASAGQRRqIAI2AgAgAiAGNgIYDAELIAMoAgQiAkEDcUEDRw0AIAMgAkF+cTYCBEEAIAA2ApDQgIAAIAEgAGogADYCACABIABBAXI2AgQPCyABIANPDQAgAygCBCICQQFxRQ0AAkACQCACQQJxDQACQCADQQAoAqDQgIAARw0AQQAgATYCoNCAgABBAEEAKAKU0ICAACAAaiIANgKU0ICAACABIABBAXI2AgQgAUEAKAKc0ICAAEcNA0EAQQA2ApDQgIAAQQBBADYCnNCAgAAPCwJAIANBACgCnNCAgABHDQBBACABNgKc0ICAAEEAQQAoApDQgIAAIABqIgA2ApDQgIAAIAEgAEEBcjYCBCABIABqIAA2AgAPCyACQXhxIABqIQACQAJAIAJB/wFLDQAgAygCCCIEIAJBA3YiBUEDdEGw0ICAAGoiBkYaAkAgAygCDCICIARHDQBBAEEAKAKI0ICAAEF+IAV3cTYCiNCAgAAMAgsgAiAGRhogAiAENgIIIAQgAjYCDAwBCyADKAIYIQcCQAJAIAMoAgwiBiADRg0AIAMoAggiAkEAKAKY0ICAAEkaIAYgAjYCCCACIAY2AgwMAQsCQCADQRRqIgIoAgAiBA0AIANBEGoiAigCACIEDQBBACEGDAELA0AgAiEFIAQiBkEUaiICKAIAIgQNACAGQRBqIQIgBigCECIEDQALIAVBADYCAAsgB0UNAAJAAkAgAyADKAIcIgRBAnRBuNKAgABqIgIoAgBHDQAgAiAGNgIAIAYNAUEAQQAoAozQgIAAQX4gBHdxNgKM0ICAAAwCCyAHQRBBFCAHKAIQIANGG2ogBjYCACAGRQ0BCyAGIAc2AhgCQCADKAIQIgJFDQAgBiACNgIQIAIgBjYCGAsgAygCFCICRQ0AIAZBFGogAjYCACACIAY2AhgLIAEgAGogADYCACABIABBAXI2AgQgAUEAKAKc0ICAAEcNAUEAIAA2ApDQgIAADwsgAyACQX5xNgIEIAEgAGogADYCACABIABBAXI2AgQLAkAgAEH/AUsNACAAQXhxQbDQgIAAaiECAkACQEEAKAKI0ICAACIEQQEgAEEDdnQiAHENAEEAIAQgAHI2AojQgIAAIAIhAAwBCyACKAIIIQALIAAgATYCDCACIAE2AgggASACNgIMIAEgADYCCA8LQR8hAgJAIABB////B0sNACAAQQh2IgIgAkGA/j9qQRB2QQhxIgJ0IgQgBEGA4B9qQRB2QQRxIgR0IgYgBkGAgA9qQRB2QQJxIgZ0QQ92IAIgBHIgBnJrIgJBAXQgACACQRVqdkEBcXJBHGohAgsgASACNgIcIAFCADcCECACQQJ0QbjSgIAAaiEEAkACQEEAKAKM0ICAACIGQQEgAnQiA3ENACAEIAE2AgBBACAGIANyNgKM0ICAACABIAQ2AhggASABNgIIIAEgATYCDAwBCyAAQQBBGSACQQF2ayACQR9GG3QhAiAEKAIAIQYCQANAIAYiBCgCBEF4cSAARg0BIAJBHXYhBiACQQF0IQIgBCAGQQRxakEQaiIDKAIAIgYNAAsgAyABNgIAIAEgBDYCGCABIAE2AgwgASABNgIIDAELIAQoAggiACABNgIMIAQgATYCCCABQQA2AhggASAENgIMIAEgADYCCAtBAEEAKAKo0ICAAEF/aiIBQX8gARs2AqjQgIAACwsEAAAAC04AAkAgAA0APwBBEHQPCwJAIABB//8DcQ0AIABBf0wNAAJAIABBEHZAACIAQX9HDQBBAEEwNgL404CAAEF/DwsgAEEQdA8LEMqAgIAAAAvyAgIDfwF+AkAgAkUNACAAIAE6AAAgAiAAaiIDQX9qIAE6AAAgAkEDSQ0AIAAgAToAAiAAIAE6AAEgA0F9aiABOgAAIANBfmogAToAACACQQdJDQAgACABOgADIANBfGogAToAACACQQlJDQAgAEEAIABrQQNxIgRqIgMgAUH/AXFBgYKECGwiATYCACADIAIgBGtBfHEiBGoiAkF8aiABNgIAIARBCUkNACADIAE2AgggAyABNgIEIAJBeGogATYCACACQXRqIAE2AgAgBEEZSQ0AIAMgATYCGCADIAE2AhQgAyABNgIQIAMgATYCDCACQXBqIAE2AgAgAkFsaiABNgIAIAJBaGogATYCACACQWRqIAE2AgAgBCADQQRxQRhyIgVrIgJBIEkNACABrUKBgICAEH4hBiADIAVqIQEDQCABIAY3AxggASAGNwMQIAEgBjcDCCABIAY3AwAgAUEgaiEBIAJBYGoiAkEfSw0ACwsgAAsLjkgBAEGACAuGSAEAAAACAAAAAwAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAYAAAAHAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW52YWxpZCBjaGFyIGluIHVybCBxdWVyeQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2JvZHkAQ29udGVudC1MZW5ndGggb3ZlcmZsb3cAQ2h1bmsgc2l6ZSBvdmVyZmxvdwBSZXNwb25zZSBvdmVyZmxvdwBJbnZhbGlkIG1ldGhvZCBmb3IgSFRUUC94LnggcmVxdWVzdABJbnZhbGlkIG1ldGhvZCBmb3IgUlRTUC94LnggcmVxdWVzdABFeHBlY3RlZCBTT1VSQ0UgbWV0aG9kIGZvciBJQ0UveC54IHJlcXVlc3QASW52YWxpZCBjaGFyIGluIHVybCBmcmFnbWVudCBzdGFydABFeHBlY3RlZCBkb3QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9zdGF0dXMASW52YWxpZCByZXNwb25zZSBzdGF0dXMASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucwBVc2VyIGNhbGxiYWNrIGVycm9yAGBvbl9yZXNldGAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2hlYWRlcmAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfYmVnaW5gIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABsb3NlZWVwLWFsaXZlAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgAAAAAAAAAAAAAAAAAAAHJhbnNmZXItZW5jb2RpbmdwZ3JhZGUNCg0KDQpTTQ0KDQpUVFAvQ0UvVFNQLwAAAAAAAAAAAAAAAAECAAEDAAAAAAAAAAAAAAAAAAAAAAAABAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAABAgABAwAAAAAAAAAAAAAAAAAAAAAAAAQBAQUBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAQAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAABAAACAAAAAAAAAAAAAAAAAAAAAAAAAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAgAAAAACAAAAAAAAAAAAAAAAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==' + + +/***/ }), + +/***/ 41891: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.enumToMap = void 0; +function enumToMap(obj) { + const res = {}; + Object.keys(obj).forEach((key) => { + const value = obj[key]; + if (typeof value === 'number') { + res[key] = value; + } + }); + return res; +} +exports.enumToMap = enumToMap; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 66771: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { kClients } = __nccwpck_require__(72785) +const Agent = __nccwpck_require__(7890) +const { + kAgent, + kMockAgentSet, + kMockAgentGet, + kDispatches, + kIsMockActive, + kNetConnect, + kGetNetConnect, + kOptions, + kFactory +} = __nccwpck_require__(24347) +const MockClient = __nccwpck_require__(58687) +const MockPool = __nccwpck_require__(26193) +const { matchValue, buildMockOptions } = __nccwpck_require__(79323) +const { InvalidArgumentError, UndiciError } = __nccwpck_require__(48045) +const Dispatcher = __nccwpck_require__(60412) +const Pluralizer = __nccwpck_require__(78891) +const PendingInterceptorsFormatter = __nccwpck_require__(86823) + +class FakeWeakRef { + constructor (value) { + this.value = value + } + + deref () { + return this.value + } +} + +class MockAgent extends Dispatcher { + constructor (opts) { + super(opts) + + this[kNetConnect] = true + this[kIsMockActive] = true + + // Instantiate Agent and encapsulate + if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) { + throw new InvalidArgumentError('Argument opts.agent must implement Agent') + } + const agent = opts && opts.agent ? opts.agent : new Agent(opts) + this[kAgent] = agent + + this[kClients] = agent[kClients] + this[kOptions] = buildMockOptions(opts) + } + + get (origin) { + let dispatcher = this[kMockAgentGet](origin) + + if (!dispatcher) { + dispatcher = this[kFactory](origin) + this[kMockAgentSet](origin, dispatcher) + } + return dispatcher + } + + dispatch (opts, handler) { + // Call MockAgent.get to perform additional setup before dispatching as normal + this.get(opts.origin) + return this[kAgent].dispatch(opts, handler) + } + + async close () { + await this[kAgent].close() + this[kClients].clear() + } + + deactivate () { + this[kIsMockActive] = false + } + + activate () { + this[kIsMockActive] = true + } + + enableNetConnect (matcher) { + if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) { + if (Array.isArray(this[kNetConnect])) { + this[kNetConnect].push(matcher) + } else { + this[kNetConnect] = [matcher] + } + } else if (typeof matcher === 'undefined') { + this[kNetConnect] = true + } else { + throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.') + } + } + + disableNetConnect () { + this[kNetConnect] = false + } + + // This is required to bypass issues caused by using global symbols - see: + // https://github.com/nodejs/undici/issues/1447 + get isMockActive () { + return this[kIsMockActive] + } + + [kMockAgentSet] (origin, dispatcher) { + this[kClients].set(origin, new FakeWeakRef(dispatcher)) + } + + [kFactory] (origin) { + const mockOptions = Object.assign({ agent: this }, this[kOptions]) + return this[kOptions] && this[kOptions].connections === 1 + ? new MockClient(origin, mockOptions) + : new MockPool(origin, mockOptions) + } + + [kMockAgentGet] (origin) { + // First check if we can immediately find it + const ref = this[kClients].get(origin) + if (ref) { + return ref.deref() + } + + // If the origin is not a string create a dummy parent pool and return to user + if (typeof origin !== 'string') { + const dispatcher = this[kFactory]('http://localhost:9999') + this[kMockAgentSet](origin, dispatcher) + return dispatcher + } + + // If we match, create a pool and assign the same dispatches + for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) { + const nonExplicitDispatcher = nonExplicitRef.deref() + if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) { + const dispatcher = this[kFactory](origin) + this[kMockAgentSet](origin, dispatcher) + dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches] + return dispatcher + } + } + } + + [kGetNetConnect] () { + return this[kNetConnect] + } + + pendingInterceptors () { + const mockAgentClients = this[kClients] + + return Array.from(mockAgentClients.entries()) + .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin }))) + .filter(({ pending }) => pending) + } + + assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) { + const pending = this.pendingInterceptors() + + if (pending.length === 0) { + return + } + + const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length) + + throw new UndiciError(` +${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending: + +${pendingInterceptorsFormatter.format(pending)} +`.trim()) + } +} + +module.exports = MockAgent + + +/***/ }), + +/***/ 58687: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { promisify } = __nccwpck_require__(73837) +const Client = __nccwpck_require__(33598) +const { buildMockDispatch } = __nccwpck_require__(79323) +const { + kDispatches, + kMockAgent, + kClose, + kOriginalClose, + kOrigin, + kOriginalDispatch, + kConnected +} = __nccwpck_require__(24347) +const { MockInterceptor } = __nccwpck_require__(90410) +const Symbols = __nccwpck_require__(72785) +const { InvalidArgumentError } = __nccwpck_require__(48045) + +/** + * MockClient provides an API that extends the Client to influence the mockDispatches. + */ +class MockClient extends Client { + constructor (origin, opts) { + super(origin, opts) + + if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') { + throw new InvalidArgumentError('Argument opts.agent must implement Agent') + } + + this[kMockAgent] = opts.agent + this[kOrigin] = origin + this[kDispatches] = [] + this[kConnected] = 1 + this[kOriginalDispatch] = this.dispatch + this[kOriginalClose] = this.close.bind(this) + + this.dispatch = buildMockDispatch.call(this) + this.close = this[kClose] + } + + get [Symbols.kConnected] () { + return this[kConnected] + } + + /** + * Sets up the base interceptor for mocking replies from undici. + */ + intercept (opts) { + return new MockInterceptor(opts, this[kDispatches]) + } + + async [kClose] () { + await promisify(this[kOriginalClose])() + this[kConnected] = 0 + this[kMockAgent][Symbols.kClients].delete(this[kOrigin]) + } +} + +module.exports = MockClient + + +/***/ }), + +/***/ 50888: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { UndiciError } = __nccwpck_require__(48045) + +class MockNotMatchedError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, MockNotMatchedError) + this.name = 'MockNotMatchedError' + this.message = message || 'The request does not match any registered mock dispatches' + this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED' + } +} + +module.exports = { + MockNotMatchedError +} + + +/***/ }), + +/***/ 90410: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(79323) +const { + kDispatches, + kDispatchKey, + kDefaultHeaders, + kDefaultTrailers, + kContentLength, + kMockDispatch +} = __nccwpck_require__(24347) +const { InvalidArgumentError } = __nccwpck_require__(48045) +const { buildURL } = __nccwpck_require__(83983) + +/** + * Defines the scope API for an interceptor reply + */ +class MockScope { + constructor (mockDispatch) { + this[kMockDispatch] = mockDispatch + } + + /** + * Delay a reply by a set amount in ms. + */ + delay (waitInMs) { + if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) { + throw new InvalidArgumentError('waitInMs must be a valid integer > 0') + } + + this[kMockDispatch].delay = waitInMs + return this + } + + /** + * For a defined reply, never mark as consumed. + */ + persist () { + this[kMockDispatch].persist = true + return this + } + + /** + * Allow one to define a reply for a set amount of matching requests. + */ + times (repeatTimes) { + if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) { + throw new InvalidArgumentError('repeatTimes must be a valid integer > 0') + } + + this[kMockDispatch].times = repeatTimes + return this + } +} + +/** + * Defines an interceptor for a Mock + */ +class MockInterceptor { + constructor (opts, mockDispatches) { + if (typeof opts !== 'object') { + throw new InvalidArgumentError('opts must be an object') + } + if (typeof opts.path === 'undefined') { + throw new InvalidArgumentError('opts.path must be defined') + } + if (typeof opts.method === 'undefined') { + opts.method = 'GET' + } + // See https://github.com/nodejs/undici/issues/1245 + // As per RFC 3986, clients are not supposed to send URI + // fragments to servers when they retrieve a document, + if (typeof opts.path === 'string') { + if (opts.query) { + opts.path = buildURL(opts.path, opts.query) + } else { + // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811 + const parsedURL = new URL(opts.path, 'data://') + opts.path = parsedURL.pathname + parsedURL.search + } + } + if (typeof opts.method === 'string') { + opts.method = opts.method.toUpperCase() + } + + this[kDispatchKey] = buildKey(opts) + this[kDispatches] = mockDispatches + this[kDefaultHeaders] = {} + this[kDefaultTrailers] = {} + this[kContentLength] = false + } + + createMockScopeDispatchData (statusCode, data, responseOptions = {}) { + const responseData = getResponseData(data) + const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {} + const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers } + const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers } + + return { statusCode, data, headers, trailers } + } + + validateReplyParameters (statusCode, data, responseOptions) { + if (typeof statusCode === 'undefined') { + throw new InvalidArgumentError('statusCode must be defined') + } + if (typeof data === 'undefined') { + throw new InvalidArgumentError('data must be defined') + } + if (typeof responseOptions !== 'object') { + throw new InvalidArgumentError('responseOptions must be an object') + } + } + + /** + * Mock an undici request with a defined reply. + */ + reply (replyData) { + // Values of reply aren't available right now as they + // can only be available when the reply callback is invoked. + if (typeof replyData === 'function') { + // We'll first wrap the provided callback in another function, + // this function will properly resolve the data from the callback + // when invoked. + const wrappedDefaultsCallback = (opts) => { + // Our reply options callback contains the parameter for statusCode, data and options. + const resolvedData = replyData(opts) + + // Check if it is in the right format + if (typeof resolvedData !== 'object') { + throw new InvalidArgumentError('reply options callback must return an object') + } + + const { statusCode, data = '', responseOptions = {} } = resolvedData + this.validateReplyParameters(statusCode, data, responseOptions) + // Since the values can be obtained immediately we return them + // from this higher order function that will be resolved later. + return { + ...this.createMockScopeDispatchData(statusCode, data, responseOptions) + } + } + + // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data. + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback) + return new MockScope(newMockDispatch) + } + + // We can have either one or three parameters, if we get here, + // we should have 1-3 parameters. So we spread the arguments of + // this function to obtain the parameters, since replyData will always + // just be the statusCode. + const [statusCode, data = '', responseOptions = {}] = [...arguments] + this.validateReplyParameters(statusCode, data, responseOptions) + + // Send in-already provided data like usual + const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions) + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData) + return new MockScope(newMockDispatch) + } + + /** + * Mock an undici request with a defined error. + */ + replyWithError (error) { + if (typeof error === 'undefined') { + throw new InvalidArgumentError('error must be defined') + } + + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error }) + return new MockScope(newMockDispatch) + } + + /** + * Set default reply headers on the interceptor for subsequent replies + */ + defaultReplyHeaders (headers) { + if (typeof headers === 'undefined') { + throw new InvalidArgumentError('headers must be defined') + } + + this[kDefaultHeaders] = headers + return this + } + + /** + * Set default reply trailers on the interceptor for subsequent replies + */ + defaultReplyTrailers (trailers) { + if (typeof trailers === 'undefined') { + throw new InvalidArgumentError('trailers must be defined') + } + + this[kDefaultTrailers] = trailers + return this + } + + /** + * Set reply content length header for replies on the interceptor + */ + replyContentLength () { + this[kContentLength] = true + return this + } +} + +module.exports.MockInterceptor = MockInterceptor +module.exports.MockScope = MockScope + + +/***/ }), + +/***/ 26193: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { promisify } = __nccwpck_require__(73837) +const Pool = __nccwpck_require__(4634) +const { buildMockDispatch } = __nccwpck_require__(79323) +const { + kDispatches, + kMockAgent, + kClose, + kOriginalClose, + kOrigin, + kOriginalDispatch, + kConnected +} = __nccwpck_require__(24347) +const { MockInterceptor } = __nccwpck_require__(90410) +const Symbols = __nccwpck_require__(72785) +const { InvalidArgumentError } = __nccwpck_require__(48045) + +/** + * MockPool provides an API that extends the Pool to influence the mockDispatches. + */ +class MockPool extends Pool { + constructor (origin, opts) { + super(origin, opts) + + if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') { + throw new InvalidArgumentError('Argument opts.agent must implement Agent') + } + + this[kMockAgent] = opts.agent + this[kOrigin] = origin + this[kDispatches] = [] + this[kConnected] = 1 + this[kOriginalDispatch] = this.dispatch + this[kOriginalClose] = this.close.bind(this) + + this.dispatch = buildMockDispatch.call(this) + this.close = this[kClose] + } + + get [Symbols.kConnected] () { + return this[kConnected] + } + + /** + * Sets up the base interceptor for mocking replies from undici. + */ + intercept (opts) { + return new MockInterceptor(opts, this[kDispatches]) + } + + async [kClose] () { + await promisify(this[kOriginalClose])() + this[kConnected] = 0 + this[kMockAgent][Symbols.kClients].delete(this[kOrigin]) + } +} + +module.exports = MockPool + + +/***/ }), + +/***/ 24347: +/***/ ((module) => { + +"use strict"; + + +module.exports = { + kAgent: Symbol('agent'), + kOptions: Symbol('options'), + kFactory: Symbol('factory'), + kDispatches: Symbol('dispatches'), + kDispatchKey: Symbol('dispatch key'), + kDefaultHeaders: Symbol('default headers'), + kDefaultTrailers: Symbol('default trailers'), + kContentLength: Symbol('content length'), + kMockAgent: Symbol('mock agent'), + kMockAgentSet: Symbol('mock agent set'), + kMockAgentGet: Symbol('mock agent get'), + kMockDispatch: Symbol('mock dispatch'), + kClose: Symbol('close'), + kOriginalClose: Symbol('original agent close'), + kOrigin: Symbol('origin'), + kIsMockActive: Symbol('is mock active'), + kNetConnect: Symbol('net connect'), + kGetNetConnect: Symbol('get net connect'), + kConnected: Symbol('connected') +} + + +/***/ }), + +/***/ 79323: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { MockNotMatchedError } = __nccwpck_require__(50888) +const { + kDispatches, + kMockAgent, + kOriginalDispatch, + kOrigin, + kGetNetConnect +} = __nccwpck_require__(24347) +const { buildURL, nop } = __nccwpck_require__(83983) +const { STATUS_CODES } = __nccwpck_require__(13685) +const { + types: { + isPromise + } +} = __nccwpck_require__(73837) + +function matchValue (match, value) { + if (typeof match === 'string') { + return match === value + } + if (match instanceof RegExp) { + return match.test(value) + } + if (typeof match === 'function') { + return match(value) === true + } + return false +} + +function lowerCaseEntries (headers) { + return Object.fromEntries( + Object.entries(headers).map(([headerName, headerValue]) => { + return [headerName.toLocaleLowerCase(), headerValue] + }) + ) +} + +/** + * @param {import('../../index').Headers|string[]|Record} headers + * @param {string} key + */ +function getHeaderByName (headers, key) { + if (Array.isArray(headers)) { + for (let i = 0; i < headers.length; i += 2) { + if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) { + return headers[i + 1] + } + } + + return undefined + } else if (typeof headers.get === 'function') { + return headers.get(key) + } else { + return lowerCaseEntries(headers)[key.toLocaleLowerCase()] + } +} + +/** @param {string[]} headers */ +function buildHeadersFromArray (headers) { // fetch HeadersList + const clone = headers.slice() + const entries = [] + for (let index = 0; index < clone.length; index += 2) { + entries.push([clone[index], clone[index + 1]]) + } + return Object.fromEntries(entries) +} + +function matchHeaders (mockDispatch, headers) { + if (typeof mockDispatch.headers === 'function') { + if (Array.isArray(headers)) { // fetch HeadersList + headers = buildHeadersFromArray(headers) + } + return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {}) + } + if (typeof mockDispatch.headers === 'undefined') { + return true + } + if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') { + return false + } + + for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) { + const headerValue = getHeaderByName(headers, matchHeaderName) + + if (!matchValue(matchHeaderValue, headerValue)) { + return false + } + } + return true +} + +function safeUrl (path) { + if (typeof path !== 'string') { + return path + } + + const pathSegments = path.split('?') + + if (pathSegments.length !== 2) { + return path + } + + const qp = new URLSearchParams(pathSegments.pop()) + qp.sort() + return [...pathSegments, qp.toString()].join('?') +} + +function matchKey (mockDispatch, { path, method, body, headers }) { + const pathMatch = matchValue(mockDispatch.path, path) + const methodMatch = matchValue(mockDispatch.method, method) + const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true + const headersMatch = matchHeaders(mockDispatch, headers) + return pathMatch && methodMatch && bodyMatch && headersMatch +} + +function getResponseData (data) { + if (Buffer.isBuffer(data)) { + return data + } else if (typeof data === 'object') { + return JSON.stringify(data) + } else { + return data.toString() + } +} + +function getMockDispatch (mockDispatches, key) { + const basePath = key.query ? buildURL(key.path, key.query) : key.path + const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath + + // Match path + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath)) + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`) + } + + // Match method + matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method)) + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`) + } + + // Match body + matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true) + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`) + } + + // Match headers + matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers)) + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`) + } + + return matchedMockDispatches[0] +} + +function addMockDispatch (mockDispatches, key, data) { + const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false } + const replyData = typeof data === 'function' ? { callback: data } : { ...data } + const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } } + mockDispatches.push(newMockDispatch) + return newMockDispatch +} + +function deleteMockDispatch (mockDispatches, key) { + const index = mockDispatches.findIndex(dispatch => { + if (!dispatch.consumed) { + return false + } + return matchKey(dispatch, key) + }) + if (index !== -1) { + mockDispatches.splice(index, 1) + } +} + +function buildKey (opts) { + const { path, method, body, headers, query } = opts + return { + path, + method, + body, + headers, + query + } +} + +function generateKeyValues (data) { + return Object.entries(data).reduce((keyValuePairs, [key, value]) => [ + ...keyValuePairs, + Buffer.from(`${key}`), + Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`) + ], []) +} + +/** + * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status + * @param {number} statusCode + */ +function getStatusText (statusCode) { + return STATUS_CODES[statusCode] || 'unknown' +} + +async function getResponse (body) { + const buffers = [] + for await (const data of body) { + buffers.push(data) + } + return Buffer.concat(buffers).toString('utf8') +} + +/** + * Mock dispatch function used to simulate undici dispatches + */ +function mockDispatch (opts, handler) { + // Get mock dispatch from built key + const key = buildKey(opts) + const mockDispatch = getMockDispatch(this[kDispatches], key) + + mockDispatch.timesInvoked++ + + // Here's where we resolve a callback if a callback is present for the dispatch data. + if (mockDispatch.data.callback) { + mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) } + } + + // Parse mockDispatch data + const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch + const { timesInvoked, times } = mockDispatch + + // If it's used up and not persistent, mark as consumed + mockDispatch.consumed = !persist && timesInvoked >= times + mockDispatch.pending = timesInvoked < times + + // If specified, trigger dispatch error + if (error !== null) { + deleteMockDispatch(this[kDispatches], key) + handler.onError(error) + return true + } + + // Handle the request with a delay if necessary + if (typeof delay === 'number' && delay > 0) { + setTimeout(() => { + handleReply(this[kDispatches]) + }, delay) + } else { + handleReply(this[kDispatches]) + } + + function handleReply (mockDispatches, _data = data) { + // fetch's HeadersList is a 1D string array + const optsHeaders = Array.isArray(opts.headers) + ? buildHeadersFromArray(opts.headers) + : opts.headers + const body = typeof _data === 'function' + ? _data({ ...opts, headers: optsHeaders }) + : _data + + // util.types.isPromise is likely needed for jest. + if (isPromise(body)) { + // If handleReply is asynchronous, throwing an error + // in the callback will reject the promise, rather than + // synchronously throw the error, which breaks some tests. + // Rather, we wait for the callback to resolve if it is a + // promise, and then re-run handleReply with the new body. + body.then((newData) => handleReply(mockDispatches, newData)) + return + } + + const responseData = getResponseData(body) + const responseHeaders = generateKeyValues(headers) + const responseTrailers = generateKeyValues(trailers) + + handler.abort = nop + handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode)) + handler.onData(Buffer.from(responseData)) + handler.onComplete(responseTrailers) + deleteMockDispatch(mockDispatches, key) + } + + function resume () {} + + return true +} + +function buildMockDispatch () { + const agent = this[kMockAgent] + const origin = this[kOrigin] + const originalDispatch = this[kOriginalDispatch] + + return function dispatch (opts, handler) { + if (agent.isMockActive) { + try { + mockDispatch.call(this, opts, handler) + } catch (error) { + if (error instanceof MockNotMatchedError) { + const netConnect = agent[kGetNetConnect]() + if (netConnect === false) { + throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`) + } + if (checkNetConnect(netConnect, origin)) { + originalDispatch.call(this, opts, handler) + } else { + throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`) + } + } else { + throw error + } + } + } else { + originalDispatch.call(this, opts, handler) + } + } +} + +function checkNetConnect (netConnect, origin) { + const url = new URL(origin) + if (netConnect === true) { + return true + } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) { + return true + } + return false +} + +function buildMockOptions (opts) { + if (opts) { + const { agent, ...mockOptions } = opts + return mockOptions + } +} + +module.exports = { + getResponseData, + getMockDispatch, + addMockDispatch, + deleteMockDispatch, + buildKey, + generateKeyValues, + matchValue, + getResponse, + getStatusText, + mockDispatch, + buildMockDispatch, + checkNetConnect, + buildMockOptions, + getHeaderByName +} + + +/***/ }), + +/***/ 86823: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { Transform } = __nccwpck_require__(12781) +const { Console } = __nccwpck_require__(96206) + +/** + * Gets the output of `console.table(…)` as a string. + */ +module.exports = class PendingInterceptorsFormatter { + constructor ({ disableColors } = {}) { + this.transform = new Transform({ + transform (chunk, _enc, cb) { + cb(null, chunk) + } + }) + + this.logger = new Console({ + stdout: this.transform, + inspectOptions: { + colors: !disableColors && !process.env.CI + } + }) + } + + format (pendingInterceptors) { + const withPrettyHeaders = pendingInterceptors.map( + ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + Method: method, + Origin: origin, + Path: path, + 'Status code': statusCode, + Persistent: persist ? '✅' : '❌', + Invocations: timesInvoked, + Remaining: persist ? Infinity : times - timesInvoked + })) + + this.logger.table(withPrettyHeaders) + return this.transform.read().toString() + } +} + + +/***/ }), + +/***/ 78891: +/***/ ((module) => { + +"use strict"; + + +const singulars = { + pronoun: 'it', + is: 'is', + was: 'was', + this: 'this' +} + +const plurals = { + pronoun: 'they', + is: 'are', + was: 'were', + this: 'these' +} + +module.exports = class Pluralizer { + constructor (singular, plural) { + this.singular = singular + this.plural = plural + } + + pluralize (count) { + const one = count === 1 + const keys = one ? singulars : plurals + const noun = one ? this.singular : this.plural + return { ...keys, count, noun } + } +} + + +/***/ }), + +/***/ 68266: +/***/ ((module) => { + +"use strict"; +/* eslint-disable */ + + + +// Extracted from node/lib/internal/fixed_queue.js + +// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two. +const kSize = 2048; +const kMask = kSize - 1; + +// The FixedQueue is implemented as a singly-linked list of fixed-size +// circular buffers. It looks something like this: +// +// head tail +// | | +// v v +// +-----------+ <-----\ +-----------+ <------\ +-----------+ +// | [null] | \----- | next | \------- | next | +// +-----------+ +-----------+ +-----------+ +// | item | <-- bottom | item | <-- bottom | [empty] | +// | item | | item | | [empty] | +// | item | | item | | [empty] | +// | item | | item | | [empty] | +// | item | | item | bottom --> | item | +// | item | | item | | item | +// | ... | | ... | | ... | +// | item | | item | | item | +// | item | | item | | item | +// | [empty] | <-- top | item | | item | +// | [empty] | | item | | item | +// | [empty] | | [empty] | <-- top top --> | [empty] | +// +-----------+ +-----------+ +-----------+ +// +// Or, if there is only one circular buffer, it looks something +// like either of these: +// +// head tail head tail +// | | | | +// v v v v +// +-----------+ +-----------+ +// | [null] | | [null] | +// +-----------+ +-----------+ +// | [empty] | | item | +// | [empty] | | item | +// | item | <-- bottom top --> | [empty] | +// | item | | [empty] | +// | [empty] | <-- top bottom --> | item | +// | [empty] | | item | +// +-----------+ +-----------+ +// +// Adding a value means moving `top` forward by one, removing means +// moving `bottom` forward by one. After reaching the end, the queue +// wraps around. +// +// When `top === bottom` the current queue is empty and when +// `top + 1 === bottom` it's full. This wastes a single space of storage +// but allows much quicker checks. + +class FixedCircularBuffer { + constructor() { + this.bottom = 0; + this.top = 0; + this.list = new Array(kSize); + this.next = null; + } + + isEmpty() { + return this.top === this.bottom; + } + + isFull() { + return ((this.top + 1) & kMask) === this.bottom; + } + + push(data) { + this.list[this.top] = data; + this.top = (this.top + 1) & kMask; + } + + shift() { + const nextItem = this.list[this.bottom]; + if (nextItem === undefined) + return null; + this.list[this.bottom] = undefined; + this.bottom = (this.bottom + 1) & kMask; + return nextItem; + } +} + +module.exports = class FixedQueue { + constructor() { + this.head = this.tail = new FixedCircularBuffer(); + } + + isEmpty() { + return this.head.isEmpty(); + } + + push(data) { + if (this.head.isFull()) { + // Head is full: Creates a new queue, sets the old queue's `.next` to it, + // and sets it as the new main queue. + this.head = this.head.next = new FixedCircularBuffer(); + } + this.head.push(data); + } + + shift() { + const tail = this.tail; + const next = tail.shift(); + if (tail.isEmpty() && tail.next !== null) { + // If there is another queue, it forms the new tail. + this.tail = tail.next; + } + return next; + } +}; + + +/***/ }), + +/***/ 73198: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const DispatcherBase = __nccwpck_require__(74839) +const FixedQueue = __nccwpck_require__(68266) +const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(72785) +const PoolStats = __nccwpck_require__(39689) + +const kClients = Symbol('clients') +const kNeedDrain = Symbol('needDrain') +const kQueue = Symbol('queue') +const kClosedResolve = Symbol('closed resolve') +const kOnDrain = Symbol('onDrain') +const kOnConnect = Symbol('onConnect') +const kOnDisconnect = Symbol('onDisconnect') +const kOnConnectionError = Symbol('onConnectionError') +const kGetDispatcher = Symbol('get dispatcher') +const kAddClient = Symbol('add client') +const kRemoveClient = Symbol('remove client') +const kStats = Symbol('stats') + +class PoolBase extends DispatcherBase { + constructor () { + super() + + this[kQueue] = new FixedQueue() + this[kClients] = [] + this[kQueued] = 0 + + const pool = this + + this[kOnDrain] = function onDrain (origin, targets) { + const queue = pool[kQueue] + + let needDrain = false + + while (!needDrain) { + const item = queue.shift() + if (!item) { + break + } + pool[kQueued]-- + needDrain = !this.dispatch(item.opts, item.handler) + } + + this[kNeedDrain] = needDrain + + if (!this[kNeedDrain] && pool[kNeedDrain]) { + pool[kNeedDrain] = false + pool.emit('drain', origin, [pool, ...targets]) + } + + if (pool[kClosedResolve] && queue.isEmpty()) { + Promise + .all(pool[kClients].map(c => c.close())) + .then(pool[kClosedResolve]) + } + } + + this[kOnConnect] = (origin, targets) => { + pool.emit('connect', origin, [pool, ...targets]) + } + + this[kOnDisconnect] = (origin, targets, err) => { + pool.emit('disconnect', origin, [pool, ...targets], err) + } + + this[kOnConnectionError] = (origin, targets, err) => { + pool.emit('connectionError', origin, [pool, ...targets], err) + } + + this[kStats] = new PoolStats(this) + } + + get [kBusy] () { + return this[kNeedDrain] + } + + get [kConnected] () { + return this[kClients].filter(client => client[kConnected]).length + } + + get [kFree] () { + return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length + } + + get [kPending] () { + let ret = this[kQueued] + for (const { [kPending]: pending } of this[kClients]) { + ret += pending + } + return ret + } + + get [kRunning] () { + let ret = 0 + for (const { [kRunning]: running } of this[kClients]) { + ret += running + } + return ret + } + + get [kSize] () { + let ret = this[kQueued] + for (const { [kSize]: size } of this[kClients]) { + ret += size + } + return ret + } + + get stats () { + return this[kStats] + } + + async [kClose] () { + if (this[kQueue].isEmpty()) { + return Promise.all(this[kClients].map(c => c.close())) + } else { + return new Promise((resolve) => { + this[kClosedResolve] = resolve + }) + } + } + + async [kDestroy] (err) { + while (true) { + const item = this[kQueue].shift() + if (!item) { + break + } + item.handler.onError(err) + } + + return Promise.all(this[kClients].map(c => c.destroy(err))) + } + + [kDispatch] (opts, handler) { + const dispatcher = this[kGetDispatcher]() + + if (!dispatcher) { + this[kNeedDrain] = true + this[kQueue].push({ opts, handler }) + this[kQueued]++ + } else if (!dispatcher.dispatch(opts, handler)) { + dispatcher[kNeedDrain] = true + this[kNeedDrain] = !this[kGetDispatcher]() + } + + return !this[kNeedDrain] + } + + [kAddClient] (client) { + client + .on('drain', this[kOnDrain]) + .on('connect', this[kOnConnect]) + .on('disconnect', this[kOnDisconnect]) + .on('connectionError', this[kOnConnectionError]) + + this[kClients].push(client) + + if (this[kNeedDrain]) { + process.nextTick(() => { + if (this[kNeedDrain]) { + this[kOnDrain](client[kUrl], [this, client]) + } + }) + } + + return this + } + + [kRemoveClient] (client) { + client.close(() => { + const idx = this[kClients].indexOf(client) + if (idx !== -1) { + this[kClients].splice(idx, 1) + } + }) + + this[kNeedDrain] = this[kClients].some(dispatcher => ( + !dispatcher[kNeedDrain] && + dispatcher.closed !== true && + dispatcher.destroyed !== true + )) + } +} + +module.exports = { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kRemoveClient, + kGetDispatcher +} + + +/***/ }), + +/***/ 39689: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(72785) +const kPool = Symbol('pool') + +class PoolStats { + constructor (pool) { + this[kPool] = pool + } + + get connected () { + return this[kPool][kConnected] + } + + get free () { + return this[kPool][kFree] + } + + get pending () { + return this[kPool][kPending] + } + + get queued () { + return this[kPool][kQueued] + } + + get running () { + return this[kPool][kRunning] + } + + get size () { + return this[kPool][kSize] + } +} + +module.exports = PoolStats + + +/***/ }), + +/***/ 4634: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kGetDispatcher +} = __nccwpck_require__(73198) +const Client = __nccwpck_require__(33598) +const { + InvalidArgumentError +} = __nccwpck_require__(48045) +const util = __nccwpck_require__(83983) +const { kUrl, kInterceptors } = __nccwpck_require__(72785) +const buildConnector = __nccwpck_require__(82067) + +const kOptions = Symbol('options') +const kConnections = Symbol('connections') +const kFactory = Symbol('factory') + +function defaultFactory (origin, opts) { + return new Client(origin, opts) +} + +class Pool extends PoolBase { + constructor (origin, { + connections, + factory = defaultFactory, + connect, + connectTimeout, + tls, + maxCachedSessions, + socketPath, + autoSelectFamily, + autoSelectFamilyAttemptTimeout, + allowH2, + ...options + } = {}) { + super() + + if (connections != null && (!Number.isFinite(connections) || connections < 0)) { + throw new InvalidArgumentError('invalid connections') + } + + if (typeof factory !== 'function') { + throw new InvalidArgumentError('factory must be a function.') + } + + if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { + throw new InvalidArgumentError('connect must be a function or an object') + } + + if (typeof connect !== 'function') { + connect = buildConnector({ + ...tls, + maxCachedSessions, + allowH2, + socketPath, + timeout: connectTimeout == null ? 10e3 : connectTimeout, + ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined), + ...connect + }) + } + + this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool) + ? options.interceptors.Pool + : [] + this[kConnections] = connections || null + this[kUrl] = util.parseOrigin(origin) + this[kOptions] = { ...util.deepClone(options), connect, allowH2 } + this[kOptions].interceptors = options.interceptors + ? { ...options.interceptors } + : undefined + this[kFactory] = factory + } + + [kGetDispatcher] () { + let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain]) + + if (dispatcher) { + return dispatcher + } + + if (!this[kConnections] || this[kClients].length < this[kConnections]) { + dispatcher = this[kFactory](this[kUrl], this[kOptions]) + this[kAddClient](dispatcher) + } + + return dispatcher + } +} + +module.exports = Pool + + +/***/ }), + +/***/ 97858: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(72785) +const { URL } = __nccwpck_require__(57310) +const Agent = __nccwpck_require__(7890) +const Pool = __nccwpck_require__(4634) +const DispatcherBase = __nccwpck_require__(74839) +const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(48045) +const buildConnector = __nccwpck_require__(82067) + +const kAgent = Symbol('proxy agent') +const kClient = Symbol('proxy client') +const kProxyHeaders = Symbol('proxy headers') +const kRequestTls = Symbol('request tls settings') +const kProxyTls = Symbol('proxy tls settings') +const kConnectEndpoint = Symbol('connect endpoint function') + +function defaultProtocolPort (protocol) { + return protocol === 'https:' ? 443 : 80 +} + +function buildProxyOptions (opts) { + if (typeof opts === 'string') { + opts = { uri: opts } + } + + if (!opts || !opts.uri) { + throw new InvalidArgumentError('Proxy opts.uri is mandatory') + } + + return { + uri: opts.uri, + protocol: opts.protocol || 'https' + } +} + +function defaultFactory (origin, opts) { + return new Pool(origin, opts) +} + +class ProxyAgent extends DispatcherBase { + constructor (opts) { + super(opts) + this[kProxy] = buildProxyOptions(opts) + this[kAgent] = new Agent(opts) + this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent) + ? opts.interceptors.ProxyAgent + : [] + + if (typeof opts === 'string') { + opts = { uri: opts } + } + + if (!opts || !opts.uri) { + throw new InvalidArgumentError('Proxy opts.uri is mandatory') + } + + const { clientFactory = defaultFactory } = opts + + if (typeof clientFactory !== 'function') { + throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.') + } + + this[kRequestTls] = opts.requestTls + this[kProxyTls] = opts.proxyTls + this[kProxyHeaders] = opts.headers || {} + + if (opts.auth && opts.token) { + throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token') + } else if (opts.auth) { + /* @deprecated in favour of opts.token */ + this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}` + } else if (opts.token) { + this[kProxyHeaders]['proxy-authorization'] = opts.token + } + + const resolvedUrl = new URL(opts.uri) + const { origin, port, host } = resolvedUrl + + const connect = buildConnector({ ...opts.proxyTls }) + this[kConnectEndpoint] = buildConnector({ ...opts.requestTls }) + this[kClient] = clientFactory(resolvedUrl, { connect }) + this[kAgent] = new Agent({ + ...opts, + connect: async (opts, callback) => { + let requestedHost = opts.host + if (!opts.port) { + requestedHost += `:${defaultProtocolPort(opts.protocol)}` + } + try { + const { socket, statusCode } = await this[kClient].connect({ + origin, + port, + path: requestedHost, + signal: opts.signal, + headers: { + ...this[kProxyHeaders], + host + } + }) + if (statusCode !== 200) { + socket.on('error', () => {}).destroy() + callback(new RequestAbortedError('Proxy response !== 200 when HTTP Tunneling')) + } + if (opts.protocol !== 'https:') { + callback(null, socket) + return + } + let servername + if (this[kRequestTls]) { + servername = this[kRequestTls].servername + } else { + servername = opts.servername + } + this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback) + } catch (err) { + callback(err) + } + } + }) + } + + dispatch (opts, handler) { + const { host } = new URL(opts.origin) + const headers = buildHeaders(opts.headers) + throwIfProxyAuthIsSent(headers) + return this[kAgent].dispatch( + { + ...opts, + headers: { + ...headers, + host + } + }, + handler + ) + } + + async [kClose] () { + await this[kAgent].close() + await this[kClient].close() + } + + async [kDestroy] () { + await this[kAgent].destroy() + await this[kClient].destroy() + } +} + +/** + * @param {string[] | Record} headers + * @returns {Record} + */ +function buildHeaders (headers) { + // When using undici.fetch, the headers list is stored + // as an array. + if (Array.isArray(headers)) { + /** @type {Record} */ + const headersPair = {} + + for (let i = 0; i < headers.length; i += 2) { + headersPair[headers[i]] = headers[i + 1] + } + + return headersPair + } + + return headers +} + +/** + * @param {Record} headers + * + * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers + * Nevertheless, it was changed and to avoid a security vulnerability by end users + * this check was created. + * It should be removed in the next major version for performance reasons + */ +function throwIfProxyAuthIsSent (headers) { + const existProxyAuth = headers && Object.keys(headers) + .find((key) => key.toLowerCase() === 'proxy-authorization') + if (existProxyAuth) { + throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor') + } +} + +module.exports = ProxyAgent + + +/***/ }), + +/***/ 29459: +/***/ ((module) => { + +"use strict"; + + +let fastNow = Date.now() +let fastNowTimeout + +const fastTimers = [] + +function onTimeout () { + fastNow = Date.now() + + let len = fastTimers.length + let idx = 0 + while (idx < len) { + const timer = fastTimers[idx] + + if (timer.state === 0) { + timer.state = fastNow + timer.delay + } else if (timer.state > 0 && fastNow >= timer.state) { + timer.state = -1 + timer.callback(timer.opaque) + } + + if (timer.state === -1) { + timer.state = -2 + if (idx !== len - 1) { + fastTimers[idx] = fastTimers.pop() + } else { + fastTimers.pop() + } + len -= 1 + } else { + idx += 1 + } + } + + if (fastTimers.length > 0) { + refreshTimeout() + } +} + +function refreshTimeout () { + if (fastNowTimeout && fastNowTimeout.refresh) { + fastNowTimeout.refresh() + } else { + clearTimeout(fastNowTimeout) + fastNowTimeout = setTimeout(onTimeout, 1e3) + if (fastNowTimeout.unref) { + fastNowTimeout.unref() + } + } +} + +class Timeout { + constructor (callback, delay, opaque) { + this.callback = callback + this.delay = delay + this.opaque = opaque + + // -2 not in timer list + // -1 in timer list but inactive + // 0 in timer list waiting for time + // > 0 in timer list waiting for time to expire + this.state = -2 + + this.refresh() + } + + refresh () { + if (this.state === -2) { + fastTimers.push(this) + if (!fastNowTimeout || fastTimers.length === 1) { + refreshTimeout() + } + } + + this.state = 0 + } + + clear () { + this.state = -1 + } +} + +module.exports = { + setTimeout (callback, delay, opaque) { + return delay < 1e3 + ? setTimeout(callback, delay, opaque) + : new Timeout(callback, delay, opaque) + }, + clearTimeout (timeout) { + if (timeout instanceof Timeout) { + timeout.clear() + } else { + clearTimeout(timeout) + } + } +} + + +/***/ }), + +/***/ 35354: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const diagnosticsChannel = __nccwpck_require__(67643) +const { uid, states } = __nccwpck_require__(19188) +const { + kReadyState, + kSentClose, + kByteParser, + kReceivedClose +} = __nccwpck_require__(37578) +const { fireEvent, failWebsocketConnection } = __nccwpck_require__(25515) +const { CloseEvent } = __nccwpck_require__(52611) +const { makeRequest } = __nccwpck_require__(48359) +const { fetching } = __nccwpck_require__(74881) +const { Headers } = __nccwpck_require__(10554) +const { getGlobalDispatcher } = __nccwpck_require__(21892) +const { kHeadersList } = __nccwpck_require__(72785) + +const channels = {} +channels.open = diagnosticsChannel.channel('undici:websocket:open') +channels.close = diagnosticsChannel.channel('undici:websocket:close') +channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error') + +/** @type {import('crypto')} */ +let crypto +try { + crypto = __nccwpck_require__(6113) +} catch { + +} + +/** + * @see https://websockets.spec.whatwg.org/#concept-websocket-establish + * @param {URL} url + * @param {string|string[]} protocols + * @param {import('./websocket').WebSocket} ws + * @param {(response: any) => void} onEstablish + * @param {Partial} options + */ +function establishWebSocketConnection (url, protocols, ws, onEstablish, options) { + // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s + // scheme is "ws", and to "https" otherwise. + const requestURL = url + + requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:' + + // 2. Let request be a new request, whose URL is requestURL, client is client, + // service-workers mode is "none", referrer is "no-referrer", mode is + // "websocket", credentials mode is "include", cache mode is "no-store" , + // and redirect mode is "error". + const request = makeRequest({ + urlList: [requestURL], + serviceWorkers: 'none', + referrer: 'no-referrer', + mode: 'websocket', + credentials: 'include', + cache: 'no-store', + redirect: 'error' + }) + + // Note: undici extension, allow setting custom headers. + if (options.headers) { + const headersList = new Headers(options.headers)[kHeadersList] + + request.headersList = headersList + } + + // 3. Append (`Upgrade`, `websocket`) to request’s header list. + // 4. Append (`Connection`, `Upgrade`) to request’s header list. + // Note: both of these are handled by undici currently. + // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397 + + // 5. Let keyValue be a nonce consisting of a randomly selected + // 16-byte value that has been forgiving-base64-encoded and + // isomorphic encoded. + const keyValue = crypto.randomBytes(16).toString('base64') + + // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s + // header list. + request.headersList.append('sec-websocket-key', keyValue) + + // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s + // header list. + request.headersList.append('sec-websocket-version', '13') + + // 8. For each protocol in protocols, combine + // (`Sec-WebSocket-Protocol`, protocol) in request’s header + // list. + for (const protocol of protocols) { + request.headersList.append('sec-websocket-protocol', protocol) + } + + // 9. Let permessageDeflate be a user-agent defined + // "permessage-deflate" extension header value. + // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673 + // TODO: enable once permessage-deflate is supported + const permessageDeflate = '' // 'permessage-deflate; 15' + + // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to + // request’s header list. + // request.headersList.append('sec-websocket-extensions', permessageDeflate) + + // 11. Fetch request with useParallelQueue set to true, and + // processResponse given response being these steps: + const controller = fetching({ + request, + useParallelQueue: true, + dispatcher: options.dispatcher ?? getGlobalDispatcher(), + processResponse (response) { + // 1. If response is a network error or its status is not 101, + // fail the WebSocket connection. + if (response.type === 'error' || response.status !== 101) { + failWebsocketConnection(ws, 'Received network error or non-101 status code.') + return + } + + // 2. If protocols is not the empty list and extracting header + // list values given `Sec-WebSocket-Protocol` and response’s + // header list results in null, failure, or the empty byte + // sequence, then fail the WebSocket connection. + if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) { + failWebsocketConnection(ws, 'Server did not respond with sent protocols.') + return + } + + // 3. Follow the requirements stated step 2 to step 6, inclusive, + // of the last set of steps in section 4.1 of The WebSocket + // Protocol to validate response. This either results in fail + // the WebSocket connection or the WebSocket connection is + // established. + + // 2. If the response lacks an |Upgrade| header field or the |Upgrade| + // header field contains a value that is not an ASCII case- + // insensitive match for the value "websocket", the client MUST + // _Fail the WebSocket Connection_. + if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') { + failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".') + return + } + + // 3. If the response lacks a |Connection| header field or the + // |Connection| header field doesn't contain a token that is an + // ASCII case-insensitive match for the value "Upgrade", the client + // MUST _Fail the WebSocket Connection_. + if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') { + failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".') + return + } + + // 4. If the response lacks a |Sec-WebSocket-Accept| header field or + // the |Sec-WebSocket-Accept| contains a value other than the + // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket- + // Key| (as a string, not base64-decoded) with the string "258EAFA5- + // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and + // trailing whitespace, the client MUST _Fail the WebSocket + // Connection_. + const secWSAccept = response.headersList.get('Sec-WebSocket-Accept') + const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64') + if (secWSAccept !== digest) { + failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.') + return + } + + // 5. If the response includes a |Sec-WebSocket-Extensions| header + // field and this header field indicates the use of an extension + // that was not present in the client's handshake (the server has + // indicated an extension not requested by the client), the client + // MUST _Fail the WebSocket Connection_. (The parsing of this + // header field to determine which extensions are requested is + // discussed in Section 9.1.) + const secExtension = response.headersList.get('Sec-WebSocket-Extensions') + + if (secExtension !== null && secExtension !== permessageDeflate) { + failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.') + return + } + + // 6. If the response includes a |Sec-WebSocket-Protocol| header field + // and this header field indicates the use of a subprotocol that was + // not present in the client's handshake (the server has indicated a + // subprotocol not requested by the client), the client MUST _Fail + // the WebSocket Connection_. + const secProtocol = response.headersList.get('Sec-WebSocket-Protocol') + + if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) { + failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.') + return + } + + response.socket.on('data', onSocketData) + response.socket.on('close', onSocketClose) + response.socket.on('error', onSocketError) + + if (channels.open.hasSubscribers) { + channels.open.publish({ + address: response.socket.address(), + protocol: secProtocol, + extensions: secExtension + }) + } + + onEstablish(response) + } + }) + + return controller +} + +/** + * @param {Buffer} chunk + */ +function onSocketData (chunk) { + if (!this.ws[kByteParser].write(chunk)) { + this.pause() + } +} + +/** + * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol + * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4 + */ +function onSocketClose () { + const { ws } = this + + // If the TCP connection was closed after the + // WebSocket closing handshake was completed, the WebSocket connection + // is said to have been closed _cleanly_. + const wasClean = ws[kSentClose] && ws[kReceivedClose] + + let code = 1005 + let reason = '' + + const result = ws[kByteParser].closingInfo + + if (result) { + code = result.code ?? 1005 + reason = result.reason + } else if (!ws[kSentClose]) { + // If _The WebSocket + // Connection is Closed_ and no Close control frame was received by the + // endpoint (such as could occur if the underlying transport connection + // is lost), _The WebSocket Connection Close Code_ is considered to be + // 1006. + code = 1006 + } + + // 1. Change the ready state to CLOSED (3). + ws[kReadyState] = states.CLOSED + + // 2. If the user agent was required to fail the WebSocket + // connection, or if the WebSocket connection was closed + // after being flagged as full, fire an event named error + // at the WebSocket object. + // TODO + + // 3. Fire an event named close at the WebSocket object, + // using CloseEvent, with the wasClean attribute + // initialized to true if the connection closed cleanly + // and false otherwise, the code attribute initialized to + // the WebSocket connection close code, and the reason + // attribute initialized to the result of applying UTF-8 + // decode without BOM to the WebSocket connection close + // reason. + fireEvent('close', ws, CloseEvent, { + wasClean, code, reason + }) + + if (channels.close.hasSubscribers) { + channels.close.publish({ + websocket: ws, + code, + reason + }) + } +} + +function onSocketError (error) { + const { ws } = this + + ws[kReadyState] = states.CLOSING + + if (channels.socketError.hasSubscribers) { + channels.socketError.publish(error) + } + + this.destroy() +} + +module.exports = { + establishWebSocketConnection +} + + +/***/ }), + +/***/ 19188: +/***/ ((module) => { + +"use strict"; + + +// This is a Globally Unique Identifier unique used +// to validate that the endpoint accepts websocket +// connections. +// See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3 +const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11' + +/** @type {PropertyDescriptor} */ +const staticPropertyDescriptors = { + enumerable: true, + writable: false, + configurable: false +} + +const states = { + CONNECTING: 0, + OPEN: 1, + CLOSING: 2, + CLOSED: 3 +} + +const opcodes = { + CONTINUATION: 0x0, + TEXT: 0x1, + BINARY: 0x2, + CLOSE: 0x8, + PING: 0x9, + PONG: 0xA +} + +const maxUnsigned16Bit = 2 ** 16 - 1 // 65535 + +const parserStates = { + INFO: 0, + PAYLOADLENGTH_16: 2, + PAYLOADLENGTH_64: 3, + READ_DATA: 4 +} + +const emptyBuffer = Buffer.allocUnsafe(0) + +module.exports = { + uid, + staticPropertyDescriptors, + states, + opcodes, + maxUnsigned16Bit, + parserStates, + emptyBuffer +} + + +/***/ }), + +/***/ 52611: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { webidl } = __nccwpck_require__(21744) +const { kEnumerableProperty } = __nccwpck_require__(83983) +const { MessagePort } = __nccwpck_require__(71267) + +/** + * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent + */ +class MessageEvent extends Event { + #eventInit + + constructor (type, eventInitDict = {}) { + webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' }) + + type = webidl.converters.DOMString(type) + eventInitDict = webidl.converters.MessageEventInit(eventInitDict) + + super(type, eventInitDict) + + this.#eventInit = eventInitDict + } + + get data () { + webidl.brandCheck(this, MessageEvent) + + return this.#eventInit.data + } + + get origin () { + webidl.brandCheck(this, MessageEvent) + + return this.#eventInit.origin + } + + get lastEventId () { + webidl.brandCheck(this, MessageEvent) + + return this.#eventInit.lastEventId + } + + get source () { + webidl.brandCheck(this, MessageEvent) + + return this.#eventInit.source + } + + get ports () { + webidl.brandCheck(this, MessageEvent) + + if (!Object.isFrozen(this.#eventInit.ports)) { + Object.freeze(this.#eventInit.ports) + } + + return this.#eventInit.ports + } + + initMessageEvent ( + type, + bubbles = false, + cancelable = false, + data = null, + origin = '', + lastEventId = '', + source = null, + ports = [] + ) { + webidl.brandCheck(this, MessageEvent) + + webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' }) + + return new MessageEvent(type, { + bubbles, cancelable, data, origin, lastEventId, source, ports + }) + } +} + +/** + * @see https://websockets.spec.whatwg.org/#the-closeevent-interface + */ +class CloseEvent extends Event { + #eventInit + + constructor (type, eventInitDict = {}) { + webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' }) + + type = webidl.converters.DOMString(type) + eventInitDict = webidl.converters.CloseEventInit(eventInitDict) + + super(type, eventInitDict) + + this.#eventInit = eventInitDict + } + + get wasClean () { + webidl.brandCheck(this, CloseEvent) + + return this.#eventInit.wasClean + } + + get code () { + webidl.brandCheck(this, CloseEvent) + + return this.#eventInit.code + } + + get reason () { + webidl.brandCheck(this, CloseEvent) + + return this.#eventInit.reason + } +} + +// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface +class ErrorEvent extends Event { + #eventInit + + constructor (type, eventInitDict) { + webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' }) + + super(type, eventInitDict) + + type = webidl.converters.DOMString(type) + eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {}) + + this.#eventInit = eventInitDict + } + + get message () { + webidl.brandCheck(this, ErrorEvent) + + return this.#eventInit.message + } + + get filename () { + webidl.brandCheck(this, ErrorEvent) + + return this.#eventInit.filename + } + + get lineno () { + webidl.brandCheck(this, ErrorEvent) + + return this.#eventInit.lineno + } + + get colno () { + webidl.brandCheck(this, ErrorEvent) + + return this.#eventInit.colno + } + + get error () { + webidl.brandCheck(this, ErrorEvent) + + return this.#eventInit.error + } +} + +Object.defineProperties(MessageEvent.prototype, { + [Symbol.toStringTag]: { + value: 'MessageEvent', + configurable: true + }, + data: kEnumerableProperty, + origin: kEnumerableProperty, + lastEventId: kEnumerableProperty, + source: kEnumerableProperty, + ports: kEnumerableProperty, + initMessageEvent: kEnumerableProperty +}) + +Object.defineProperties(CloseEvent.prototype, { + [Symbol.toStringTag]: { + value: 'CloseEvent', + configurable: true + }, + reason: kEnumerableProperty, + code: kEnumerableProperty, + wasClean: kEnumerableProperty +}) + +Object.defineProperties(ErrorEvent.prototype, { + [Symbol.toStringTag]: { + value: 'ErrorEvent', + configurable: true + }, + message: kEnumerableProperty, + filename: kEnumerableProperty, + lineno: kEnumerableProperty, + colno: kEnumerableProperty, + error: kEnumerableProperty +}) + +webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort) + +webidl.converters['sequence'] = webidl.sequenceConverter( + webidl.converters.MessagePort +) + +const eventInit = [ + { + key: 'bubbles', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'cancelable', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'composed', + converter: webidl.converters.boolean, + defaultValue: false + } +] + +webidl.converters.MessageEventInit = webidl.dictionaryConverter([ + ...eventInit, + { + key: 'data', + converter: webidl.converters.any, + defaultValue: null + }, + { + key: 'origin', + converter: webidl.converters.USVString, + defaultValue: '' + }, + { + key: 'lastEventId', + converter: webidl.converters.DOMString, + defaultValue: '' + }, + { + key: 'source', + // Node doesn't implement WindowProxy or ServiceWorker, so the only + // valid value for source is a MessagePort. + converter: webidl.nullableConverter(webidl.converters.MessagePort), + defaultValue: null + }, + { + key: 'ports', + converter: webidl.converters['sequence'], + get defaultValue () { + return [] + } + } +]) + +webidl.converters.CloseEventInit = webidl.dictionaryConverter([ + ...eventInit, + { + key: 'wasClean', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'code', + converter: webidl.converters['unsigned short'], + defaultValue: 0 + }, + { + key: 'reason', + converter: webidl.converters.USVString, + defaultValue: '' + } +]) + +webidl.converters.ErrorEventInit = webidl.dictionaryConverter([ + ...eventInit, + { + key: 'message', + converter: webidl.converters.DOMString, + defaultValue: '' + }, + { + key: 'filename', + converter: webidl.converters.USVString, + defaultValue: '' + }, + { + key: 'lineno', + converter: webidl.converters['unsigned long'], + defaultValue: 0 + }, + { + key: 'colno', + converter: webidl.converters['unsigned long'], + defaultValue: 0 + }, + { + key: 'error', + converter: webidl.converters.any + } +]) + +module.exports = { + MessageEvent, + CloseEvent, + ErrorEvent +} + + +/***/ }), + +/***/ 25444: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { maxUnsigned16Bit } = __nccwpck_require__(19188) + +/** @type {import('crypto')} */ +let crypto +try { + crypto = __nccwpck_require__(6113) +} catch { + +} + +class WebsocketFrameSend { + /** + * @param {Buffer|undefined} data + */ + constructor (data) { + this.frameData = data + this.maskKey = crypto.randomBytes(4) + } + + createFrame (opcode) { + const bodyLength = this.frameData?.byteLength ?? 0 + + /** @type {number} */ + let payloadLength = bodyLength // 0-125 + let offset = 6 + + if (bodyLength > maxUnsigned16Bit) { + offset += 8 // payload length is next 8 bytes + payloadLength = 127 + } else if (bodyLength > 125) { + offset += 2 // payload length is next 2 bytes + payloadLength = 126 + } + + const buffer = Buffer.allocUnsafe(bodyLength + offset) + + // Clear first 2 bytes, everything else is overwritten + buffer[0] = buffer[1] = 0 + buffer[0] |= 0x80 // FIN + buffer[0] = (buffer[0] & 0xF0) + opcode // opcode + + /*! ws. MIT License. Einar Otto Stangvik */ + buffer[offset - 4] = this.maskKey[0] + buffer[offset - 3] = this.maskKey[1] + buffer[offset - 2] = this.maskKey[2] + buffer[offset - 1] = this.maskKey[3] + + buffer[1] = payloadLength + + if (payloadLength === 126) { + buffer.writeUInt16BE(bodyLength, 2) + } else if (payloadLength === 127) { + // Clear extended payload length + buffer[2] = buffer[3] = 0 + buffer.writeUIntBE(bodyLength, 4, 6) + } + + buffer[1] |= 0x80 // MASK + + // mask body + for (let i = 0; i < bodyLength; i++) { + buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4] + } + + return buffer + } +} + +module.exports = { + WebsocketFrameSend +} + + +/***/ }), + +/***/ 11688: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { Writable } = __nccwpck_require__(12781) +const diagnosticsChannel = __nccwpck_require__(67643) +const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(19188) +const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(37578) +const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(25515) +const { WebsocketFrameSend } = __nccwpck_require__(25444) + +// This code was influenced by ws released under the MIT license. +// Copyright (c) 2011 Einar Otto Stangvik +// Copyright (c) 2013 Arnout Kazemier and contributors +// Copyright (c) 2016 Luigi Pinca and contributors + +const channels = {} +channels.ping = diagnosticsChannel.channel('undici:websocket:ping') +channels.pong = diagnosticsChannel.channel('undici:websocket:pong') + +class ByteParser extends Writable { + #buffers = [] + #byteOffset = 0 + + #state = parserStates.INFO + + #info = {} + #fragments = [] + + constructor (ws) { + super() + + this.ws = ws + } + + /** + * @param {Buffer} chunk + * @param {() => void} callback + */ + _write (chunk, _, callback) { + this.#buffers.push(chunk) + this.#byteOffset += chunk.length + + this.run(callback) + } + + /** + * Runs whenever a new chunk is received. + * Callback is called whenever there are no more chunks buffering, + * or not enough bytes are buffered to parse. + */ + run (callback) { + while (true) { + if (this.#state === parserStates.INFO) { + // If there aren't enough bytes to parse the payload length, etc. + if (this.#byteOffset < 2) { + return callback() + } + + const buffer = this.consume(2) + + this.#info.fin = (buffer[0] & 0x80) !== 0 + this.#info.opcode = buffer[0] & 0x0F + + // If we receive a fragmented message, we use the type of the first + // frame to parse the full message as binary/text, when it's terminated + this.#info.originalOpcode ??= this.#info.opcode + + this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION + + if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) { + // Only text and binary frames can be fragmented + failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.') + return + } + + const payloadLength = buffer[1] & 0x7F + + if (payloadLength <= 125) { + this.#info.payloadLength = payloadLength + this.#state = parserStates.READ_DATA + } else if (payloadLength === 126) { + this.#state = parserStates.PAYLOADLENGTH_16 + } else if (payloadLength === 127) { + this.#state = parserStates.PAYLOADLENGTH_64 + } + + if (this.#info.fragmented && payloadLength > 125) { + // A fragmented frame can't be fragmented itself + failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.') + return + } else if ( + (this.#info.opcode === opcodes.PING || + this.#info.opcode === opcodes.PONG || + this.#info.opcode === opcodes.CLOSE) && + payloadLength > 125 + ) { + // Control frames can have a payload length of 125 bytes MAX + failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.') + return + } else if (this.#info.opcode === opcodes.CLOSE) { + if (payloadLength === 1) { + failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.') + return + } + + const body = this.consume(payloadLength) + + this.#info.closeInfo = this.parseCloseBody(false, body) + + if (!this.ws[kSentClose]) { + // If an endpoint receives a Close frame and did not previously send a + // Close frame, the endpoint MUST send a Close frame in response. (When + // sending a Close frame in response, the endpoint typically echos the + // status code it received.) + const body = Buffer.allocUnsafe(2) + body.writeUInt16BE(this.#info.closeInfo.code, 0) + const closeFrame = new WebsocketFrameSend(body) + + this.ws[kResponse].socket.write( + closeFrame.createFrame(opcodes.CLOSE), + (err) => { + if (!err) { + this.ws[kSentClose] = true + } + } + ) + } + + // Upon either sending or receiving a Close control frame, it is said + // that _The WebSocket Closing Handshake is Started_ and that the + // WebSocket connection is in the CLOSING state. + this.ws[kReadyState] = states.CLOSING + this.ws[kReceivedClose] = true + + this.end() + + return + } else if (this.#info.opcode === opcodes.PING) { + // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in + // response, unless it already received a Close frame. + // A Pong frame sent in response to a Ping frame must have identical + // "Application data" + + const body = this.consume(payloadLength) + + if (!this.ws[kReceivedClose]) { + const frame = new WebsocketFrameSend(body) + + this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG)) + + if (channels.ping.hasSubscribers) { + channels.ping.publish({ + payload: body + }) + } + } + + this.#state = parserStates.INFO + + if (this.#byteOffset > 0) { + continue + } else { + callback() + return + } + } else if (this.#info.opcode === opcodes.PONG) { + // A Pong frame MAY be sent unsolicited. This serves as a + // unidirectional heartbeat. A response to an unsolicited Pong frame is + // not expected. + + const body = this.consume(payloadLength) + + if (channels.pong.hasSubscribers) { + channels.pong.publish({ + payload: body + }) + } + + if (this.#byteOffset > 0) { + continue + } else { + callback() + return + } + } + } else if (this.#state === parserStates.PAYLOADLENGTH_16) { + if (this.#byteOffset < 2) { + return callback() + } + + const buffer = this.consume(2) + + this.#info.payloadLength = buffer.readUInt16BE(0) + this.#state = parserStates.READ_DATA + } else if (this.#state === parserStates.PAYLOADLENGTH_64) { + if (this.#byteOffset < 8) { + return callback() + } + + const buffer = this.consume(8) + const upper = buffer.readUInt32BE(0) + + // 2^31 is the maxinimum bytes an arraybuffer can contain + // on 32-bit systems. Although, on 64-bit systems, this is + // 2^53-1 bytes. + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length + // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275 + // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e + if (upper > 2 ** 31 - 1) { + failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.') + return + } + + const lower = buffer.readUInt32BE(4) + + this.#info.payloadLength = (upper << 8) + lower + this.#state = parserStates.READ_DATA + } else if (this.#state === parserStates.READ_DATA) { + if (this.#byteOffset < this.#info.payloadLength) { + // If there is still more data in this chunk that needs to be read + return callback() + } else if (this.#byteOffset >= this.#info.payloadLength) { + // If the server sent multiple frames in a single chunk + + const body = this.consume(this.#info.payloadLength) + + this.#fragments.push(body) + + // If the frame is unfragmented, or a fragmented frame was terminated, + // a message was received + if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) { + const fullMessage = Buffer.concat(this.#fragments) + + websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage) + + this.#info = {} + this.#fragments.length = 0 + } + + this.#state = parserStates.INFO + } + } + + if (this.#byteOffset > 0) { + continue + } else { + callback() + break + } + } + } + + /** + * Take n bytes from the buffered Buffers + * @param {number} n + * @returns {Buffer|null} + */ + consume (n) { + if (n > this.#byteOffset) { + return null + } else if (n === 0) { + return emptyBuffer + } + + if (this.#buffers[0].length === n) { + this.#byteOffset -= this.#buffers[0].length + return this.#buffers.shift() + } + + const buffer = Buffer.allocUnsafe(n) + let offset = 0 + + while (offset !== n) { + const next = this.#buffers[0] + const { length } = next + + if (length + offset === n) { + buffer.set(this.#buffers.shift(), offset) + break + } else if (length + offset > n) { + buffer.set(next.subarray(0, n - offset), offset) + this.#buffers[0] = next.subarray(n - offset) + break + } else { + buffer.set(this.#buffers.shift(), offset) + offset += next.length + } + } + + this.#byteOffset -= n + + return buffer + } + + parseCloseBody (onlyCode, data) { + // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5 + /** @type {number|undefined} */ + let code + + if (data.length >= 2) { + // _The WebSocket Connection Close Code_ is + // defined as the status code (Section 7.4) contained in the first Close + // control frame received by the application + code = data.readUInt16BE(0) + } + + if (onlyCode) { + if (!isValidStatusCode(code)) { + return null + } + + return { code } + } + + // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6 + /** @type {Buffer} */ + let reason = data.subarray(2) + + // Remove BOM + if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) { + reason = reason.subarray(3) + } + + if (code !== undefined && !isValidStatusCode(code)) { + return null + } + + try { + // TODO: optimize this + reason = new TextDecoder('utf-8', { fatal: true }).decode(reason) + } catch { + return null + } + + return { code, reason } + } + + get closingInfo () { + return this.#info.closeInfo + } +} + +module.exports = { + ByteParser +} + + +/***/ }), + +/***/ 37578: +/***/ ((module) => { + +"use strict"; + + +module.exports = { + kWebSocketURL: Symbol('url'), + kReadyState: Symbol('ready state'), + kController: Symbol('controller'), + kResponse: Symbol('response'), + kBinaryType: Symbol('binary type'), + kSentClose: Symbol('sent close'), + kReceivedClose: Symbol('received close'), + kByteParser: Symbol('byte parser') +} + + +/***/ }), + +/***/ 25515: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(37578) +const { states, opcodes } = __nccwpck_require__(19188) +const { MessageEvent, ErrorEvent } = __nccwpck_require__(52611) + +/* globals Blob */ + +/** + * @param {import('./websocket').WebSocket} ws + */ +function isEstablished (ws) { + // If the server's response is validated as provided for above, it is + // said that _The WebSocket Connection is Established_ and that the + // WebSocket Connection is in the OPEN state. + return ws[kReadyState] === states.OPEN +} + +/** + * @param {import('./websocket').WebSocket} ws + */ +function isClosing (ws) { + // Upon either sending or receiving a Close control frame, it is said + // that _The WebSocket Closing Handshake is Started_ and that the + // WebSocket connection is in the CLOSING state. + return ws[kReadyState] === states.CLOSING +} + +/** + * @param {import('./websocket').WebSocket} ws + */ +function isClosed (ws) { + return ws[kReadyState] === states.CLOSED +} + +/** + * @see https://dom.spec.whatwg.org/#concept-event-fire + * @param {string} e + * @param {EventTarget} target + * @param {EventInit | undefined} eventInitDict + */ +function fireEvent (e, target, eventConstructor = Event, eventInitDict) { + // 1. If eventConstructor is not given, then let eventConstructor be Event. + + // 2. Let event be the result of creating an event given eventConstructor, + // in the relevant realm of target. + // 3. Initialize event’s type attribute to e. + const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap + + // 4. Initialize any other IDL attributes of event as described in the + // invocation of this algorithm. + + // 5. Return the result of dispatching event at target, with legacy target + // override flag set if set. + target.dispatchEvent(event) +} + +/** + * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol + * @param {import('./websocket').WebSocket} ws + * @param {number} type Opcode + * @param {Buffer} data application data + */ +function websocketMessageReceived (ws, type, data) { + // 1. If ready state is not OPEN (1), then return. + if (ws[kReadyState] !== states.OPEN) { + return + } + + // 2. Let dataForEvent be determined by switching on type and binary type: + let dataForEvent + + if (type === opcodes.TEXT) { + // -> type indicates that the data is Text + // a new DOMString containing data + try { + dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data) + } catch { + failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.') + return + } + } else if (type === opcodes.BINARY) { + if (ws[kBinaryType] === 'blob') { + // -> type indicates that the data is Binary and binary type is "blob" + // a new Blob object, created in the relevant Realm of the WebSocket + // object, that represents data as its raw data + dataForEvent = new Blob([data]) + } else { + // -> type indicates that the data is Binary and binary type is "arraybuffer" + // a new ArrayBuffer object, created in the relevant Realm of the + // WebSocket object, whose contents are data + dataForEvent = new Uint8Array(data).buffer + } + } + + // 3. Fire an event named message at the WebSocket object, using MessageEvent, + // with the origin attribute initialized to the serialization of the WebSocket + // object’s url's origin, and the data attribute initialized to dataForEvent. + fireEvent('message', ws, MessageEvent, { + origin: ws[kWebSocketURL].origin, + data: dataForEvent + }) +} + +/** + * @see https://datatracker.ietf.org/doc/html/rfc6455 + * @see https://datatracker.ietf.org/doc/html/rfc2616 + * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407 + * @param {string} protocol + */ +function isValidSubprotocol (protocol) { + // If present, this value indicates one + // or more comma-separated subprotocol the client wishes to speak, + // ordered by preference. The elements that comprise this value + // MUST be non-empty strings with characters in the range U+0021 to + // U+007E not including separator characters as defined in + // [RFC2616] and MUST all be unique strings. + if (protocol.length === 0) { + return false + } + + for (const char of protocol) { + const code = char.charCodeAt(0) + + if ( + code < 0x21 || + code > 0x7E || + char === '(' || + char === ')' || + char === '<' || + char === '>' || + char === '@' || + char === ',' || + char === ';' || + char === ':' || + char === '\\' || + char === '"' || + char === '/' || + char === '[' || + char === ']' || + char === '?' || + char === '=' || + char === '{' || + char === '}' || + code === 32 || // SP + code === 9 // HT + ) { + return false + } + } + + return true +} + +/** + * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4 + * @param {number} code + */ +function isValidStatusCode (code) { + if (code >= 1000 && code < 1015) { + return ( + code !== 1004 && // reserved + code !== 1005 && // "MUST NOT be set as a status code" + code !== 1006 // "MUST NOT be set as a status code" + ) + } + + return code >= 3000 && code <= 4999 +} + +/** + * @param {import('./websocket').WebSocket} ws + * @param {string|undefined} reason + */ +function failWebsocketConnection (ws, reason) { + const { [kController]: controller, [kResponse]: response } = ws + + controller.abort() + + if (response?.socket && !response.socket.destroyed) { + response.socket.destroy() + } + + if (reason) { + fireEvent('error', ws, ErrorEvent, { + error: new Error(reason) + }) + } +} + +module.exports = { + isEstablished, + isClosing, + isClosed, + fireEvent, + isValidSubprotocol, + isValidStatusCode, + failWebsocketConnection, + websocketMessageReceived +} + + +/***/ }), + +/***/ 54284: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { webidl } = __nccwpck_require__(21744) +const { DOMException } = __nccwpck_require__(41037) +const { URLSerializer } = __nccwpck_require__(685) +const { getGlobalOrigin } = __nccwpck_require__(71246) +const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(19188) +const { + kWebSocketURL, + kReadyState, + kController, + kBinaryType, + kResponse, + kSentClose, + kByteParser +} = __nccwpck_require__(37578) +const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(25515) +const { establishWebSocketConnection } = __nccwpck_require__(35354) +const { WebsocketFrameSend } = __nccwpck_require__(25444) +const { ByteParser } = __nccwpck_require__(11688) +const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(83983) +const { getGlobalDispatcher } = __nccwpck_require__(21892) +const { types } = __nccwpck_require__(73837) + +let experimentalWarned = false + +// https://websockets.spec.whatwg.org/#interface-definition +class WebSocket extends EventTarget { + #events = { + open: null, + error: null, + close: null, + message: null + } + + #bufferedAmount = 0 + #protocol = '' + #extensions = '' + + /** + * @param {string} url + * @param {string|string[]} protocols + */ + constructor (url, protocols = []) { + super() + + webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' }) + + if (!experimentalWarned) { + experimentalWarned = true + process.emitWarning('WebSockets are experimental, expect them to change at any time.', { + code: 'UNDICI-WS' + }) + } + + const options = webidl.converters['DOMString or sequence or WebSocketInit'](protocols) + + url = webidl.converters.USVString(url) + protocols = options.protocols + + // 1. Let baseURL be this's relevant settings object's API base URL. + const baseURL = getGlobalOrigin() + + // 1. Let urlRecord be the result of applying the URL parser to url with baseURL. + let urlRecord + + try { + urlRecord = new URL(url, baseURL) + } catch (e) { + // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException. + throw new DOMException(e, 'SyntaxError') + } + + // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws". + if (urlRecord.protocol === 'http:') { + urlRecord.protocol = 'ws:' + } else if (urlRecord.protocol === 'https:') { + // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss". + urlRecord.protocol = 'wss:' + } + + // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException. + if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') { + throw new DOMException( + `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`, + 'SyntaxError' + ) + } + + // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError" + // DOMException. + if (urlRecord.hash || urlRecord.href.endsWith('#')) { + throw new DOMException('Got fragment', 'SyntaxError') + } + + // 8. If protocols is a string, set protocols to a sequence consisting + // of just that string. + if (typeof protocols === 'string') { + protocols = [protocols] + } + + // 9. If any of the values in protocols occur more than once or otherwise + // fail to match the requirements for elements that comprise the value + // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket + // protocol, then throw a "SyntaxError" DOMException. + if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) { + throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError') + } + + if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) { + throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError') + } + + // 10. Set this's url to urlRecord. + this[kWebSocketURL] = new URL(urlRecord.href) + + // 11. Let client be this's relevant settings object. + + // 12. Run this step in parallel: + + // 1. Establish a WebSocket connection given urlRecord, protocols, + // and client. + this[kController] = establishWebSocketConnection( + urlRecord, + protocols, + this, + (response) => this.#onConnectionEstablished(response), + options + ) + + // Each WebSocket object has an associated ready state, which is a + // number representing the state of the connection. Initially it must + // be CONNECTING (0). + this[kReadyState] = WebSocket.CONNECTING + + // The extensions attribute must initially return the empty string. + + // The protocol attribute must initially return the empty string. + + // Each WebSocket object has an associated binary type, which is a + // BinaryType. Initially it must be "blob". + this[kBinaryType] = 'blob' + } + + /** + * @see https://websockets.spec.whatwg.org/#dom-websocket-close + * @param {number|undefined} code + * @param {string|undefined} reason + */ + close (code = undefined, reason = undefined) { + webidl.brandCheck(this, WebSocket) + + if (code !== undefined) { + code = webidl.converters['unsigned short'](code, { clamp: true }) + } + + if (reason !== undefined) { + reason = webidl.converters.USVString(reason) + } + + // 1. If code is present, but is neither an integer equal to 1000 nor an + // integer in the range 3000 to 4999, inclusive, throw an + // "InvalidAccessError" DOMException. + if (code !== undefined) { + if (code !== 1000 && (code < 3000 || code > 4999)) { + throw new DOMException('invalid code', 'InvalidAccessError') + } + } + + let reasonByteLength = 0 + + // 2. If reason is present, then run these substeps: + if (reason !== undefined) { + // 1. Let reasonBytes be the result of encoding reason. + // 2. If reasonBytes is longer than 123 bytes, then throw a + // "SyntaxError" DOMException. + reasonByteLength = Buffer.byteLength(reason) + + if (reasonByteLength > 123) { + throw new DOMException( + `Reason must be less than 123 bytes; received ${reasonByteLength}`, + 'SyntaxError' + ) + } + } + + // 3. Run the first matching steps from the following list: + if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) { + // If this's ready state is CLOSING (2) or CLOSED (3) + // Do nothing. + } else if (!isEstablished(this)) { + // If the WebSocket connection is not yet established + // Fail the WebSocket connection and set this's ready state + // to CLOSING (2). + failWebsocketConnection(this, 'Connection was closed before it was established.') + this[kReadyState] = WebSocket.CLOSING + } else if (!isClosing(this)) { + // If the WebSocket closing handshake has not yet been started + // Start the WebSocket closing handshake and set this's ready + // state to CLOSING (2). + // - If neither code nor reason is present, the WebSocket Close + // message must not have a body. + // - If code is present, then the status code to use in the + // WebSocket Close message must be the integer given by code. + // - If reason is also present, then reasonBytes must be + // provided in the Close message after the status code. + + const frame = new WebsocketFrameSend() + + // If neither code nor reason is present, the WebSocket Close + // message must not have a body. + + // If code is present, then the status code to use in the + // WebSocket Close message must be the integer given by code. + if (code !== undefined && reason === undefined) { + frame.frameData = Buffer.allocUnsafe(2) + frame.frameData.writeUInt16BE(code, 0) + } else if (code !== undefined && reason !== undefined) { + // If reason is also present, then reasonBytes must be + // provided in the Close message after the status code. + frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength) + frame.frameData.writeUInt16BE(code, 0) + // the body MAY contain UTF-8-encoded data with value /reason/ + frame.frameData.write(reason, 2, 'utf-8') + } else { + frame.frameData = emptyBuffer + } + + /** @type {import('stream').Duplex} */ + const socket = this[kResponse].socket + + socket.write(frame.createFrame(opcodes.CLOSE), (err) => { + if (!err) { + this[kSentClose] = true + } + }) + + // Upon either sending or receiving a Close control frame, it is said + // that _The WebSocket Closing Handshake is Started_ and that the + // WebSocket connection is in the CLOSING state. + this[kReadyState] = states.CLOSING + } else { + // Otherwise + // Set this's ready state to CLOSING (2). + this[kReadyState] = WebSocket.CLOSING + } + } + + /** + * @see https://websockets.spec.whatwg.org/#dom-websocket-send + * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data + */ + send (data) { + webidl.brandCheck(this, WebSocket) + + webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' }) + + data = webidl.converters.WebSocketSendData(data) + + // 1. If this's ready state is CONNECTING, then throw an + // "InvalidStateError" DOMException. + if (this[kReadyState] === WebSocket.CONNECTING) { + throw new DOMException('Sent before connected.', 'InvalidStateError') + } + + // 2. Run the appropriate set of steps from the following list: + // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1 + // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2 + + if (!isEstablished(this) || isClosing(this)) { + return + } + + /** @type {import('stream').Duplex} */ + const socket = this[kResponse].socket + + // If data is a string + if (typeof data === 'string') { + // If the WebSocket connection is established and the WebSocket + // closing handshake has not yet started, then the user agent + // must send a WebSocket Message comprised of the data argument + // using a text frame opcode; if the data cannot be sent, e.g. + // because it would need to be buffered but the buffer is full, + // the user agent must flag the WebSocket as full and then close + // the WebSocket connection. Any invocation of this method with a + // string argument that does not throw an exception must increase + // the bufferedAmount attribute by the number of bytes needed to + // express the argument as UTF-8. + + const value = Buffer.from(data) + const frame = new WebsocketFrameSend(value) + const buffer = frame.createFrame(opcodes.TEXT) + + this.#bufferedAmount += value.byteLength + socket.write(buffer, () => { + this.#bufferedAmount -= value.byteLength + }) + } else if (types.isArrayBuffer(data)) { + // If the WebSocket connection is established, and the WebSocket + // closing handshake has not yet started, then the user agent must + // send a WebSocket Message comprised of data using a binary frame + // opcode; if the data cannot be sent, e.g. because it would need + // to be buffered but the buffer is full, the user agent must flag + // the WebSocket as full and then close the WebSocket connection. + // The data to be sent is the data stored in the buffer described + // by the ArrayBuffer object. Any invocation of this method with an + // ArrayBuffer argument that does not throw an exception must + // increase the bufferedAmount attribute by the length of the + // ArrayBuffer in bytes. + + const value = Buffer.from(data) + const frame = new WebsocketFrameSend(value) + const buffer = frame.createFrame(opcodes.BINARY) + + this.#bufferedAmount += value.byteLength + socket.write(buffer, () => { + this.#bufferedAmount -= value.byteLength + }) + } else if (ArrayBuffer.isView(data)) { + // If the WebSocket connection is established, and the WebSocket + // closing handshake has not yet started, then the user agent must + // send a WebSocket Message comprised of data using a binary frame + // opcode; if the data cannot be sent, e.g. because it would need to + // be buffered but the buffer is full, the user agent must flag the + // WebSocket as full and then close the WebSocket connection. The + // data to be sent is the data stored in the section of the buffer + // described by the ArrayBuffer object that data references. Any + // invocation of this method with this kind of argument that does + // not throw an exception must increase the bufferedAmount attribute + // by the length of data’s buffer in bytes. + + const ab = Buffer.from(data, data.byteOffset, data.byteLength) + + const frame = new WebsocketFrameSend(ab) + const buffer = frame.createFrame(opcodes.BINARY) + + this.#bufferedAmount += ab.byteLength + socket.write(buffer, () => { + this.#bufferedAmount -= ab.byteLength + }) + } else if (isBlobLike(data)) { + // If the WebSocket connection is established, and the WebSocket + // closing handshake has not yet started, then the user agent must + // send a WebSocket Message comprised of data using a binary frame + // opcode; if the data cannot be sent, e.g. because it would need to + // be buffered but the buffer is full, the user agent must flag the + // WebSocket as full and then close the WebSocket connection. The data + // to be sent is the raw data represented by the Blob object. Any + // invocation of this method with a Blob argument that does not throw + // an exception must increase the bufferedAmount attribute by the size + // of the Blob object’s raw data, in bytes. + + const frame = new WebsocketFrameSend() + + data.arrayBuffer().then((ab) => { + const value = Buffer.from(ab) + frame.frameData = value + const buffer = frame.createFrame(opcodes.BINARY) + + this.#bufferedAmount += value.byteLength + socket.write(buffer, () => { + this.#bufferedAmount -= value.byteLength + }) + }) + } + } + + get readyState () { + webidl.brandCheck(this, WebSocket) + + // The readyState getter steps are to return this's ready state. + return this[kReadyState] + } + + get bufferedAmount () { + webidl.brandCheck(this, WebSocket) + + return this.#bufferedAmount + } + + get url () { + webidl.brandCheck(this, WebSocket) + + // The url getter steps are to return this's url, serialized. + return URLSerializer(this[kWebSocketURL]) + } + + get extensions () { + webidl.brandCheck(this, WebSocket) + + return this.#extensions + } + + get protocol () { + webidl.brandCheck(this, WebSocket) + + return this.#protocol + } + + get onopen () { + webidl.brandCheck(this, WebSocket) + + return this.#events.open + } + + set onopen (fn) { + webidl.brandCheck(this, WebSocket) + + if (this.#events.open) { + this.removeEventListener('open', this.#events.open) + } + + if (typeof fn === 'function') { + this.#events.open = fn + this.addEventListener('open', fn) + } else { + this.#events.open = null + } + } + + get onerror () { + webidl.brandCheck(this, WebSocket) + + return this.#events.error + } + + set onerror (fn) { + webidl.brandCheck(this, WebSocket) + + if (this.#events.error) { + this.removeEventListener('error', this.#events.error) + } + + if (typeof fn === 'function') { + this.#events.error = fn + this.addEventListener('error', fn) + } else { + this.#events.error = null + } + } + + get onclose () { + webidl.brandCheck(this, WebSocket) + + return this.#events.close + } + + set onclose (fn) { + webidl.brandCheck(this, WebSocket) + + if (this.#events.close) { + this.removeEventListener('close', this.#events.close) + } + + if (typeof fn === 'function') { + this.#events.close = fn + this.addEventListener('close', fn) + } else { + this.#events.close = null + } + } + + get onmessage () { + webidl.brandCheck(this, WebSocket) + + return this.#events.message + } + + set onmessage (fn) { + webidl.brandCheck(this, WebSocket) + + if (this.#events.message) { + this.removeEventListener('message', this.#events.message) + } + + if (typeof fn === 'function') { + this.#events.message = fn + this.addEventListener('message', fn) + } else { + this.#events.message = null + } + } + + get binaryType () { + webidl.brandCheck(this, WebSocket) + + return this[kBinaryType] + } + + set binaryType (type) { + webidl.brandCheck(this, WebSocket) + + if (type !== 'blob' && type !== 'arraybuffer') { + this[kBinaryType] = 'blob' + } else { + this[kBinaryType] = type + } + } + + /** + * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol + */ + #onConnectionEstablished (response) { + // processResponse is called when the "response’s header list has been received and initialized." + // once this happens, the connection is open + this[kResponse] = response + + const parser = new ByteParser(this) + parser.on('drain', function onParserDrain () { + this.ws[kResponse].socket.resume() + }) + + response.socket.ws = this + this[kByteParser] = parser + + // 1. Change the ready state to OPEN (1). + this[kReadyState] = states.OPEN + + // 2. Change the extensions attribute’s value to the extensions in use, if + // it is not the null value. + // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1 + const extensions = response.headersList.get('sec-websocket-extensions') + + if (extensions !== null) { + this.#extensions = extensions + } + + // 3. Change the protocol attribute’s value to the subprotocol in use, if + // it is not the null value. + // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9 + const protocol = response.headersList.get('sec-websocket-protocol') + + if (protocol !== null) { + this.#protocol = protocol + } + + // 4. Fire an event named open at the WebSocket object. + fireEvent('open', this) + } +} + +// https://websockets.spec.whatwg.org/#dom-websocket-connecting +WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING +// https://websockets.spec.whatwg.org/#dom-websocket-open +WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN +// https://websockets.spec.whatwg.org/#dom-websocket-closing +WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING +// https://websockets.spec.whatwg.org/#dom-websocket-closed +WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED + +Object.defineProperties(WebSocket.prototype, { + CONNECTING: staticPropertyDescriptors, + OPEN: staticPropertyDescriptors, + CLOSING: staticPropertyDescriptors, + CLOSED: staticPropertyDescriptors, + url: kEnumerableProperty, + readyState: kEnumerableProperty, + bufferedAmount: kEnumerableProperty, + onopen: kEnumerableProperty, + onerror: kEnumerableProperty, + onclose: kEnumerableProperty, + close: kEnumerableProperty, + onmessage: kEnumerableProperty, + binaryType: kEnumerableProperty, + send: kEnumerableProperty, + extensions: kEnumerableProperty, + protocol: kEnumerableProperty, + [Symbol.toStringTag]: { + value: 'WebSocket', + writable: false, + enumerable: false, + configurable: true + } +}) + +Object.defineProperties(WebSocket, { + CONNECTING: staticPropertyDescriptors, + OPEN: staticPropertyDescriptors, + CLOSING: staticPropertyDescriptors, + CLOSED: staticPropertyDescriptors +}) + +webidl.converters['sequence'] = webidl.sequenceConverter( + webidl.converters.DOMString +) + +webidl.converters['DOMString or sequence'] = function (V) { + if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) { + return webidl.converters['sequence'](V) + } + + return webidl.converters.DOMString(V) +} + +// This implements the propsal made in https://github.com/whatwg/websockets/issues/42 +webidl.converters.WebSocketInit = webidl.dictionaryConverter([ + { + key: 'protocols', + converter: webidl.converters['DOMString or sequence'], + get defaultValue () { + return [] + } + }, + { + key: 'dispatcher', + converter: (V) => V, + get defaultValue () { + return getGlobalDispatcher() + } + }, + { + key: 'headers', + converter: webidl.nullableConverter(webidl.converters.HeadersInit) + } +]) + +webidl.converters['DOMString or sequence or WebSocketInit'] = function (V) { + if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) { + return webidl.converters.WebSocketInit(V) + } + + return { protocols: webidl.converters['DOMString or sequence'](V) } +} + +webidl.converters.WebSocketSendData = function (V) { + if (webidl.util.Type(V) === 'Object') { + if (isBlobLike(V)) { + return webidl.converters.Blob(V, { strict: false }) + } + + if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) { + return webidl.converters.BufferSource(V) + } + } + + return webidl.converters.USVString(V) +} + +module.exports = { + WebSocket +} + + +/***/ }), + +/***/ 56733: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getCLI = void 0; +const node_1 = __nccwpck_require__(17374); +const cli_1 = __importDefault(__nccwpck_require__(65461)); +// @ts-ignore +const package_json_1 = __nccwpck_require__(4147); +/** + * CLI Singleton + * + * When the `MOCK` environment variable is set, stub out network calls. + */ +const getCLI = () => { + // Set the User-Agent string. + process.env['SENTRY_PIPELINE'] = `github-action-release/${package_json_1.version}`; + const cli = new cli_1.default(null, { + headers: Object.assign({}, (0, node_1.getTraceData)()), + }).releases; + if (process.env['MOCK']) { + cli.execute = (args, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + live) => __awaiter(void 0, void 0, void 0, function* () { + return Promise.resolve(args.join(' ')); + }); + } + return cli; +}; +exports.getCLI = getCLI; + + +/***/ }), + +/***/ 70399: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const Sentry = __importStar(__nccwpck_require__(17374)); +const core = __importStar(__nccwpck_require__(42186)); +const cli_1 = __nccwpck_require__(56733); +const options = __importStar(__nccwpck_require__(26159)); +const process = __importStar(__nccwpck_require__(77282)); +const telemetry_1 = __nccwpck_require__(12417); +(0, telemetry_1.withTelemetry)({ + enabled: (0, telemetry_1.isTelemetryEnabled)(), +}, () => __awaiter(void 0, void 0, void 0, function* () { + try { + const workingDirectory = options.getWorkingDirectory(); + const currentWorkingDirectory = process.cwd(); + if (workingDirectory) { + process.chdir(workingDirectory); + } + // Validate options first so we can fail early. + options.checkEnvironmentVariables(); + const environment = options.getEnvironment(); + const inject = options.getBooleanOption('inject', false); + const sourcemaps = options.getSourcemaps(); + const dist = options.getDist(); + const shouldFinalize = options.getBooleanOption('finalize', true); + const ignoreMissing = options.getBooleanOption('ignore_missing', false); + const ignoreEmpty = options.getBooleanOption('ignore_empty', false); + const deployStartedAtOption = options.getStartedAt(); + const setCommitsOption = options.getSetCommitsOption(); + const projects = options.getProjects(); + const urlPrefix = options.getUrlPrefixOption(); + const stripCommonPrefix = options.getBooleanOption('strip_common_prefix', false); + const version = yield options.getVersion(); + if (projects.length === 1) { + Sentry.setTag('project', projects[0]); + } + else { + Sentry.setTag('projects', projects.join(',')); + } + core.debug(`Version is ${version}`); + yield (0, cli_1.getCLI)().new(version, { projects }); + Sentry.setTag('set-commits', setCommitsOption); + if (setCommitsOption !== 'skip') { + yield (0, telemetry_1.traceStep)('set-commits', () => __awaiter(void 0, void 0, void 0, function* () { + core.debug(`Setting commits with option '${setCommitsOption}'`); + yield (0, cli_1.getCLI)().setCommits(version, { + auto: true, + ignoreMissing, + ignoreEmpty, + }); + })); + } + Sentry.setTag('sourcemaps', sourcemaps.length > 0); + Sentry.setTag('inject', inject); + if (sourcemaps.length) { + if (inject) { + yield (0, telemetry_1.traceStep)('inject-debug-ids', () => __awaiter(void 0, void 0, void 0, function* () { + core.debug(`Injecting Debug IDs`); + // Unfortunately, @sentry/cli does not yet have an alias for inject + yield (0, cli_1.getCLI)().execute(['sourcemaps', 'inject', ...sourcemaps], true); + })); + } + yield (0, telemetry_1.traceStep)('upload-sourcemaps', () => __awaiter(void 0, void 0, void 0, function* () { + core.debug(`Adding sourcemaps`); + yield Promise.all(projects.map((project) => __awaiter(void 0, void 0, void 0, function* () { + // upload source maps can only do one project at a time + const localProjects = [project]; + const sourceMapOptions = { + include: sourcemaps, + projects: localProjects, + dist, + urlPrefix, + stripCommonPrefix, + }; + return (0, cli_1.getCLI)().uploadSourceMaps(version, sourceMapOptions); + }))); + Sentry.setTag('sourcemaps-uploaded', true); + })); + } + if (environment) { + yield (0, telemetry_1.traceStep)('add-environment', () => __awaiter(void 0, void 0, void 0, function* () { + core.debug(`Adding deploy to release`); + yield (0, cli_1.getCLI)().newDeploy(version, Object.assign({ env: environment }, (deployStartedAtOption && { started: deployStartedAtOption }))); + })); + } + Sentry.setTag('finalize', shouldFinalize); + if (shouldFinalize) { + yield (0, telemetry_1.traceStep)('finalizing-release', () => __awaiter(void 0, void 0, void 0, function* () { + core.debug(`Finalizing the release`); + yield (0, cli_1.getCLI)().finalize(version); + Sentry.setTag('finalized', true); + })); + } + if (workingDirectory) { + process.chdir(currentWorkingDirectory); + } + core.debug(`Done`); + core.setOutput('version', version); + } + catch (error) { + core.setFailed(error.message); + throw error; + } +})); + + +/***/ }), + +/***/ 26159: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getWorkingDirectory = exports.getUrlPrefixOption = exports.getProjects = exports.checkEnvironmentVariables = exports.getSetCommitsOption = exports.getBooleanOption = exports.getDist = exports.getSourcemaps = exports.getStartedAt = exports.getEnvironment = exports.getVersion = void 0; +const core = __importStar(__nccwpck_require__(42186)); +const cli_1 = __nccwpck_require__(56733); +/** + * Get the release version string from parameter or propose one. + * @throws + * @returns Promise + */ +const getVersion = () => __awaiter(void 0, void 0, void 0, function* () { + const versionOption = core.getInput('version'); + const versionPrefixOption = core.getInput('version_prefix'); + let version = ''; + if (versionOption) { + // If the users passes in `${{github.ref}}, then it will have an unwanted prefix. + version = versionOption.replace(/^(refs\/tags\/)/, ''); + } + else { + core.debug('Version not provided, proposing one...'); + version = yield (0, cli_1.getCLI)().proposeVersion(); + } + if (versionPrefixOption) { + version = `${versionPrefixOption}${version}`; + } + return version; +}); +exports.getVersion = getVersion; +/** + * Get `environment`, a required parameter. + * @throws + * @returns string + */ +const getEnvironment = () => { + return core.getInput('environment'); +}; +exports.getEnvironment = getEnvironment; +/** + * Optionally get a UNIX timestamp of when the deployment started. + * Input timestamp may also be ISO 8601. + * + * @throws + * @returns number + */ +const getStartedAt = () => { + const startedAtOption = core.getInput('started_at'); + if (!startedAtOption) { + return null; + } + // In sentry-cli, we parse integer first. + const isStartedAtAnInteger = /^-?[\d]+$/.test(startedAtOption); + const startedAtTimestamp = parseInt(startedAtOption); + const startedAt8601 = Math.floor(Date.parse(startedAtOption) / 1000); + let outputTimestamp; + if (isStartedAtAnInteger && !isNaN(startedAtTimestamp)) { + outputTimestamp = startedAtTimestamp; + } + else if (!isNaN(startedAt8601)) { + outputTimestamp = startedAt8601; + } + if (!outputTimestamp || outputTimestamp < 0) { + throw new Error('started_at not in valid format. Unix timestamp or ISO 8601 date expected'); + } + return outputTimestamp; +}; +exports.getStartedAt = getStartedAt; +/** + * Source maps are optional, but there may be several as a space-separated list. + * @returns string[] + */ +const getSourcemaps = () => { + const sourcemapsOption = core.getInput('sourcemaps'); + if (!sourcemapsOption) { + return []; + } + return sourcemapsOption.split(' '); +}; +exports.getSourcemaps = getSourcemaps; +/** + * Dist is optional, but should be a string when provided. + * @returns string + */ +const getDist = () => { + const distOption = core.getInput('dist'); + if (!distOption) { + return undefined; + } + return distOption; +}; +exports.getDist = getDist; +/** + * Fetch boolean option from input. Throws error if option value is not a boolean. + * @param input string + * @param defaultValue boolean + * @returns boolean + */ +const getBooleanOption = (input, defaultValue) => { + const option = core.getInput(input); + if (!option) { + return defaultValue; + } + const value = option.trim().toLowerCase(); + switch (value) { + case 'true': + case '1': + return true; + case 'false': + case '0': + return false; + } + throw Error(`${input} is not a boolean`); +}; +exports.getBooleanOption = getBooleanOption; +const getSetCommitsOption = () => { + let setCommitOption = core.getInput('set_commits'); + // default to auto + if (!setCommitOption) { + return 'auto'; + } + // convert to lower case + setCommitOption = setCommitOption.toLowerCase(); + switch (setCommitOption) { + case 'auto': + return 'auto'; + case 'skip': + return 'skip'; + default: + throw Error('set_commits must be "auto" or "skip"'); + } +}; +exports.getSetCommitsOption = getSetCommitsOption; +/** + * Check for required environment variables. + */ +const checkEnvironmentVariables = () => { + if (process.env['MOCK']) { + // Set environment variables for mock runs if they aren't already + for (const variable of [ + 'SENTRY_AUTH_TOKEN', + 'SENTRY_ORG', + 'SENTRY_PROJECT', + ]) { + if (!(variable in process.env)) { + process.env[variable] = variable; + } + } + } + if (!process.env['SENTRY_ORG']) { + throw Error('Environment variable SENTRY_ORG is missing an organization slug'); + } + if (!process.env['SENTRY_AUTH_TOKEN']) { + throw Error('Environment variable SENTRY_AUTH_TOKEN is missing an auth token'); + } +}; +exports.checkEnvironmentVariables = checkEnvironmentVariables; +const getProjects = () => { + const projectsOption = core.getInput('projects') || ''; + const projects = projectsOption + .split(' ') + .map(proj => proj.trim()) + .filter(proj => !!proj); + if (projects.length > 0) { + return projects; + } + const project = process.env['SENTRY_PROJECT']; + if (!project) { + throw Error('Environment variable SENTRY_PROJECT is missing a project slug and no projects are specified with the "projects" option'); + } + return [project]; +}; +exports.getProjects = getProjects; +const getUrlPrefixOption = () => { + return core.getInput('url_prefix'); +}; +exports.getUrlPrefixOption = getUrlPrefixOption; +const getWorkingDirectory = () => { + // The action runs inside `github.action_path` and as such + // doesn't automatically have access to the user's git + // In case users don't provide their own `working_directory` + // we use `GITHUB_WORKSPACE` which is at the top of the repo. + return (core.getInput('working_directory') || process.env.GITHUB_WORKSPACE || ''); +}; +exports.getWorkingDirectory = getWorkingDirectory; + + +/***/ }), + +/***/ 12417: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isTelemetryEnabled = exports.isSelfHosted = exports.safeFlush = exports.traceStep = exports.updateProgress = exports.withTelemetry = void 0; +const ciOptions = __importStar(__nccwpck_require__(26159)); +const Sentry = __importStar(__nccwpck_require__(17374)); +const package_json_1 = __importDefault(__nccwpck_require__(4147)); +const SENTRY_SAAS_HOSTNAME = 'sentry.io'; +/** + * Initializes Sentry and wraps the given callback + * in a span. + */ +function withTelemetry(options, callback) { + return __awaiter(this, void 0, void 0, function* () { + Sentry.initWithoutDefaultIntegrations({ + dsn: 'https://2172f0c14072ba401de59317df8ded93@o1.ingest.us.sentry.io/4508608809533441', + enabled: options.enabled, + environment: `production-sentry-github-action`, + tracesSampleRate: 1, + sampleRate: 1, + release: package_json_1.default.version, + integrations: [Sentry.httpIntegration()], + tracePropagationTargets: ['sentry.io/api'], + }); + const session = Sentry.startSession(); + const org = process.env['SENTRY_ORG']; + Sentry.setUser({ id: org }); + Sentry.setTag('organization', org); + Sentry.setTag('node', process.version); + Sentry.setTag('platform', process.platform); + try { + return yield Sentry.startSpan({ + name: 'sentry-github-action-execution', + op: 'action.flow', + }, () => __awaiter(this, void 0, void 0, function* () { + updateProgress('start'); + const res = yield callback(); + updateProgress('finished'); + return res; + })); + } + catch (e) { + session.status = 'crashed'; + Sentry.captureException('Error during sentry-github-action execution.'); + throw e; + } + finally { + Sentry.endSession(); + yield safeFlush(); + } + }); +} +exports.withTelemetry = withTelemetry; +/** + * Sets the `progress` tag to a given step. + */ +function updateProgress(step) { + Sentry.setTag('progress', step); +} +exports.updateProgress = updateProgress; +/** + * Wraps the given callback in a span. + */ +function traceStep(step, callback) { + updateProgress(step); + return Sentry.startSpan({ name: step, op: 'action.step' }, () => callback()); +} +exports.traceStep = traceStep; +/** + * Flushing can fail, we never want to crash because of telemetry. + */ +function safeFlush() { + return __awaiter(this, void 0, void 0, function* () { + try { + yield Sentry.flush(3000); + } + catch (_a) { + // Noop when flushing fails. + // We don't even need to log anything because there's likely nothing the user can do and they likely will not care. + } + }); +} +exports.safeFlush = safeFlush; +/** + * Check whether the user is self-hosting Sentry. + */ +function isSelfHosted() { + const url = new URL(process.env['SENTRY_URL'] || `https://${SENTRY_SAAS_HOSTNAME}`); + return url.hostname !== SENTRY_SAAS_HOSTNAME; +} +exports.isSelfHosted = isSelfHosted; +/** + * Determine if telemetry should be enabled. + */ +function isTelemetryEnabled() { + return (!ciOptions.getBooleanOption('disable_telemetry', false) && !isSelfHosted()); +} +exports.isTelemetryEnabled = isTelemetryEnabled; + + +/***/ }), + +/***/ 65461: +/***/ ((module) => { + +"use strict"; +module.exports = require("@sentry/cli"); + +/***/ }), + +/***/ 39491: +/***/ ((module) => { + +"use strict"; +module.exports = require("assert"); + +/***/ }), + +/***/ 50852: +/***/ ((module) => { + +"use strict"; +module.exports = require("async_hooks"); + +/***/ }), + +/***/ 14300: +/***/ ((module) => { + +"use strict"; +module.exports = require("buffer"); + +/***/ }), + +/***/ 32081: +/***/ ((module) => { + +"use strict"; +module.exports = require("child_process"); + +/***/ }), + +/***/ 96206: +/***/ ((module) => { + +"use strict"; +module.exports = require("console"); + +/***/ }), + +/***/ 6113: +/***/ ((module) => { + +"use strict"; +module.exports = require("crypto"); + +/***/ }), + +/***/ 67643: +/***/ ((module) => { + +"use strict"; +module.exports = require("diagnostics_channel"); + +/***/ }), + +/***/ 82361: +/***/ ((module) => { + +"use strict"; +module.exports = require("events"); + +/***/ }), + +/***/ 57147: +/***/ ((module) => { + +"use strict"; +module.exports = require("fs"); + +/***/ }), + +/***/ 13685: +/***/ ((module) => { + +"use strict"; +module.exports = require("http"); + +/***/ }), + +/***/ 85158: +/***/ ((module) => { + +"use strict"; +module.exports = require("http2"); + +/***/ }), + +/***/ 95687: +/***/ ((module) => { + +"use strict"; +module.exports = require("https"); + +/***/ }), + +/***/ 98188: +/***/ ((module) => { + +"use strict"; +module.exports = require("module"); + +/***/ }), + +/***/ 41808: +/***/ ((module) => { + +"use strict"; +module.exports = require("net"); + +/***/ }), + +/***/ 17718: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:child_process"); + +/***/ }), + +/***/ 65714: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:diagnostics_channel"); + +/***/ }), + +/***/ 15673: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:events"); + +/***/ }), + +/***/ 87561: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:fs"); + +/***/ }), + +/***/ 88849: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:http"); + +/***/ }), + +/***/ 22286: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:https"); + +/***/ }), + +/***/ 85690: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:inspector"); + +/***/ }), + +/***/ 87503: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:net"); + +/***/ }), + +/***/ 70612: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:os"); + +/***/ }), + +/***/ 49411: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:path"); + +/***/ }), + +/***/ 51747: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:readline"); + +/***/ }), + +/***/ 84492: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:stream"); + +/***/ }), + +/***/ 31764: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:tls"); + +/***/ }), + +/***/ 47261: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:util"); + +/***/ }), + +/***/ 24086: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:worker_threads"); + +/***/ }), + +/***/ 65628: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:zlib"); + +/***/ }), + +/***/ 22037: +/***/ ((module) => { + +"use strict"; +module.exports = require("os"); + +/***/ }), + +/***/ 71017: +/***/ ((module) => { + +"use strict"; +module.exports = require("path"); + +/***/ }), + +/***/ 4074: +/***/ ((module) => { + +"use strict"; +module.exports = require("perf_hooks"); + +/***/ }), + +/***/ 77282: +/***/ ((module) => { + +"use strict"; +module.exports = require("process"); + +/***/ }), + +/***/ 63477: +/***/ ((module) => { + +"use strict"; +module.exports = require("querystring"); + +/***/ }), + +/***/ 12781: +/***/ ((module) => { + +"use strict"; +module.exports = require("stream"); + +/***/ }), + +/***/ 35356: +/***/ ((module) => { + +"use strict"; +module.exports = require("stream/web"); + +/***/ }), + +/***/ 71576: +/***/ ((module) => { + +"use strict"; +module.exports = require("string_decoder"); + +/***/ }), + +/***/ 39512: +/***/ ((module) => { + +"use strict"; +module.exports = require("timers"); + +/***/ }), + +/***/ 24404: +/***/ ((module) => { + +"use strict"; +module.exports = require("tls"); + +/***/ }), + +/***/ 76224: +/***/ ((module) => { + +"use strict"; +module.exports = require("tty"); + +/***/ }), + +/***/ 57310: +/***/ ((module) => { + +"use strict"; +module.exports = require("url"); + +/***/ }), + +/***/ 73837: +/***/ ((module) => { + +"use strict"; +module.exports = require("util"); + +/***/ }), + +/***/ 29830: +/***/ ((module) => { + +"use strict"; +module.exports = require("util/types"); + +/***/ }), + +/***/ 71267: +/***/ ((module) => { + +"use strict"; +module.exports = require("worker_threads"); + +/***/ }), + +/***/ 59796: +/***/ ((module) => { + +"use strict"; +module.exports = require("zlib"); + +/***/ }), + +/***/ 78154: +/***/ ((module) => { + +"use strict"; +module.exports = JSON.parse('{"assert":true,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16","async_hooks":">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],"buffer_ieee754":">= 0.5 && < 0.9.7","buffer":true,"node:buffer":[">= 14.18 && < 15",">= 16"],"child_process":true,"node:child_process":[">= 14.18 && < 15",">= 16"],"cluster":">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],"console":true,"node:console":[">= 14.18 && < 15",">= 16"],"constants":true,"node:constants":[">= 14.18 && < 15",">= 16"],"crypto":true,"node:crypto":[">= 14.18 && < 15",">= 16"],"_debug_agent":">= 1 && < 8","_debugger":"< 8","dgram":true,"node:dgram":[">= 14.18 && < 15",">= 16"],"diagnostics_channel":[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],"dns":true,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16","domain":">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],"events":true,"node:events":[">= 14.18 && < 15",">= 16"],"freelist":"< 6","fs":true,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],"_http_agent":">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],"_http_client":">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],"_http_common":">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],"_http_incoming":">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],"_http_outgoing":">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],"_http_server":">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],"http":true,"node:http":[">= 14.18 && < 15",">= 16"],"http2":">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],"https":true,"node:https":[">= 14.18 && < 15",">= 16"],"inspector":">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],"_linklist":"< 8","module":true,"node:module":[">= 14.18 && < 15",">= 16"],"net":true,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12","os":true,"node:os":[">= 14.18 && < 15",">= 16"],"path":true,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16","perf_hooks":">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],"process":">= 1","node:process":[">= 14.18 && < 15",">= 16"],"punycode":">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],"querystring":true,"node:querystring":[">= 14.18 && < 15",">= 16"],"readline":true,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17","repl":true,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],"smalloc":">= 0.11.5 && < 3","node:sqlite":[">= 22.13 && < 23",">= 23.4"],"_stream_duplex":">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],"_stream_transform":">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],"_stream_wrap":">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],"_stream_passthrough":">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],"_stream_readable":">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],"_stream_writable":">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],"stream":true,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5","string_decoder":true,"node:string_decoder":[">= 14.18 && < 15",">= 16"],"sys":[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],"timers":true,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16","_tls_common":">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],"_tls_legacy":">= 0.11.3 && < 10","_tls_wrap":">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],"tls":true,"node:tls":[">= 14.18 && < 15",">= 16"],"trace_events":">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],"tty":true,"node:tty":[">= 14.18 && < 15",">= 16"],"url":true,"node:url":[">= 14.18 && < 15",">= 16"],"util":true,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8":">= 1","node:v8":[">= 14.18 && < 15",">= 16"],"vm":true,"node:vm":[">= 14.18 && < 15",">= 16"],"wasi":[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],"worker_threads":">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],"zlib":">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}'); + +/***/ }), + +/***/ 74476: +/***/ ((module) => { + +"use strict"; +module.exports = JSON.parse('{"assert":true,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16","async_hooks":">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],"buffer_ieee754":">= 0.5 && < 0.9.7","buffer":true,"node:buffer":[">= 14.18 && < 15",">= 16"],"child_process":true,"node:child_process":[">= 14.18 && < 15",">= 16"],"cluster":">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],"console":true,"node:console":[">= 14.18 && < 15",">= 16"],"constants":true,"node:constants":[">= 14.18 && < 15",">= 16"],"crypto":true,"node:crypto":[">= 14.18 && < 15",">= 16"],"_debug_agent":">= 1 && < 8","_debugger":"< 8","dgram":true,"node:dgram":[">= 14.18 && < 15",">= 16"],"diagnostics_channel":[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],"dns":true,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16","domain":">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],"events":true,"node:events":[">= 14.18 && < 15",">= 16"],"freelist":"< 6","fs":true,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],"_http_agent":">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],"_http_client":">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],"_http_common":">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],"_http_incoming":">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],"_http_outgoing":">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],"_http_server":">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],"http":true,"node:http":[">= 14.18 && < 15",">= 16"],"http2":">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],"https":true,"node:https":[">= 14.18 && < 15",">= 16"],"inspector":">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],"_linklist":"< 8","module":true,"node:module":[">= 14.18 && < 15",">= 16"],"net":true,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12","os":true,"node:os":[">= 14.18 && < 15",">= 16"],"path":true,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16","perf_hooks":">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],"process":">= 1","node:process":[">= 14.18 && < 15",">= 16"],"punycode":">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],"querystring":true,"node:querystring":[">= 14.18 && < 15",">= 16"],"readline":true,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17","repl":true,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],"smalloc":">= 0.11.5 && < 3","node:sqlite":">= 23.4","_stream_duplex":">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],"_stream_transform":">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],"_stream_wrap":">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],"_stream_passthrough":">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],"_stream_readable":">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],"_stream_writable":">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],"stream":true,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5","string_decoder":true,"node:string_decoder":[">= 14.18 && < 15",">= 16"],"sys":[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],"timers":true,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16","_tls_common":">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],"_tls_legacy":">= 0.11.3 && < 10","_tls_wrap":">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],"tls":true,"node:tls":[">= 14.18 && < 15",">= 16"],"trace_events":">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],"tty":true,"node:tty":[">= 14.18 && < 15",">= 16"],"url":true,"node:url":[">= 14.18 && < 15",">= 16"],"util":true,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8":">= 1","node:v8":[">= 14.18 && < 15",">= 16"],"vm":true,"node:vm":[">= 14.18 && < 15",">= 16"],"wasi":[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],"worker_threads":">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],"zlib":">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}'); + +/***/ }), + +/***/ 85425: +/***/ ((module) => { + +"use strict"; +module.exports = JSON.parse('{"eN":{"H":"https://github.com/elastic/require-in-the-middle/issues"}}'); + +/***/ }), + +/***/ 4147: +/***/ ((module) => { + +"use strict"; +module.exports = JSON.parse('{"name":"action-release","version":"1.9.0","private":true,"description":"GitHub Action for creating a release on Sentry","main":"dist/index.js","scripts":{"start":"node dist/index.js","build":"ncc build src/main.ts -e @sentry/cli","format":"prettier --write **/*.ts **/*.md","format-check":"prettier --check **/*.ts **/*.md","lint":"eslint src/**/*.ts","test":"jest","all":"yarn run format && yarn run lint && yarn run build && yarn test"},"repository":{"type":"git","url":"git+https://github.com/getsentry/action-release.git"},"keywords":["actions","sentry","release"],"author":"Sentry","license":"MIT","dependencies":{"@actions/core":"^1.11.1","@sentry/node":"^8.54.0"},"devDependencies":{"@sentry/cli":"^2.41.1","@types/jest":"^29.5.6","@types/node":"^20.8.9","@typescript-eslint/parser":"^6.9.0","@vercel/ncc":"^0.38.1","eslint":"^8.52.0","eslint-plugin-github":"^4.10.1","eslint-plugin-jest":"^27.4.3","jest":"^29.7.0","jest-circus":"^29.7.0","js-yaml":"^4.1.0","prettier":"^3.0.3","ts-jest":"^29.1.1","typescript":"^5.2.2"},"volta":{"node":"18.17.0","yarn":"1.22.4"}}'); + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __nccwpck_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ id: moduleId, +/******/ loaded: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ var threw = true; +/******/ try { +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete __webpack_module_cache__[moduleId]; +/******/ } +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/create fake namespace object */ +/******/ (() => { +/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); +/******/ var leafPrototypes; +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 16: return value when it's Promise-like +/******/ // mode & 8|1: behave like require +/******/ __nccwpck_require__.t = function(value, mode) { +/******/ if(mode & 1) value = this(value); +/******/ if(mode & 8) return value; +/******/ if(typeof value === 'object' && value) { +/******/ if((mode & 4) && value.__esModule) return value; +/******/ if((mode & 16) && typeof value.then === 'function') return value; +/******/ } +/******/ var ns = Object.create(null); +/******/ __nccwpck_require__.r(ns); +/******/ var def = {}; +/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; +/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { +/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); +/******/ } +/******/ def['default'] = () => (value); +/******/ __nccwpck_require__.d(ns, def); +/******/ return ns; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __nccwpck_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__nccwpck_require__.o(definition, key) && !__nccwpck_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __nccwpck_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __nccwpck_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/node module decorator */ +/******/ (() => { +/******/ __nccwpck_require__.nmd = (module) => { +/******/ module.paths = []; +/******/ if (!module.children) module.children = []; +/******/ return module; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/compat */ +/******/ +/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/"; +/******/ +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module is referenced by other modules so it can't be inlined +/******/ var __webpack_exports__ = __nccwpck_require__(70399); +/******/ module.exports = __webpack_exports__; +/******/ +/******/ })() +; \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100755 index 17058117..00000000 --- a/entrypoint.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -l -node /action-release/dist/index.js diff --git a/package.json b/package.json index ca80023a..08198d13 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "description": "GitHub Action for creating a release on Sentry", "main": "dist/index.js", "scripts": { - "build": "ncc build src/main.ts", + "start": "node dist/index.js", + "build": "ncc build src/main.ts -e @sentry/cli", "format": "prettier --write **/*.ts **/*.md", "format-check": "prettier --check **/*.ts **/*.md", "lint": "eslint src/**/*.ts", @@ -24,11 +25,11 @@ "author": "Sentry", "license": "MIT", "dependencies": { - "@actions/core": "^1.10.0", - "@sentry/cli": "^2.24.1", - "@sentry/node": "^8.48.0" + "@actions/core": "^1.11.1", + "@sentry/node": "^8.54.0" }, "devDependencies": { + "@sentry/cli": "^2.41.1", "@types/jest": "^29.5.6", "@types/node": "^20.8.9", "@typescript-eslint/parser": "^6.9.0", diff --git a/scripts/craft-pre-release.sh b/scripts/craft-pre-release.sh index e8e79cac..05dcdecd 100644 --- a/scripts/craft-pre-release.sh +++ b/scripts/craft-pre-release.sh @@ -3,15 +3,12 @@ set -eux OLD_VERSION="${1}" NEW_VERSION="${2}" -DOCKER_REGISTRY_IMAGE="docker://ghcr.io/getsentry/action-release-image" # Move to the project root SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $SCRIPT_DIR/.. -# Bump the npm package version +# Bump the npm version without creating a git tag for it +# as craft/publish will take care of that export npm_config_git_tag_version=false npm version "${NEW_VERSION}" - -# Update the docker image tag in the action -sed -i "s|\($DOCKER_REGISTRY_IMAGE:\)[^']*|\1$NEW_VERSION|" action.yml diff --git a/src/main.ts b/src/main.ts index befd51ed..0396e07d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,12 +3,7 @@ import * as core from '@actions/core'; import {getCLI} from './cli'; import * as options from './options'; import * as process from 'process'; -import { - isSelfHosted, - isTelemetryEnabled, - traceStep, - withTelemetry, -} from './telemetry'; +import {isTelemetryEnabled, traceStep, withTelemetry} from './telemetry'; withTelemetry( { @@ -16,6 +11,13 @@ withTelemetry( }, async () => { try { + const workingDirectory = options.getWorkingDirectory(); + const currentWorkingDirectory = process.cwd(); + + if (workingDirectory) { + process.chdir(workingDirectory); + } + // Validate options first so we can fail early. options.checkEnvironmentVariables(); @@ -35,7 +37,6 @@ withTelemetry( false ); const version = await options.getVersion(); - const workingDirectory = options.getWorkingDirectory(); if (projects.length === 1) { Sentry.setTag('project', projects[0]); @@ -46,11 +47,6 @@ withTelemetry( core.debug(`Version is ${version}`); await getCLI().new(version, {projects}); - const currentWorkingDirectory = process.cwd(); - if (workingDirectory !== null && workingDirectory.length > 0) { - process.chdir(workingDirectory); - } - Sentry.setTag('set-commits', setCommitsOption); if (setCommitsOption !== 'skip') { @@ -121,7 +117,7 @@ withTelemetry( }); } - if (workingDirectory !== null && workingDirectory.length > 0) { + if (workingDirectory) { process.chdir(currentWorkingDirectory); } diff --git a/src/options.ts b/src/options.ts index 52cfe85b..13f580c4 100644 --- a/src/options.ts +++ b/src/options.ts @@ -193,5 +193,11 @@ export const getUrlPrefixOption = (): string => { }; export const getWorkingDirectory = (): string => { - return core.getInput('working_directory'); + // The action runs inside `github.action_path` and as such + // doesn't automatically have access to the user's git + // In case users don't provide their own `working_directory` + // we use `GITHUB_WORKSPACE` which is at the top of the repo. + return ( + core.getInput('working_directory') || process.env.GITHUB_WORKSPACE || '' + ); }; diff --git a/src/telemetry.ts b/src/telemetry.ts index 32c724a6..5b7c1d31 100644 --- a/src/telemetry.ts +++ b/src/telemetry.ts @@ -1,4 +1,4 @@ -import * as options from './options'; +import * as ciOptions from './options'; import * as Sentry from '@sentry/node'; import packageJson from '../package.json'; @@ -99,6 +99,6 @@ export function isSelfHosted(): boolean { */ export function isTelemetryEnabled(): boolean { return ( - !options.getBooleanOption('disable_telemetry', false) && !isSelfHosted() + !ciOptions.getBooleanOption('disable_telemetry', false) && !isSelfHosted() ); } diff --git a/yarn.lock b/yarn.lock index 02cc7a01..38f1a54e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,13 +7,20 @@ resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== -"@actions/core@^1.10.0": - version "1.10.1" - resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.10.1.tgz#61108e7ac40acae95ee36da074fa5850ca4ced8a" - integrity sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g== +"@actions/core@^1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.11.1.tgz#ae683aac5112438021588030efb53b1adb86f172" + integrity sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A== dependencies: + "@actions/exec" "^1.1.1" "@actions/http-client" "^2.0.1" - uuid "^8.3.2" + +"@actions/exec@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@actions/exec/-/exec-1.1.1.tgz#2e43f28c54022537172819a7cf886c844221a611" + integrity sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w== + dependencies: + "@actions/io" "^1.0.1" "@actions/http-client@^2.0.1": version "2.2.0" @@ -23,6 +30,11 @@ tunnel "^0.0.6" undici "^5.25.4" +"@actions/io@^1.0.1": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@actions/io/-/io-1.1.3.tgz#4cdb6254da7962b07473ff5c335f3da485d94d71" + integrity sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q== + "@ampproject/remapping@^2.2.0": version "2.2.1" resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" @@ -654,10 +666,10 @@ dependencies: "@opentelemetry/api" "^1.0.0" -"@opentelemetry/api-logs@0.56.0": - version "0.56.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/api-logs/-/api-logs-0.56.0.tgz#68f8c51ca905c260b610c8a3c67d3f9fa3d59a45" - integrity sha512-Wr39+94UNNG3Ei9nv3pHd4AJ63gq5nSemMRpCd8fPwDL9rN3vK26lzxfH27mw16XzOSO+TpyQwBAMaLxaPWG0g== +"@opentelemetry/api-logs@0.57.1": + version "0.57.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/api-logs/-/api-logs-0.57.1.tgz#97ebd714f0b1fcdf896e85c465ae5c5b22747425" + integrity sha512-I4PHczeujhQAQv6ZBzqHYEUiggZL4IdSMixtVD3EYqbdrjujE7kRfI5QohjlPoJm8BvenoW5YaTMWRrbpot6tg== dependencies: "@opentelemetry/api" "^1.3.0" @@ -666,239 +678,239 @@ resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.9.0.tgz#d03eba68273dc0f7509e2a3d5cba21eae10379fe" integrity sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg== -"@opentelemetry/context-async-hooks@^1.29.0": - version "1.30.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/context-async-hooks/-/context-async-hooks-1.30.0.tgz#5639c8a7d19c6fe04a44b86aa302cb09008f6db9" - integrity sha512-roCetrG/cz0r/gugQm/jFo75UxblVvHaNSRoR0kSSRSzXFAiIBqFCZuH458BHBNRtRe+0yJdIJ21L9t94bw7+g== - -"@opentelemetry/core@1.29.0": - version "1.29.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.29.0.tgz#a9397dfd9a8b37b2435b5e44be16d39ec1c82bd9" - integrity sha512-gmT7vAreXl0DTHD2rVZcw3+l2g84+5XiHIqdBUxXbExymPCvSsGOpiwMmn8nkiJur28STV31wnhIDrzWDPzjfA== - dependencies: - "@opentelemetry/semantic-conventions" "1.28.0" +"@opentelemetry/context-async-hooks@^1.30.1": + version "1.30.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/context-async-hooks/-/context-async-hooks-1.30.1.tgz#4f76280691a742597fd0bf682982126857622948" + integrity sha512-s5vvxXPVdjqS3kTLKMeBMvop9hbWkwzBpu+mUO2M7sZtlkyDJGwFe33wRKnbaYDo8ExRVBIIdwIGrqpxHuKttA== -"@opentelemetry/core@1.30.0", "@opentelemetry/core@^1.1.0", "@opentelemetry/core@^1.26.0", "@opentelemetry/core@^1.29.0", "@opentelemetry/core@^1.8.0": +"@opentelemetry/core@1.30.0", "@opentelemetry/core@^1.1.0", "@opentelemetry/core@^1.26.0", "@opentelemetry/core@^1.8.0": version "1.30.0" resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.30.0.tgz#ef959e11e137d72466e566e375ecc5a82e922b86" integrity sha512-Q/3u/K73KUjTCnFUP97ZY+pBjQ1kPEgjOfXj/bJl8zW7GbXdkw6cwuyZk6ZTXkVgCBsYRYUzx4fvYK1jxdb9MA== dependencies: "@opentelemetry/semantic-conventions" "1.28.0" -"@opentelemetry/instrumentation-amqplib@^0.45.0": - version "0.45.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-amqplib/-/instrumentation-amqplib-0.45.0.tgz#747d72e38ff89266670e730ead90b85b6edc62d3" - integrity sha512-SlKLsOS65NGMIBG1Lh/hLrMDU9WzTUF25apnV6ZmWZB1bBmUwan7qrwwrTu1cL5LzJWCXOdZPuTaxP7pC9qxnQ== +"@opentelemetry/core@1.30.1", "@opentelemetry/core@^1.30.1": + version "1.30.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.30.1.tgz#a0b468bb396358df801881709ea38299fc30ab27" + integrity sha512-OOCM2C/QIURhJMuKaekP3TRBxBKxG/TWWA0TL2J6nXUtDnuCtccy49LUJF8xPFXMX+0LMcxFpCo8M9cGY1W6rQ== + dependencies: + "@opentelemetry/semantic-conventions" "1.28.0" + +"@opentelemetry/instrumentation-amqplib@^0.46.0": + version "0.46.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-amqplib/-/instrumentation-amqplib-0.46.0.tgz#8b0c61213034780a79c16216c62eee0ce1457ddf" + integrity sha512-04VHHV1KIN/c1wLWwzmLI02d/welgscBJ4BuDqrHaxd+ZIdlVXK9UYQsYf3JwSeF52z/4YoSzr8bfdVBSWoMAg== dependencies: "@opentelemetry/core" "^1.8.0" - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" "@opentelemetry/semantic-conventions" "^1.27.0" -"@opentelemetry/instrumentation-connect@0.42.0": - version "0.42.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-connect/-/instrumentation-connect-0.42.0.tgz#daebedbe65068746c9db0eee6e3a636a0912d251" - integrity sha512-bOoYHBmbnq/jFaLHmXJ55VQ6jrH5fHDMAPjFM0d3JvR0dvIqW7anEoNC33QqYGFYUfVJ50S0d/eoyF61ALqQuA== +"@opentelemetry/instrumentation-connect@0.43.0": + version "0.43.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-connect/-/instrumentation-connect-0.43.0.tgz#411035f4a8f2e498dbfa7300e545c58586a062e2" + integrity sha512-Q57JGpH6T4dkYHo9tKXONgLtxzsh1ZEW5M9A/OwKrZFyEpLqWgjhcZ3hIuVvDlhb426iDF1f9FPToV/mi5rpeA== dependencies: "@opentelemetry/core" "^1.8.0" - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" "@opentelemetry/semantic-conventions" "^1.27.0" "@types/connect" "3.4.36" -"@opentelemetry/instrumentation-dataloader@0.15.0": - version "0.15.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-dataloader/-/instrumentation-dataloader-0.15.0.tgz#c3ac6f41672961a489080edd2c59aceebe412798" - integrity sha512-5fP35A2jUPk4SerVcduEkpbRAIoqa2PaP5rWumn01T1uSbavXNccAr3Xvx1N6xFtZxXpLJq4FYqGFnMgDWgVng== +"@opentelemetry/instrumentation-dataloader@0.16.0": + version "0.16.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-dataloader/-/instrumentation-dataloader-0.16.0.tgz#913345c335f67bf8e17a9b38c227dba741fe488b" + integrity sha512-88+qCHZC02up8PwKHk0UQKLLqGGURzS3hFQBZC7PnGwReuoKjHXS1o29H58S+QkXJpkTr2GACbx8j6mUoGjNPA== dependencies: - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" -"@opentelemetry/instrumentation-express@0.46.0": - version "0.46.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-express/-/instrumentation-express-0.46.0.tgz#8dfbc9dc567e2e864a00a6a7edfbec2dd8482056" - integrity sha512-BCEClDj/HPq/1xYRAlOr6z+OUnbp2eFp18DSrgyQz4IT9pkdYk8eWHnMi9oZSqlC6J5mQzkFmaW5RrKb1GLQhg== +"@opentelemetry/instrumentation-express@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-express/-/instrumentation-express-0.47.0.tgz#f0477db3b1f4b342beb9ecd08edc26c470566724" + integrity sha512-XFWVx6k0XlU8lu6cBlCa29ONtVt6ADEjmxtyAyeF2+rifk8uBJbk1La0yIVfI0DoKURGbaEDTNelaXG9l/lNNQ== dependencies: "@opentelemetry/core" "^1.8.0" - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" "@opentelemetry/semantic-conventions" "^1.27.0" -"@opentelemetry/instrumentation-fastify@0.43.0": - version "0.43.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-fastify/-/instrumentation-fastify-0.43.0.tgz#855e259733bd75e21cb54cc110a7910861b200a4" - integrity sha512-Lmdsg7tYiV+K3/NKVAQfnnLNGmakUOFdB0PhoTh2aXuSyCmyNnnDvhn2MsArAPTZ68wnD5Llh5HtmiuTkf+DyQ== +"@opentelemetry/instrumentation-fastify@0.44.1": + version "0.44.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-fastify/-/instrumentation-fastify-0.44.1.tgz#c8080f24a6fbdd14689c619ad7b14fe189b10f28" + integrity sha512-RoVeMGKcNttNfXMSl6W4fsYoCAYP1vi6ZAWIGhBY+o7R9Y0afA7f9JJL0j8LHbyb0P0QhSYk+6O56OwI2k4iRQ== dependencies: "@opentelemetry/core" "^1.8.0" - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" "@opentelemetry/semantic-conventions" "^1.27.0" -"@opentelemetry/instrumentation-fs@0.18.0": - version "0.18.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-fs/-/instrumentation-fs-0.18.0.tgz#6ef0e58cda3212ce2cd17bddc4dd74f768fd74c0" - integrity sha512-kC40y6CEMONm8/MWwoF5GHWIC7gOdF+g3sgsjfwJaUkgD6bdWV+FgG0XApqSbTQndICKzw3RonVk8i7s6mHqhA== +"@opentelemetry/instrumentation-fs@0.19.0": + version "0.19.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-fs/-/instrumentation-fs-0.19.0.tgz#a44807aea97edc64c597d6a5b5b8637b7ab45057" + integrity sha512-JGwmHhBkRT2G/BYNV1aGI+bBjJu4fJUD/5/Jat0EWZa2ftrLV3YE8z84Fiij/wK32oMZ88eS8DI4ecLGZhpqsQ== dependencies: "@opentelemetry/core" "^1.8.0" - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" -"@opentelemetry/instrumentation-generic-pool@0.42.0": - version "0.42.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-generic-pool/-/instrumentation-generic-pool-0.42.0.tgz#6c6c6dcf2300e803acb22b2b914c6053acb80bf3" - integrity sha512-J4QxqiQ1imtB9ogzsOnHra0g3dmmLAx4JCeoK3o0rFes1OirljNHnO8Hsj4s1jAir8WmWvnEEQO1y8yk6j2tog== +"@opentelemetry/instrumentation-generic-pool@0.43.0": + version "0.43.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-generic-pool/-/instrumentation-generic-pool-0.43.0.tgz#b1769eb0e30f2abb764a9cbc811aa3d4560ecc24" + integrity sha512-at8GceTtNxD1NfFKGAuwtqM41ot/TpcLh+YsGe4dhf7gvv1HW/ZWdq6nfRtS6UjIvZJOokViqLPJ3GVtZItAnQ== dependencies: - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" -"@opentelemetry/instrumentation-graphql@0.46.0": - version "0.46.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-graphql/-/instrumentation-graphql-0.46.0.tgz#fbcf0844656c759294c03c30c471fc4862209a01" - integrity sha512-tplk0YWINSECcK89PGM7IVtOYenXyoOuhOQlN0X0YrcDUfMS4tZMKkVc0vyhNWYYrexnUHwNry2YNBNugSpjlQ== +"@opentelemetry/instrumentation-graphql@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-graphql/-/instrumentation-graphql-0.47.0.tgz#271807e21a6224bd1986a3e9887650f1858ee733" + integrity sha512-Cc8SMf+nLqp0fi8oAnooNEfwZWFnzMiBHCGmDFYqmgjPylyLmi83b+NiTns/rKGwlErpW0AGPt0sMpkbNlzn8w== dependencies: - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" -"@opentelemetry/instrumentation-hapi@0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-hapi/-/instrumentation-hapi-0.44.0.tgz#5b4524bef636209ba6cc95cfbb976b605c2946cd" - integrity sha512-4HdNIMNXWK1O6nsaQOrACo83QWEVoyNODTdVDbUqtqXiv2peDfD0RAPhSQlSGWLPw3S4d9UoOmrV7s2HYj6T2A== +"@opentelemetry/instrumentation-hapi@0.45.1": + version "0.45.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-hapi/-/instrumentation-hapi-0.45.1.tgz#5edf982549070d95e20152d568279548ad44d662" + integrity sha512-VH6mU3YqAKTePPfUPwfq4/xr049774qWtfTuJqVHoVspCLiT3bW+fCQ1toZxt6cxRPYASoYaBsMA3CWo8B8rcw== dependencies: "@opentelemetry/core" "^1.8.0" - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" "@opentelemetry/semantic-conventions" "^1.27.0" -"@opentelemetry/instrumentation-http@0.56.0": - version "0.56.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-http/-/instrumentation-http-0.56.0.tgz#f7a9e1bb4126c0d918775c1368a42b8afd5a48a2" - integrity sha512-/bWHBUAq8VoATnH9iLk5w8CE9+gj+RgYSUphe7hry472n6fYl7+4PvuScoQMdmSUTprKq/gyr2kOWL6zrC7FkQ== +"@opentelemetry/instrumentation-http@0.57.1": + version "0.57.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-http/-/instrumentation-http-0.57.1.tgz#2d8b395df62191475e76fa0eb7bf60079ea886b9" + integrity sha512-ThLmzAQDs7b/tdKI3BV2+yawuF09jF111OFsovqT1Qj3D8vjwKBwhi/rDE5xethwn4tSXtZcJ9hBsVAlWFQZ7g== dependencies: - "@opentelemetry/core" "1.29.0" - "@opentelemetry/instrumentation" "0.56.0" + "@opentelemetry/core" "1.30.1" + "@opentelemetry/instrumentation" "0.57.1" "@opentelemetry/semantic-conventions" "1.28.0" forwarded-parse "2.1.2" semver "^7.5.2" -"@opentelemetry/instrumentation-ioredis@0.46.0": - version "0.46.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-ioredis/-/instrumentation-ioredis-0.46.0.tgz#ec230466813f8ce82eb9ca9b23308ccfa460ce2b" - integrity sha512-sOdsq8oGi29V58p1AkefHvuB3l2ymP1IbxRIX3y4lZesQWKL8fLhBmy8xYjINSQ5gHzWul2yoz7pe7boxhZcqQ== +"@opentelemetry/instrumentation-ioredis@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-ioredis/-/instrumentation-ioredis-0.47.0.tgz#f83bd133d36d137d2d0b58bfbdfe12ed6fe5ab2f" + integrity sha512-4HqP9IBC8e7pW9p90P3q4ox0XlbLGme65YTrA3UTLvqvo4Z6b0puqZQP203YFu8m9rE/luLfaG7/xrwwqMUpJw== dependencies: - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" "@opentelemetry/redis-common" "^0.36.2" "@opentelemetry/semantic-conventions" "^1.27.0" -"@opentelemetry/instrumentation-kafkajs@0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-kafkajs/-/instrumentation-kafkajs-0.6.0.tgz#5d1c6738da8e270acde9259521a9c6e0f421490c" - integrity sha512-MGQrzqEUAl0tacKJUFpuNHJesyTi51oUzSVizn7FdvJplkRIdS11FukyZBZJEscofSEdk7Ycmg+kNMLi5QHUFg== +"@opentelemetry/instrumentation-kafkajs@0.7.0": + version "0.7.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-kafkajs/-/instrumentation-kafkajs-0.7.0.tgz#079b949ec814b42e49d23bb4d4f73735fe460d52" + integrity sha512-LB+3xiNzc034zHfCtgs4ITWhq6Xvdo8bsq7amR058jZlf2aXXDrN9SV4si4z2ya9QX4tz6r4eZJwDkXOp14/AQ== dependencies: - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" "@opentelemetry/semantic-conventions" "^1.27.0" -"@opentelemetry/instrumentation-knex@0.43.0": - version "0.43.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-knex/-/instrumentation-knex-0.43.0.tgz#1f45cfea69212bd579e4fa95c6d5cccdd9626b8e" - integrity sha512-mOp0TRQNFFSBj5am0WF67fRO7UZMUmsF3/7HSDja9g3H4pnj+4YNvWWyZn4+q0rGrPtywminAXe0rxtgaGYIqg== +"@opentelemetry/instrumentation-knex@0.44.0": + version "0.44.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-knex/-/instrumentation-knex-0.44.0.tgz#af251ed38f06a2f248812c5addf0266697b6149a" + integrity sha512-SlT0+bLA0Lg3VthGje+bSZatlGHw/vwgQywx0R/5u9QC59FddTQSPJeWNw29M6f8ScORMeUOOTwihlQAn4GkJQ== dependencies: - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" "@opentelemetry/semantic-conventions" "^1.27.0" -"@opentelemetry/instrumentation-koa@0.46.0": - version "0.46.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-koa/-/instrumentation-koa-0.46.0.tgz#bcdfb29f3b41be45355a9aa278fb231e19eb02e5" - integrity sha512-RcWXMQdJQANnPUaXbHY5G0Fg6gmleZ/ZtZeSsekWPaZmQq12FGk0L1UwodIgs31OlYfviAZ4yTeytoSUkgo5vQ== +"@opentelemetry/instrumentation-koa@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-koa/-/instrumentation-koa-0.47.0.tgz#a74b35809ba95d0f9db49e8c3f214bde475b095a" + integrity sha512-HFdvqf2+w8sWOuwtEXayGzdZ2vWpCKEQv5F7+2DSA74Te/Cv4rvb2E5So5/lh+ok4/RAIPuvCbCb/SHQFzMmbw== dependencies: "@opentelemetry/core" "^1.8.0" - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" "@opentelemetry/semantic-conventions" "^1.27.0" -"@opentelemetry/instrumentation-lru-memoizer@0.43.0": - version "0.43.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-lru-memoizer/-/instrumentation-lru-memoizer-0.43.0.tgz#7d3f524a10715d9f681e8d4ee6bfe91be80c82cf" - integrity sha512-fZc+1eJUV+tFxaB3zkbupiA8SL3vhDUq89HbDNg1asweYrEb9OlHIB+Ot14ZiHUc1qCmmWmZHbPTwa56mVVwzg== +"@opentelemetry/instrumentation-lru-memoizer@0.44.0": + version "0.44.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-lru-memoizer/-/instrumentation-lru-memoizer-0.44.0.tgz#c22e770d950c165f80c657a9c790c9843baaa65b" + integrity sha512-Tn7emHAlvYDFik3vGU0mdwvWJDwtITtkJ+5eT2cUquct6nIs+H8M47sqMJkCpyPe5QIBJoTOHxmc6mj9lz6zDw== dependencies: - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" -"@opentelemetry/instrumentation-mongodb@0.50.0": - version "0.50.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mongodb/-/instrumentation-mongodb-0.50.0.tgz#e5c60ad0bfbdd8ac3238c255a0662b7430083303" - integrity sha512-DtwJMjYFXFT5auAvv8aGrBj1h3ciA/dXQom11rxL7B1+Oy3FopSpanvwYxJ+z0qmBrQ1/iMuWELitYqU4LnlkQ== +"@opentelemetry/instrumentation-mongodb@0.51.0": + version "0.51.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mongodb/-/instrumentation-mongodb-0.51.0.tgz#8a323c2fb4cb2c93bf95f1b1c0fcb30952d12a08" + integrity sha512-cMKASxCX4aFxesoj3WK8uoQ0YUrRvnfxaO72QWI2xLu5ZtgX/QvdGBlU3Ehdond5eb74c2s1cqRQUIptBnKz1g== dependencies: - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" "@opentelemetry/semantic-conventions" "^1.27.0" -"@opentelemetry/instrumentation-mongoose@0.45.0": - version "0.45.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mongoose/-/instrumentation-mongoose-0.45.0.tgz#c8179827769fac8528b681da5888ae1779bd844b" - integrity sha512-zHgNh+A01C5baI2mb5dAGyMC7DWmUpOfwpV8axtC0Hd5Uzqv+oqKgKbVDIVhOaDkPxjgVJwYF9YQZl2pw2qxIA== +"@opentelemetry/instrumentation-mongoose@0.46.0": + version "0.46.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mongoose/-/instrumentation-mongoose-0.46.0.tgz#c3a5f69e1a5b950b542cf84650fbbd3e31bd681e" + integrity sha512-mtVv6UeaaSaWTeZtLo4cx4P5/ING2obSqfWGItIFSunQBrYROfhuVe7wdIrFUs2RH1tn2YYpAJyMaRe/bnTTIQ== dependencies: "@opentelemetry/core" "^1.8.0" - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" "@opentelemetry/semantic-conventions" "^1.27.0" -"@opentelemetry/instrumentation-mysql2@0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mysql2/-/instrumentation-mysql2-0.44.0.tgz#309d3fa452d4fcb632c4facb68ed7ea74b6738f9" - integrity sha512-e9QY4AGsjGFwmfHd6kBa4yPaQZjAq2FuxMb0BbKlXCAjG+jwqw+sr9xWdJGR60jMsTq52hx3mAlE3dUJ9BipxQ== +"@opentelemetry/instrumentation-mysql2@0.45.0": + version "0.45.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mysql2/-/instrumentation-mysql2-0.45.0.tgz#95501759d470dbc7038670e91205e8ed601ec402" + integrity sha512-qLslv/EPuLj0IXFvcE3b0EqhWI8LKmrgRPIa4gUd8DllbBpqJAvLNJSv3cC6vWwovpbSI3bagNO/3Q2SuXv2xA== dependencies: - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" "@opentelemetry/semantic-conventions" "^1.27.0" "@opentelemetry/sql-common" "^0.40.1" -"@opentelemetry/instrumentation-mysql@0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mysql/-/instrumentation-mysql-0.44.0.tgz#a29af4432d4289ed9d147d9c30038c57031d950c" - integrity sha512-al7jbXvT/uT1KV8gdNDzaWd5/WXf+mrjrsF0/NtbnqLa0UUFGgQnoK3cyborgny7I+KxWhL8h7YPTf6Zq4nKsg== +"@opentelemetry/instrumentation-mysql@0.45.0": + version "0.45.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mysql/-/instrumentation-mysql-0.45.0.tgz#e4df8bc709c0c8b0ff90bbef92fb36e92ebe0d19" + integrity sha512-tWWyymgwYcTwZ4t8/rLDfPYbOTF3oYB8SxnYMtIQ1zEf5uDm90Ku3i6U/vhaMyfHNlIHvDhvJh+qx5Nc4Z3Acg== dependencies: - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" "@opentelemetry/semantic-conventions" "^1.27.0" "@types/mysql" "2.15.26" -"@opentelemetry/instrumentation-nestjs-core@0.43.0": - version "0.43.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-nestjs-core/-/instrumentation-nestjs-core-0.43.0.tgz#c176409ab5ebfac862298e31a6a149126e278700" - integrity sha512-NEo4RU7HTjiaXk3curqXUvCb9alRiFWxQY//+hvDXwWLlADX2vB6QEmVCeEZrKO+6I/tBrI4vNdAnbCY9ldZVg== +"@opentelemetry/instrumentation-nestjs-core@0.44.0": + version "0.44.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-nestjs-core/-/instrumentation-nestjs-core-0.44.0.tgz#d2a3631de3bed2b1c0a03afa79c08ae22bef8b6c" + integrity sha512-t16pQ7A4WYu1yyQJZhRKIfUNvl5PAaF2pEteLvgJb/BWdd1oNuU1rOYt4S825kMy+0q4ngiX281Ss9qiwHfxFQ== dependencies: - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" "@opentelemetry/semantic-conventions" "^1.27.0" -"@opentelemetry/instrumentation-pg@0.49.0": - version "0.49.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-pg/-/instrumentation-pg-0.49.0.tgz#47a6a461099fae8e1ffbb97b715a0c34f0aec0b6" - integrity sha512-3alvNNjPXVdAPdY1G7nGRVINbDxRK02+KAugDiEpzw0jFQfU8IzFkSWA4jyU4/GbMxKvHD+XIOEfSjpieSodKw== +"@opentelemetry/instrumentation-pg@0.50.0": + version "0.50.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-pg/-/instrumentation-pg-0.50.0.tgz#525ecf683c349529539a14f2be47164f4e3eb0f5" + integrity sha512-TtLxDdYZmBhFswm8UIsrDjh/HFBeDXd4BLmE8h2MxirNHewLJ0VS9UUddKKEverb5Sm2qFVjqRjcU+8Iw4FJ3w== dependencies: "@opentelemetry/core" "^1.26.0" - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" "@opentelemetry/semantic-conventions" "1.27.0" "@opentelemetry/sql-common" "^0.40.1" "@types/pg" "8.6.1" "@types/pg-pool" "2.0.6" -"@opentelemetry/instrumentation-redis-4@0.45.0": - version "0.45.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-redis-4/-/instrumentation-redis-4-0.45.0.tgz#34115d39f7050b8576344d9e7f7cb8ceebf85067" - integrity sha512-Sjgym1xn3mdxPRH5CNZtoz+bFd3E3NlGIu7FoYr4YrQouCc9PbnmoBcmSkEdDy5LYgzNildPgsjx9l0EKNjKTQ== +"@opentelemetry/instrumentation-redis-4@0.46.0": + version "0.46.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-redis-4/-/instrumentation-redis-4-0.46.0.tgz#828704b8134f023730ac508bcf3a38ca4d5d697c" + integrity sha512-aTUWbzbFMFeRODn3720TZO0tsh/49T8H3h8vVnVKJ+yE36AeW38Uj/8zykQ/9nO8Vrtjr5yKuX3uMiG/W8FKNw== dependencies: - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" "@opentelemetry/redis-common" "^0.36.2" "@opentelemetry/semantic-conventions" "^1.27.0" -"@opentelemetry/instrumentation-tedious@0.17.0": - version "0.17.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-tedious/-/instrumentation-tedious-0.17.0.tgz#689b7c87346f11b73488b3aa91661d15e8fa830c" - integrity sha512-yRBz2409an03uVd1Q2jWMt3SqwZqRFyKoWYYX3hBAtPDazJ4w5L+1VOij71TKwgZxZZNdDBXImTQjii+VeuzLg== +"@opentelemetry/instrumentation-tedious@0.18.0": + version "0.18.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-tedious/-/instrumentation-tedious-0.18.0.tgz#636745423db28e303b4e0289b8f69685cb36f807" + integrity sha512-9zhjDpUDOtD+coeADnYEJQ0IeLVCj7w/hqzIutdp5NqS1VqTAanaEfsEcSypyvYv5DX3YOsTUoF+nr2wDXPETA== dependencies: - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" "@opentelemetry/semantic-conventions" "^1.27.0" "@types/tedious" "^4.0.14" -"@opentelemetry/instrumentation-undici@0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-undici/-/instrumentation-undici-0.9.0.tgz#c0be1854a90a5002d2345f8bc939d659a9ad76b1" - integrity sha512-lxc3cpUZ28CqbrWcUHxGW/ObDpMOYbuxF/ZOzeFZq54P9uJ2Cpa8gcrC9F716mtuiMaekwk8D6n34vg/JtkkxQ== +"@opentelemetry/instrumentation-undici@0.10.0": + version "0.10.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-undici/-/instrumentation-undici-0.10.0.tgz#99cba213a6e9d47a82896b6c782c3f2d60e0edb5" + integrity sha512-vm+V255NGw9gaSsPD6CP0oGo8L55BffBc8KnxqsMuc6XiAD1L8SFNzsW0RHhxJFqy9CJaJh+YiJ5EHXuZ5rZBw== dependencies: "@opentelemetry/core" "^1.8.0" - "@opentelemetry/instrumentation" "^0.56.0" + "@opentelemetry/instrumentation" "^0.57.0" -"@opentelemetry/instrumentation@0.56.0", "@opentelemetry/instrumentation@^0.56.0": - version "0.56.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation/-/instrumentation-0.56.0.tgz#3330ce16d9235a548efa1019a4a7f01414edd44a" - integrity sha512-2KkGBKE+FPXU1F0zKww+stnlUxUTlBvLCiWdP63Z9sqXYeNI/ziNzsxAp4LAdUcTQmXjw1IWgvm5CAb/BHy99w== +"@opentelemetry/instrumentation@0.57.1", "@opentelemetry/instrumentation@^0.57.0", "@opentelemetry/instrumentation@^0.57.1": + version "0.57.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation/-/instrumentation-0.57.1.tgz#5aea772be8783a35d69d643da46582f381ba1810" + integrity sha512-SgHEKXoVxOjc20ZYusPG3Fh+RLIZTSa4x8QtD3NfgAUDyqdFFS9W1F2ZVbZkqDCdyMcQG02Ok4duUGLHJXHgbA== dependencies: - "@opentelemetry/api-logs" "0.56.0" + "@opentelemetry/api-logs" "0.57.1" "@types/shimmer" "^1.2.0" import-in-the-middle "^1.8.1" require-in-the-middle "^7.1.1" @@ -922,7 +934,7 @@ resolved "https://registry.yarnpkg.com/@opentelemetry/redis-common/-/redis-common-0.36.2.tgz#906ac8e4d804d4109f3ebd5c224ac988276fdc47" integrity sha512-faYX1N0gpLhej/6nyp6bgRjzAKXn5GOEMYY7YhciSfCoITAktLUtQ36d24QEWNA1/WA1y6qQunCe0OhHRkVl9g== -"@opentelemetry/resources@1.30.0", "@opentelemetry/resources@^1.29.0": +"@opentelemetry/resources@1.30.0": version "1.30.0" resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.30.0.tgz#87604359e6195c017075b7d294a949ad018e692d" integrity sha512-5mGMjL0Uld/99t7/pcd7CuVtJbkARckLVuiOX84nO8RtLtIz0/J6EOHM2TGvPZ6F4K+XjUq13gMx14w80SVCQg== @@ -930,7 +942,15 @@ "@opentelemetry/core" "1.30.0" "@opentelemetry/semantic-conventions" "1.28.0" -"@opentelemetry/sdk-trace-base@^1.22", "@opentelemetry/sdk-trace-base@^1.29.0": +"@opentelemetry/resources@1.30.1", "@opentelemetry/resources@^1.30.1": + version "1.30.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.30.1.tgz#a4eae17ebd96947fdc7a64f931ca4b71e18ce964" + integrity sha512-5UxZqiAgLYGFjS4s9qm5mBVo433u+dSPUFWVWXmLAD4wB65oMCoXaJP1KJa9DIYYMeHu3z4BZcStG3LC593cWA== + dependencies: + "@opentelemetry/core" "1.30.1" + "@opentelemetry/semantic-conventions" "1.28.0" + +"@opentelemetry/sdk-trace-base@^1.22": version "1.30.0" resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.30.0.tgz#27c68ab01b1cfb4af16356550f8091d6e727f182" integrity sha512-RKQDaDIkV7PwizmHw+rE/FgfB2a6MBx+AEVVlAHXRG1YYxLiBpPX2KhmoB99R5vA4b72iJrjle68NDWnbrE9Dg== @@ -939,6 +959,15 @@ "@opentelemetry/resources" "1.30.0" "@opentelemetry/semantic-conventions" "1.28.0" +"@opentelemetry/sdk-trace-base@^1.30.1": + version "1.30.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.30.1.tgz#41a42234096dc98e8f454d24551fc80b816feb34" + integrity sha512-jVPgBbH1gCy2Lb7X0AVQ8XAfgg0pJ4nvl8/IiQA6nxOsPvS+0zMJaFSs2ltXe0J6C8dqjcnpyqINDJmU30+uOg== + dependencies: + "@opentelemetry/core" "1.30.1" + "@opentelemetry/resources" "1.30.1" + "@opentelemetry/semantic-conventions" "1.28.0" + "@opentelemetry/semantic-conventions@1.27.0": version "1.27.0" resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz#1a857dcc95a5ab30122e04417148211e6f945e6c" @@ -977,45 +1006,45 @@ "@opentelemetry/instrumentation" "^0.49 || ^0.50 || ^0.51 || ^0.52.0 || ^0.53.0" "@opentelemetry/sdk-trace-base" "^1.22" -"@sentry/cli-darwin@2.24.1": - version "2.24.1" - resolved "https://registry.yarnpkg.com/@sentry/cli-darwin/-/cli-darwin-2.24.1.tgz#feae406b2bf9a6a736e5a6f31e5561aaae8ed902" - integrity sha512-L6puTcZn5AarTL9YCVCSSCJoMV7opMx5hwwl0+sQGbLO8BChuC2QZl+j4ftEb3WgnFcT5+OODBlu4ocREtG7sQ== - -"@sentry/cli-linux-arm64@2.24.1": - version "2.24.1" - resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.24.1.tgz#a3e5339904fcb89167736a4a3c6edcd697972c24" - integrity sha512-47fq/sOZnY8oSnuEurlplHKlcEhCf4Pd3JHmV6N8dYYwPEapoELb3V53BDPhjkj/rwdpJf8T90+LXCQkeF/o+w== - -"@sentry/cli-linux-arm@2.24.1": - version "2.24.1" - resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm/-/cli-linux-arm-2.24.1.tgz#3784604555de7baa17b0b7ae8b7912d37d52738e" - integrity sha512-wnOeIl0NzUdSvz7kJKTovksDUwx6TTyV1iBjM19gZGqi+hfNc1bUa1IDGSY0m/T+CpSZiuKL0M36sYet5euDUQ== - -"@sentry/cli-linux-i686@2.24.1": - version "2.24.1" - resolved "https://registry.yarnpkg.com/@sentry/cli-linux-i686/-/cli-linux-i686-2.24.1.tgz#9ba0c0eaa783bd955060ea105278c2856c42755f" - integrity sha512-OjpP1aRV0cwdtcics0hv8tZR6Bl5+1KIc+0habMeMxfTN7FvGmJb3ZTpuhi8OJLDglppQe6KlWzEFi8UgcE42Q== - -"@sentry/cli-linux-x64@2.24.1": - version "2.24.1" - resolved "https://registry.yarnpkg.com/@sentry/cli-linux-x64/-/cli-linux-x64-2.24.1.tgz#b7d157b66f76a5ac47a43b934eadeec50e9c5640" - integrity sha512-GfryILChjrgSGBrT90ln46qt6UTI1ebevcDPoWArftTQ0n+P4tPFcfA9bCMV16Jsnc59CtjMFlQknLOAWnezgg== - -"@sentry/cli-win32-i686@2.24.1": - version "2.24.1" - resolved "https://registry.yarnpkg.com/@sentry/cli-win32-i686/-/cli-win32-i686-2.24.1.tgz#b01158d6e633a2e6dfed59feaeb6979a32d7632c" - integrity sha512-COi7b/g3BbJHlJfF7GA0LAw/foyP3rMfDLQid/4fj7a0DqNjwAJRgazXvvtAY7/3XThHVE/sgLH0UmAgYaBBpA== - -"@sentry/cli-win32-x64@2.24.1": - version "2.24.1" - resolved "https://registry.yarnpkg.com/@sentry/cli-win32-x64/-/cli-win32-x64-2.24.1.tgz#8b8752606939d229207b1afe6d4a254d24acb47c" - integrity sha512-gJxQw9ppRgZecMZ4t7mi5zWTFssVFbO2V35Nq6qk9bwHACa/LjQbyRqSqOg6zil8QruGvH1oQYClFZHlW8EHuA== - -"@sentry/cli@^2.24.1": - version "2.24.1" - resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.24.1.tgz#9b643ee44c7b2be7cf9b9435b7eea4b92bdfd6cd" - integrity sha512-eXqbKRzychtG8mMfGmqc0DRY677ngHRYa3aVS8f0VVKHK4PPV/ta08ORs0iS73IaasP563r8YEzpYjD74GtSZA== +"@sentry/cli-darwin@2.41.1": + version "2.41.1" + resolved "https://registry.yarnpkg.com/@sentry/cli-darwin/-/cli-darwin-2.41.1.tgz#ca7e12bf1ad59bc2df35868ae98abc8869108efa" + integrity sha512-7pS3pu/SuhE6jOn3wptstAg6B5nUP878O6s+2svT7b5fKNfYUi/6NPK6dAveh2Ca0rwVq40TO4YFJabWMgTpdQ== + +"@sentry/cli-linux-arm64@2.41.1": + version "2.41.1" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.41.1.tgz#948e8af8290418b1562db3531db08e69e39d74bb" + integrity sha512-EzYCEnnENBnS5kpNW+2dBcrPZn1MVfywh2joGVQZTpmgDL5YFJ59VOd+K0XuEwqgFI8BSNI14KXZ75s4DD1/Vw== + +"@sentry/cli-linux-arm@2.41.1": + version "2.41.1" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm/-/cli-linux-arm-2.41.1.tgz#1e5fa971ae8dfb3ea5564c8503b4e635ae6aed8a" + integrity sha512-wNUvquD6qjOCczvuBGf9OiD29nuQ6yf8zzfyPJa5Bdx1QXuteKsKb6HBrMwuIR3liyuu0duzHd+H/+p1n541Hg== + +"@sentry/cli-linux-i686@2.41.1": + version "2.41.1" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-i686/-/cli-linux-i686-2.41.1.tgz#3f01aff314f2ad8fd761f3e6e807a5ec09ae4eb4" + integrity sha512-urpQCWrdYnSAsZY3udttuMV88wTJzKZL10xsrp7sjD/Hd+O6qSLVLkxebIlxts70jMLLFHYrQ2bkRg5kKuX6Fg== + +"@sentry/cli-linux-x64@2.41.1": + version "2.41.1" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-x64/-/cli-linux-x64-2.41.1.tgz#30dbf966a4b4c1721ffccd901dfcb6f967db073d" + integrity sha512-ZqpYwHXAaK4MMEFlyaLYr6mJTmpy9qP6n30jGhLTW7kHKS3s6GPLCSlNmIfeClrInEt0963fM633ZRnXa04VPw== + +"@sentry/cli-win32-i686@2.41.1": + version "2.41.1" + resolved "https://registry.yarnpkg.com/@sentry/cli-win32-i686/-/cli-win32-i686-2.41.1.tgz#f88eeb5d2d4ee46c38d8616ae1eb484108ea71c2" + integrity sha512-AuRimCeVsx99DIOr9cwdYBHk39tlmAuPDdy2r16iNzY0InXs4xOys4gGzM7N4vlFQvFkzuc778Su0HkfasgprA== + +"@sentry/cli-win32-x64@2.41.1": + version "2.41.1" + resolved "https://registry.yarnpkg.com/@sentry/cli-win32-x64/-/cli-win32-x64-2.41.1.tgz#eefd95a2aa184adb464334e265b55a9142070f6f" + integrity sha512-6JcPvXGye61+wPp0xdzfc2YLE/Dcud8JdaK8VxLM3b/8+Em7E+UyliDu3uF8+YGUqizY5JYTd3fs17DC8DZhLw== + +"@sentry/cli@^2.41.1": + version "2.41.1" + resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.41.1.tgz#a9467ca3ff4acfcdedec1565c9ff726b93758d29" + integrity sha512-0GVmDiTV7R1492wkVY4bGcfC0fSmRmQjuxaaPI8CIV9B2VP9pBVCUizi1mevXaaE4I3fM60LI+XYrKFEneuVog== dependencies: https-proxy-agent "^5.0.0" node-fetch "^2.6.7" @@ -1023,66 +1052,66 @@ proxy-from-env "^1.1.0" which "^2.0.2" optionalDependencies: - "@sentry/cli-darwin" "2.24.1" - "@sentry/cli-linux-arm" "2.24.1" - "@sentry/cli-linux-arm64" "2.24.1" - "@sentry/cli-linux-i686" "2.24.1" - "@sentry/cli-linux-x64" "2.24.1" - "@sentry/cli-win32-i686" "2.24.1" - "@sentry/cli-win32-x64" "2.24.1" - -"@sentry/core@8.48.0": - version "8.48.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-8.48.0.tgz#3bb8d06305f0ec7c873453844687deafdeab168b" - integrity sha512-VGwYgTfLpvJ5LRO5A+qWo1gpo6SfqaGXL9TOzVgBucAdpzbrYHpZ87sEarDVq/4275uk1b0S293/mfsskFczyw== - -"@sentry/node@^8.48.0": - version "8.48.0" - resolved "https://registry.yarnpkg.com/@sentry/node/-/node-8.48.0.tgz#d4d1374431028af7663a06bf7268bf40a9bf1fa0" - integrity sha512-pnprAuUOc8cxnJdZA09hutHXNsbQZoDgzf3zPyXMNx0ewB/RviFMOgfe7ViX1mIB/oVrcFenXBgO5uvTd7JwPg== + "@sentry/cli-darwin" "2.41.1" + "@sentry/cli-linux-arm" "2.41.1" + "@sentry/cli-linux-arm64" "2.41.1" + "@sentry/cli-linux-i686" "2.41.1" + "@sentry/cli-linux-x64" "2.41.1" + "@sentry/cli-win32-i686" "2.41.1" + "@sentry/cli-win32-x64" "2.41.1" + +"@sentry/core@8.54.0": + version "8.54.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-8.54.0.tgz#a2ebec965cadcb6de89e116689feeef79d5862a6" + integrity sha512-03bWf+D1j28unOocY/5FDB6bUHtYlm6m6ollVejhg45ZmK9iPjdtxNWbrLsjT1WRym0Tjzowu+A3p+eebYEv0Q== + +"@sentry/node@^8.54.0": + version "8.54.0" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-8.54.0.tgz#4ba175e320c36263f75a88670f4a5507754cf8f0" + integrity sha512-z9ak481OtCw3V4l55ke/9FOiorF2J/niO1J1gvGefXpgFucpw0M3qqEFjB5cpg9HoZM8Y1WtA1OFusfTAnvcXg== dependencies: "@opentelemetry/api" "^1.9.0" - "@opentelemetry/context-async-hooks" "^1.29.0" - "@opentelemetry/core" "^1.29.0" - "@opentelemetry/instrumentation" "^0.56.0" - "@opentelemetry/instrumentation-amqplib" "^0.45.0" - "@opentelemetry/instrumentation-connect" "0.42.0" - "@opentelemetry/instrumentation-dataloader" "0.15.0" - "@opentelemetry/instrumentation-express" "0.46.0" - "@opentelemetry/instrumentation-fastify" "0.43.0" - "@opentelemetry/instrumentation-fs" "0.18.0" - "@opentelemetry/instrumentation-generic-pool" "0.42.0" - "@opentelemetry/instrumentation-graphql" "0.46.0" - "@opentelemetry/instrumentation-hapi" "0.44.0" - "@opentelemetry/instrumentation-http" "0.56.0" - "@opentelemetry/instrumentation-ioredis" "0.46.0" - "@opentelemetry/instrumentation-kafkajs" "0.6.0" - "@opentelemetry/instrumentation-knex" "0.43.0" - "@opentelemetry/instrumentation-koa" "0.46.0" - "@opentelemetry/instrumentation-lru-memoizer" "0.43.0" - "@opentelemetry/instrumentation-mongodb" "0.50.0" - "@opentelemetry/instrumentation-mongoose" "0.45.0" - "@opentelemetry/instrumentation-mysql" "0.44.0" - "@opentelemetry/instrumentation-mysql2" "0.44.0" - "@opentelemetry/instrumentation-nestjs-core" "0.43.0" - "@opentelemetry/instrumentation-pg" "0.49.0" - "@opentelemetry/instrumentation-redis-4" "0.45.0" - "@opentelemetry/instrumentation-tedious" "0.17.0" - "@opentelemetry/instrumentation-undici" "0.9.0" - "@opentelemetry/resources" "^1.29.0" - "@opentelemetry/sdk-trace-base" "^1.29.0" + "@opentelemetry/context-async-hooks" "^1.30.1" + "@opentelemetry/core" "^1.30.1" + "@opentelemetry/instrumentation" "^0.57.1" + "@opentelemetry/instrumentation-amqplib" "^0.46.0" + "@opentelemetry/instrumentation-connect" "0.43.0" + "@opentelemetry/instrumentation-dataloader" "0.16.0" + "@opentelemetry/instrumentation-express" "0.47.0" + "@opentelemetry/instrumentation-fastify" "0.44.1" + "@opentelemetry/instrumentation-fs" "0.19.0" + "@opentelemetry/instrumentation-generic-pool" "0.43.0" + "@opentelemetry/instrumentation-graphql" "0.47.0" + "@opentelemetry/instrumentation-hapi" "0.45.1" + "@opentelemetry/instrumentation-http" "0.57.1" + "@opentelemetry/instrumentation-ioredis" "0.47.0" + "@opentelemetry/instrumentation-kafkajs" "0.7.0" + "@opentelemetry/instrumentation-knex" "0.44.0" + "@opentelemetry/instrumentation-koa" "0.47.0" + "@opentelemetry/instrumentation-lru-memoizer" "0.44.0" + "@opentelemetry/instrumentation-mongodb" "0.51.0" + "@opentelemetry/instrumentation-mongoose" "0.46.0" + "@opentelemetry/instrumentation-mysql" "0.45.0" + "@opentelemetry/instrumentation-mysql2" "0.45.0" + "@opentelemetry/instrumentation-nestjs-core" "0.44.0" + "@opentelemetry/instrumentation-pg" "0.50.0" + "@opentelemetry/instrumentation-redis-4" "0.46.0" + "@opentelemetry/instrumentation-tedious" "0.18.0" + "@opentelemetry/instrumentation-undici" "0.10.0" + "@opentelemetry/resources" "^1.30.1" + "@opentelemetry/sdk-trace-base" "^1.30.1" "@opentelemetry/semantic-conventions" "^1.28.0" "@prisma/instrumentation" "5.22.0" - "@sentry/core" "8.48.0" - "@sentry/opentelemetry" "8.48.0" + "@sentry/core" "8.54.0" + "@sentry/opentelemetry" "8.54.0" import-in-the-middle "^1.11.2" -"@sentry/opentelemetry@8.48.0": - version "8.48.0" - resolved "https://registry.yarnpkg.com/@sentry/opentelemetry/-/opentelemetry-8.48.0.tgz#718e7942724d64ffe8e901941b0e4050fa07780b" - integrity sha512-1JLXgmIvD3T7xn9ypwWW0V3GirNy4BN2fOUbZau/nUX/Jj5DttSoPn7x7xTaPSpfaA24PiP93zXmJEfZvCk00Q== +"@sentry/opentelemetry@8.54.0": + version "8.54.0" + resolved "https://registry.yarnpkg.com/@sentry/opentelemetry/-/opentelemetry-8.54.0.tgz#0fd2c732b6f83ec7a6eb27defbb535784657669d" + integrity sha512-Tkmd8bmXMx0PKZF53ywk/FfvDrphX8NdPH5N53HxyMvGxSf2trZkTuOSFJg6zKibyGYO6+PUeGO3g2WJKUxwGA== dependencies: - "@sentry/core" "8.48.0" + "@sentry/core" "8.54.0" "@sinclair/typebox@^0.27.8": version "0.27.8" @@ -1862,12 +1891,12 @@ damerau-levenshtein@^1.0.8: resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA== -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: - version "4.3.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== +debug@4, debug@^4.3.5: + version "4.4.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" + integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== dependencies: - ms "2.1.2" + ms "^2.1.3" debug@^3.2.7: version "3.2.7" @@ -1876,12 +1905,12 @@ debug@^3.2.7: dependencies: ms "^2.1.1" -debug@^4.3.5: - version "4.4.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" - integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== +debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: - ms "^2.1.3" + ms "2.1.2" dedent@^1.0.0: version "1.5.1" @@ -4540,11 +4569,6 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -uuid@^8.3.2: - version "8.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== - v8-to-istanbul@^9.0.1: version "9.1.3" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz#ea456604101cd18005ac2cae3cdd1aa058a6306b"