Skip to content
Snippets Groups Projects
onDeleteAccount.js 7.96 MiB
Newer Older
  • Learn to ignore specific revisions
  • build-token's avatar
    build-token committed
    236001 236002 236003 236004 236005 236006 236007 236008 236009 236010 236011 236012 236013 236014 236015 236016 236017 236018 236019 236020 236021 236022 236023 236024 236025 236026 236027 236028 236029 236030 236031 236032 236033 236034 236035 236036 236037 236038 236039 236040 236041 236042 236043 236044 236045 236046 236047 236048 236049 236050 236051 236052 236053 236054 236055 236056 236057 236058 236059 236060 236061 236062 236063 236064 236065 236066 236067 236068 236069 236070 236071 236072 236073 236074 236075 236076 236077 236078 236079 236080 236081 236082 236083 236084 236085 236086 236087 236088 236089 236090 236091 236092 236093 236094 236095 236096 236097 236098 236099 236100 236101 236102 236103 236104 236105 236106 236107 236108 236109 236110 236111 236112 236113 236114 236115 236116 236117 236118 236119 236120 236121 236122 236123 236124 236125 236126 236127 236128 236129 236130 236131 236132 236133 236134 236135 236136 236137 236138 236139 236140 236141 236142 236143 236144 236145 236146 236147 236148 236149 236150 236151 236152 236153 236154 236155 236156 236157 236158 236159 236160 236161 236162 236163 236164 236165 236166 236167 236168 236169 236170 236171 236172 236173 236174 236175 236176 236177 236178 236179 236180 236181 236182 236183 236184 236185 236186 236187 236188 236189 236190 236191 236192 236193 236194 236195 236196 236197 236198 236199 236200 236201 236202 236203 236204 236205 236206 236207 236208 236209 236210 236211 236212 236213 236214 236215 236216 236217 236218 236219 236220 236221 236222 236223 236224 236225 236226 236227 236228 236229 236230 236231 236232 236233 236234 236235 236236 236237 236238 236239 236240 236241 236242 236243 236244 236245 236246 236247 236248 236249 236250 236251 236252 236253 236254 236255 236256 236257 236258 236259 236260 236261 236262 236263 236264 236265 236266 236267 236268 236269 236270 236271 236272 236273 236274 236275 236276 236277 236278 236279 236280 236281 236282 236283 236284 236285 236286 236287 236288 236289 236290 236291 236292 236293 236294 236295 236296 236297 236298 236299 236300 236301 236302 236303 236304 236305 236306 236307 236308 236309 236310 236311 236312 236313 236314 236315 236316 236317 236318 236319 236320 236321 236322 236323 236324 236325 236326 236327 236328 236329 236330 236331 236332 236333 236334 236335 236336 236337 236338 236339 236340 236341 236342 236343 236344 236345 236346 236347 236348 236349 236350 236351 236352 236353 236354 236355 236356 236357 236358 236359 236360 236361 236362 236363 236364 236365 236366 236367 236368 236369 236370 236371 236372 236373 236374 236375 236376 236377 236378 236379 236380 236381 236382 236383 236384 236385 236386 236387 236388 236389 236390 236391 236392 236393 236394 236395 236396 236397 236398 236399 236400 236401 236402 236403 236404 236405 236406 236407 236408 236409 236410 236411 236412 236413 236414 236415 236416 236417 236418 236419 236420 236421 236422 236423 236424 236425 236426 236427 236428 236429 236430 236431 236432 236433 236434 236435 236436 236437 236438 236439 236440 236441 236442 236443 236444 236445 236446 236447 236448 236449 236450 236451 236452 236453 236454 236455 236456 236457 236458 236459 236460 236461 236462 236463 236464 236465 236466 236467 236468 236469 236470 236471 236472 236473 236474 236475 236476 236477 236478 236479 236480 236481 236482 236483 236484 236485 236486 236487 236488 236489 236490 236491 236492 236493 236494 236495 236496 236497 236498 236499 236500 236501 236502 236503 236504 236505 236506 236507 236508 236509 236510 236511 236512 236513 236514 236515 236516 236517 236518 236519 236520 236521 236522 236523 236524 236525 236526 236527 236528 236529 236530 236531 236532 236533 236534 236535 236536 236537 236538 236539 236540 236541 236542 236543 236544 236545 236546 236547 236548 236549 236550 236551 236552 236553 236554 236555 236556 236557 236558 236559 236560 236561 236562 236563 236564 236565 236566 236567 236568 236569 236570 236571 236572 236573 236574 236575 236576 236577 236578 236579 236580 236581 236582 236583 236584 236585 236586 236587 236588 236589 236590 236591 236592 236593 236594 236595 236596 236597 236598 236599 236600 236601 236602 236603 236604 236605 236606 236607 236608 236609 236610 236611 236612 236613 236614 236615 236616 236617 236618 236619 236620 236621 236622 236623 236624 236625 236626 236627 236628 236629 236630 236631 236632 236633 236634 236635 236636 236637 236638 236639 236640 236641 236642 236643 236644 236645 236646 236647 236648 236649 236650 236651 236652 236653 236654 236655 236656 236657 236658 236659 236660 236661 236662 236663 236664 236665 236666 236667 236668 236669 236670 236671 236672 236673 236674 236675 236676 236677 236678 236679 236680 236681 236682 236683 236684 236685 236686 236687 236688 236689 236690 236691 236692 236693 236694 236695 236696 236697 236698 236699 236700 236701 236702 236703 236704 236705 236706 236707 236708 236709 236710 236711 236712 236713 236714 236715 236716 236717 236718 236719 236720 236721 236722 236723 236724 236725 236726 236727 236728 236729 236730 236731 236732 236733 236734 236735 236736 236737 236738 236739 236740 236741 236742 236743 236744 236745 236746 236747 236748 236749 236750 236751 236752 236753 236754 236755 236756 236757 236758 236759 236760 236761 236762 236763 236764 236765 236766 236767 236768 236769
                socket.removeListener('close', onclose);
                socket.removeListener('readable', read);
            }
            function onclose(err) {
                debug('onclose had error %o', err);
            }
            function onend() {
                debug('onend');
            }
            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 firstLine = buffered.toString('ascii', 0, buffered.indexOf('\r\n'));
                const statusCode = +firstLine.split(' ')[1];
                debug('got proxy server response: %o', firstLine);
                resolve({
                    statusCode,
                    buffered
                });
            }
            socket.on('error', onerror);
            socket.on('close', onclose);
            socket.on('end', onend);
            read();
        });
    }
    exports["default"] = parseProxyResponse;
    //# sourceMappingURL=parse-proxy-response.js.map
    
    /***/ }),
    /* 1650 */
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    "use strict";
    __webpack_require__.r(__webpack_exports__);
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    /* harmony export */   "_nullishCoalesce": () => (/* binding */ _nullishCoalesce)
    /* harmony export */ });
    /**
     * 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();
    //   }
    // }
    
    
    //# sourceMappingURL=_nullishCoalesce.js.map
    
    
    /***/ }),
    /* 1651 */
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    "use strict";
    __webpack_require__.r(__webpack_exports__);
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    /* harmony export */   "close": () => (/* binding */ close),
    /* harmony export */   "defaultIntegrations": () => (/* binding */ defaultIntegrations),
    /* harmony export */   "defaultStackParser": () => (/* binding */ defaultStackParser),
    /* harmony export */   "flush": () => (/* binding */ flush),
    /* harmony export */   "getSentryRelease": () => (/* binding */ getSentryRelease),
    /* harmony export */   "init": () => (/* binding */ init),
    /* harmony export */   "isAutoSessionTrackingEnabled": () => (/* binding */ isAutoSessionTrackingEnabled),
    /* harmony export */   "lastEventId": () => (/* binding */ lastEventId)
    /* harmony export */ });
    /* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(1625);
    /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(1673);
    /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(1674);
    /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(1602);
    /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(1632);
    /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(1675);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(1624);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(1615);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(1606);
    /* harmony import */ var domain__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1314);
    /* harmony import */ var domain__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(domain__WEBPACK_IMPORTED_MODULE_0__);
    /* harmony import */ var _client_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1627);
    /* harmony import */ var _integrations_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1652);
    /* harmony import */ var _module_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1671);
    /* harmony import */ var _transports_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1635);
    /* harmony import */ var _integrations_console_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1653);
    /* harmony import */ var _integrations_http_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1655);
    /* harmony import */ var _integrations_onuncaughtexception_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1658);
    /* harmony import */ var _integrations_onunhandledrejection_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1660);
    /* harmony import */ var _integrations_contextlines_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(1662);
    /* harmony import */ var _integrations_context_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(1665);
    /* harmony import */ var _integrations_modules_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(1664);
    /* harmony import */ var _integrations_requestdata_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(1666);
    /* harmony import */ var _integrations_linkederrors_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(1661);
    /* harmony import */ var _transports_http_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(1636);
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    /* eslint-disable max-lines */
    
    const defaultIntegrations = [
      // Common
      new _sentry_core__WEBPACK_IMPORTED_MODULE_15__.InboundFilters(),
      new _sentry_core__WEBPACK_IMPORTED_MODULE_16__.FunctionToString(),
      // Native Wrappers
      new _integrations_console_js__WEBPACK_IMPORTED_MODULE_5__.Console(),
      new _integrations_http_js__WEBPACK_IMPORTED_MODULE_6__.Http(),
      // Global Handlers
      new _integrations_onuncaughtexception_js__WEBPACK_IMPORTED_MODULE_7__.OnUncaughtException(),
      new _integrations_onunhandledrejection_js__WEBPACK_IMPORTED_MODULE_8__.OnUnhandledRejection(),
      // Event Info
      new _integrations_contextlines_js__WEBPACK_IMPORTED_MODULE_9__.ContextLines(),
      new _integrations_context_js__WEBPACK_IMPORTED_MODULE_10__.Context(),
      new _integrations_modules_js__WEBPACK_IMPORTED_MODULE_11__.Modules(),
      new _integrations_requestdata_js__WEBPACK_IMPORTED_MODULE_12__.RequestData(),
      // Misc
      new _integrations_linkederrors_js__WEBPACK_IMPORTED_MODULE_13__.LinkedErrors(),
    ];
    
    /**
     * The Sentry Node SDK Client.
     *
     * To use this SDK, call the {@link init} function as early as possible in the
     * main entry module. To set context information or send manual events, use the
     * provided methods.
     *
     * @example
     * ```
     *
     * const { init } = require('@sentry/node');
     *
     * init({
     *   dsn: '__DSN__',
     *   // ...
     * });
     * ```
     *
     * @example
     * ```
     *
     * const { configureScope } = require('@sentry/node');
     * configureScope((scope: Scope) => {
     *   scope.setExtra({ battery: 0.7 });
     *   scope.setTag({ user_mode: 'admin' });
     *   scope.setUser({ id: '4711' });
     * });
     * ```
     *
     * @example
     * ```
     *
     * const { addBreadcrumb } = require('@sentry/node');
     * addBreadcrumb({
     *   message: 'My Breadcrumb',
     *   // ...
     * });
     * ```
     *
     * @example
     * ```
     *
     * const Sentry = require('@sentry/node');
     * Sentry.captureMessage('Hello, world!');
     * Sentry.captureException(new Error('Good bye'));
     * Sentry.captureEvent({
     *   message: 'Manual',
     *   stacktrace: [
     *     // ...
     *   ],
     * });
     * ```
     *
     * @see {@link NodeOptions} for documentation on configuration options.
     */
    function init(options = {}) {
      const carrier = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_17__.getMainCarrier)();
      const autoloadedIntegrations = (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_18__._optionalChain)([carrier, 'access', _ => _.__SENTRY__, 'optionalAccess', _2 => _2.integrations]) || [];
    
      options.defaultIntegrations =
        options.defaultIntegrations === false
          ? []
          : [
              ...(Array.isArray(options.defaultIntegrations) ? options.defaultIntegrations : defaultIntegrations),
              ...autoloadedIntegrations,
            ];
    
      if (options.dsn === undefined && process.env.SENTRY_DSN) {
        options.dsn = process.env.SENTRY_DSN;
      }
    
      if (options.tracesSampleRate === undefined && process.env.SENTRY_TRACES_SAMPLE_RATE) {
        const tracesSampleRate = parseFloat(process.env.SENTRY_TRACES_SAMPLE_RATE);
        if (isFinite(tracesSampleRate)) {
          options.tracesSampleRate = tracesSampleRate;
        }
      }
    
      if (options.release === undefined) {
        const detectedRelease = getSentryRelease();
        if (detectedRelease !== undefined) {
          options.release = detectedRelease;
        } else {
          // If release is not provided, then we should disable autoSessionTracking
          options.autoSessionTracking = false;
        }
      }
    
      if (options.environment === undefined && process.env.SENTRY_ENVIRONMENT) {
        options.environment = process.env.SENTRY_ENVIRONMENT;
      }
    
      if (options.autoSessionTracking === undefined && options.dsn !== undefined) {
        options.autoSessionTracking = true;
      }
    
      if (options.instrumenter === undefined) {
        options.instrumenter = 'sentry';
      }
    
      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
      if (domain__WEBPACK_IMPORTED_MODULE_0__.active) {
        (0,_sentry_core__WEBPACK_IMPORTED_MODULE_17__.setHubOnCarrier)(carrier, (0,_sentry_core__WEBPACK_IMPORTED_MODULE_17__.getCurrentHub)());
      }
    
      // TODO(v7): Refactor this to reduce the logic above
      const clientOptions = {
        ...options,
        stackParser: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_19__.stackParserFromStackParserOptions)(options.stackParser || defaultStackParser),
        integrations: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_20__.getIntegrationsToSetup)(options),
        transport: options.transport || _transports_http_js__WEBPACK_IMPORTED_MODULE_14__.makeNodeTransport,
      };
    
      (0,_sentry_core__WEBPACK_IMPORTED_MODULE_21__.initAndBind)(_client_js__WEBPACK_IMPORTED_MODULE_1__.NodeClient, clientOptions);
    
      if (options.autoSessionTracking) {
        startSessionTracking();
      }
    }
    
    /**
     * This is the getter for lastEventId.
     *
     * @returns The last event id of a captured event.
     */
    function lastEventId() {
      return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_17__.getCurrentHub)().lastEventId();
    }
    
    /**
     * 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 = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_17__.getCurrentHub)().getClient();
      if (client) {
        return client.flush(timeout);
      }
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_22__.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 = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_17__.getCurrentHub)().getClient();
      if (client) {
        return client.close(timeout);
      }
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_22__.logger.warn('Cannot flush events and disable SDK. No client defined.');
      return Promise.resolve(false);
    }
    
    /**
     * Function that takes an instance of NodeClient and checks if autoSessionTracking option is enabled for that client
     */
    function isAutoSessionTrackingEnabled(client) {
      if (client === undefined) {
        return false;
      }
      const clientOptions = client && client.getOptions();
      if (clientOptions && clientOptions.autoSessionTracking !== undefined) {
        return clientOptions.autoSessionTracking;
      }
      return false;
    }
    
    /**
     * Returns a release dynamically from environment variables.
     */
    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 (_sentry_utils__WEBPACK_IMPORTED_MODULE_23__.GLOBAL_OBJ.SENTRY_RELEASE && _sentry_utils__WEBPACK_IMPORTED_MODULE_23__.GLOBAL_OBJ.SENTRY_RELEASE.id) {
        return _sentry_utils__WEBPACK_IMPORTED_MODULE_23__.GLOBAL_OBJ.SENTRY_RELEASE.id;
      }
    
      return (
        // GitHub Actions - https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables
        process.env.GITHUB_SHA ||
        // Netlify - https://docs.netlify.com/configure-builds/environment-variables/#build-metadata
        process.env.COMMIT_REF ||
        // 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 ||
        fallback
      );
    }
    
    /** Node.js stack parser */
    const defaultStackParser = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_19__.createStackParser)((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_19__.nodeStackLineParser)(_module_js__WEBPACK_IMPORTED_MODULE_3__.getModule));
    
    /**
     * Enable automatic Session Tracking for the node process.
     */
    function startSessionTracking() {
      const hub = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_17__.getCurrentHub)();
      hub.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 = (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_18__._optionalChain)([hub, 'access', _3 => _3.getScope, 'call', _4 => _4(), 'optionalAccess', _5 => _5.getSession, 'call', _6 => _6()]);
        const terminalStates = ['exited', 'crashed'];
        // 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 && !terminalStates.includes(session.status)) hub.endSession();
      });
    }
    
    
    //# sourceMappingURL=sdk.js.map
    
    
    /***/ }),
    /* 1652 */
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    "use strict";
    __webpack_require__.r(__webpack_exports__);
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    /* harmony export */   "Console": () => (/* reexport safe */ _console_js__WEBPACK_IMPORTED_MODULE_0__.Console),
    /* harmony export */   "Http": () => (/* reexport safe */ _http_js__WEBPACK_IMPORTED_MODULE_1__.Http),
    /* harmony export */   "OnUncaughtException": () => (/* reexport safe */ _onuncaughtexception_js__WEBPACK_IMPORTED_MODULE_2__.OnUncaughtException),
    /* harmony export */   "OnUnhandledRejection": () => (/* reexport safe */ _onunhandledrejection_js__WEBPACK_IMPORTED_MODULE_3__.OnUnhandledRejection),
    /* harmony export */   "LinkedErrors": () => (/* reexport safe */ _linkederrors_js__WEBPACK_IMPORTED_MODULE_4__.LinkedErrors),
    /* harmony export */   "Modules": () => (/* reexport safe */ _modules_js__WEBPACK_IMPORTED_MODULE_5__.Modules),
    /* harmony export */   "ContextLines": () => (/* reexport safe */ _contextlines_js__WEBPACK_IMPORTED_MODULE_6__.ContextLines),
    /* harmony export */   "Context": () => (/* reexport safe */ _context_js__WEBPACK_IMPORTED_MODULE_7__.Context),
    /* harmony export */   "RequestData": () => (/* reexport safe */ _requestdata_js__WEBPACK_IMPORTED_MODULE_8__.RequestData)
    /* harmony export */ });
    /* harmony import */ var _console_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1653);
    /* harmony import */ var _http_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1655);
    /* harmony import */ var _onuncaughtexception_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1658);
    /* harmony import */ var _onunhandledrejection_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1660);
    /* harmony import */ var _linkederrors_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1661);
    /* harmony import */ var _modules_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1664);
    /* harmony import */ var _contextlines_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1662);
    /* harmony import */ var _context_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1665);
    /* harmony import */ var _requestdata_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1666);
    
    
    
    
    
    
    
    
    
    //# sourceMappingURL=index.js.map
    
    
    /***/ }),
    /* 1653 */
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    "use strict";
    __webpack_require__.r(__webpack_exports__);
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    /* harmony export */   "Console": () => (/* binding */ Console)
    /* harmony export */ });
    /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1602);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1612);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1654);
    /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(64);
    /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_0__);
    
    
    
    
    /** Console module integration */
    class Console  {constructor() { Console.prototype.__init.call(this); }
      /**
       * @inheritDoc
       */
       static __initStatic() {this.id = 'Console';}
    
      /**
       * @inheritDoc
       */
       __init() {this.name = Console.id;}
    
      /**
       * @inheritDoc
       */
       setupOnce() {
        for (const level of ['debug', 'info', 'warn', 'error', 'log']) {
          (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.fill)(console, level, createConsoleWrapper(level));
        }
      }
    } Console.__initStatic();
    
    /**
     * Wrapper function that'll be used for every console level
     */
    function createConsoleWrapper(level) {
      return function consoleWrapper(originalConsoleMethod) {
        const sentryLevel = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.severityLevelFromString)(level);
    
        /* eslint-disable prefer-rest-params */
        return function () {
          if ((0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.getCurrentHub)().getIntegration(Console)) {
            (0,_sentry_core__WEBPACK_IMPORTED_MODULE_3__.getCurrentHub)().addBreadcrumb(
              {
                category: 'console',
                level: sentryLevel,
                message: util__WEBPACK_IMPORTED_MODULE_0__.format.apply(undefined, arguments),
              },
              {
                input: [...arguments],
                level,
              },
            );
          }
    
          originalConsoleMethod.apply(this, arguments);
        };
        /* eslint-enable prefer-rest-params */
      };
    }
    
    
    //# sourceMappingURL=console.js.map
    
    
    /***/ }),
    /* 1654 */
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    "use strict";
    __webpack_require__.r(__webpack_exports__);
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    /* harmony export */   "severityFromString": () => (/* binding */ severityFromString),
    /* harmony export */   "severityLevelFromString": () => (/* binding */ severityLevelFromString),
    /* harmony export */   "validSeverityLevels": () => (/* binding */ validSeverityLevels)
    /* harmony export */ });
    // Note: Ideally the `SeverityLevel` type would be derived from `validSeverityLevels`, but that would mean either
    //
    // a) moving `validSeverityLevels` to `@sentry/types`,
    // b) moving the`SeverityLevel` type here, or
    // c) importing `validSeverityLevels` from here into `@sentry/types`.
    //
    // Option A would make `@sentry/types` a runtime dependency of `@sentry/utils` (not good), and options B and C would
    // create a circular dependency between `@sentry/types` and `@sentry/utils` (also not good). So a TODO accompanying the
    // type, reminding anyone who changes it to change this list also, will have to do.
    
    const validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug'];
    
    /**
     * Converts a string-based level into a member of the deprecated {@link Severity} enum.
     *
     * @deprecated `severityFromString` is deprecated. Please use `severityLevelFromString` instead.
     *
     * @param level String representation of Severity
     * @returns Severity
     */
    function severityFromString(level) {
      return severityLevelFromString(level) ;
    }
    
    /**
     * 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' : validSeverityLevels.includes(level) ? level : 'log') ;
    }
    
    
    //# sourceMappingURL=severity.js.map
    
    
    /***/ }),
    /* 1655 */
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    "use strict";
    __webpack_require__.r(__webpack_exports__);
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    /* harmony export */   "Http": () => (/* binding */ Http)
    /* harmony export */ });
    /* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1625);
    /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1602);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1609);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1615);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1612);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1610);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1657);
    /* harmony import */ var _utils_http_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1656);
    
    
    
    
    
    const NODE_VERSION = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.parseSemver)(process.versions.node);
    
    /**
     * The http module integration instruments Node's internal http module. It creates breadcrumbs, transactions for outgoing
     * http requests and attaches trace data when tracing is enabled via its `tracing` option.
     */
    class Http  {
      /**
       * @inheritDoc
       */
       static __initStatic() {this.id = 'Http';}
    
      /**
       * @inheritDoc
       */
       __init() {this.name = Http.id;}
    
      /**
       * @inheritDoc
       */
       constructor(options = {}) {;Http.prototype.__init.call(this);
        this._breadcrumbs = typeof options.breadcrumbs === 'undefined' ? true : options.breadcrumbs;
        this._tracing = !options.tracing ? undefined : options.tracing === true ? {} : options.tracing;
      }
    
      /**
       * @inheritDoc
       */
       setupOnce(
        _addGlobalEventProcessor,
        setupOnceGetCurrentHub,
      ) {
        // No need to instrument if we don't want to track anything
        if (!this._breadcrumbs && !this._tracing) {
          return;
        }
    
        const clientOptions = (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_2__._optionalChain)([setupOnceGetCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getOptions, 'call', _5 => _5()]);
    
        // Do not auto-instrument for other instrumenter
        if (clientOptions && clientOptions.instrumenter !== 'sentry') {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.log('HTTP Integration is skipped because of instrumenter configuration.');
          return;
        }
    
        // TODO (v8): `tracePropagationTargets` and `shouldCreateSpanForRequest` will be removed from clientOptions
        // and we will no longer have to do this optional merge, we can just pass `this._tracing` directly.
        const tracingOptions = this._tracing ? { ...clientOptions, ...this._tracing } : undefined;
    
        const wrappedHandlerMaker = _createWrappedRequestMethodFactory(this._breadcrumbs, tracingOptions);
    
        // eslint-disable-next-line @typescript-eslint/no-var-requires
        const httpModule = __webpack_require__(80);
        (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.fill)(httpModule, 'get', wrappedHandlerMaker);
        (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.fill)(httpModule, 'request', wrappedHandlerMaker);
    
        // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.
        // If we do, we'd get double breadcrumbs and double spans for `https` calls.
        // It has been changed in Node 9, so for all versions equal and above, we patch `https` separately.
        if (NODE_VERSION.major && NODE_VERSION.major > 8) {
          // eslint-disable-next-line @typescript-eslint/no-var-requires
          const httpsModule = __webpack_require__(81);
          (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.fill)(httpsModule, 'get', wrappedHandlerMaker);
          (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.fill)(httpsModule, 'request', wrappedHandlerMaker);
        }
      }
    }Http.__initStatic();
    
    // for ease of reading below
    
    /**
     * Function which creates a function which creates wrapped versions of internal `request` and `get` calls within `http`
     * and `https` modules. (NB: Not a typo - this is a creator^2!)
     *
     * @param breadcrumbsEnabled Whether or not to record outgoing requests as breadcrumbs
     * @param tracingEnabled Whether or not to record outgoing requests as tracing spans
     *
     * @returns A function which accepts the exiting handler and returns a wrapped handler
     */
    function _createWrappedRequestMethodFactory(
      breadcrumbsEnabled,
      tracingOptions,
    ) {
      // We're caching results so we don't have to recompute regexp every time we create a request.
      const createSpanUrlMap = {};
      const headersUrlMap = {};
    
      const shouldCreateSpan = (url) => {
        if ((0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_2__._optionalChain)([tracingOptions, 'optionalAccess', _6 => _6.shouldCreateSpanForRequest]) === undefined) {
          return true;
        }
    
        if (createSpanUrlMap[url]) {
          return createSpanUrlMap[url];
        }
    
        createSpanUrlMap[url] = tracingOptions.shouldCreateSpanForRequest(url);
    
        return createSpanUrlMap[url];
      };
    
      const shouldAttachTraceData = (url) => {
        if ((0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_2__._optionalChain)([tracingOptions, 'optionalAccess', _7 => _7.tracePropagationTargets]) === undefined) {
          return true;
        }
    
        if (headersUrlMap[url]) {
          return headersUrlMap[url];
        }
    
        headersUrlMap[url] = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_5__.stringMatchesSomePattern)(url, tracingOptions.tracePropagationTargets);
    
        return headersUrlMap[url];
      };
    
      return function wrappedRequestMethodFactory(originalRequestMethod) {
        return function wrappedMethod( ...args) {
          // eslint-disable-next-line @typescript-eslint/no-this-alias
          const httpModule = this;
    
          const requestArgs = (0,_utils_http_js__WEBPACK_IMPORTED_MODULE_0__.normalizeRequestArgs)(this, args);
          const requestOptions = requestArgs[0];
          const requestUrl = (0,_utils_http_js__WEBPACK_IMPORTED_MODULE_0__.extractUrl)(requestOptions);
    
          // we don't want to record requests to Sentry as either breadcrumbs or spans, so just use the original method
          if ((0,_utils_http_js__WEBPACK_IMPORTED_MODULE_0__.isSentryRequest)(requestUrl)) {
            return originalRequestMethod.apply(httpModule, requestArgs);
          }
    
          let requestSpan;
          let parentSpan;
    
          const scope = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_6__.getCurrentHub)().getScope();
    
          if (scope && tracingOptions && shouldCreateSpan(requestUrl)) {
            parentSpan = scope.getSpan();
    
            if (parentSpan) {
              requestSpan = parentSpan.startChild({
                description: `${requestOptions.method || 'GET'} ${requestUrl}`,
                op: 'http.client',
              });
    
              if (shouldAttachTraceData(requestUrl)) {
                const sentryTraceHeader = requestSpan.toTraceparent();
                (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
                  _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.log(
                    `[Tracing] Adding sentry-trace header ${sentryTraceHeader} to outgoing request to "${requestUrl}": `,
                  );
    
                requestOptions.headers = {
                  ...requestOptions.headers,
                  'sentry-trace': sentryTraceHeader,
                };
    
                if (parentSpan.transaction) {
                  const dynamicSamplingContext = parentSpan.transaction.getDynamicSamplingContext();
                  const sentryBaggageHeader = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_7__.dynamicSamplingContextToSentryBaggageHeader)(dynamicSamplingContext);
    
                  let newBaggageHeaderField;
                  if (!requestOptions.headers || !requestOptions.headers.baggage) {
                    newBaggageHeaderField = sentryBaggageHeader;
                  } else if (!sentryBaggageHeader) {
                    newBaggageHeaderField = requestOptions.headers.baggage;
                  } else if (Array.isArray(requestOptions.headers.baggage)) {
                    newBaggageHeaderField = [...requestOptions.headers.baggage, sentryBaggageHeader];
                  } else {
                    // Type-cast explanation:
                    // Technically this the following could be of type `(number | string)[]` but for the sake of simplicity
                    // we say this is undefined behaviour, since it would not be baggage spec conform if the user did this.
                    newBaggageHeaderField = [requestOptions.headers.baggage, sentryBaggageHeader] ;
                  }
    
                  requestOptions.headers = {
                    ...requestOptions.headers,
                    // Setting a hader to `undefined` will crash in node so we only set the baggage header when it's defined
                    ...(newBaggageHeaderField && { baggage: newBaggageHeaderField }),
                  };
                }
              } else {
                (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
                  _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.log(
                    `[Tracing] Not adding sentry-trace header to outgoing request (${requestUrl}) due to mismatching tracePropagationTargets option.`,
                  );
              }
    
              const transaction = parentSpan.transaction;
              if (transaction) {
    
    build-token's avatar
    build-token committed
                transaction.metadata.propagations++;
    
    build-token's avatar
    build-token committed
    236771 236772 236773 236774 236775 236776 236777 236778 236779 236780 236781 236782 236783 236784 236785 236786 236787 236788 236789 236790 236791 236792 236793 236794 236795 236796 236797 236798 236799 236800 236801 236802 236803 236804 236805 236806 236807 236808 236809 236810 236811 236812 236813 236814 236815 236816 236817 236818 236819 236820 236821 236822 236823 236824 236825 236826 236827 236828 236829 236830 236831 236832 236833 236834 236835 236836 236837 236838 236839 236840 236841 236842 236843 236844 236845 236846 236847 236848 236849 236850 236851 236852 236853 236854 236855 236856 236857 236858 236859 236860 236861 236862 236863 236864 236865 236866 236867 236868 236869 236870 236871 236872 236873 236874 236875 236876 236877 236878 236879 236880 236881 236882 236883 236884 236885 236886 236887 236888 236889 236890 236891 236892 236893 236894 236895 236896 236897 236898 236899 236900 236901 236902 236903 236904 236905 236906 236907 236908 236909 236910 236911 236912 236913 236914 236915 236916 236917 236918 236919 236920 236921 236922 236923 236924 236925 236926 236927 236928 236929 236930 236931 236932 236933 236934 236935 236936 236937 236938 236939 236940 236941 236942 236943 236944 236945 236946 236947 236948 236949 236950 236951 236952 236953 236954 236955 236956 236957 236958 236959 236960 236961 236962 236963 236964 236965 236966 236967 236968 236969 236970 236971 236972 236973 236974 236975 236976 236977 236978 236979 236980 236981 236982 236983 236984 236985 236986 236987 236988 236989 236990 236991 236992 236993 236994 236995 236996 236997 236998 236999 237000
              }
            }
          }
    
          // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
          return originalRequestMethod
            .apply(httpModule, requestArgs)
            .once('response', function ( res) {
              // eslint-disable-next-line @typescript-eslint/no-this-alias
              const req = this;
              if (breadcrumbsEnabled) {
                addRequestBreadcrumb('response', requestUrl, req, res);
              }
              if (requestSpan) {
                if (res.statusCode) {
                  requestSpan.setHttpStatus(res.statusCode);
                }
                requestSpan.description = (0,_utils_http_js__WEBPACK_IMPORTED_MODULE_0__.cleanSpanDescription)(requestSpan.description, requestOptions, req);
                requestSpan.finish();
              }
            })
            .once('error', function () {
              // eslint-disable-next-line @typescript-eslint/no-this-alias
              const req = this;
    
              if (breadcrumbsEnabled) {
                addRequestBreadcrumb('error', requestUrl, req);
              }
              if (requestSpan) {
                requestSpan.setHttpStatus(500);
                requestSpan.description = (0,_utils_http_js__WEBPACK_IMPORTED_MODULE_0__.cleanSpanDescription)(requestSpan.description, requestOptions, req);
                requestSpan.finish();
              }
            });
        };
      };
    }
    
    /**
     * Captures Breadcrumb based on provided request/response pair
     */
    function addRequestBreadcrumb(event, url, req, res) {
      if (!(0,_sentry_core__WEBPACK_IMPORTED_MODULE_6__.getCurrentHub)().getIntegration(Http)) {
        return;
      }
    
      (0,_sentry_core__WEBPACK_IMPORTED_MODULE_6__.getCurrentHub)().addBreadcrumb(
        {
          category: 'http',
          data: {
            method: req.method,
            status_code: res && res.statusCode,
            url,
          },
          type: 'http',
        },
        {
          event,
          request: req,
          response: res,
        },
      );
    }
    
    
    //# sourceMappingURL=http.js.map
    
    
    /***/ }),
    /* 1656 */
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    "use strict";
    __webpack_require__.r(__webpack_exports__);
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    /* harmony export */   "cleanSpanDescription": () => (/* binding */ cleanSpanDescription),
    /* harmony export */   "extractUrl": () => (/* binding */ extractUrl),
    /* harmony export */   "isSentryRequest": () => (/* binding */ isSentryRequest),
    /* harmony export */   "normalizeRequestArgs": () => (/* binding */ normalizeRequestArgs),
    /* harmony export */   "urlToOptions": () => (/* binding */ urlToOptions)
    /* harmony export */ });
    /* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1625);
    /* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1602);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1609);
    /* harmony import */ var url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(63);
    /* harmony import */ var url__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(url__WEBPACK_IMPORTED_MODULE_0__);
    
    
    
    
    
    const NODE_VERSION = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.parseSemver)(process.versions.node);
    
    /**
     * Checks whether given url points to Sentry server
     * @param url url to verify
     */
    function isSentryRequest(url) {
      const dsn = (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_2__._optionalChain)([_sentry_core__WEBPACK_IMPORTED_MODULE_3__.getCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getDsn, 'call', _5 => _5()]);
      return dsn ? url.includes(dsn.host) : false;
    }
    
    /**
     * Assemble a URL to be used for breadcrumbs and spans.
     *
     * @param requestOptions RequestOptions object containing the component parts for a URL
     * @returns Fully-formed URL
     */
    function extractUrl(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
      const port =
        !requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 ? '' : `:${requestOptions.port}`;
      const path = requestOptions.path ? requestOptions.path : '/';
    
      return `${protocol}//${hostname}${port}${path}`;
    }
    
    /**
     * Handle various edge cases in the span description (for spans representing http(s) requests).
     *
     * @param description current `description` property of the span representing the request
     * @param requestOptions Configuration data for the request
     * @param Request Request object
     *
     * @returns The cleaned description
     */
    function cleanSpanDescription(
      description,
      requestOptions,
      request,
    ) {
      // nothing to clean
      if (!description) {
        return description;
      }
    
      // eslint-disable-next-line prefer-const
      let [method, requestUrl] = description.split(' ');
    
      // superagent sticks the protocol in a weird place (we check for host because if both host *and* protocol are missing,
      // we're likely dealing with an internal route and this doesn't apply)
      if (requestOptions.host && !requestOptions.protocol) {
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
        requestOptions.protocol = (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_2__._optionalChain)([(request ), 'optionalAccess', _6 => _6.agent, 'optionalAccess', _7 => _7.protocol]); // worst comes to worst, this is undefined and nothing changes
        requestUrl = extractUrl(requestOptions);
      }
    
      // internal routes can end up starting with a triple slash rather than a single one
      if ((0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_2__._optionalChain)([requestUrl, 'optionalAccess', _8 => _8.startsWith, 'call', _9 => _9('///')])) {
        requestUrl = requestUrl.slice(2);
      }
    
      return `${method} ${requestUrl}`;
    }
    
    // the node types are missing a few properties which node's `urlToOptions` function spits out
    
    /**
     * Convert a URL object into a RequestOptions object.
     *
     * Copied from Node's internals (where it's used in http(s).request() and http(s).get()), modified only to use the
     * RequestOptions type above.
     *
     * See https://github.com/nodejs/node/blob/master/lib/internal/url.js.
     */
    function urlToOptions(url) {
      const options = {
        protocol: url.protocol,
        hostname:
          typeof url.hostname === 'string' && url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname,
        hash: url.hash,
        search: url.search,
        pathname: url.pathname,
        path: `${url.pathname || ''}${url.search || ''}`,
        href: url.href,
      };
      if (url.port !== '') {
        options.port = Number(url.port);
      }
      if (url.username || url.password) {
        options.auth = `${url.username}:${url.password}`;
      }
      return options;
    }
    
    /**
     * Normalize inputs to `http(s).request()` and `http(s).get()`.
     *
     * Legal inputs to `http(s).request()` and `http(s).get()` can take one of ten forms:
     *     [ RequestOptions | string | URL ],
     *     [ RequestOptions | string | URL, RequestCallback ],
     *     [ string | URL, RequestOptions ], and
     *     [ string | URL, RequestOptions, RequestCallback ].
     *
     * This standardizes to one of two forms: [ RequestOptions ] and [ RequestOptions, RequestCallback ]. A similar thing is
     * done as the first step of `http(s).request()` and `http(s).get()`; this just does it early so that we can interact
     * with the args in a standard way.
     *
     * @param requestArgs The inputs to `http(s).request()` or `http(s).get()`, as an array.
     *
     * @returns Equivalent args of the form [ RequestOptions ] or [ RequestOptions, RequestCallback ].
     */
    function normalizeRequestArgs(
      httpModule,
      requestArgs,
    ) {
      let callback, requestOptions;
    
      // pop off the callback, if there is one
      if (typeof requestArgs[requestArgs.length - 1] === 'function') {
        callback = requestArgs.pop() ;
      }
    
      // create a RequestOptions object of whatever's at index 0
      if (typeof requestArgs[0] === 'string') {
        requestOptions = urlToOptions(new url__WEBPACK_IMPORTED_MODULE_0__.URL(requestArgs[0]));
      } else if (requestArgs[0] instanceof url__WEBPACK_IMPORTED_MODULE_0__.URL) {
        requestOptions = urlToOptions(requestArgs[0]);
      } else {
        requestOptions = requestArgs[0];
      }
    
      // if the options were given separately from the URL, fold them in
      if (requestArgs.length === 2) {
        requestOptions = { ...requestOptions, ...requestArgs[1] };
      }
    
      // Figure out the protocol if it's currently missing