{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/@sentry/utils/esm/node.js","webpack:///./node_modules/@sentry/utils/esm/stacktrace.js","webpack:///./node_modules/@sentry/utils/esm/browser.js","webpack:///./node_modules/tslib/tslib.es6.js","webpack:///./node_modules/@sentry/utils/esm/is.js","webpack:///(webpack)/buildin/global.js","webpack:///./node_modules/@sentry/utils/esm/global.js","webpack:///(webpack)/buildin/harmony-module.js","webpack:///./node_modules/@sentry/utils/esm/memo.js","webpack:///./node_modules/@sentry/utils/esm/time.js","webpack:///./node_modules/@sentry/utils/esm/object.js","webpack:///./node_modules/process/browser.js","webpack:///./node_modules/@sentry/core/esm/integrations/functiontostring.js","webpack:///./node_modules/@sentry/utils/esm/syncpromise.js","webpack:///./node_modules/@sentry/hub/esm/scope.js","webpack:///./node_modules/@sentry/utils/esm/misc.js","webpack:///./node_modules/@sentry/utils/esm/logger.js","webpack:///./node_modules/@sentry/hub/esm/session.js","webpack:///./node_modules/@sentry/hub/esm/hub.js","webpack:///./node_modules/@sentry/core/esm/integrations/inboundfilters.js","webpack:///./node_modules/@sentry/utils/esm/supports.js","webpack:///./node_modules/@sentry/utils/esm/instrument.js","webpack:///./node_modules/@sentry/core/esm/version.js","webpack:///./node_modules/@sentry/utils/esm/polyfill.js","webpack:///./node_modules/@sentry/utils/esm/error.js","webpack:///./node_modules/@sentry/utils/esm/dsn.js","webpack:///./node_modules/@sentry/core/esm/integration.js","webpack:///./node_modules/@sentry/core/esm/baseclient.js","webpack:///./node_modules/@sentry/core/esm/transports/noop.js","webpack:///./node_modules/@sentry/types/esm/severity.js","webpack:///./node_modules/@sentry/core/esm/basebackend.js","webpack:///./node_modules/@sentry/browser/esm/stack-parsers.js","webpack:///./node_modules/@sentry/browser/esm/eventbuilder.js","webpack:///./node_modules/@sentry/core/esm/api.js","webpack:///./node_modules/@sentry/utils/esm/envelope.js","webpack:///./node_modules/@sentry/core/esm/request.js","webpack:///./node_modules/@sentry/utils/esm/promisebuffer.js","webpack:///./node_modules/@sentry/utils/esm/ratelimit.js","webpack:///./node_modules/@sentry/browser/esm/transports/utils.js","webpack:///./node_modules/@sentry/utils/esm/async.js","webpack:///./node_modules/@sentry/browser/esm/transports/base.js","webpack:///./node_modules/@sentry/utils/esm/clientreport.js","webpack:///./node_modules/@sentry/utils/esm/status.js","webpack:///./node_modules/@sentry/browser/esm/transports/fetch.js","webpack:///./node_modules/@sentry/browser/esm/transports/xhr.js","webpack:///./node_modules/@sentry/browser/esm/backend.js","webpack:///./node_modules/@sentry/minimal/esm/index.js","webpack:///./node_modules/@sentry/browser/esm/helpers.js","webpack:///./node_modules/@sentry/utils/esm/enums.js","webpack:///./node_modules/@sentry/utils/esm/severity.js","webpack:///./node_modules/@sentry/browser/esm/integrations/breadcrumbs.js","webpack:///./node_modules/@sentry/browser/esm/client.js","webpack:///./node_modules/@sentry/browser/esm/integrations/trycatch.js","webpack:///./node_modules/@sentry/browser/esm/integrations/globalhandlers.js","webpack:///./node_modules/@sentry/browser/esm/integrations/linkederrors.js","webpack:///./node_modules/@sentry/browser/esm/integrations/dedupe.js","webpack:///./node_modules/@sentry/browser/esm/integrations/useragent.js","webpack:///./node_modules/@sentry/browser/esm/sdk.js","webpack:///./node_modules/@sentry/core/esm/sdk.js","webpack:///./app/javascript/packs/sentry.js.erb","webpack:///./node_modules/@sentry/utils/esm/env.js","webpack:///./node_modules/@sentry/utils/esm/string.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","isNodeEnv","toString","process","dynamicRequire","mod","request","require","createStackParser","parsers","_i","arguments","length","sortedParsers","sort","a","b","map","stack","skipFirst","e_1","_a","e_2","_b","frames","_c","split","slice","_d","next","done","line","sortedParsers_1","sortedParsers_1_1","frame","parser","push","e_2_1","error","e_1_1","stripSentryFramesAndReverse","localStack","firstFrameFunction","lastFrameFunction","indexOf","filename","reverse","getFunctionName","fn","e","htmlTreeAsString","elem","keyAttrs","currentElem","out","height","len","sepLength","nextStr","_htmlElementAsString","parentNode","join","_oO","el","className","classes","attr","tagName","toLowerCase","keyAttrPairs","filter","keyAttr","getAttribute","forEach","keyAttrPair","id","allowedAttrs","getLocationHref","global","document","location","href","oO","_extendStatics","setPrototypeOf","__proto__","Array","__extends","__","this","constructor","_assign","assign","apply","__values","iterator","TypeError","__read","ar","__spread","concat","_typeof","obj","objectToString","isError","wat","isInstanceOf","Error","isBuiltin","ty","isErrorEvent","isDOMError","isDOMException","isString","isPrimitive","isPlainObject","isEvent","Event","isElement","Element","isRegExp","isThenable","Boolean","then","isSyntheticEvent","base","_e","g","Function","window","fallbackGlobalObject","getGlobalObject","self","originalModule","webpackPolyfill","children","memoBuilder","hasWeakSet","WeakSet","inner","has","add","splice","dateTimestampSource","nowSeconds","Date","now","platformPerformance","performance","_","getNodePerformance","timeOrigin","getBrowserPerformance","timestampSource","undefined","dateTimestampInSeconds","timestampInSeconds","performanceNow","dateNow","timeOriginDelta","Math","abs","timeOriginIsReliable","navigationStart","timing","navigationStartDelta","fill","source","replacementFactory","original","wrapped","markFunctionWrapped","_Oo","addNonEnumerableProperty","writable","configurable","proto","getOriginalFunction","func","__sentry_original__","urlEncode","keys","encodeURIComponent","getWalkSource","err","message","event_1","type","target","currentTarget","CustomEvent","detail","jsonSize","encodeURI","utf8Length","JSON","stringify","normalizeToSize","depth","maxSize","serialized","normalize","makeSerializable","_events","String","walk","memo","Infinity","memoize","unmemoize","serializable","serializeValue","toJSON","acc","isArray","innerKey","innerValue","input","extractExceptionKeysForMessage","exception","maxLength","includedKeys","dropUndefinedKeys","val","rv","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","setTimeout","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","drainQueue","timeout","run","marker","runClearTimeout","Item","array","noop","nextTick","args","title","browser","env","argv","version","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","originalFunctionToString","FunctionToString","setupOnce","context","resolvedSyncPromise","resolve","rejectedSyncPromise","reason","reject","SyncPromise","executor","_this","_state","_handlers","_resolve","_setResult","_reject","state","is","_value","_executeHandlers","cachedHandlers","handler","onfulfilled","onrejected","result","onfinally","isRejected","Scope","_notifyingListeners","_scopeListeners","_eventProcessors","_breadcrumbs","_user","_tags","_extra","_contexts","_sdkProcessingMetadata","clone","scope","newScope","_level","_span","_session","_transactionName","_fingerprint","_requestSession","addScopeListener","callback","addEventProcessor","setUser","user","update","_notifyScopeListeners","getUser","getRequestSession","setRequestSession","requestSession","setTags","tags","setTag","setExtras","extras","setExtra","extra","setFingerprint","fingerprint","setLevel","level","setTransactionName","setTransaction","setContext","setSpan","span","getSpan","getTransaction","transaction","setSession","session","getSession","captureContext","updatedScope","contexts","clear","addBreadcrumb","breadcrumb","maxBreadcrumbs","maxCrumbs","min","mergedBreadcrumb","timestamp","clearBreadcrumbs","applyToEvent","event","hint","trace","getTraceContext","transactionName","_applyFingerprint","breadcrumbs","sdkProcessingMetadata","_notifyEventProcessors","getGlobalEventProcessors","setSDKProcessingMetadata","newData","processors","index","processor","_final","__SENTRY__","globalEventProcessors","uuid4","crypto","msCrypto","getRandomValues","arr","Uint16Array","pad","num","v","replace","random","parseUrl","url","match","query","fragment","host","path","protocol","relative","getFirstException","values","getEventDescription","eventId","event_id","firstException","addExceptionTypeValue","addExceptionMechanism","newMechanism","currentMechanism","mechanism","handled","mergedData","data","checkOrSetAlreadyCaught","__sentry_captured__","PREFIX","consoleSandbox","originalConsole","console","wrappedLevels","Logger","_enabled","disable","enable","log","warn","logger","Session","errors","sid","duration","status","init","ignoreDuration","startingTime","time","started","ipAddress","ip_address","did","email","username","release","environment","userAgent","close","toISOString","attrs","user_agent","Hub","client","_version","_stack","getStackTop","bindClient","isOlderThan","setupIntegrations","pushScope","getScope","getStack","getClient","popScope","pop","withScope","captureException","_lastEventId","finalHint","syntheticException","originalException","_invokeClient","captureMessage","captureEvent","lastEventId","getOptions","beforeBreadcrumb","finalBreadcrumb","configureScope","oldHub","makeMain","getIntegration","integration","startSpan","_callExtensionMethod","startTransaction","customSamplingContext","traceHeaders","captureSession","endSession","_sendSessionUpdate","layer","startSession","navigator","currentSession","method","carrier","getMainCarrier","sentry","extensions","hub","registry","getHubFromCarrier","setHubOnCarrier","hasHubOnCarrier","activeDomain","domain","active","registryHubTopStack","getHubFromActiveDomain","DEFAULT_IGNORE_ERRORS","InboundFilters","_options","clientOptions","options","_mergeOptions","_shouldDropEvent","_isSentryError","_isIgnoredError","_isDeniedUrl","_getEventFilterUrl","_isAllowedUrl","ignoreInternal","ignoreErrors","_getPossibleEventMessages","some","pattern","denyUrls","allowUrls","whitelistUrls","blacklistUrls","_getLastValidUrl","stacktrace","frames_1","supportsFetch","Headers","Request","Response","isNativeFetch","test","supportsReferrerPolicy","referrerPolicy","lastHref","handlers","instrumented","instrument","originalConsoleMethod","triggerHandlers","instrumentConsole","triggerDOMHandler","globalDOMEventHandler","makeDOMEventHandler","addEventListener","originalAddEventListener","listener","handlers_1","__sentry_instrumentation_handlers__","handlerForType","refCount","originalRemoveEventListener","handlers_2","instrumentDOM","xhrproto","XMLHttpRequest","originalOpen","xhr","xhrInfo","__sentry_xhr__","toUpperCase","__sentry_own_request__","onreadystatechangeHandler","readyState","status_code","endTimestamp","startTimestamp","onreadystatechange","readyStateArgs","originalSend","body","instrumentXHR","fetch","doc","createElement","sandbox","hidden","head","appendChild","contentWindow","removeChild","supportsNativeFetch","originalFetch","handlerData","fetchData","getFetchMethod","getFetchUrl","response","instrumentFetch","chrome","isChromePackagedApp","app","runtime","hasHistoryApi","history","pushState","replaceState","oldOnPopState","onpopstate","historyReplacementFunction","originalHistoryFunction","from","to","instrumentHistory","_oldOnErrorHandler","onerror","msg","column","_oldOnUnhandledRejectionHandler","onunhandledrejection","addInstrumentationHandler","fetchArgs","debounceTimerID","lastCapturedEvent","globalListener","isContentEditable","shouldSkipDOMEvent","previous","current","shouldShortcircuitPreviousDebounce","prop","_super","SentryError","_newTarget","DSN_REGEX","dsnToString","dsn","withPassword","pass","port","projectId","publicKey","dsnFromComponents","components","makeDsn","str","exec","projectMatch","dsnFromString","component","isValidProtocol","isNaN","parseInt","validateDsn","installedIntegrations","filterDuplicates","integrations","reduce","every","accIntegration","defaultIntegrations","userIntegrations","userIntegration","integrationsNames","getIntegrationsToSetup","setupIntegration","ALREADY_SEEN_ERROR","BaseClient","backendClass","_integrations","_numProcessing","_backend","_dsn","_process","_getBackend","eventFromException","_captureEvent","promisedEvent","eventFromMessage","_isEnabled","_sendSession","getDsn","getTransport","flush","_isClientDoneProcessing","clientFinished","transportFlushed","enabled","initialized","_updateSessionFromEvent","crashed","errored","exceptions","exceptions_1","exceptions_1_1","sessionNonTerminal","Number","sendSession","ticked","interval","setInterval","clearInterval","_prepareEvent","normalizeDepth","prepared","_applyClientOptions","_applyIntegrationsMetadata","finalScope","evt","_normalizeEvent","normalized","baseClientNormalized","dist","maxValueLength","integrationsArray","sdk","_sendEvent","sendEvent","_processEvent","finalEvent","beforeSend","sampleRate","transport","recordLostEvent","outcome","category","isTransaction","__sentry__","nullErr","_ensureBeforeSendRv","processedEvent","promise","Severity","NoopTransport","BaseBackend","_transport","_setupTransport","_exception","_hint","_message","createFrame","lineno","colno","in_app","chromeRegex","chromeEvalRegex","chromeStackParser","parts","subMatch","extractSafariExtensionDetails","geckoREgex","geckoEvalRegex","geckoStackParser","winjsRegex","winjsStackParser","opera10Regex","opera10StackParser","opera11Regex","opera11StackParser","isSafariExtension","isSafariWebExtension","exceptionFromError","ex","parseStackFrames","extractMessage","eventFromError","popSize","framesToPop","reactMinifiedRegexp","getPopSize","eventFromUnknownInput","attachStacktrace","isUnhandledRejection","domException","name_1","eventFromString","code","__serialized__","eventFromPlainObject","synthetic","frames_2","API","metadata","tunnel","_dsnObject","_tunnel","forceEnvelope","getBaseApiEndpoint","getStoreEndpoint","getStoreEndpointWithUrlEncodedAuth","getEnvelopeEndpointWithUrlEncodedAuth","_getIngestEndpoint","_encodedAuth","sentry_key","sentry_version","_getEnvelopeEndpoint","createEnvelope","headers","items","serializeEnvelope","envelope","serializedHeaders","item","itemHeaders","payload","serializedPayload","getSdkMetadataForEnvelopeHeader","api","eventToSentryRequest","sdkInfo","eventType","useEnvelope","transactionSampling","samplingMethod","rate","packages","enhanceEventWithSdkInfo","skippedNormalization","JSONStringifyError","newErr","innerErr","req","sent_at","sample_rates","makePromiseBuffer","limit","buffer","remove","task","$","taskProducer","drain","counter","capturedSetTimeout","parseRetryAfterHeader","header","headerDelay","headerDate","parse","cachedFetchImpl","getNativeFetchImplementation","fetchImpl","sendReport","sendBeacon","fetch_1","credentials","keepalive","requestTypeToCategory","BaseTransport","_buffer","_rateLimits","_outcomes","_api","_metadata","initDsn","sendClientReports","visibilityState","_flushOutcomes","_sendRequest","sessionToSentryRequest","outcomes","discarded_events","discardedEvents","quantity","_handleResponse","requestType","_handleRateLimit","_disabledUntil","all","_isRateLimited","rlHeader","raHeader","trim","parameters","delay","_f","FetchTransport","_fetch","sentryRequest","originalPayload","Promise","fetchParameters","XHRTransport","getResponseHeader","open","setRequestHeader","send","BrowserBackend","Info","transportOptions","callOnHub","ignoreOnError","shouldIgnoreOnError","ignoreNextOnError","wrap","before","wrapper","__sentry_wrapped__","sentryWrapped","wrappedArguments","arg","getOwnPropertyDescriptor","injectReportDialog","script","async","src","dsnLike","dialogOptions","endpoint","encodedOptions","getReportDialogEndpoint","onLoad","onload","injectionPoint","severityFromString","Warning","isSupportedSeverity","Log","Breadcrumbs","dom","addSentryBreadcrumb","_consoleBreadcrumb","serializeAttribute","_xhrBreadcrumb","_fetchBreadcrumb","_historyBreadcrumb","parsedLoc","parsedFrom","parsedTo","BrowserClient","showReportDialog","platform","DEFAULT_EVENT_TARGET","TryCatch","eventTarget","requestAnimationFrame","_wrapTimeFunction","_wrapRAF","_wrapXHR","eventTargetOption","_wrapEventTarget","originalCallback","xmlHttpRequestProps","wrapOptions","originalFunction","eventName","handleEvent","wrappedEventHandler","originalEventHandler","GlobalHandlers","_installFunc","_installGlobalOnErrorHandler","_installGlobalOnUnhandledRejectionHandler","stackTraceLimit","installFunc","globalHandlerLog","getHubAndAttachStacktrace","groups","_enhanceEventWithInitialFrame","_eventFromIncompleteOnError","addMechanismAndCapture","ev","ev0","ev0s","ev0sf","LinkedErrors","_key","_limit","linkedErrors","_walkErrorTree","_handler","Dedupe","addGlobalEventProcessor","getCurrentHub","currentEvent","previousEvent","currentMessage","previousMessage","_isSameFingerprint","_isSameStacktrace","_isSameMessageEvent","previousException","_getExceptionFromEvent","currentException","_isSameExceptionEvent","_previousEvent","currentFrames","_getFramesFromEvent","previousFrames","frameA","frameB","currentFingerprint","previousFingerprint","UserAgent","referrer","Referer","startSessionOnHub","window_1","SENTRY_RELEASE","autoSessionTracking","clientClass","debug","initialScope","initAndBind","startSessionTracking","Sentry","isDebugBuild","__SENTRY_NO_DEBUG__","__SENTRY_BROWSER_BUNDLE__","isBrowserBundle","truncate","max","substr","snipLine","newLine","lineLength","start","end","safeJoin","delimiter","output","isMatchingPattern"],"mappings":";aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,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C,EAAO2hB,GACvC,QAAK,YAAS3hB,KAIV,YAAS2hB,GACJA,EAAQa,KAAKxiB,GAGC,kBAAZ2hB,IAC0B,IAA5B3hB,EAAM0D,QAAQie","file":"js/sentry-891167431ed9581effa3.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/packs/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 615);\n","/**\n * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,\n * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.\n */\nimport { isBrowserBundle } from './env';\n/**\n * Checks whether we're in the Node.js or Browser environment\n *\n * @returns Answer to given question\n */\n\nexport function isNodeEnv() {\n // explicitly check for browser bundles as those can be optimized statically\n // by terser/rollup.\n return !isBrowserBundle() && Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]';\n}\n/**\n * Requires a module which is protected against bundler minification.\n *\n * @param request The module path to resolve\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\nexport function dynamicRequire(mod, request) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return mod.require(request);\n}\n/**\n * Helper for dynamically loading module that should work with linked dependencies.\n * The problem is that we _should_ be using `require(require.resolve(moduleName, { paths: [cwd()] }))`\n * However it's _not possible_ to do that with Webpack, as it has to know all the dependencies during\n * build time. `require.resolve` is also not available in any other way, so we cannot create,\n * a fake helper like we do with `dynamicRequire`.\n *\n * We always prefer to use local package, thus the value is not returned early from each `try/catch` block.\n * That is to mimic the behavior of `require.resolve` exactly.\n *\n * @param moduleName module name to require\n * @returns possibly required module\n */\n\nexport function loadModule(moduleName) {\n var mod;\n\n try {\n mod = dynamicRequire(module, moduleName);\n } catch (e) {// no-empty\n }\n\n try {\n var cwd = dynamicRequire(module, 'process').cwd;\n mod = dynamicRequire(module, cwd() + \"/node_modules/\" + moduleName);\n } catch (e) {// no-empty\n }\n\n return mod;\n}","import { __assign, __values } from \"tslib\";\nvar STACKTRACE_LIMIT = 50;\n/**\n * Creates a stack parser with the supplied line parsers\n *\n * StackFrames are returned in the correct order for Sentry Exception\n * frames and with Sentry SDK internal frames removed from the top and bottom\n *\n */\n\nexport function createStackParser() {\n var parsers = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n parsers[_i] = arguments[_i];\n }\n\n var sortedParsers = parsers.sort(function (a, b) {\n return a[0] - b[0];\n }).map(function (p) {\n return p[1];\n });\n return function (stack, skipFirst) {\n var e_1, _a, e_2, _b;\n\n if (skipFirst === void 0) {\n skipFirst = 0;\n }\n\n var frames = [];\n\n try {\n for (var _c = __values(stack.split('\\n').slice(skipFirst)), _d = _c.next(); !_d.done; _d = _c.next()) {\n var line = _d.value;\n\n try {\n for (var sortedParsers_1 = (e_2 = void 0, __values(sortedParsers)), sortedParsers_1_1 = sortedParsers_1.next(); !sortedParsers_1_1.done; sortedParsers_1_1 = sortedParsers_1.next()) {\n var parser = sortedParsers_1_1.value;\n var frame = parser(line);\n\n if (frame) {\n frames.push(frame);\n break;\n }\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (sortedParsers_1_1 && !sortedParsers_1_1.done && (_b = sortedParsers_1[\"return\"])) _b.call(sortedParsers_1);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_d && !_d.done && (_a = _c[\"return\"])) _a.call(_c);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n return stripSentryFramesAndReverse(frames);\n };\n}\n/**\n * @hidden\n */\n\nexport function stripSentryFramesAndReverse(stack) {\n if (!stack.length) {\n return [];\n }\n\n var localStack = stack;\n var firstFrameFunction = localStack[0][\"function\"] || '';\n var lastFrameFunction = localStack[localStack.length - 1][\"function\"] || ''; // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)\n\n if (firstFrameFunction.indexOf('captureMessage') !== -1 || firstFrameFunction.indexOf('captureException') !== -1) {\n localStack = localStack.slice(1);\n } // 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)\n\n\n if (lastFrameFunction.indexOf('sentryWrapped') !== -1) {\n localStack = localStack.slice(0, -1);\n } // The frame where the crash happened, should be the last entry in the array\n\n\n return localStack.slice(0, STACKTRACE_LIMIT).map(function (frame) {\n return __assign(__assign({}, frame), {\n filename: frame.filename || localStack[0].filename,\n \"function\": frame[\"function\"] || '?'\n });\n }).reverse();\n}\nvar defaultFunctionName = '';\n/**\n * Safely extract function name from itself\n */\n\nexport function getFunctionName(fn) {\n try {\n if (!fn || typeof fn !== 'function') {\n return defaultFunctionName;\n }\n\n return fn.name || defaultFunctionName;\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return defaultFunctionName;\n }\n}","import { getGlobalObject } from './global';\nimport { isString } from './is';\n/**\n * Given a child DOM element, returns a query-selector statement describing that\n * and its ancestors\n * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]\n * @returns generated DOM path\n */\n\nexport function htmlTreeAsString(elem, keyAttrs) {\n // try/catch both:\n // - accessing event.target (see getsentry/raven-js#838, #768)\n // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly\n // - can throw an exception in some circumstances.\n try {\n var currentElem = elem;\n var MAX_TRAVERSE_HEIGHT = 5;\n var MAX_OUTPUT_LEN = 80;\n var out = [];\n var height = 0;\n var len = 0;\n var separator = ' > ';\n var sepLength = separator.length;\n var nextStr = void 0; // eslint-disable-next-line no-plusplus\n\n while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = _htmlElementAsString(currentElem, keyAttrs); // bail out if\n // - nextStr is the 'html' element\n // - the length of the string that would be created exceeds MAX_OUTPUT_LEN\n // (ignore this limit if we are on the first iteration)\n\n if (nextStr === 'html' || height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN) {\n break;\n }\n\n out.push(nextStr);\n len += nextStr.length;\n currentElem = currentElem.parentNode;\n }\n\n return out.reverse().join(separator);\n } catch (_oO) {\n return '';\n }\n}\n/**\n * Returns a simple, query-selector representation of a DOM element\n * e.g. [HTMLElement] => input#foo.btn[name=baz]\n * @returns generated DOM path\n */\n\nfunction _htmlElementAsString(el, keyAttrs) {\n var elem = el;\n var out = [];\n var className;\n var classes;\n var key;\n var attr;\n var i;\n\n if (!elem || !elem.tagName) {\n return '';\n }\n\n out.push(elem.tagName.toLowerCase()); // Pairs of attribute keys defined in `serializeAttribute` and their values on element.\n\n var keyAttrPairs = keyAttrs && keyAttrs.length ? keyAttrs.filter(function (keyAttr) {\n return elem.getAttribute(keyAttr);\n }).map(function (keyAttr) {\n return [keyAttr, elem.getAttribute(keyAttr)];\n }) : null;\n\n if (keyAttrPairs && keyAttrPairs.length) {\n keyAttrPairs.forEach(function (keyAttrPair) {\n out.push(\"[\" + keyAttrPair[0] + \"=\\\"\" + keyAttrPair[1] + \"\\\"]\");\n });\n } else {\n if (elem.id) {\n out.push(\"#\" + elem.id);\n } // eslint-disable-next-line prefer-const\n\n\n className = elem.className;\n\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n\n for (i = 0; i < classes.length; i++) {\n out.push(\".\" + classes[i]);\n }\n }\n }\n\n var allowedAttrs = ['type', 'name', 'title', 'alt'];\n\n for (i = 0; i < allowedAttrs.length; i++) {\n key = allowedAttrs[i];\n attr = elem.getAttribute(key);\n\n if (attr) {\n out.push(\"[\" + key + \"=\\\"\" + attr + \"\\\"]\");\n }\n }\n\n return out.join('');\n}\n/**\n * A safe form of location.href\n */\n\n\nexport function getLocationHref() {\n var global = getGlobalObject();\n\n try {\n return global.document.location.href;\n } catch (oO) {\n return '';\n }\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\n\n/* global Reflect, Promise */\nvar _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (b.hasOwnProperty(p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nvar _assign = function __assign() {\n _assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return _assign.apply(this, arguments);\n};\n\nexport { _assign as __assign };\nexport function __rest(s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n}\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if ((typeof Reflect === \"undefined\" ? \"undefined\" : _typeof(Reflect)) === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {\n if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n }\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\nexport function __param(paramIndex, decorator) {\n return function (target, key) {\n decorator(target, key, paramIndex);\n };\n}\nexport function __metadata(metadataKey, metadataValue) {\n if ((typeof Reflect === \"undefined\" ? \"undefined\" : _typeof(Reflect)) === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\nexport function __generator(thisArg, body) {\n var _ = {\n label: 0,\n sent: function sent() {\n if (t[0] & 1) throw t[1];\n return t[1];\n },\n trys: [],\n ops: []\n },\n f,\n y,\n t,\n g;\n return g = {\n next: verb(0),\n \"throw\": verb(1),\n \"return\": verb(2)\n }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () {\n return this;\n }), g;\n\n function verb(n) {\n return function (v) {\n return step([n, v]);\n };\n }\n\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n\n while (_) {\n try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n\n case 4:\n _.label++;\n return {\n value: op[1],\n done: false\n };\n\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n\n case 7:\n op = _.ops.pop();\n\n _.trys.pop();\n\n continue;\n\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n\n if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {\n _.label = op[1];\n break;\n }\n\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n\n if (t && _.label < t[2]) {\n _.label = t[2];\n\n _.ops.push(op);\n\n break;\n }\n\n if (t[2]) _.ops.pop();\n\n _.trys.pop();\n\n continue;\n }\n\n op = body.call(thisArg, _);\n } catch (e) {\n op = [6, e];\n y = 0;\n } finally {\n f = t = 0;\n }\n }\n\n if (op[0] & 5) throw op[1];\n return {\n value: op[0] ? op[1] : void 0,\n done: true\n };\n }\n}\nexport function __exportStar(m, exports) {\n for (var p in m) {\n if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n }\n}\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator,\n m = s && o[s],\n i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function next() {\n if (o && i >= o.length) o = void 0;\n return {\n value: o && o[i++],\n done: !o\n };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o),\n r,\n ar = [],\n e;\n\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {\n ar.push(r.value);\n }\n } catch (error) {\n e = {\n error: error\n };\n } finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n } finally {\n if (e) throw e.error;\n }\n }\n\n return ar;\n}\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++) {\n ar = ar.concat(__read(arguments[i]));\n }\n\n return ar;\n}\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) {\n s += arguments[i].length;\n }\n\n for (var r = Array(s), k = 0, i = 0; i < il; i++) {\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) {\n r[k] = a[j];\n }\n }\n\n return r;\n}\n;\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []),\n i,\n q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () {\n return this;\n }, i;\n\n function verb(n) {\n if (g[n]) i[n] = function (v) {\n return new Promise(function (a, b) {\n q.push([n, v, a, b]) > 1 || resume(n, v);\n });\n };\n }\n\n function resume(n, v) {\n try {\n step(g[n](v));\n } catch (e) {\n settle(q[0][3], e);\n }\n }\n\n function step(r) {\n r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);\n }\n\n function fulfill(value) {\n resume(\"next\", value);\n }\n\n function reject(value) {\n resume(\"throw\", value);\n }\n\n function settle(f, v) {\n if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);\n }\n}\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) {\n throw e;\n }), verb(\"return\"), i[Symbol.iterator] = function () {\n return this;\n }, i;\n\n function verb(n, f) {\n i[n] = o[n] ? function (v) {\n return (p = !p) ? {\n value: __await(o[n](v)),\n done: n === \"return\"\n } : f ? f(v) : v;\n } : f;\n }\n}\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator],\n i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () {\n return this;\n }, i);\n\n function verb(n) {\n i[n] = o[n] && function (v) {\n return new Promise(function (resolve, reject) {\n v = o[n](v), settle(resolve, reject, v.done, v.value);\n });\n };\n }\n\n function settle(resolve, reject, d, v) {\n Promise.resolve(v).then(function (v) {\n resolve({\n value: v,\n done: d\n });\n }, reject);\n }\n}\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) {\n Object.defineProperty(cooked, \"raw\", {\n value: raw\n });\n } else {\n cooked.raw = raw;\n }\n\n return cooked;\n}\n;\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) {\n if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n }\n result[\"default\"] = mod;\n return result;\n}\nexport function __importDefault(mod) {\n return mod && mod.__esModule ? mod : {\n \"default\": mod\n };\n}\nexport function __classPrivateFieldGet(receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n\n return privateMap.get(receiver);\n}\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n\n privateMap.set(receiver, value);\n return value;\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n// eslint-disable-next-line @typescript-eslint/unbound-method\nvar objectToString = Object.prototype.toString;\n/**\n * Checks whether given value's type is one of a few Error or Error-like\n * {@link isError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isError(wat) {\n switch (objectToString.call(wat)) {\n case '[object Error]':\n case '[object Exception]':\n case '[object DOMException]':\n return true;\n\n default:\n return isInstanceOf(wat, Error);\n }\n}\n\nfunction isBuiltin(wat, ty) {\n return objectToString.call(wat) === \"[object \" + ty + \"]\";\n}\n/**\n * Checks whether given value's type is ErrorEvent\n * {@link isErrorEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\n\nexport function isErrorEvent(wat) {\n return isBuiltin(wat, 'ErrorEvent');\n}\n/**\n * Checks whether given value's type is DOMError\n * {@link isDOMError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isDOMError(wat) {\n return isBuiltin(wat, 'DOMError');\n}\n/**\n * Checks whether given value's type is DOMException\n * {@link isDOMException}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isDOMException(wat) {\n return isBuiltin(wat, 'DOMException');\n}\n/**\n * Checks whether given value's type is a string\n * {@link isString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isString(wat) {\n return isBuiltin(wat, 'String');\n}\n/**\n * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)\n * {@link isPrimitive}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isPrimitive(wat) {\n return wat === null || _typeof(wat) !== 'object' && typeof wat !== 'function';\n}\n/**\n * Checks whether given value's type is an object literal\n * {@link isPlainObject}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isPlainObject(wat) {\n return isBuiltin(wat, 'Object');\n}\n/**\n * Checks whether given value's type is an Event instance\n * {@link isEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isEvent(wat) {\n return typeof Event !== 'undefined' && isInstanceOf(wat, Event);\n}\n/**\n * Checks whether given value's type is an Element instance\n * {@link isElement}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isElement(wat) {\n return typeof Element !== 'undefined' && isInstanceOf(wat, Element);\n}\n/**\n * Checks whether given value's type is an regexp\n * {@link isRegExp}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isRegExp(wat) {\n return isBuiltin(wat, 'RegExp');\n}\n/**\n * Checks whether given value has a then function.\n * @param wat A value to be checked.\n */\n\nexport function isThenable(wat) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return Boolean(wat && wat.then && typeof wat.then === 'function');\n}\n/**\n * Checks whether given value's type is a SyntheticEvent\n * {@link isSyntheticEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isSyntheticEvent(wat) {\n return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;\n}\n/**\n * Checks whether given value's type is an instance of provided constructor.\n * {@link isInstanceOf}.\n *\n * @param wat A value to be checked.\n * @param base A constructor to be used in a check.\n * @returns A boolean representing the result.\n */\n\nexport function isInstanceOf(wat, base) {\n try {\n return wat instanceof base;\n } catch (_e) {\n return false;\n }\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar g; // This works in non-strict mode\n\ng = function () {\n return this;\n}();\n\ntry {\n // This works if eval is allowed (see CSP)\n g = g || new Function(\"return this\")();\n} catch (e) {\n // This works if the window reference is available\n if ((typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) === \"object\") g = window;\n} // g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\n\nmodule.exports = g;","/**\n * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,\n * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.\n */\nimport { isNodeEnv } from './node';\nvar fallbackGlobalObject = {};\n/**\n * Safely get global scope object\n *\n * @returns Global scope object\n */\n\nexport function getGlobalObject() {\n return isNodeEnv() ? global : typeof window !== 'undefined' // eslint-disable-line no-restricted-globals\n ? window // eslint-disable-line no-restricted-globals\n : typeof self !== 'undefined' ? self : fallbackGlobalObject;\n}","module.exports = function (originalModule) {\n if (!originalModule.webpackPolyfill) {\n var module = Object.create(originalModule); // module.parent = undefined by default\n\n if (!module.children) module.children = [];\n Object.defineProperty(module, \"loaded\", {\n enumerable: true,\n get: function get() {\n return module.l;\n }\n });\n Object.defineProperty(module, \"id\", {\n enumerable: true,\n get: function get() {\n return module.i;\n }\n });\n Object.defineProperty(module, \"exports\", {\n enumerable: true\n });\n module.webpackPolyfill = 1;\n }\n\n return module;\n};","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/**\n * Helper to decycle json objects\n */\nexport function memoBuilder() {\n var hasWeakSet = typeof WeakSet === 'function';\n var inner = hasWeakSet ? new WeakSet() : [];\n\n function memoize(obj) {\n if (hasWeakSet) {\n if (inner.has(obj)) {\n return true;\n }\n\n inner.add(obj);\n return false;\n } // eslint-disable-next-line @typescript-eslint/prefer-for-of\n\n\n for (var i = 0; i < inner.length; i++) {\n var value = inner[i];\n\n if (value === obj) {\n return true;\n }\n }\n\n inner.push(obj);\n return false;\n }\n\n function unmemoize(obj) {\n if (hasWeakSet) {\n inner[\"delete\"](obj);\n } else {\n for (var i = 0; i < inner.length; i++) {\n if (inner[i] === obj) {\n inner.splice(i, 1);\n break;\n }\n }\n }\n }\n\n return [memoize, unmemoize];\n}","import { getGlobalObject } from './global';\nimport { dynamicRequire, isNodeEnv } from './node';\n/**\n * A TimestampSource implementation for environments that do not support the Performance Web API natively.\n *\n * Note that this TimestampSource does not use a monotonic clock. A call to `nowSeconds` may return a timestamp earlier\n * than a previously returned value. We do not try to emulate a monotonic behavior in order to facilitate debugging. It\n * is more obvious to explain \"why does my span have negative duration\" than \"why my spans have zero duration\".\n */\n\nvar dateTimestampSource = {\n nowSeconds: function nowSeconds() {\n return Date.now() / 1000;\n }\n};\n/**\n * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not\n * support the API.\n *\n * Wrapping the native API works around differences in behavior from different browsers.\n */\n\nfunction getBrowserPerformance() {\n var performance = getGlobalObject().performance;\n\n if (!performance || !performance.now) {\n return undefined;\n } // Replace performance.timeOrigin with our own timeOrigin based on Date.now().\n //\n // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin +\n // performance.now() gives a date arbitrarily in the past.\n //\n // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is\n // undefined.\n //\n // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to\n // interact with data coming out of performance entries.\n //\n // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that\n // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes\n // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have\n // observed skews that can be as long as days, weeks or months.\n //\n // See https://github.com/getsentry/sentry-javascript/issues/2590.\n //\n // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload\n // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation\n // transactions of long-lived web pages.\n\n\n var timeOrigin = Date.now() - performance.now();\n return {\n now: function now() {\n return performance.now();\n },\n timeOrigin: timeOrigin\n };\n}\n/**\n * Returns the native Performance API implementation from Node.js. Returns undefined in old Node.js versions that don't\n * implement the API.\n */\n\n\nfunction getNodePerformance() {\n try {\n var perfHooks = dynamicRequire(module, 'perf_hooks');\n return perfHooks.performance;\n } catch (_) {\n return undefined;\n }\n}\n/**\n * The Performance API implementation for the current platform, if available.\n */\n\n\nvar platformPerformance = isNodeEnv() ? getNodePerformance() : getBrowserPerformance();\nvar timestampSource = platformPerformance === undefined ? dateTimestampSource : {\n nowSeconds: function nowSeconds() {\n return (platformPerformance.timeOrigin + platformPerformance.now()) / 1000;\n }\n};\n/**\n * Returns a timestamp in seconds since the UNIX epoch using the Date API.\n */\n\nexport var dateTimestampInSeconds = dateTimestampSource.nowSeconds.bind(dateTimestampSource);\n/**\n * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the\n * availability of the Performance API.\n *\n * See `usingPerformanceAPI` to test whether the Performance API is used.\n *\n * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is\n * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The\n * skew can grow to arbitrary amounts like days, weeks or months.\n * See https://github.com/getsentry/sentry-javascript/issues/2590.\n */\n\nexport var timestampInSeconds = timestampSource.nowSeconds.bind(timestampSource); // Re-exported with an old name for backwards-compatibility.\n\nexport var timestampWithMs = timestampInSeconds;\n/**\n * A boolean that is true when timestampInSeconds uses the Performance API to produce monotonic timestamps.\n */\n\nexport var usingPerformanceAPI = platformPerformance !== undefined;\n/**\n * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only.\n */\n\nexport var _browserPerformanceTimeOriginMode;\n/**\n * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the\n * performance API is available.\n */\n\nexport var browserPerformanceTimeOrigin = function () {\n // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or\n // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin\n // data as reliable if they are within a reasonable threshold of the current time.\n var performance = getGlobalObject().performance;\n\n if (!performance || !performance.now) {\n _browserPerformanceTimeOriginMode = 'none';\n return undefined;\n }\n\n var threshold = 3600 * 1000;\n var performanceNow = performance.now();\n var dateNow = Date.now(); // if timeOrigin isn't available set delta to threshold so it isn't used\n\n var timeOriginDelta = performance.timeOrigin ? Math.abs(performance.timeOrigin + performanceNow - dateNow) : threshold;\n var timeOriginIsReliable = timeOriginDelta < threshold; // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin\n // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.\n // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always\n // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the\n // Date API.\n // eslint-disable-next-line deprecation/deprecation\n\n var navigationStart = performance.timing && performance.timing.navigationStart;\n var hasNavigationStart = typeof navigationStart === 'number'; // if navigationStart isn't available set delta to threshold so it isn't used\n\n var navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;\n var navigationStartIsReliable = navigationStartDelta < threshold;\n\n if (timeOriginIsReliable || navigationStartIsReliable) {\n // Use the more reliable time origin\n if (timeOriginDelta <= navigationStartDelta) {\n _browserPerformanceTimeOriginMode = 'timeOrigin';\n return performance.timeOrigin;\n } else {\n _browserPerformanceTimeOriginMode = 'navigationStart';\n return navigationStart;\n }\n } // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date.\n\n\n _browserPerformanceTimeOriginMode = 'dateNow';\n return dateNow;\n}();","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport { __read, __values } from \"tslib\";\nimport { htmlTreeAsString } from './browser';\nimport { isElement, isError, isEvent, isInstanceOf, isPlainObject, isPrimitive, isSyntheticEvent } from './is';\nimport { memoBuilder } from './memo';\nimport { getFunctionName } from './stacktrace';\nimport { truncate } from './string';\n/**\n * Replace a method in an object with a wrapped version of itself.\n *\n * @param source An object that contains a method to be wrapped.\n * @param name The name of the method to be wrapped.\n * @param replacementFactory A higher-order function that takes the original version of the given method and returns a\n * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to\n * 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`.\n * @returns void\n */\n\nexport function fill(source, name, replacementFactory) {\n if (!(name in source)) {\n return;\n }\n\n var original = source[name];\n var wrapped = replacementFactory(original); // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n\n if (typeof wrapped === 'function') {\n try {\n markFunctionWrapped(wrapped, original);\n } catch (_Oo) {// This can throw if multiple fill happens on a global object like XMLHttpRequest\n // Fixes https://github.com/getsentry/sentry-javascript/issues/2043\n }\n }\n\n source[name] = wrapped;\n}\n/**\n * Defines a non-enumerable property on the given object.\n *\n * @param obj The object on which to set the property\n * @param name The name of the property to be set\n * @param value The value to which to set the property\n */\n\nexport function addNonEnumerableProperty(obj, name, value) {\n Object.defineProperty(obj, name, {\n // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it\n value: value,\n writable: true,\n configurable: true\n });\n}\n/**\n * Remembers the original function on the wrapped function and\n * patches up the prototype.\n *\n * @param wrapped the wrapper function\n * @param original the original function that gets wrapped\n */\n\nexport function markFunctionWrapped(wrapped, original) {\n var proto = original.prototype || {};\n wrapped.prototype = original.prototype = proto;\n addNonEnumerableProperty(wrapped, '__sentry_original__', original);\n}\n/**\n * This extracts the original function if available. See\n * `markFunctionWrapped` for more information.\n *\n * @param func the function to unwrap\n * @returns the unwrapped version of the function if available.\n */\n\nexport function getOriginalFunction(func) {\n return func.__sentry_original__;\n}\n/**\n * Encodes given object into url-friendly format\n *\n * @param object An object that contains serializable values\n * @returns string Encoded\n */\n\nexport function urlEncode(object) {\n return Object.keys(object).map(function (key) {\n return encodeURIComponent(key) + \"=\" + encodeURIComponent(object[key]);\n }).join('&');\n}\n/**\n * Transforms any object into an object literal with all its attributes\n * attached to it.\n *\n * @param value Initial source that we have to transform in order for it to be usable by the serializer\n */\n\nfunction getWalkSource(value) {\n if (isError(value)) {\n var error = value;\n var err = {\n message: error.message,\n name: error.name,\n stack: error.stack\n };\n\n for (var i in error) {\n if (Object.prototype.hasOwnProperty.call(error, i)) {\n err[i] = error[i];\n }\n }\n\n return err;\n }\n\n if (isEvent(value)) {\n var event_1 = value;\n var source = {}; // Accessing event attributes can throw (see https://github.com/getsentry/sentry-javascript/issues/768 and\n // https://github.com/getsentry/sentry-javascript/issues/838), but accessing `type` hasn't been wrapped in a\n // try-catch in at least two years and no one's complained, so that's likely not an issue anymore\n\n source.type = event_1.type;\n\n try {\n source.target = isElement(event_1.target) ? htmlTreeAsString(event_1.target) : Object.prototype.toString.call(event_1.target);\n } catch (_oO) {\n source.target = '';\n }\n\n try {\n source.currentTarget = isElement(event_1.currentTarget) ? htmlTreeAsString(event_1.currentTarget) : Object.prototype.toString.call(event_1.currentTarget);\n } catch (_oO) {\n source.currentTarget = '';\n }\n\n if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {\n source.detail = event_1.detail;\n }\n\n for (var attr in event_1) {\n if (Object.prototype.hasOwnProperty.call(event_1, attr)) {\n source[attr] = event_1[attr];\n }\n }\n\n return source;\n }\n\n return value;\n}\n/** Calculates bytes size of input string */\n\n\nfunction utf8Length(value) {\n // eslint-disable-next-line no-bitwise\n return ~-encodeURI(value).split(/%..|./).length;\n}\n/** Calculates bytes size of input object */\n\n\nfunction jsonSize(value) {\n return utf8Length(JSON.stringify(value));\n}\n/** JSDoc */\n\n\nexport function normalizeToSize(object, // Default Node.js REPL depth\ndepth, // 100kB, as 200kB is max payload size, so half sounds reasonable\nmaxSize) {\n if (depth === void 0) {\n depth = 3;\n }\n\n if (maxSize === void 0) {\n maxSize = 100 * 1024;\n }\n\n var serialized = normalize(object, depth);\n\n if (jsonSize(serialized) > maxSize) {\n return normalizeToSize(object, depth - 1, maxSize);\n }\n\n return serialized;\n}\n/**\n * Transform any non-primitive, BigInt, or Symbol-type value into a string. Acts as a no-op on strings, numbers,\n * booleans, null, and undefined.\n *\n * @param value The value to stringify\n * @returns For non-primitive, BigInt, and Symbol-type values, a string denoting the value's type, type and value, or\n * type and `description` property, respectively. For non-BigInt, non-Symbol primitives, returns the original value,\n * unchanged.\n */\n\nfunction serializeValue(value) {\n // Node.js REPL notation\n if (typeof value === 'string') {\n return value;\n }\n\n var type = Object.prototype.toString.call(value);\n\n if (type === '[object Object]') {\n return '[Object]';\n }\n\n if (type === '[object Array]') {\n return '[Array]';\n } // `makeSerializable` provides a string representation of certain non-serializable values. For all others, it's a\n // pass-through.\n\n\n var serializable = makeSerializable(value);\n return isPrimitive(serializable) ? serializable : type;\n}\n/**\n * makeSerializable()\n *\n * Takes unserializable input and make it serializer-friendly.\n *\n * Handles globals, functions, `undefined`, `NaN`, and other non-serializable values.\n */\n\n\nfunction makeSerializable(value, key) {\n if (key === 'domain' && value && _typeof(value) === 'object' && value._events) {\n return '[Domain]';\n }\n\n if (key === 'domainEmitter') {\n return '[DomainEmitter]';\n }\n\n if (typeof global !== 'undefined' && value === global) {\n return '[Global]';\n } // It's safe to use `window` and `document` here in this manner, as we are asserting using `typeof` first\n // which won't throw if they are not present.\n // eslint-disable-next-line no-restricted-globals\n\n\n if (typeof window !== 'undefined' && value === window) {\n return '[Window]';\n } // eslint-disable-next-line no-restricted-globals\n\n\n if (typeof document !== 'undefined' && value === document) {\n return '[Document]';\n } // React's SyntheticEvent thingy\n\n\n if (isSyntheticEvent(value)) {\n return '[SyntheticEvent]';\n }\n\n if (typeof value === 'number' && value !== value) {\n return '[NaN]';\n }\n\n if (value === void 0) {\n return '[undefined]';\n }\n\n if (typeof value === 'function') {\n return \"[Function: \" + getFunctionName(value) + \"]\";\n } // symbols and bigints are considered primitives by TS, but aren't natively JSON-serilaizable\n\n\n if (_typeof(value) === 'symbol') {\n return \"[\" + String(value) + \"]\";\n }\n\n if (typeof value === 'bigint') {\n return \"[BigInt: \" + String(value) + \"]\";\n }\n\n return value;\n}\n/**\n * Walks an object to perform a normalization on it\n *\n * @param key of object that's walked in current iteration\n * @param value object to be walked\n * @param depth Optional number indicating how deep should walking be performed\n * @param memo Optional Memo class handling decycling\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\n\nexport function walk(key, value, depth, memo) {\n if (depth === void 0) {\n depth = +Infinity;\n }\n\n if (memo === void 0) {\n memo = memoBuilder();\n }\n\n var _a = __read(memo, 2),\n memoize = _a[0],\n unmemoize = _a[1]; // If we reach the maximum depth, serialize whatever is left\n\n\n if (depth === 0) {\n return serializeValue(value);\n }\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n // If value implements `toJSON` method, call it and return early\n\n\n if (value !== null && value !== undefined && typeof value.toJSON === 'function') {\n return value.toJSON();\n }\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n // `makeSerializable` provides a string representation of certain non-serializable values. For all others, it's a\n // pass-through. If what comes back is a primitive (either because it's been stringified or because it was primitive\n // all along), we're done.\n\n\n var serializable = makeSerializable(value, key);\n\n if (isPrimitive(serializable)) {\n return serializable;\n } // Create source that we will use for the next iteration. It will either be an objectified error object (`Error` type\n // with extracted key:value pairs) or the input itself.\n\n\n var source = getWalkSource(value); // Create an accumulator that will act as a parent for all future itterations of that branch\n\n var acc = Array.isArray(value) ? [] : {}; // If we already walked that branch, bail out, as it's circular reference\n\n if (memoize(value)) {\n return '[Circular ~]';\n } // Walk all keys of the source\n\n\n for (var innerKey in source) {\n // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.\n if (!Object.prototype.hasOwnProperty.call(source, innerKey)) {\n continue;\n } // Recursively walk through all the child nodes\n\n\n var innerValue = source[innerKey];\n acc[innerKey] = walk(innerKey, innerValue, depth - 1, memo);\n } // Once walked through all the branches, remove the parent from memo storage\n\n\n unmemoize(value); // Return accumulated values\n\n return acc;\n}\n/**\n * normalize()\n *\n * - Creates a copy to prevent original input mutation\n * - Skip non-enumerablers\n * - Calls `toJSON` if implemented\n * - Removes circular references\n * - Translates non-serializeable values (undefined/NaN/Functions) to serializable format\n * - Translates known global objects/Classes to a string representations\n * - Takes care of Error objects serialization\n * - Optionally limit depth of final output\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\nexport function normalize(input, depth) {\n try {\n // since we're at the outermost level, there is no key\n return walk('', input, depth);\n } catch (_oO) {\n return '**non-serializable**';\n }\n}\n/**\n * Given any captured exception, extract its keys and create a sorted\n * and truncated list that will be used inside the event message.\n * eg. `Non-error exception captured with keys: foo, bar, baz`\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\nexport function extractExceptionKeysForMessage(exception, maxLength) {\n if (maxLength === void 0) {\n maxLength = 40;\n }\n\n var keys = Object.keys(getWalkSource(exception));\n keys.sort();\n\n if (!keys.length) {\n return '[object has no keys]';\n }\n\n if (keys[0].length >= maxLength) {\n return truncate(keys[0], maxLength);\n }\n\n for (var includedKeys = keys.length; includedKeys > 0; includedKeys--) {\n var serialized = keys.slice(0, includedKeys).join(', ');\n\n if (serialized.length > maxLength) {\n continue;\n }\n\n if (includedKeys === keys.length) {\n return serialized;\n }\n\n return truncate(serialized, maxLength);\n }\n\n return '';\n}\n/**\n * Given any object, return the new object with removed keys that value was `undefined`.\n * Works recursively on objects and arrays.\n */\n\nexport function dropUndefinedKeys(val) {\n var e_1, _a;\n\n if (isPlainObject(val)) {\n var obj = val;\n var rv = {};\n\n try {\n for (var _b = __values(Object.keys(obj)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var key = _c.value;\n\n if (typeof obj[key] !== 'undefined') {\n rv[key] = dropUndefinedKeys(obj[key]);\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b[\"return\"])) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n return rv;\n }\n\n if (Array.isArray(val)) {\n return val.map(dropUndefinedKeys);\n }\n\n return val;\n}\n/**\n * Ensure that something is an object.\n *\n * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper\n * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives.\n *\n * @param wat The subject of the objectification\n * @returns A version of `wat` which can safely be used with `Object` class methods\n */\n\nexport function objectify(wat) {\n var objectified;\n\n switch (true) {\n case wat === undefined || wat === null:\n objectified = new String(wat);\n break;\n // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason\n // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as\n // an object in order to wrap it.\n\n case _typeof(wat) === 'symbol' || typeof wat === 'bigint':\n objectified = Object(wat);\n break;\n // this will catch the remaining primitives: `String`, `Number`, and `Boolean`\n\n case isPrimitive(wat):\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n objectified = new wat.constructor(wat);\n break;\n // by process of elimination, at this point we know that `wat` must already be an object\n\n default:\n objectified = wat;\n break;\n }\n\n return objectified;\n}","// shim for using process in browser\nvar process = module.exports = {}; // cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\n\nfunction defaultClearTimeout() {\n throw new Error('clearTimeout has not been defined');\n}\n\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n})();\n\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n } // if setTimeout wasn't available but was latter defined\n\n\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n}\n\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n } // if clearTimeout wasn't available but was latter defined\n\n\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n}\n\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n\n draining = false;\n\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n var len = queue.length;\n\n while (len) {\n currentQueue = queue;\n queue = [];\n\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n\n queueIndex = -1;\n len = queue.length;\n }\n\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n\n queue.push(new Item(fun, args));\n\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n}; // v8 likes predictible objects\n\n\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\n\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\n\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\n\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) {\n return [];\n};\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () {\n return '/';\n};\n\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\n\nprocess.umask = function () {\n return 0;\n};","import { getOriginalFunction } from '@sentry/utils';\nvar originalFunctionToString;\n/** Patch toString calls to return proper name for wrapped functions */\n\nvar FunctionToString =\n/** @class */\nfunction () {\n function FunctionToString() {\n /**\n * @inheritDoc\n */\n this.name = FunctionToString.id;\n }\n /**\n * @inheritDoc\n */\n\n\n FunctionToString.prototype.setupOnce = function () {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n originalFunctionToString = Function.prototype.toString; // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n Function.prototype.toString = function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var context = getOriginalFunction(this) || this;\n return originalFunctionToString.apply(context, args);\n };\n };\n /**\n * @inheritDoc\n */\n\n\n FunctionToString.id = 'FunctionToString';\n return FunctionToString;\n}();\n\nexport { FunctionToString };","/* eslint-disable @typescript-eslint/explicit-function-return-type */\n\n/* eslint-disable @typescript-eslint/typedef */\n\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { isThenable } from './is';\n/**\n * Creates a resolved sync promise.\n *\n * @param value the value to resolve the promise with\n * @returns the resolved sync promise\n */\n\nexport function resolvedSyncPromise(value) {\n return new SyncPromise(function (resolve) {\n resolve(value);\n });\n}\n/**\n * Creates a rejected sync promise.\n *\n * @param value the value to reject the promise with\n * @returns the rejected sync promise\n */\n\nexport function rejectedSyncPromise(reason) {\n return new SyncPromise(function (_, reject) {\n reject(reason);\n });\n}\n/**\n * Thenable class that behaves like a Promise and follows it's interface\n * but is not async internally\n */\n\nvar SyncPromise =\n/** @class */\nfunction () {\n function SyncPromise(executor) {\n var _this = this;\n\n this._state = 0\n /* PENDING */\n ;\n this._handlers = [];\n /** JSDoc */\n\n this._resolve = function (value) {\n _this._setResult(1\n /* RESOLVED */\n , value);\n };\n /** JSDoc */\n\n\n this._reject = function (reason) {\n _this._setResult(2\n /* REJECTED */\n , reason);\n };\n /** JSDoc */\n\n\n this._setResult = function (state, value) {\n if (_this._state !== 0\n /* PENDING */\n ) {\n return;\n }\n\n if (isThenable(value)) {\n void value.then(_this._resolve, _this._reject);\n return;\n }\n\n _this._state = state;\n _this._value = value;\n\n _this._executeHandlers();\n };\n /** JSDoc */\n\n\n this._executeHandlers = function () {\n if (_this._state === 0\n /* PENDING */\n ) {\n return;\n }\n\n var cachedHandlers = _this._handlers.slice();\n\n _this._handlers = [];\n cachedHandlers.forEach(function (handler) {\n if (handler[0]) {\n return;\n }\n\n if (_this._state === 1\n /* RESOLVED */\n ) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n handler[1](_this._value);\n }\n\n if (_this._state === 2\n /* REJECTED */\n ) {\n handler[2](_this._value);\n }\n\n handler[0] = true;\n });\n };\n\n try {\n executor(this._resolve, this._reject);\n } catch (e) {\n this._reject(e);\n }\n }\n /** JSDoc */\n\n\n SyncPromise.prototype.then = function (onfulfilled, onrejected) {\n var _this = this;\n\n return new SyncPromise(function (resolve, reject) {\n _this._handlers.push([false, function (result) {\n if (!onfulfilled) {\n // TODO: ¯\\_(ツ)_/¯\n // TODO: FIXME\n resolve(result);\n } else {\n try {\n resolve(onfulfilled(result));\n } catch (e) {\n reject(e);\n }\n }\n }, function (reason) {\n if (!onrejected) {\n reject(reason);\n } else {\n try {\n resolve(onrejected(reason));\n } catch (e) {\n reject(e);\n }\n }\n }]);\n\n _this._executeHandlers();\n });\n };\n /** JSDoc */\n\n\n SyncPromise.prototype[\"catch\"] = function (onrejected) {\n return this.then(function (val) {\n return val;\n }, onrejected);\n };\n /** JSDoc */\n\n\n SyncPromise.prototype[\"finally\"] = function (onfinally) {\n var _this = this;\n\n return new SyncPromise(function (resolve, reject) {\n var val;\n var isRejected;\n return _this.then(function (value) {\n isRejected = false;\n val = value;\n\n if (onfinally) {\n onfinally();\n }\n }, function (reason) {\n isRejected = true;\n val = reason;\n\n if (onfinally) {\n onfinally();\n }\n }).then(function () {\n if (isRejected) {\n reject(val);\n return;\n }\n\n resolve(val);\n });\n });\n };\n\n return SyncPromise;\n}();\n\nexport { SyncPromise };","import { __assign, __read, __spread } from \"tslib\";\nimport { dateTimestampInSeconds, getGlobalObject, isPlainObject, isThenable, SyncPromise } from '@sentry/utils';\n/**\n * Absolute maximum number of breadcrumbs added to an event.\n * The `maxBreadcrumbs` option cannot be higher than this value.\n */\n\nvar MAX_BREADCRUMBS = 100;\n/**\n * Holds additional event information. {@link Scope.applyToEvent} will be\n * called by the client before an event will be sent.\n */\n\nvar Scope =\n/** @class */\nfunction () {\n function Scope() {\n /** Flag if notifying is happening. */\n this._notifyingListeners = false;\n /** Callback for client to receive scope changes. */\n\n this._scopeListeners = [];\n /** Callback list that will be called after {@link applyToEvent}. */\n\n this._eventProcessors = [];\n /** Array of breadcrumbs. */\n\n this._breadcrumbs = [];\n /** User */\n\n this._user = {};\n /** Tags */\n\n this._tags = {};\n /** Extra */\n\n this._extra = {};\n /** Contexts */\n\n this._contexts = {};\n /**\n * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get\n * sent to Sentry\n */\n\n this._sdkProcessingMetadata = {};\n }\n /**\n * Inherit values from the parent scope.\n * @param scope to clone.\n */\n\n\n Scope.clone = function (scope) {\n var newScope = new Scope();\n\n if (scope) {\n newScope._breadcrumbs = __spread(scope._breadcrumbs);\n newScope._tags = __assign({}, scope._tags);\n newScope._extra = __assign({}, scope._extra);\n newScope._contexts = __assign({}, scope._contexts);\n newScope._user = scope._user;\n newScope._level = scope._level;\n newScope._span = scope._span;\n newScope._session = scope._session;\n newScope._transactionName = scope._transactionName;\n newScope._fingerprint = scope._fingerprint;\n newScope._eventProcessors = __spread(scope._eventProcessors);\n newScope._requestSession = scope._requestSession;\n }\n\n return newScope;\n };\n /**\n * Add internal on change listener. Used for sub SDKs that need to store the scope.\n * @hidden\n */\n\n\n Scope.prototype.addScopeListener = function (callback) {\n this._scopeListeners.push(callback);\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.addEventProcessor = function (callback) {\n this._eventProcessors.push(callback);\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setUser = function (user) {\n this._user = user || {};\n\n if (this._session) {\n this._session.update({\n user: user\n });\n }\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.getUser = function () {\n return this._user;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.getRequestSession = function () {\n return this._requestSession;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setRequestSession = function (requestSession) {\n this._requestSession = requestSession;\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setTags = function (tags) {\n this._tags = __assign(__assign({}, this._tags), tags);\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setTag = function (key, value) {\n var _a;\n\n this._tags = __assign(__assign({}, this._tags), (_a = {}, _a[key] = value, _a));\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setExtras = function (extras) {\n this._extra = __assign(__assign({}, this._extra), extras);\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setExtra = function (key, extra) {\n var _a;\n\n this._extra = __assign(__assign({}, this._extra), (_a = {}, _a[key] = extra, _a));\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setFingerprint = function (fingerprint) {\n this._fingerprint = fingerprint;\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setLevel = function (level) {\n this._level = level;\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setTransactionName = function (name) {\n this._transactionName = name;\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * Can be removed in major version.\n * @deprecated in favor of {@link this.setTransactionName}\n */\n\n\n Scope.prototype.setTransaction = function (name) {\n return this.setTransactionName(name);\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setContext = function (key, context) {\n var _a;\n\n if (context === null) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._contexts[key];\n } else {\n this._contexts = __assign(__assign({}, this._contexts), (_a = {}, _a[key] = context, _a));\n }\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setSpan = function (span) {\n this._span = span;\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.getSpan = function () {\n return this._span;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.getTransaction = function () {\n // Often, this span (if it exists at all) will be a transaction, but it's not guaranteed to be. Regardless, it will\n // have a pointer to the currently-active transaction.\n var span = this.getSpan();\n return span && span.transaction;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setSession = function (session) {\n if (!session) {\n delete this._session;\n } else {\n this._session = session;\n }\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.getSession = function () {\n return this._session;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.update = function (captureContext) {\n if (!captureContext) {\n return this;\n }\n\n if (typeof captureContext === 'function') {\n var updatedScope = captureContext(this);\n return updatedScope instanceof Scope ? updatedScope : this;\n }\n\n if (captureContext instanceof Scope) {\n this._tags = __assign(__assign({}, this._tags), captureContext._tags);\n this._extra = __assign(__assign({}, this._extra), captureContext._extra);\n this._contexts = __assign(__assign({}, this._contexts), captureContext._contexts);\n\n if (captureContext._user && Object.keys(captureContext._user).length) {\n this._user = captureContext._user;\n }\n\n if (captureContext._level) {\n this._level = captureContext._level;\n }\n\n if (captureContext._fingerprint) {\n this._fingerprint = captureContext._fingerprint;\n }\n\n if (captureContext._requestSession) {\n this._requestSession = captureContext._requestSession;\n }\n } else if (isPlainObject(captureContext)) {\n // eslint-disable-next-line no-param-reassign\n captureContext = captureContext;\n this._tags = __assign(__assign({}, this._tags), captureContext.tags);\n this._extra = __assign(__assign({}, this._extra), captureContext.extra);\n this._contexts = __assign(__assign({}, this._contexts), captureContext.contexts);\n\n if (captureContext.user) {\n this._user = captureContext.user;\n }\n\n if (captureContext.level) {\n this._level = captureContext.level;\n }\n\n if (captureContext.fingerprint) {\n this._fingerprint = captureContext.fingerprint;\n }\n\n if (captureContext.requestSession) {\n this._requestSession = captureContext.requestSession;\n }\n }\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.clear = function () {\n this._breadcrumbs = [];\n this._tags = {};\n this._extra = {};\n this._user = {};\n this._contexts = {};\n this._level = undefined;\n this._transactionName = undefined;\n this._fingerprint = undefined;\n this._requestSession = undefined;\n this._span = undefined;\n this._session = undefined;\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.addBreadcrumb = function (breadcrumb, maxBreadcrumbs) {\n var maxCrumbs = typeof maxBreadcrumbs === 'number' ? Math.min(maxBreadcrumbs, MAX_BREADCRUMBS) : MAX_BREADCRUMBS; // No data has been changed, so don't notify scope listeners\n\n if (maxCrumbs <= 0) {\n return this;\n }\n\n var mergedBreadcrumb = __assign({\n timestamp: dateTimestampInSeconds()\n }, breadcrumb);\n\n this._breadcrumbs = __spread(this._breadcrumbs, [mergedBreadcrumb]).slice(-maxCrumbs);\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.clearBreadcrumbs = function () {\n this._breadcrumbs = [];\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * Applies the current context and fingerprint to the event.\n * Note that breadcrumbs will be added by the client.\n * Also if the event has already breadcrumbs on it, we do not merge them.\n * @param event Event\n * @param hint May contain additional information about the original exception.\n * @hidden\n */\n\n\n Scope.prototype.applyToEvent = function (event, hint) {\n if (this._extra && Object.keys(this._extra).length) {\n event.extra = __assign(__assign({}, this._extra), event.extra);\n }\n\n if (this._tags && Object.keys(this._tags).length) {\n event.tags = __assign(__assign({}, this._tags), event.tags);\n }\n\n if (this._user && Object.keys(this._user).length) {\n event.user = __assign(__assign({}, this._user), event.user);\n }\n\n if (this._contexts && Object.keys(this._contexts).length) {\n event.contexts = __assign(__assign({}, this._contexts), event.contexts);\n }\n\n if (this._level) {\n event.level = this._level;\n }\n\n if (this._transactionName) {\n event.transaction = this._transactionName;\n } // We want to set the trace context for normal events only if there isn't already\n // a trace context on the event. There is a product feature in place where we link\n // errors with transaction and it relies on that.\n\n\n if (this._span) {\n event.contexts = __assign({\n trace: this._span.getTraceContext()\n }, event.contexts);\n var transactionName = this._span.transaction && this._span.transaction.name;\n\n if (transactionName) {\n event.tags = __assign({\n transaction: transactionName\n }, event.tags);\n }\n }\n\n this._applyFingerprint(event);\n\n event.breadcrumbs = __spread(event.breadcrumbs || [], this._breadcrumbs);\n event.breadcrumbs = event.breadcrumbs.length > 0 ? event.breadcrumbs : undefined;\n event.sdkProcessingMetadata = this._sdkProcessingMetadata;\n return this._notifyEventProcessors(__spread(getGlobalEventProcessors(), this._eventProcessors), event, hint);\n };\n /**\n * Add data which will be accessible during event processing but won't get sent to Sentry\n */\n\n\n Scope.prototype.setSDKProcessingMetadata = function (newData) {\n this._sdkProcessingMetadata = __assign(__assign({}, this._sdkProcessingMetadata), newData);\n return this;\n };\n /**\n * This will be called after {@link applyToEvent} is finished.\n */\n\n\n Scope.prototype._notifyEventProcessors = function (processors, event, hint, index) {\n var _this = this;\n\n if (index === void 0) {\n index = 0;\n }\n\n return new SyncPromise(function (resolve, reject) {\n var processor = processors[index];\n\n if (event === null || typeof processor !== 'function') {\n resolve(event);\n } else {\n var result = processor(__assign({}, event), hint);\n\n if (isThenable(result)) {\n void result.then(function (_final) {\n return _this._notifyEventProcessors(processors, _final, hint, index + 1).then(resolve);\n }).then(null, reject);\n } else {\n void _this._notifyEventProcessors(processors, result, hint, index + 1).then(resolve).then(null, reject);\n }\n }\n });\n };\n /**\n * This will be called on every set call.\n */\n\n\n Scope.prototype._notifyScopeListeners = function () {\n var _this = this; // We need this check for this._notifyingListeners to be able to work on scope during updates\n // If this check is not here we'll produce endless recursion when something is done with the scope\n // during the callback.\n\n\n if (!this._notifyingListeners) {\n this._notifyingListeners = true;\n\n this._scopeListeners.forEach(function (callback) {\n callback(_this);\n });\n\n this._notifyingListeners = false;\n }\n };\n /**\n * Applies fingerprint from the scope to the event if there's one,\n * uses message if there's one instead or get rid of empty fingerprint\n */\n\n\n Scope.prototype._applyFingerprint = function (event) {\n // Make sure it's an array first and we actually have something in place\n event.fingerprint = event.fingerprint ? Array.isArray(event.fingerprint) ? event.fingerprint : [event.fingerprint] : []; // If we have something on the scope, then merge it with event\n\n if (this._fingerprint) {\n event.fingerprint = event.fingerprint.concat(this._fingerprint);\n } // If we have no data at all, remove empty array default\n\n\n if (event.fingerprint && !event.fingerprint.length) {\n delete event.fingerprint;\n }\n };\n\n return Scope;\n}();\n\nexport { Scope };\n/**\n * Returns the global event processors.\n */\n\nfunction getGlobalEventProcessors() {\n /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */\n var global = getGlobalObject();\n global.__SENTRY__ = global.__SENTRY__ || {};\n global.__SENTRY__.globalEventProcessors = global.__SENTRY__.globalEventProcessors || [];\n return global.__SENTRY__.globalEventProcessors;\n /* eslint-enable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */\n}\n/**\n * Add a EventProcessor to be kept globally.\n * @param callback EventProcessor to add\n */\n\n\nexport function addGlobalEventProcessor(callback) {\n getGlobalEventProcessors().push(callback);\n}","import { __assign } from \"tslib\";\nimport { getGlobalObject } from './global';\nimport { addNonEnumerableProperty } from './object';\nimport { snipLine } from './string';\n/**\n * UUID4 generator\n *\n * @returns string Generated UUID4.\n */\n\nexport function uuid4() {\n var global = getGlobalObject();\n var crypto = global.crypto || global.msCrypto;\n\n if (!(crypto === void 0) && crypto.getRandomValues) {\n // Use window.crypto API if available\n var arr = new Uint16Array(8);\n crypto.getRandomValues(arr); // set 4 in byte 7\n // eslint-disable-next-line no-bitwise\n\n arr[3] = arr[3] & 0xfff | 0x4000; // set 2 most significant bits of byte 9 to '10'\n // eslint-disable-next-line no-bitwise\n\n arr[4] = arr[4] & 0x3fff | 0x8000;\n\n var pad = function pad(num) {\n var v = num.toString(16);\n\n while (v.length < 4) {\n v = \"0\" + v;\n }\n\n return v;\n };\n\n return pad(arr[0]) + pad(arr[1]) + pad(arr[2]) + pad(arr[3]) + pad(arr[4]) + pad(arr[5]) + pad(arr[6]) + pad(arr[7]);\n } // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n\n\n return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n // eslint-disable-next-line no-bitwise\n var r = Math.random() * 16 | 0; // eslint-disable-next-line no-bitwise\n\n var v = c === 'x' ? r : r & 0x3 | 0x8;\n return v.toString(16);\n });\n}\n/**\n * Parses string form of URL into an object\n * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B\n * // intentionally using regex and not href parsing trick because React Native and other\n * // environments where DOM might not be available\n * @returns parsed URL object\n */\n\nexport function parseUrl(url) {\n if (!url) {\n return {};\n }\n\n var match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\n if (!match) {\n return {};\n } // coerce to undefined values to empty string so we don't get 'undefined'\n\n\n var query = match[6] || '';\n var fragment = match[8] || '';\n return {\n host: match[4],\n path: match[5],\n protocol: match[2],\n relative: match[5] + query + fragment\n };\n}\n\nfunction getFirstException(event) {\n return event.exception && event.exception.values ? event.exception.values[0] : undefined;\n}\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\n\n\nexport function getEventDescription(event) {\n var message = event.message,\n eventId = event.event_id;\n\n if (message) {\n return message;\n }\n\n var firstException = getFirstException(event);\n\n if (firstException) {\n if (firstException.type && firstException.value) {\n return firstException.type + \": \" + firstException.value;\n }\n\n return firstException.type || firstException.value || eventId || '';\n }\n\n return eventId || '';\n}\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\n\nexport function addExceptionTypeValue(event, value, type) {\n var exception = event.exception = event.exception || {};\n var values = exception.values = exception.values || [];\n var firstException = values[0] = values[0] || {};\n\n if (!firstException.value) {\n firstException.value = value || '';\n }\n\n if (!firstException.type) {\n firstException.type = type || 'Error';\n }\n}\n/**\n * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed.\n *\n * @param event The event to modify.\n * @param newMechanism Mechanism data to add to the event.\n * @hidden\n */\n\nexport function addExceptionMechanism(event, newMechanism) {\n var firstException = getFirstException(event);\n\n if (!firstException) {\n return;\n }\n\n var defaultMechanism = {\n type: 'generic',\n handled: true\n };\n var currentMechanism = firstException.mechanism;\n firstException.mechanism = __assign(__assign(__assign({}, defaultMechanism), currentMechanism), newMechanism);\n\n if (newMechanism && 'data' in newMechanism) {\n var mergedData = __assign(__assign({}, currentMechanism && currentMechanism.data), newMechanism.data);\n\n firstException.mechanism.data = mergedData;\n }\n} // https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n\nvar 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-]+)*))?$/;\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\n\nexport function parseSemver(input) {\n var match = input.match(SEMVER_REGEXP) || [];\n var major = parseInt(match[1], 10);\n var minor = parseInt(match[2], 10);\n var patch = parseInt(match[3], 10);\n return {\n buildmetadata: match[5],\n major: isNaN(major) ? undefined : major,\n minor: isNaN(minor) ? undefined : minor,\n patch: isNaN(patch) ? undefined : patch,\n prerelease: match[4]\n };\n}\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\n\nexport function addContextToFrame(lines, frame, linesOfContext) {\n if (linesOfContext === void 0) {\n linesOfContext = 5;\n }\n\n var lineno = frame.lineno || 0;\n var maxLines = lines.length;\n var sourceLine = Math.max(Math.min(maxLines, lineno - 1), 0);\n frame.pre_context = lines.slice(Math.max(0, sourceLine - linesOfContext), sourceLine).map(function (line) {\n return snipLine(line, 0);\n });\n frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);\n frame.post_context = lines.slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext).map(function (line) {\n return snipLine(line, 0);\n });\n}\n/**\n * Strip the query string and fragment off of a given URL or path (if present)\n *\n * @param urlPath Full URL or path, including possible query string and/or fragment\n * @returns URL or path without query string or fragment\n */\n\nexport function stripUrlQueryAndFragment(urlPath) {\n // eslint-disable-next-line no-useless-escape\n return urlPath.split(/[\\?#]/, 1)[0];\n}\n/**\n * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object\n * in question), and marks it captured if not.\n *\n * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and\n * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so\n * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because\n * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not\n * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This\n * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we\n * see it.\n *\n * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on\n * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent\n * object wrapper forms so that this check will always work. However, because we need to flag the exact object which\n * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification\n * must be done before the exception captured.\n *\n * @param A thrown exception to check or flag as having been seen\n * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)\n */\n\nexport function checkOrSetAlreadyCaught(exception) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (exception && exception.__sentry_captured__) {\n return true;\n }\n\n try {\n // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the\n // `ExtraErrorData` integration\n addNonEnumerableProperty(exception, '__sentry_captured__', true);\n } catch (err) {// `exception` is a primitive, so we can't mark it seen\n }\n\n return false;\n}","import { __read, __spread } from \"tslib\";\nimport { getGlobalObject } from './global'; // TODO: Implement different loggers for different environments\n\nvar global = getGlobalObject();\n/** Prefix for logging strings */\n\nvar PREFIX = 'Sentry Logger ';\n/**\n * Temporarily unwrap `console.log` and friends in order to perform the given callback using the original methods.\n * Restores wrapping after the callback completes.\n *\n * @param callback The function to run against the original `console` messages\n * @returns The results of the callback\n */\n\nexport function consoleSandbox(callback) {\n var global = getGlobalObject();\n var levels = ['debug', 'info', 'warn', 'error', 'log', 'assert'];\n\n if (!('console' in global)) {\n return callback();\n } // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\n\n var originalConsole = global.console;\n var wrappedLevels = {}; // Restore all wrapped console methods\n\n levels.forEach(function (level) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (level in global.console && originalConsole[level].__sentry_original__) {\n wrappedLevels[level] = originalConsole[level];\n originalConsole[level] = originalConsole[level].__sentry_original__;\n }\n }); // Perform callback manipulations\n\n var result = callback(); // Revert restoration to wrapped state\n\n Object.keys(wrappedLevels).forEach(function (level) {\n originalConsole[level] = wrappedLevels[level];\n });\n return result;\n}\n/** JSDoc */\n\nvar Logger =\n/** @class */\nfunction () {\n /** JSDoc */\n function Logger() {\n this._enabled = false;\n }\n /** JSDoc */\n\n\n Logger.prototype.disable = function () {\n this._enabled = false;\n };\n /** JSDoc */\n\n\n Logger.prototype.enable = function () {\n this._enabled = true;\n };\n /** JSDoc */\n\n\n Logger.prototype.log = function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n if (!this._enabled) {\n return;\n }\n\n consoleSandbox(function () {\n var _a;\n\n (_a = global.console).log.apply(_a, __spread([PREFIX + \"[Log]:\"], args));\n });\n };\n /** JSDoc */\n\n\n Logger.prototype.warn = function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n if (!this._enabled) {\n return;\n }\n\n consoleSandbox(function () {\n var _a;\n\n (_a = global.console).warn.apply(_a, __spread([PREFIX + \"[Warn]:\"], args));\n });\n };\n /** JSDoc */\n\n\n Logger.prototype.error = function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n if (!this._enabled) {\n return;\n }\n\n consoleSandbox(function () {\n var _a;\n\n (_a = global.console).error.apply(_a, __spread([PREFIX + \"[Error]:\"], args));\n });\n };\n\n return Logger;\n}(); // Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used\n\n\nglobal.__SENTRY__ = global.__SENTRY__ || {};\nvar logger = global.__SENTRY__.logger || (global.__SENTRY__.logger = new Logger());\nexport { logger };","import { dropUndefinedKeys, timestampInSeconds, uuid4 } from '@sentry/utils';\n/**\n * @inheritdoc\n */\n\nvar Session =\n/** @class */\nfunction () {\n function Session(context) {\n this.errors = 0;\n this.sid = uuid4();\n this.duration = 0;\n this.status = 'ok';\n this.init = true;\n this.ignoreDuration = false; // Both timestamp and started are in seconds since the UNIX epoch.\n\n var startingTime = timestampInSeconds();\n this.timestamp = startingTime;\n this.started = startingTime;\n\n if (context) {\n this.update(context);\n }\n }\n /** JSDoc */\n // eslint-disable-next-line complexity\n\n\n Session.prototype.update = function (context) {\n if (context === void 0) {\n context = {};\n }\n\n if (context.user) {\n if (!this.ipAddress && context.user.ip_address) {\n this.ipAddress = context.user.ip_address;\n }\n\n if (!this.did && !context.did) {\n this.did = context.user.id || context.user.email || context.user.username;\n }\n }\n\n this.timestamp = context.timestamp || timestampInSeconds();\n\n if (context.ignoreDuration) {\n this.ignoreDuration = context.ignoreDuration;\n }\n\n if (context.sid) {\n // Good enough uuid validation. — Kamil\n this.sid = context.sid.length === 32 ? context.sid : uuid4();\n }\n\n if (context.init !== undefined) {\n this.init = context.init;\n }\n\n if (!this.did && context.did) {\n this.did = \"\" + context.did;\n }\n\n if (typeof context.started === 'number') {\n this.started = context.started;\n }\n\n if (this.ignoreDuration) {\n this.duration = undefined;\n } else if (typeof context.duration === 'number') {\n this.duration = context.duration;\n } else {\n var duration = this.timestamp - this.started;\n this.duration = duration >= 0 ? duration : 0;\n }\n\n if (context.release) {\n this.release = context.release;\n }\n\n if (context.environment) {\n this.environment = context.environment;\n }\n\n if (!this.ipAddress && context.ipAddress) {\n this.ipAddress = context.ipAddress;\n }\n\n if (!this.userAgent && context.userAgent) {\n this.userAgent = context.userAgent;\n }\n\n if (typeof context.errors === 'number') {\n this.errors = context.errors;\n }\n\n if (context.status) {\n this.status = context.status;\n }\n };\n /** JSDoc */\n\n\n Session.prototype.close = function (status) {\n if (status) {\n this.update({\n status: status\n });\n } else if (this.status === 'ok') {\n this.update({\n status: 'exited'\n });\n } else {\n this.update();\n }\n };\n /** JSDoc */\n\n\n Session.prototype.toJSON = function () {\n return dropUndefinedKeys({\n sid: \"\" + this.sid,\n init: this.init,\n // Make sure that sec is converted to ms for date constructor\n started: new Date(this.started * 1000).toISOString(),\n timestamp: new Date(this.timestamp * 1000).toISOString(),\n status: this.status,\n errors: this.errors,\n did: typeof this.did === 'number' || typeof this.did === 'string' ? \"\" + this.did : undefined,\n duration: this.duration,\n attrs: {\n release: this.release,\n environment: this.environment,\n ip_address: this.ipAddress,\n user_agent: this.userAgent\n }\n });\n };\n\n return Session;\n}();\n\nexport { Session };","import { __assign, __read, __spread } from \"tslib\";\nimport { consoleSandbox, dateTimestampInSeconds, getGlobalObject, isNodeEnv, logger, uuid4 } from '@sentry/utils';\nimport { Scope } from './scope';\nimport { Session } from './session';\n/**\n * API compatibility version of this hub.\n *\n * WARNING: This number should only be increased when the global interface\n * changes and new methods are introduced.\n *\n * @hidden\n */\n\nexport var API_VERSION = 4;\n/**\n * Default maximum number of breadcrumbs added to an event. Can be overwritten\n * with {@link Options.maxBreadcrumbs}.\n */\n\nvar DEFAULT_BREADCRUMBS = 100;\n/**\n * @inheritDoc\n */\n\nvar Hub =\n/** @class */\nfunction () {\n /**\n * Creates a new instance of the hub, will push one {@link Layer} into the\n * internal stack on creation.\n *\n * @param client bound to the hub.\n * @param scope bound to the hub.\n * @param version number, higher number means higher priority.\n */\n function Hub(client, scope, _version) {\n if (scope === void 0) {\n scope = new Scope();\n }\n\n if (_version === void 0) {\n _version = API_VERSION;\n }\n\n this._version = _version;\n /** Is a {@link Layer}[] containing the client and scope */\n\n this._stack = [{}];\n this.getStackTop().scope = scope;\n\n if (client) {\n this.bindClient(client);\n }\n }\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.isOlderThan = function (version) {\n return this._version < version;\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.bindClient = function (client) {\n var top = this.getStackTop();\n top.client = client;\n\n if (client && client.setupIntegrations) {\n client.setupIntegrations();\n }\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.pushScope = function () {\n // We want to clone the content of prev scope\n var scope = Scope.clone(this.getScope());\n this.getStack().push({\n client: this.getClient(),\n scope: scope\n });\n return scope;\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.popScope = function () {\n if (this.getStack().length <= 1) return false;\n return !!this.getStack().pop();\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.withScope = function (callback) {\n var scope = this.pushScope();\n\n try {\n callback(scope);\n } finally {\n this.popScope();\n }\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.getClient = function () {\n return this.getStackTop().client;\n };\n /** Returns the scope of the top stack. */\n\n\n Hub.prototype.getScope = function () {\n return this.getStackTop().scope;\n };\n /** Returns the scope stack for domains or the process. */\n\n\n Hub.prototype.getStack = function () {\n return this._stack;\n };\n /** Returns the topmost scope layer in the order domain > local > process. */\n\n\n Hub.prototype.getStackTop = function () {\n return this._stack[this._stack.length - 1];\n };\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n\n\n Hub.prototype.captureException = function (exception, hint) {\n var eventId = this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4();\n var finalHint = hint; // If there's no explicit hint provided, mimic the same thing that would happen\n // in the minimal itself to create a consistent behavior.\n // We don't do this in the client, as it's the lowest level API, and doing this,\n // would prevent user from having full control over direct calls.\n\n if (!hint) {\n var syntheticException = void 0;\n\n try {\n throw new Error('Sentry syntheticException');\n } catch (exception) {\n syntheticException = exception;\n }\n\n finalHint = {\n originalException: exception,\n syntheticException: syntheticException\n };\n }\n\n this._invokeClient('captureException', exception, __assign(__assign({}, finalHint), {\n event_id: eventId\n }));\n\n return eventId;\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.captureMessage = function (message, level, hint) {\n var eventId = this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4();\n var finalHint = hint; // If there's no explicit hint provided, mimic the same thing that would happen\n // in the minimal itself to create a consistent behavior.\n // We don't do this in the client, as it's the lowest level API, and doing this,\n // would prevent user from having full control over direct calls.\n\n if (!hint) {\n var syntheticException = void 0;\n\n try {\n throw new Error(message);\n } catch (exception) {\n syntheticException = exception;\n }\n\n finalHint = {\n originalException: message,\n syntheticException: syntheticException\n };\n }\n\n this._invokeClient('captureMessage', message, level, __assign(__assign({}, finalHint), {\n event_id: eventId\n }));\n\n return eventId;\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.captureEvent = function (event, hint) {\n var eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (event.type !== 'transaction') {\n this._lastEventId = eventId;\n }\n\n this._invokeClient('captureEvent', event, __assign(__assign({}, hint), {\n event_id: eventId\n }));\n\n return eventId;\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.lastEventId = function () {\n return this._lastEventId;\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.addBreadcrumb = function (breadcrumb, hint) {\n var _a = this.getStackTop(),\n scope = _a.scope,\n client = _a.client;\n\n if (!scope || !client) return; // eslint-disable-next-line @typescript-eslint/unbound-method\n\n var _b = client.getOptions && client.getOptions() || {},\n _c = _b.beforeBreadcrumb,\n beforeBreadcrumb = _c === void 0 ? null : _c,\n _d = _b.maxBreadcrumbs,\n maxBreadcrumbs = _d === void 0 ? DEFAULT_BREADCRUMBS : _d;\n\n if (maxBreadcrumbs <= 0) return;\n var timestamp = dateTimestampInSeconds();\n\n var mergedBreadcrumb = __assign({\n timestamp: timestamp\n }, breadcrumb);\n\n var finalBreadcrumb = beforeBreadcrumb ? consoleSandbox(function () {\n return beforeBreadcrumb(mergedBreadcrumb, hint);\n }) : mergedBreadcrumb;\n if (finalBreadcrumb === null) return;\n scope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.setUser = function (user) {\n var scope = this.getScope();\n if (scope) scope.setUser(user);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.setTags = function (tags) {\n var scope = this.getScope();\n if (scope) scope.setTags(tags);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.setExtras = function (extras) {\n var scope = this.getScope();\n if (scope) scope.setExtras(extras);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.setTag = function (key, value) {\n var scope = this.getScope();\n if (scope) scope.setTag(key, value);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.setExtra = function (key, extra) {\n var scope = this.getScope();\n if (scope) scope.setExtra(key, extra);\n };\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n Hub.prototype.setContext = function (name, context) {\n var scope = this.getScope();\n if (scope) scope.setContext(name, context);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.configureScope = function (callback) {\n var _a = this.getStackTop(),\n scope = _a.scope,\n client = _a.client;\n\n if (scope && client) {\n callback(scope);\n }\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.run = function (callback) {\n var oldHub = makeMain(this);\n\n try {\n callback(this);\n } finally {\n makeMain(oldHub);\n }\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.getIntegration = function (integration) {\n var client = this.getClient();\n if (!client) return null;\n\n try {\n return client.getIntegration(integration);\n } catch (_oO) {\n logger.warn(\"Cannot retrieve integration \" + integration.id + \" from the current Hub\");\n return null;\n }\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.startSpan = function (context) {\n return this._callExtensionMethod('startSpan', context);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.startTransaction = function (context, customSamplingContext) {\n return this._callExtensionMethod('startTransaction', context, customSamplingContext);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.traceHeaders = function () {\n return this._callExtensionMethod('traceHeaders');\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.captureSession = function (endSession) {\n if (endSession === void 0) {\n endSession = false;\n } // both send the update and pull the session from the scope\n\n\n if (endSession) {\n return this.endSession();\n } // only send the update\n\n\n this._sendSessionUpdate();\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.endSession = function () {\n var layer = this.getStackTop();\n var scope = layer && layer.scope;\n var session = scope && scope.getSession();\n\n if (session) {\n session.close();\n }\n\n this._sendSessionUpdate(); // the session is over; take it off of the scope\n\n\n if (scope) {\n scope.setSession();\n }\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.startSession = function (context) {\n var _a = this.getStackTop(),\n scope = _a.scope,\n client = _a.client;\n\n var _b = client && client.getOptions() || {},\n release = _b.release,\n environment = _b.environment; // Will fetch userAgent if called from browser sdk\n\n\n var global = getGlobalObject();\n var userAgent = (global.navigator || {}).userAgent;\n var session = new Session(__assign(__assign(__assign({\n release: release,\n environment: environment\n }, scope && {\n user: scope.getUser()\n }), userAgent && {\n userAgent: userAgent\n }), context));\n\n if (scope) {\n // End existing session if there's one\n var currentSession = scope.getSession && scope.getSession();\n\n if (currentSession && currentSession.status === 'ok') {\n currentSession.update({\n status: 'exited'\n });\n }\n\n this.endSession(); // Afterwards we set the new session on the scope\n\n scope.setSession(session);\n }\n\n return session;\n };\n /**\n * Sends the current Session on the scope\n */\n\n\n Hub.prototype._sendSessionUpdate = function () {\n var _a = this.getStackTop(),\n scope = _a.scope,\n client = _a.client;\n\n if (!scope) return;\n var session = scope.getSession && scope.getSession();\n\n if (session) {\n if (client && client.captureSession) {\n client.captureSession(session);\n }\n }\n };\n /**\n * Internal helper function to call a method on the top client if it exists.\n *\n * @param method The method to call on the client.\n * @param args Arguments to pass to the client function.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n Hub.prototype._invokeClient = function (method) {\n var _a;\n\n var args = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n\n var _b = this.getStackTop(),\n scope = _b.scope,\n client = _b.client;\n\n if (client && client[method]) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n (_a = client)[method].apply(_a, __spread(args, [scope]));\n }\n };\n /**\n * Calls global extension method and binding current instance to the function call\n */\n // @ts-ignore Function lacks ending return statement and return type does not include 'undefined'. ts(2366)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n Hub.prototype._callExtensionMethod = function (method) {\n var args = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n\n var carrier = getMainCarrier();\n var sentry = carrier.__SENTRY__;\n\n if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {\n return sentry.extensions[method].apply(this, args);\n }\n\n logger.warn(\"Extension method \" + method + \" couldn't be found, doing nothing.\");\n };\n\n return Hub;\n}();\n\nexport { Hub };\n/**\n * Returns the global shim registry.\n *\n * FIXME: This function is problematic, because despite always returning a valid Carrier,\n * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check\n * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.\n **/\n\nexport function getMainCarrier() {\n var carrier = getGlobalObject();\n carrier.__SENTRY__ = carrier.__SENTRY__ || {\n extensions: {},\n hub: undefined\n };\n return carrier;\n}\n/**\n * Replaces the current main hub with the passed one on the global object\n *\n * @returns The old replaced hub\n */\n\nexport function makeMain(hub) {\n var registry = getMainCarrier();\n var oldHub = getHubFromCarrier(registry);\n setHubOnCarrier(registry, hub);\n return oldHub;\n}\n/**\n * Returns the default hub instance.\n *\n * If a hub is already registered in the global carrier but this module\n * contains a more recent version, it replaces the registered version.\n * Otherwise, the currently registered hub will be returned.\n */\n\nexport function getCurrentHub() {\n // Get main carrier (global for every environment)\n var registry = getMainCarrier(); // If there's no hub, or its an old API, assign a new one\n\n if (!hasHubOnCarrier(registry) || getHubFromCarrier(registry).isOlderThan(API_VERSION)) {\n setHubOnCarrier(registry, new Hub());\n } // Prefer domains over global if they are there (applicable only to Node environment)\n\n\n if (isNodeEnv()) {\n return getHubFromActiveDomain(registry);\n } // Return hub that lives on a global object\n\n\n return getHubFromCarrier(registry);\n}\n/**\n * Returns the active domain, if one exists\n * @deprecated No longer used; remove in v7\n * @returns The domain, or undefined if there is no active domain\n */\n// eslint-disable-next-line deprecation/deprecation\n\nexport function getActiveDomain() {\n logger.warn('Function `getActiveDomain` is deprecated and will be removed in a future version.');\n\n var sentry = getMainCarrier().__SENTRY__;\n\n return sentry && sentry.extensions && sentry.extensions.domain && sentry.extensions.domain.active;\n}\n/**\n * Try to read the hub from an active domain, and fallback to the registry if one doesn't exist\n * @returns discovered hub\n */\n\nfunction getHubFromActiveDomain(registry) {\n try {\n var sentry = getMainCarrier().__SENTRY__;\n\n var activeDomain = sentry && sentry.extensions && sentry.extensions.domain && sentry.extensions.domain.active; // If there's no active domain, just return global hub\n\n if (!activeDomain) {\n return getHubFromCarrier(registry);\n } // If there's no hub on current domain, or it's an old API, assign a new one\n\n\n if (!hasHubOnCarrier(activeDomain) || getHubFromCarrier(activeDomain).isOlderThan(API_VERSION)) {\n var registryHubTopStack = getHubFromCarrier(registry).getStackTop();\n setHubOnCarrier(activeDomain, new Hub(registryHubTopStack.client, Scope.clone(registryHubTopStack.scope)));\n } // Return hub that lives on a domain\n\n\n return getHubFromCarrier(activeDomain);\n } catch (_Oo) {\n // Return hub that lives on a global object\n return getHubFromCarrier(registry);\n }\n}\n/**\n * This will tell whether a carrier has a hub on it or not\n * @param carrier object\n */\n\n\nfunction hasHubOnCarrier(carrier) {\n return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub);\n}\n/**\n * This will create a new {@link Hub} and add to the passed object on\n * __SENTRY__.hub.\n * @param carrier object\n * @hidden\n */\n\n\nexport function getHubFromCarrier(carrier) {\n if (carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub) return carrier.__SENTRY__.hub;\n carrier.__SENTRY__ = carrier.__SENTRY__ || {};\n carrier.__SENTRY__.hub = new Hub();\n return carrier.__SENTRY__.hub;\n}\n/**\n * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute\n * @param carrier object\n * @param hub Hub\n * @returns A boolean indicating success or failure\n */\n\nexport function setHubOnCarrier(carrier, hub) {\n if (!carrier) return false;\n carrier.__SENTRY__ = carrier.__SENTRY__ || {};\n carrier.__SENTRY__.hub = hub;\n return true;\n}","import { __read, __spread } from \"tslib\";\nimport { addGlobalEventProcessor, getCurrentHub } from '@sentry/hub';\nimport { getEventDescription, isDebugBuild, isMatchingPattern, logger } from '@sentry/utils'; // \"Script error.\" is hard coded into browsers for errors that it can't read.\n// this is the result of a script being pulled in from an external domain and CORS.\n\nvar DEFAULT_IGNORE_ERRORS = [/^Script error\\.?$/, /^Javascript error: Script error\\.? on line 0$/];\n/** Inbound filters configurable by the user */\n\nvar InboundFilters =\n/** @class */\nfunction () {\n function InboundFilters(_options) {\n if (_options === void 0) {\n _options = {};\n }\n\n this._options = _options;\n /**\n * @inheritDoc\n */\n\n this.name = InboundFilters.id;\n }\n /**\n * @inheritDoc\n */\n\n\n InboundFilters.prototype.setupOnce = function () {\n addGlobalEventProcessor(function (event) {\n var hub = getCurrentHub();\n\n if (!hub) {\n return event;\n }\n\n var self = hub.getIntegration(InboundFilters);\n\n if (self) {\n var client = hub.getClient();\n var clientOptions = client ? client.getOptions() : {}; // This checks prevents most of the occurrences of the bug linked below:\n // https://github.com/getsentry/sentry-javascript/issues/2622\n // The bug is caused by multiple SDK instances, where one is minified and one is using non-mangled code.\n // Unfortunatelly we cannot fix it reliably (thus reserved property in rollup's terser config),\n // as we cannot force people using multiple instances in their apps to sync SDK versions.\n\n var options = typeof self._mergeOptions === 'function' ? self._mergeOptions(clientOptions) : {};\n\n if (typeof self._shouldDropEvent !== 'function') {\n return event;\n }\n\n return self._shouldDropEvent(event, options) ? null : event;\n }\n\n return event;\n });\n };\n /** JSDoc */\n\n\n InboundFilters.prototype._shouldDropEvent = function (event, options) {\n if (this._isSentryError(event, options)) {\n if (isDebugBuild()) {\n logger.warn(\"Event dropped due to being internal Sentry Error.\\nEvent: \" + getEventDescription(event));\n }\n\n return true;\n }\n\n if (this._isIgnoredError(event, options)) {\n if (isDebugBuild()) {\n logger.warn(\"Event dropped due to being matched by `ignoreErrors` option.\\nEvent: \" + getEventDescription(event));\n }\n\n return true;\n }\n\n if (this._isDeniedUrl(event, options)) {\n if (isDebugBuild()) {\n logger.warn(\"Event dropped due to being matched by `denyUrls` option.\\nEvent: \" + getEventDescription(event) + \".\\nUrl: \" + this._getEventFilterUrl(event));\n }\n\n return true;\n }\n\n if (!this._isAllowedUrl(event, options)) {\n if (isDebugBuild()) {\n logger.warn(\"Event dropped due to not being matched by `allowUrls` option.\\nEvent: \" + getEventDescription(event) + \".\\nUrl: \" + this._getEventFilterUrl(event));\n }\n\n return true;\n }\n\n return false;\n };\n /** JSDoc */\n\n\n InboundFilters.prototype._isSentryError = function (event, options) {\n if (!options.ignoreInternal) {\n return false;\n }\n\n try {\n // @ts-ignore can't be a sentry error if undefined\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return event.exception.values[0].type === 'SentryError';\n } catch (e) {// ignore\n }\n\n return false;\n };\n /** JSDoc */\n\n\n InboundFilters.prototype._isIgnoredError = function (event, options) {\n if (!options.ignoreErrors || !options.ignoreErrors.length) {\n return false;\n }\n\n return this._getPossibleEventMessages(event).some(function (message) {\n // Not sure why TypeScript complains here...\n return options.ignoreErrors.some(function (pattern) {\n return isMatchingPattern(message, pattern);\n });\n });\n };\n /** JSDoc */\n\n\n InboundFilters.prototype._isDeniedUrl = function (event, options) {\n // TODO: Use Glob instead?\n if (!options.denyUrls || !options.denyUrls.length) {\n return false;\n }\n\n var url = this._getEventFilterUrl(event);\n\n return !url ? false : options.denyUrls.some(function (pattern) {\n return isMatchingPattern(url, pattern);\n });\n };\n /** JSDoc */\n\n\n InboundFilters.prototype._isAllowedUrl = function (event, options) {\n // TODO: Use Glob instead?\n if (!options.allowUrls || !options.allowUrls.length) {\n return true;\n }\n\n var url = this._getEventFilterUrl(event);\n\n return !url ? true : options.allowUrls.some(function (pattern) {\n return isMatchingPattern(url, pattern);\n });\n };\n /** JSDoc */\n\n\n InboundFilters.prototype._mergeOptions = function (clientOptions) {\n if (clientOptions === void 0) {\n clientOptions = {};\n }\n\n return {\n allowUrls: __spread(this._options.whitelistUrls || [], this._options.allowUrls || [], clientOptions.whitelistUrls || [], clientOptions.allowUrls || []),\n denyUrls: __spread(this._options.blacklistUrls || [], this._options.denyUrls || [], clientOptions.blacklistUrls || [], clientOptions.denyUrls || []),\n ignoreErrors: __spread(this._options.ignoreErrors || [], clientOptions.ignoreErrors || [], DEFAULT_IGNORE_ERRORS),\n ignoreInternal: typeof this._options.ignoreInternal !== 'undefined' ? this._options.ignoreInternal : true\n };\n };\n /** JSDoc */\n\n\n InboundFilters.prototype._getPossibleEventMessages = function (event) {\n if (event.message) {\n return [event.message];\n }\n\n if (event.exception) {\n try {\n var _a = event.exception.values && event.exception.values[0] || {},\n _b = _a.type,\n type = _b === void 0 ? '' : _b,\n _c = _a.value,\n value = _c === void 0 ? '' : _c;\n\n return [\"\" + value, type + \": \" + value];\n } catch (oO) {\n if (isDebugBuild()) {\n logger.error(\"Cannot extract message for event \" + getEventDescription(event));\n }\n\n return [];\n }\n }\n\n return [];\n };\n /** JSDoc */\n\n\n InboundFilters.prototype._getLastValidUrl = function (frames) {\n if (frames === void 0) {\n frames = [];\n }\n\n for (var i = frames.length - 1; i >= 0; i--) {\n var frame = frames[i];\n\n if (frame && frame.filename !== '' && frame.filename !== '[native code]') {\n return frame.filename || null;\n }\n }\n\n return null;\n };\n /** JSDoc */\n\n\n InboundFilters.prototype._getEventFilterUrl = function (event) {\n try {\n if (event.stacktrace) {\n return this._getLastValidUrl(event.stacktrace.frames);\n }\n\n var frames_1;\n\n try {\n // @ts-ignore we only care about frames if the whole thing here is defined\n frames_1 = event.exception.values[0].stacktrace.frames;\n } catch (e) {// ignore\n }\n\n return frames_1 ? this._getLastValidUrl(frames_1) : null;\n } catch (oO) {\n if (isDebugBuild()) {\n logger.error(\"Cannot extract url for event \" + getEventDescription(event));\n }\n\n return null;\n }\n };\n /**\n * @inheritDoc\n */\n\n\n InboundFilters.id = 'InboundFilters';\n return InboundFilters;\n}();\n\nexport { InboundFilters };","import { isDebugBuild } from './env';\nimport { getGlobalObject } from './global';\nimport { logger } from './logger';\n/**\n * Tells whether current environment supports ErrorEvent objects\n * {@link supportsErrorEvent}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsErrorEvent() {\n try {\n new ErrorEvent('');\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * Tells whether current environment supports DOMError objects\n * {@link supportsDOMError}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsDOMError() {\n try {\n // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError':\n // 1 argument required, but only 0 present.\n // @ts-ignore It really needs 1 argument, not 0.\n new DOMError('');\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * Tells whether current environment supports DOMException objects\n * {@link supportsDOMException}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsDOMException() {\n try {\n new DOMException('');\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * Tells whether current environment supports Fetch API\n * {@link supportsFetch}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsFetch() {\n if (!('fetch' in getGlobalObject())) {\n return false;\n }\n\n try {\n new Headers();\n new Request('');\n new Response();\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * isNativeFetch checks if the given function is a native implementation of fetch()\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\n\nexport function isNativeFetch(func) {\n return func && /^function fetch\\(\\)\\s+\\{\\s+\\[native code\\]\\s+\\}$/.test(func.toString());\n}\n/**\n * Tells whether current environment supports Fetch API natively\n * {@link supportsNativeFetch}.\n *\n * @returns true if `window.fetch` is natively implemented, false otherwise\n */\n\nexport function supportsNativeFetch() {\n if (!supportsFetch()) {\n return false;\n }\n\n var global = getGlobalObject(); // Fast path to avoid DOM I/O\n // eslint-disable-next-line @typescript-eslint/unbound-method\n\n if (isNativeFetch(global.fetch)) {\n return true;\n } // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension)\n // so create a \"pure\" iframe to see if that has native fetch\n\n\n var result = false;\n var doc = global.document; // eslint-disable-next-line deprecation/deprecation\n\n if (doc && typeof doc.createElement === 'function') {\n try {\n var sandbox = doc.createElement('iframe');\n sandbox.hidden = true;\n doc.head.appendChild(sandbox);\n\n if (sandbox.contentWindow && sandbox.contentWindow.fetch) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n result = isNativeFetch(sandbox.contentWindow.fetch);\n }\n\n doc.head.removeChild(sandbox);\n } catch (err) {\n if (isDebugBuild()) {\n logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err);\n }\n }\n }\n\n return result;\n}\n/**\n * Tells whether current environment supports ReportingObserver API\n * {@link supportsReportingObserver}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsReportingObserver() {\n return 'ReportingObserver' in getGlobalObject();\n}\n/**\n * Tells whether current environment supports Referrer Policy API\n * {@link supportsReferrerPolicy}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsReferrerPolicy() {\n // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'\n // (see https://caniuse.com/#feat=referrer-policy),\n // it doesn't. And it throws an exception instead of ignoring this parameter...\n // REF: https://github.com/getsentry/raven-js/issues/1233\n if (!supportsFetch()) {\n return false;\n }\n\n try {\n new Request('_', {\n referrerPolicy: 'origin'\n });\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * Tells whether current environment supports History API\n * {@link supportsHistory}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsHistory() {\n // NOTE: in Chrome App environment, touching history.pushState, *even inside\n // a try/catch block*, will cause Chrome to output an error to console.error\n // borrowed from: https://github.com/angular/angular.js/pull/13945/files\n var global = getGlobalObject();\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n var chrome = global.chrome;\n var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n\n var hasHistoryApi = 'history' in global && !!global.history.pushState && !!global.history.replaceState;\n return !isChromePackagedApp && hasHistoryApi;\n}","import { __assign, __values } from \"tslib\";\nimport { isDebugBuild } from './env';\nimport { getGlobalObject } from './global';\nimport { isInstanceOf, isString } from './is';\nimport { logger } from './logger';\nimport { fill } from './object';\nimport { getFunctionName } from './stacktrace';\nimport { supportsHistory, supportsNativeFetch } from './supports';\nvar global = getGlobalObject();\n/**\n * Instrument native APIs to call handlers that can be used to create breadcrumbs, APM spans etc.\n * - Console API\n * - Fetch API\n * - XHR API\n * - History API\n * - DOM API (click/typing)\n * - Error API\n * - UnhandledRejection API\n */\n\nvar handlers = {};\nvar instrumented = {};\n/** Instruments given API */\n\nfunction instrument(type) {\n if (instrumented[type]) {\n return;\n }\n\n instrumented[type] = true;\n\n switch (type) {\n case 'console':\n instrumentConsole();\n break;\n\n case 'dom':\n instrumentDOM();\n break;\n\n case 'xhr':\n instrumentXHR();\n break;\n\n case 'fetch':\n instrumentFetch();\n break;\n\n case 'history':\n instrumentHistory();\n break;\n\n case 'error':\n instrumentError();\n break;\n\n case 'unhandledrejection':\n instrumentUnhandledRejection();\n break;\n\n default:\n logger.warn('unknown instrumentation type:', type);\n }\n}\n/**\n * Add handler that will be called when given type of instrumentation triggers.\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\n\n\nexport function addInstrumentationHandler(type, callback) {\n handlers[type] = handlers[type] || [];\n handlers[type].push(callback);\n instrument(type);\n}\n/** JSDoc */\n\nfunction triggerHandlers(type, data) {\n var e_1, _a;\n\n if (!type || !handlers[type]) {\n return;\n }\n\n try {\n for (var _b = __values(handlers[type] || []), _c = _b.next(); !_c.done; _c = _b.next()) {\n var handler = _c.value;\n\n try {\n handler(data);\n } catch (e) {\n if (isDebugBuild()) {\n logger.error(\"Error while triggering instrumentation handler.\\nType: \" + type + \"\\nName: \" + getFunctionName(handler) + \"\\nError:\", e);\n }\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b[\"return\"])) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n}\n/** JSDoc */\n\n\nfunction instrumentConsole() {\n if (!('console' in global)) {\n return;\n }\n\n ['debug', 'info', 'warn', 'error', 'log', 'assert'].forEach(function (level) {\n if (!(level in global.console)) {\n return;\n }\n\n fill(global.console, level, function (originalConsoleMethod) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n triggerHandlers('console', {\n args: args,\n level: level\n }); // this fails for some browsers. :(\n\n if (originalConsoleMethod) {\n originalConsoleMethod.apply(global.console, args);\n }\n };\n });\n });\n}\n/** JSDoc */\n\n\nfunction instrumentFetch() {\n if (!supportsNativeFetch()) {\n return;\n }\n\n fill(global, 'fetch', function (originalFetch) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var handlerData = {\n args: args,\n fetchData: {\n method: getFetchMethod(args),\n url: getFetchUrl(args)\n },\n startTimestamp: Date.now()\n };\n triggerHandlers('fetch', __assign({}, handlerData)); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\n return originalFetch.apply(global, args).then(function (response) {\n triggerHandlers('fetch', __assign(__assign({}, handlerData), {\n endTimestamp: Date.now(),\n response: response\n }));\n return response;\n }, function (error) {\n triggerHandlers('fetch', __assign(__assign({}, handlerData), {\n endTimestamp: Date.now(),\n error: error\n })); // NOTE: If you are a Sentry user, and you are seeing this stack frame,\n // it means the sentry.javascript SDK caught an error invoking your application code.\n // This is expected behavior and NOT indicative of a bug with sentry.javascript.\n\n throw error;\n });\n };\n });\n}\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\n/** Extract `method` from fetch call arguments */\n\n\nfunction getFetchMethod(fetchArgs) {\n if (fetchArgs === void 0) {\n fetchArgs = [];\n }\n\n if ('Request' in global && isInstanceOf(fetchArgs[0], Request) && fetchArgs[0].method) {\n return String(fetchArgs[0].method).toUpperCase();\n }\n\n if (fetchArgs[1] && fetchArgs[1].method) {\n return String(fetchArgs[1].method).toUpperCase();\n }\n\n return 'GET';\n}\n/** Extract `url` from fetch call arguments */\n\n\nfunction getFetchUrl(fetchArgs) {\n if (fetchArgs === void 0) {\n fetchArgs = [];\n }\n\n if (typeof fetchArgs[0] === 'string') {\n return fetchArgs[0];\n }\n\n if ('Request' in global && isInstanceOf(fetchArgs[0], Request)) {\n return fetchArgs[0].url;\n }\n\n return String(fetchArgs[0]);\n}\n/* eslint-enable @typescript-eslint/no-unsafe-member-access */\n\n/** JSDoc */\n\n\nfunction instrumentXHR() {\n if (!('XMLHttpRequest' in global)) {\n return;\n }\n\n var xhrproto = XMLHttpRequest.prototype;\n fill(xhrproto, 'open', function (originalOpen) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n } // eslint-disable-next-line @typescript-eslint/no-this-alias\n\n\n var xhr = this;\n var url = args[1];\n var xhrInfo = xhr.__sentry_xhr__ = {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n method: isString(args[0]) ? args[0].toUpperCase() : args[0],\n url: args[1]\n }; // if Sentry key appears in URL, don't capture it as a request\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\n if (isString(url) && xhrInfo.method === 'POST' && url.match(/sentry_key/)) {\n xhr.__sentry_own_request__ = true;\n }\n\n var onreadystatechangeHandler = function onreadystatechangeHandler() {\n if (xhr.readyState === 4) {\n try {\n // touching statusCode in some platforms throws\n // an exception\n xhrInfo.status_code = xhr.status;\n } catch (e) {\n /* do nothing */\n }\n\n triggerHandlers('xhr', {\n args: args,\n endTimestamp: Date.now(),\n startTimestamp: Date.now(),\n xhr: xhr\n });\n }\n };\n\n if ('onreadystatechange' in xhr && typeof xhr.onreadystatechange === 'function') {\n fill(xhr, 'onreadystatechange', function (original) {\n return function () {\n var readyStateArgs = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n readyStateArgs[_i] = arguments[_i];\n }\n\n onreadystatechangeHandler();\n return original.apply(xhr, readyStateArgs);\n };\n });\n } else {\n xhr.addEventListener('readystatechange', onreadystatechangeHandler);\n }\n\n return originalOpen.apply(xhr, args);\n };\n });\n fill(xhrproto, 'send', function (originalSend) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n if (this.__sentry_xhr__ && args[0] !== undefined) {\n this.__sentry_xhr__.body = args[0];\n }\n\n triggerHandlers('xhr', {\n args: args,\n startTimestamp: Date.now(),\n xhr: this\n });\n return originalSend.apply(this, args);\n };\n });\n}\n\nvar lastHref;\n/** JSDoc */\n\nfunction instrumentHistory() {\n if (!supportsHistory()) {\n return;\n }\n\n var oldOnPopState = global.onpopstate;\n\n global.onpopstate = function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var to = global.location.href; // keep track of the current URL state, as we always receive only the updated state\n\n var from = lastHref;\n lastHref = to;\n triggerHandlers('history', {\n from: from,\n to: to\n });\n\n if (oldOnPopState) {\n // Apparently this can throw in Firefox when incorrectly implemented plugin is installed.\n // https://github.com/getsentry/sentry-javascript/issues/3344\n // https://github.com/bugsnag/bugsnag-js/issues/469\n try {\n return oldOnPopState.apply(this, args);\n } catch (_oO) {// no-empty\n }\n }\n };\n /** @hidden */\n\n\n function historyReplacementFunction(originalHistoryFunction) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var url = args.length > 2 ? args[2] : undefined;\n\n if (url) {\n // coerce to string (this is what pushState does)\n var from = lastHref;\n var to = String(url); // keep track of the current URL state, as we always receive only the updated state\n\n lastHref = to;\n triggerHandlers('history', {\n from: from,\n to: to\n });\n }\n\n return originalHistoryFunction.apply(this, args);\n };\n }\n\n fill(global.history, 'pushState', historyReplacementFunction);\n fill(global.history, 'replaceState', historyReplacementFunction);\n}\n\nvar debounceDuration = 1000;\nvar debounceTimerID;\nvar lastCapturedEvent;\n/**\n * Decide whether the current event should finish the debounce of previously captured one.\n * @param previous previously captured event\n * @param current event to be captured\n */\n\nfunction shouldShortcircuitPreviousDebounce(previous, current) {\n // If there was no previous event, it should always be swapped for the new one.\n if (!previous) {\n return true;\n } // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress.\n\n\n if (previous.type !== current.type) {\n return true;\n }\n\n try {\n // If both events have the same type, it's still possible that actions were performed on different targets.\n // e.g. 2 clicks on different buttons.\n if (previous.target !== current.target) {\n return true;\n }\n } catch (e) {} // just accessing `target` property can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/sentry-javascript/issues/838\n // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_\n // to which an event listener was attached), we treat them as the same action, as we want to capture\n // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box.\n\n\n return false;\n}\n/**\n * Decide whether an event should be captured.\n * @param event event to be captured\n */\n\n\nfunction shouldSkipDOMEvent(event) {\n // We are only interested in filtering `keypress` events for now.\n if (event.type !== 'keypress') {\n return false;\n }\n\n try {\n var target = event.target;\n\n if (!target || !target.tagName) {\n return true;\n } // Only consider keypress events on actual input elements. This will disregard keypresses targeting body\n // e.g.tabbing through elements, hotkeys, etc.\n\n\n if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n return false;\n }\n } catch (e) {// just accessing `target` property can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/sentry-javascript/issues/838\n }\n\n return true;\n}\n/**\n * Wraps addEventListener to capture UI breadcrumbs\n * @param handler function that will be triggered\n * @param globalListener indicates whether event was captured by the global event listener\n * @returns wrapped breadcrumb events handler\n * @hidden\n */\n\n\nfunction makeDOMEventHandler(handler, globalListener) {\n if (globalListener === void 0) {\n globalListener = false;\n }\n\n return function (event) {\n // It's possible this handler might trigger multiple times for the same\n // event (e.g. event propagation through node ancestors).\n // Ignore if we've already captured that event.\n if (!event || lastCapturedEvent === event) {\n return;\n } // We always want to skip _some_ events.\n\n\n if (shouldSkipDOMEvent(event)) {\n return;\n }\n\n var name = event.type === 'keypress' ? 'input' : event.type; // If there is no debounce timer, it means that we can safely capture the new event and store it for future comparisons.\n\n if (debounceTimerID === undefined) {\n handler({\n event: event,\n name: name,\n global: globalListener\n });\n lastCapturedEvent = event;\n } // If there is a debounce awaiting, see if the new event is different enough to treat it as a unique one.\n // If that's the case, emit the previous event and store locally the newly-captured DOM event.\n else if (shouldShortcircuitPreviousDebounce(lastCapturedEvent, event)) {\n handler({\n event: event,\n name: name,\n global: globalListener\n });\n lastCapturedEvent = event;\n } // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together.\n\n\n clearTimeout(debounceTimerID);\n debounceTimerID = global.setTimeout(function () {\n debounceTimerID = undefined;\n }, debounceDuration);\n };\n}\n/** JSDoc */\n\n\nfunction instrumentDOM() {\n if (!('document' in global)) {\n return;\n } // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom\n // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before\n // we instrument `addEventListener` so that we don't end up attaching this handler twice.\n\n\n var triggerDOMHandler = triggerHandlers.bind(null, 'dom');\n var globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true);\n global.document.addEventListener('click', globalDOMEventHandler, false);\n global.document.addEventListener('keypress', globalDOMEventHandler, false); // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled\n // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That\n // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler\n // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still\n // guaranteed to fire at least once.)\n\n ['EventTarget', 'Node'].forEach(function (target) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n var proto = global[target] && global[target].prototype; // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function (originalAddEventListener) {\n return function (type, listener, options) {\n if (type === 'click' || type == 'keypress') {\n try {\n var el = this;\n var handlers_1 = el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {};\n var handlerForType = handlers_1[type] = handlers_1[type] || {\n refCount: 0\n };\n\n if (!handlerForType.handler) {\n var handler = makeDOMEventHandler(triggerDOMHandler);\n handlerForType.handler = handler;\n originalAddEventListener.call(this, type, handler, options);\n }\n\n handlerForType.refCount += 1;\n } catch (e) {// Accessing dom properties is always fragile.\n // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n }\n }\n\n return originalAddEventListener.call(this, type, listener, options);\n };\n });\n fill(proto, 'removeEventListener', function (originalRemoveEventListener) {\n return function (type, listener, options) {\n if (type === 'click' || type == 'keypress') {\n try {\n var el = this;\n var handlers_2 = el.__sentry_instrumentation_handlers__ || {};\n var handlerForType = handlers_2[type];\n\n if (handlerForType) {\n handlerForType.refCount -= 1; // If there are no longer any custom handlers of the current type on this element, we can remove ours, too.\n\n if (handlerForType.refCount <= 0) {\n originalRemoveEventListener.call(this, type, handlerForType.handler, options);\n handlerForType.handler = undefined;\n delete handlers_2[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n } // If there are no longer any custom handlers of any type on this element, cleanup everything.\n\n\n if (Object.keys(handlers_2).length === 0) {\n delete el.__sentry_instrumentation_handlers__;\n }\n }\n } catch (e) {// Accessing dom properties is always fragile.\n // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n }\n }\n\n return originalRemoveEventListener.call(this, type, listener, options);\n };\n });\n });\n}\n\nvar _oldOnErrorHandler = null;\n/** JSDoc */\n\nfunction instrumentError() {\n _oldOnErrorHandler = global.onerror;\n\n global.onerror = function (msg, url, line, column, error) {\n triggerHandlers('error', {\n column: column,\n error: error,\n line: line,\n msg: msg,\n url: url\n });\n\n if (_oldOnErrorHandler) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnErrorHandler.apply(this, arguments);\n }\n\n return false;\n };\n}\n\nvar _oldOnUnhandledRejectionHandler = null;\n/** JSDoc */\n\nfunction instrumentUnhandledRejection() {\n _oldOnUnhandledRejectionHandler = global.onunhandledrejection;\n\n global.onunhandledrejection = function (e) {\n triggerHandlers('unhandledrejection', e);\n\n if (_oldOnUnhandledRejectionHandler) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnUnhandledRejectionHandler.apply(this, arguments);\n }\n\n return true;\n };\n}","export var SDK_VERSION = '6.18.2';","export var setPrototypeOf = Object.setPrototypeOf || ({\n __proto__: []\n} instanceof Array ? setProtoOf : mixinProperties);\n/**\n * setPrototypeOf polyfill using __proto__\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\n\nfunction setProtoOf(obj, proto) {\n // @ts-ignore __proto__ does not exist on obj\n obj.__proto__ = proto;\n return obj;\n}\n/**\n * setPrototypeOf polyfill using mixin\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\n\n\nfunction mixinProperties(obj, proto) {\n for (var prop in proto) {\n if (!Object.prototype.hasOwnProperty.call(obj, prop)) {\n // @ts-ignore typescript complains about indexing so we remove\n obj[prop] = proto[prop];\n }\n }\n\n return obj;\n}","import { __extends } from \"tslib\";\nimport { setPrototypeOf } from './polyfill';\n/** An error emitted by Sentry SDKs and related utilities. */\n\nvar SentryError =\n/** @class */\nfunction (_super) {\n __extends(SentryError, _super);\n\n function SentryError(message) {\n var _newTarget = this.constructor;\n\n var _this = _super.call(this, message) || this;\n\n _this.message = message;\n _this.name = _newTarget.prototype.constructor.name;\n setPrototypeOf(_this, _newTarget.prototype);\n return _this;\n }\n\n return SentryError;\n}(Error);\n\nexport { SentryError };","import { __read } from \"tslib\";\nimport { isDebugBuild } from './env';\nimport { SentryError } from './error';\n/** Regular expression used to parse a Dsn. */\n\nvar DSN_REGEX = /^(?:(\\w+):)\\/\\/(?:(\\w+)(?::(\\w+))?@)([\\w.-]+)(?::(\\d+))?\\/(.+)/;\n\nfunction isValidProtocol(protocol) {\n return protocol === 'http' || protocol === 'https';\n}\n/**\n * Renders the string representation of this Dsn.\n *\n * By default, this will render the public representation without the password\n * component. To get the deprecated private representation, set `withPassword`\n * to true.\n *\n * @param withPassword When set to true, the password will be included.\n */\n\n\nexport function dsnToString(dsn, withPassword) {\n if (withPassword === void 0) {\n withPassword = false;\n }\n\n var host = dsn.host,\n path = dsn.path,\n pass = dsn.pass,\n port = dsn.port,\n projectId = dsn.projectId,\n protocol = dsn.protocol,\n publicKey = dsn.publicKey;\n return protocol + \"://\" + publicKey + (withPassword && pass ? \":\" + pass : '') + (\"@\" + host + (port ? \":\" + port : '') + \"/\" + (path ? path + \"/\" : path) + projectId);\n}\n\nfunction dsnFromString(str) {\n var match = DSN_REGEX.exec(str);\n\n if (!match) {\n throw new SentryError(\"Invalid Sentry Dsn: \" + str);\n }\n\n var _a = __read(match.slice(1), 6),\n protocol = _a[0],\n publicKey = _a[1],\n _b = _a[2],\n pass = _b === void 0 ? '' : _b,\n host = _a[3],\n _c = _a[4],\n port = _c === void 0 ? '' : _c,\n lastPath = _a[5];\n\n var path = '';\n var projectId = lastPath;\n var split = projectId.split('/');\n\n if (split.length > 1) {\n path = split.slice(0, -1).join('/');\n projectId = split.pop();\n }\n\n if (projectId) {\n var projectMatch = projectId.match(/^\\d+/);\n\n if (projectMatch) {\n projectId = projectMatch[0];\n }\n }\n\n return dsnFromComponents({\n host: host,\n pass: pass,\n path: path,\n projectId: projectId,\n port: port,\n protocol: protocol,\n publicKey: publicKey\n });\n}\n\nfunction dsnFromComponents(components) {\n // TODO this is for backwards compatibility, and can be removed in a future version\n if ('user' in components && !('publicKey' in components)) {\n components.publicKey = components.user;\n }\n\n return {\n user: components.publicKey || '',\n protocol: components.protocol,\n publicKey: components.publicKey || '',\n pass: components.pass || '',\n host: components.host,\n port: components.port || '',\n path: components.path || '',\n projectId: components.projectId\n };\n}\n\nfunction validateDsn(dsn) {\n if (!isDebugBuild()) {\n return;\n }\n\n var port = dsn.port,\n projectId = dsn.projectId,\n protocol = dsn.protocol;\n var requiredComponents = ['protocol', 'publicKey', 'host', 'projectId'];\n requiredComponents.forEach(function (component) {\n if (!dsn[component]) {\n throw new SentryError(\"Invalid Sentry Dsn: \" + component + \" missing\");\n }\n });\n\n if (!projectId.match(/^\\d+$/)) {\n throw new SentryError(\"Invalid Sentry Dsn: Invalid projectId \" + projectId);\n }\n\n if (!isValidProtocol(protocol)) {\n throw new SentryError(\"Invalid Sentry Dsn: Invalid protocol \" + protocol);\n }\n\n if (port && isNaN(parseInt(port, 10))) {\n throw new SentryError(\"Invalid Sentry Dsn: Invalid port \" + port);\n }\n\n return true;\n}\n/** The Sentry Dsn, identifying a Sentry instance and project. */\n\n\nexport function makeDsn(from) {\n var components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from);\n validateDsn(components);\n return components;\n}","import { __read, __spread } from \"tslib\";\nimport { addGlobalEventProcessor, getCurrentHub } from '@sentry/hub';\nimport { addNonEnumerableProperty, logger } from '@sentry/utils';\nexport var installedIntegrations = [];\n/**\n * @private\n */\n\nfunction filterDuplicates(integrations) {\n return integrations.reduce(function (acc, integrations) {\n if (acc.every(function (accIntegration) {\n return integrations.name !== accIntegration.name;\n })) {\n acc.push(integrations);\n }\n\n return acc;\n }, []);\n}\n/** Gets integration to install */\n\n\nexport function getIntegrationsToSetup(options) {\n var defaultIntegrations = options.defaultIntegrations && __spread(options.defaultIntegrations) || [];\n var userIntegrations = options.integrations;\n\n var integrations = __spread(filterDuplicates(defaultIntegrations));\n\n if (Array.isArray(userIntegrations)) {\n // Filter out integrations that are also included in user options\n integrations = __spread(integrations.filter(function (integrations) {\n return userIntegrations.every(function (userIntegration) {\n return userIntegration.name !== integrations.name;\n });\n }), filterDuplicates(userIntegrations));\n } else if (typeof userIntegrations === 'function') {\n integrations = userIntegrations(integrations);\n integrations = Array.isArray(integrations) ? integrations : [integrations];\n } // Make sure that if present, `Debug` integration will always run last\n\n\n var integrationsNames = integrations.map(function (i) {\n return i.name;\n });\n var alwaysLastToRun = 'Debug';\n\n if (integrationsNames.indexOf(alwaysLastToRun) !== -1) {\n integrations.push.apply(integrations, __spread(integrations.splice(integrationsNames.indexOf(alwaysLastToRun), 1)));\n }\n\n return integrations;\n}\n/** Setup given integration */\n\nexport function setupIntegration(integration) {\n if (installedIntegrations.indexOf(integration.name) !== -1) {\n return;\n }\n\n integration.setupOnce(addGlobalEventProcessor, getCurrentHub);\n installedIntegrations.push(integration.name);\n logger.log(\"Integration installed: \" + integration.name);\n}\n/**\n * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default\n * integrations are added unless they were already provided before.\n * @param integrations array of integration instances\n * @param withDefault should enable default integrations\n */\n\nexport function setupIntegrations(options) {\n var integrations = {};\n getIntegrationsToSetup(options).forEach(function (integration) {\n integrations[integration.name] = integration;\n setupIntegration(integration);\n }); // set the `initialized` flag so we don't run through the process again unecessarily; use `Object.defineProperty`\n // because by default it creates a property which is nonenumerable, which we want since `initialized` shouldn't be\n // considered a member of the index the way the actual integrations are\n\n addNonEnumerableProperty(integrations, 'initialized', true);\n return integrations;\n}","import { __assign, __read, __spread, __values } from \"tslib\";\n/* eslint-disable max-lines */\n\nimport { Scope } from '@sentry/hub';\nimport { checkOrSetAlreadyCaught, dateTimestampInSeconds, isDebugBuild, isPlainObject, isPrimitive, isThenable, logger, makeDsn, normalize, rejectedSyncPromise, resolvedSyncPromise, SentryError, SyncPromise, truncate, uuid4 } from '@sentry/utils';\nimport { setupIntegrations } from './integration';\nvar ALREADY_SEEN_ERROR = \"Not capturing exception because it's already been captured.\";\n/**\n * Base implementation for all JavaScript SDK clients.\n *\n * Call the constructor with the corresponding backend constructor and options\n * specific to the client subclass. To access these options later, use\n * {@link Client.getOptions}. Also, the Backend instance is available via\n * {@link Client.getBackend}.\n *\n * If a Dsn is specified in the options, it will be parsed and stored. Use\n * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is\n * invalid, the constructor will throw a {@link SentryException}. Note that\n * without a valid Dsn, the SDK will not send any events to Sentry.\n *\n * Before sending an event via the backend, it is passed through\n * {@link BaseClient._prepareEvent} to add SDK information and scope data\n * (breadcrumbs and context). To add more custom information, override this\n * method and extend the resulting prepared event.\n *\n * To issue automatically created events (e.g. via instrumentation), use\n * {@link Client.captureEvent}. It will prepare the event and pass it through\n * the callback lifecycle. To issue auto-breadcrumbs, use\n * {@link Client.addBreadcrumb}.\n *\n * @example\n * class NodeClient extends BaseClient {\n * public constructor(options: NodeOptions) {\n * super(NodeBackend, options);\n * }\n *\n * // ...\n * }\n */\n\nvar BaseClient =\n/** @class */\nfunction () {\n /**\n * Initializes this client instance.\n *\n * @param backendClass A constructor function to create the backend.\n * @param options Options for the client.\n */\n function BaseClient(backendClass, options) {\n /** Array of used integrations. */\n this._integrations = {};\n /** Number of calls being processed */\n\n this._numProcessing = 0;\n this._backend = new backendClass(options);\n this._options = options;\n\n if (options.dsn) {\n this._dsn = makeDsn(options.dsn);\n }\n }\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n\n\n BaseClient.prototype.captureException = function (exception, hint, scope) {\n var _this = this; // ensure we haven't captured this very object before\n\n\n if (checkOrSetAlreadyCaught(exception)) {\n logger.log(ALREADY_SEEN_ERROR);\n return;\n }\n\n var eventId = hint && hint.event_id;\n\n this._process(this._getBackend().eventFromException(exception, hint).then(function (event) {\n return _this._captureEvent(event, hint, scope);\n }).then(function (result) {\n eventId = result;\n }));\n\n return eventId;\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.captureMessage = function (message, level, hint, scope) {\n var _this = this;\n\n var eventId = hint && hint.event_id;\n var promisedEvent = isPrimitive(message) ? this._getBackend().eventFromMessage(String(message), level, hint) : this._getBackend().eventFromException(message, hint);\n\n this._process(promisedEvent.then(function (event) {\n return _this._captureEvent(event, hint, scope);\n }).then(function (result) {\n eventId = result;\n }));\n\n return eventId;\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.captureEvent = function (event, hint, scope) {\n // ensure we haven't captured this very object before\n if (hint && hint.originalException && checkOrSetAlreadyCaught(hint.originalException)) {\n logger.log(ALREADY_SEEN_ERROR);\n return;\n }\n\n var eventId = hint && hint.event_id;\n\n this._process(this._captureEvent(event, hint, scope).then(function (result) {\n eventId = result;\n }));\n\n return eventId;\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.captureSession = function (session) {\n if (!this._isEnabled()) {\n if (isDebugBuild()) {\n logger.warn('SDK not enabled, will not capture session.');\n }\n\n return;\n }\n\n if (!(typeof session.release === 'string')) {\n if (isDebugBuild()) {\n logger.warn('Discarded session because of missing or non-string release');\n }\n } else {\n this._sendSession(session); // After sending, we set init false to indicate it's not the first occurrence\n\n\n session.update({\n init: false\n });\n }\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.getDsn = function () {\n return this._dsn;\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.getOptions = function () {\n return this._options;\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.getTransport = function () {\n return this._getBackend().getTransport();\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.flush = function (timeout) {\n var _this = this;\n\n return this._isClientDoneProcessing(timeout).then(function (clientFinished) {\n return _this.getTransport().close(timeout).then(function (transportFlushed) {\n return clientFinished && transportFlushed;\n });\n });\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.close = function (timeout) {\n var _this = this;\n\n return this.flush(timeout).then(function (result) {\n _this.getOptions().enabled = false;\n return result;\n });\n };\n /**\n * Sets up the integrations\n */\n\n\n BaseClient.prototype.setupIntegrations = function () {\n if (this._isEnabled() && !this._integrations.initialized) {\n this._integrations = setupIntegrations(this._options);\n }\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.getIntegration = function (integration) {\n try {\n return this._integrations[integration.id] || null;\n } catch (_oO) {\n logger.warn(\"Cannot retrieve integration \" + integration.id + \" from the current Client\");\n return null;\n }\n };\n /** Updates existing session based on the provided event */\n\n\n BaseClient.prototype._updateSessionFromEvent = function (session, event) {\n var e_1, _a;\n\n var crashed = false;\n var errored = false;\n var exceptions = event.exception && event.exception.values;\n\n if (exceptions) {\n errored = true;\n\n try {\n for (var exceptions_1 = __values(exceptions), exceptions_1_1 = exceptions_1.next(); !exceptions_1_1.done; exceptions_1_1 = exceptions_1.next()) {\n var ex = exceptions_1_1.value;\n var mechanism = ex.mechanism;\n\n if (mechanism && mechanism.handled === false) {\n crashed = true;\n break;\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (exceptions_1_1 && !exceptions_1_1.done && (_a = exceptions_1[\"return\"])) _a.call(exceptions_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n } // A session is updated and that session update is sent in only one of the two following scenarios:\n // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update\n // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update\n\n\n var sessionNonTerminal = session.status === 'ok';\n var shouldUpdateAndSend = sessionNonTerminal && session.errors === 0 || sessionNonTerminal && crashed;\n\n if (shouldUpdateAndSend) {\n session.update(__assign(__assign({}, crashed && {\n status: 'crashed'\n }), {\n errors: session.errors || Number(errored || crashed)\n }));\n this.captureSession(session);\n }\n };\n /** Deliver captured session to Sentry */\n\n\n BaseClient.prototype._sendSession = function (session) {\n this._getBackend().sendSession(session);\n };\n /**\n * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying\n * \"no\" (resolving to `false`) in order to give the client a chance to potentially finish first.\n *\n * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not\n * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to\n * `true`.\n * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and\n * `false` otherwise\n */\n\n\n BaseClient.prototype._isClientDoneProcessing = function (timeout) {\n var _this = this;\n\n return new SyncPromise(function (resolve) {\n var ticked = 0;\n var tick = 1;\n var interval = setInterval(function () {\n if (_this._numProcessing == 0) {\n clearInterval(interval);\n resolve(true);\n } else {\n ticked += tick;\n\n if (timeout && ticked >= timeout) {\n clearInterval(interval);\n resolve(false);\n }\n }\n }, tick);\n });\n };\n /** Returns the current backend. */\n\n\n BaseClient.prototype._getBackend = function () {\n return this._backend;\n };\n /** Determines whether this SDK is enabled and a valid Dsn is present. */\n\n\n BaseClient.prototype._isEnabled = function () {\n return this.getOptions().enabled !== false && this._dsn !== undefined;\n };\n /**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n */\n\n\n BaseClient.prototype._prepareEvent = function (event, scope, hint) {\n var _this = this;\n\n var _a = this.getOptions().normalizeDepth,\n normalizeDepth = _a === void 0 ? 3 : _a;\n\n var prepared = __assign(__assign({}, event), {\n event_id: event.event_id || (hint && hint.event_id ? hint.event_id : uuid4()),\n timestamp: event.timestamp || dateTimestampInSeconds()\n });\n\n this._applyClientOptions(prepared);\n\n this._applyIntegrationsMetadata(prepared); // If we have scope given to us, use it as the base for further modifications.\n // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.\n\n\n var finalScope = scope;\n\n if (hint && hint.captureContext) {\n finalScope = Scope.clone(finalScope).update(hint.captureContext);\n } // We prepare the result here with a resolved Event.\n\n\n var result = resolvedSyncPromise(prepared); // This should be the last thing called, since we want that\n // {@link Hub.addEventProcessor} gets the finished prepared event.\n\n if (finalScope) {\n // In case we have a hub we reassign it.\n result = finalScope.applyToEvent(prepared, hint);\n }\n\n return result.then(function (evt) {\n if (evt) {\n // TODO this is more of the hack trying to solve https://github.com/getsentry/sentry-javascript/issues/2809\n // it is only attached as extra data to the event if the event somehow skips being normalized\n evt.sdkProcessingMetadata = __assign(__assign({}, evt.sdkProcessingMetadata), {\n normalizeDepth: normalize(normalizeDepth)\n });\n }\n\n if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n return _this._normalizeEvent(evt, normalizeDepth);\n }\n\n return evt;\n });\n };\n /**\n * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n * Normalized keys:\n * - `breadcrumbs.data`\n * - `user`\n * - `contexts`\n * - `extra`\n * @param event Event\n * @returns Normalized event\n */\n\n\n BaseClient.prototype._normalizeEvent = function (event, depth) {\n if (!event) {\n return null;\n }\n\n var normalized = __assign(__assign(__assign(__assign(__assign({}, event), event.breadcrumbs && {\n breadcrumbs: event.breadcrumbs.map(function (b) {\n return __assign(__assign({}, b), b.data && {\n data: normalize(b.data, depth)\n });\n })\n }), event.user && {\n user: normalize(event.user, depth)\n }), event.contexts && {\n contexts: normalize(event.contexts, depth)\n }), event.extra && {\n extra: normalize(event.extra, depth)\n }); // event.contexts.trace stores information about a Transaction. Similarly,\n // event.spans[] stores information about child Spans. Given that a\n // Transaction is conceptually a Span, normalization should apply to both\n // Transactions and Spans consistently.\n // For now the decision is to skip normalization of Transactions and Spans,\n // so this block overwrites the normalized event to add back the original\n // Transaction information prior to normalization.\n\n\n if (event.contexts && event.contexts.trace) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n normalized.contexts.trace = event.contexts.trace;\n }\n\n event.sdkProcessingMetadata = __assign(__assign({}, event.sdkProcessingMetadata), {\n baseClientNormalized: true\n });\n return normalized;\n };\n /**\n * Enhances event using the client configuration.\n * It takes care of all \"static\" values like environment, release and `dist`,\n * as well as truncating overly long values.\n * @param event event instance to be enhanced\n */\n\n\n BaseClient.prototype._applyClientOptions = function (event) {\n var options = this.getOptions();\n var environment = options.environment,\n release = options.release,\n dist = options.dist,\n _a = options.maxValueLength,\n maxValueLength = _a === void 0 ? 250 : _a;\n\n if (!('environment' in event)) {\n event.environment = 'environment' in options ? environment : 'production';\n }\n\n if (event.release === undefined && release !== undefined) {\n event.release = release;\n }\n\n if (event.dist === undefined && dist !== undefined) {\n event.dist = dist;\n }\n\n if (event.message) {\n event.message = truncate(event.message, maxValueLength);\n }\n\n var exception = event.exception && event.exception.values && event.exception.values[0];\n\n if (exception && exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n\n var request = event.request;\n\n if (request && request.url) {\n request.url = truncate(request.url, maxValueLength);\n }\n };\n /**\n * This function adds all used integrations to the SDK info in the event.\n * @param event The event that will be filled with all integrations.\n */\n\n\n BaseClient.prototype._applyIntegrationsMetadata = function (event) {\n var integrationsArray = Object.keys(this._integrations);\n\n if (integrationsArray.length > 0) {\n event.sdk = event.sdk || {};\n event.sdk.integrations = __spread(event.sdk.integrations || [], integrationsArray);\n }\n };\n /**\n * Tells the backend to send this event\n * @param event The Sentry event to send\n */\n\n\n BaseClient.prototype._sendEvent = function (event) {\n this._getBackend().sendEvent(event);\n };\n /**\n * Processes the event and logs an error in case of rejection\n * @param event\n * @param hint\n * @param scope\n */\n\n\n BaseClient.prototype._captureEvent = function (event, hint, scope) {\n return this._processEvent(event, hint, scope).then(function (finalEvent) {\n return finalEvent.event_id;\n }, function (reason) {\n logger.error(reason);\n return undefined;\n });\n };\n /**\n * Processes an event (either error or message) and sends it to Sentry.\n *\n * This also adds breadcrumbs and context information to the event. However,\n * platform specific meta data (such as the User's IP address) must be added\n * by the SDK implementor.\n *\n *\n * @param event The event to send to Sentry.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.\n */\n\n\n BaseClient.prototype._processEvent = function (event, hint, scope) {\n var _this = this; // eslint-disable-next-line @typescript-eslint/unbound-method\n\n\n var _a = this.getOptions(),\n beforeSend = _a.beforeSend,\n sampleRate = _a.sampleRate;\n\n var transport = this.getTransport();\n\n function recordLostEvent(outcome, category) {\n if (transport.recordLostEvent) {\n transport.recordLostEvent(outcome, category);\n }\n }\n\n if (!this._isEnabled()) {\n return rejectedSyncPromise(new SentryError('SDK not enabled, will not capture event.'));\n }\n\n var isTransaction = event.type === 'transaction'; // 1.0 === 100% events are sent\n // 0.0 === 0% events are sent\n // Sampling for transaction happens somewhere else\n\n if (!isTransaction && typeof sampleRate === 'number' && Math.random() > sampleRate) {\n recordLostEvent('sample_rate', 'event');\n return rejectedSyncPromise(new SentryError(\"Discarding event because it's not included in the random sample (sampling rate = \" + sampleRate + \")\"));\n }\n\n return this._prepareEvent(event, scope, hint).then(function (prepared) {\n if (prepared === null) {\n recordLostEvent('event_processor', event.type || 'event');\n throw new SentryError('An event processor returned null, will not send event.');\n }\n\n var isInternalException = hint && hint.data && hint.data.__sentry__ === true;\n\n if (isInternalException || isTransaction || !beforeSend) {\n return prepared;\n }\n\n var beforeSendResult = beforeSend(prepared, hint);\n return _ensureBeforeSendRv(beforeSendResult);\n }).then(function (processedEvent) {\n if (processedEvent === null) {\n recordLostEvent('before_send', event.type || 'event');\n throw new SentryError('`beforeSend` returned `null`, will not send event.');\n }\n\n var session = scope && scope.getSession && scope.getSession();\n\n if (!isTransaction && session) {\n _this._updateSessionFromEvent(session, processedEvent);\n }\n\n _this._sendEvent(processedEvent);\n\n return processedEvent;\n }).then(null, function (reason) {\n if (reason instanceof SentryError) {\n throw reason;\n }\n\n _this.captureException(reason, {\n data: {\n __sentry__: true\n },\n originalException: reason\n });\n\n throw new SentryError(\"Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\\nReason: \" + reason);\n });\n };\n /**\n * Occupies the client with processing and event\n */\n\n\n BaseClient.prototype._process = function (promise) {\n var _this = this;\n\n this._numProcessing += 1;\n void promise.then(function (value) {\n _this._numProcessing -= 1;\n return value;\n }, function (reason) {\n _this._numProcessing -= 1;\n return reason;\n });\n };\n\n return BaseClient;\n}();\n\nexport { BaseClient };\n/**\n * Verifies that return value of configured `beforeSend` is of expected type.\n */\n\nfunction _ensureBeforeSendRv(rv) {\n var nullErr = '`beforeSend` method has to return `null` or a valid event.';\n\n if (isThenable(rv)) {\n return rv.then(function (event) {\n if (!(isPlainObject(event) || event === null)) {\n throw new SentryError(nullErr);\n }\n\n return event;\n }, function (e) {\n throw new SentryError(\"beforeSend rejected with \" + e);\n });\n } else if (!(isPlainObject(rv) || rv === null)) {\n throw new SentryError(nullErr);\n }\n\n return rv;\n}","import { resolvedSyncPromise } from '@sentry/utils';\n/** Noop transport */\n\nvar NoopTransport =\n/** @class */\nfunction () {\n function NoopTransport() {}\n /**\n * @inheritDoc\n */\n\n\n NoopTransport.prototype.sendEvent = function (_) {\n return resolvedSyncPromise({\n reason: 'NoopTransport: Event has been skipped because no Dsn is configured.',\n status: 'skipped'\n });\n };\n /**\n * @inheritDoc\n */\n\n\n NoopTransport.prototype.close = function (_) {\n return resolvedSyncPromise(true);\n };\n\n return NoopTransport;\n}();\n\nexport { NoopTransport };","/**\n * TODO(v7): Remove this enum and replace with SeverityLevel\n */\nexport var Severity;\n\n(function (Severity) {\n /** JSDoc */\n Severity[\"Fatal\"] = \"fatal\";\n /** JSDoc */\n\n Severity[\"Error\"] = \"error\";\n /** JSDoc */\n\n Severity[\"Warning\"] = \"warning\";\n /** JSDoc */\n\n Severity[\"Log\"] = \"log\";\n /** JSDoc */\n\n Severity[\"Info\"] = \"info\";\n /** JSDoc */\n\n Severity[\"Debug\"] = \"debug\";\n /** JSDoc */\n\n Severity[\"Critical\"] = \"critical\";\n})(Severity || (Severity = {})); // TODO: in v7, these can disappear, because they now also exist in `@sentry/utils`. (Having them there rather than here\n// is nice because then it enforces the idea that only types are exported from `@sentry/types`.)\n\n\nexport var SeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug', 'critical'];","import { isDebugBuild, logger, SentryError } from '@sentry/utils';\nimport { NoopTransport } from './transports/noop';\n/**\n * This is the base implemention of a Backend.\n * @hidden\n */\n\nvar BaseBackend =\n/** @class */\nfunction () {\n /** Creates a new backend instance. */\n function BaseBackend(options) {\n this._options = options;\n\n if (!this._options.dsn) {\n logger.warn('No DSN provided, backend will not do anything.');\n }\n\n this._transport = this._setupTransport();\n }\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n\n\n BaseBackend.prototype.eventFromException = function (_exception, _hint) {\n throw new SentryError('Backend has to implement `eventFromException` method');\n };\n /**\n * @inheritDoc\n */\n\n\n BaseBackend.prototype.eventFromMessage = function (_message, _level, _hint) {\n throw new SentryError('Backend has to implement `eventFromMessage` method');\n };\n /**\n * @inheritDoc\n */\n\n\n BaseBackend.prototype.sendEvent = function (event) {\n void this._transport.sendEvent(event).then(null, function (reason) {\n if (isDebugBuild()) {\n logger.error('Error while sending event:', reason);\n }\n });\n };\n /**\n * @inheritDoc\n */\n\n\n BaseBackend.prototype.sendSession = function (session) {\n if (!this._transport.sendSession) {\n if (isDebugBuild()) {\n logger.warn(\"Dropping session because custom transport doesn't implement sendSession\");\n }\n\n return;\n }\n\n void this._transport.sendSession(session).then(null, function (reason) {\n if (isDebugBuild()) {\n logger.error('Error while sending session:', reason);\n }\n });\n };\n /**\n * @inheritDoc\n */\n\n\n BaseBackend.prototype.getTransport = function () {\n return this._transport;\n };\n /**\n * Sets up the transport so it can be used later to send requests.\n */\n\n\n BaseBackend.prototype._setupTransport = function () {\n return new NoopTransport();\n };\n\n return BaseBackend;\n}();\n\nexport { BaseBackend };","import { __read } from \"tslib\"; // global reference to slice\n\nvar UNKNOWN_FUNCTION = '?';\nvar OPERA10_PRIORITY = 10;\nvar OPERA11_PRIORITY = 20;\nvar CHROME_PRIORITY = 30;\nvar WINJS_PRIORITY = 40;\nvar GECKO_PRIORITY = 50;\n\nfunction createFrame(filename, func, lineno, colno) {\n var frame = {\n filename: filename,\n \"function\": func,\n // All browser frames are considered in_app\n in_app: true\n };\n\n if (lineno !== undefined) {\n frame.lineno = lineno;\n }\n\n if (colno !== undefined) {\n frame.colno = colno;\n }\n\n return frame;\n} // Chromium based browsers: Chrome, Brave, new Opera, new Edge\n\n\nvar chromeRegex = /^\\s*at (?:(.*?) ?\\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack||[-a-z]+:|.*bundle|\\/).*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\nvar chromeEvalRegex = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n\nvar chrome = function chrome(line) {\n var parts = chromeRegex.exec(line);\n\n if (parts) {\n var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n\n if (isEval) {\n var subMatch = chromeEvalRegex.exec(parts[2]);\n\n if (subMatch) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = subMatch[1]; // url\n\n parts[3] = subMatch[2]; // line\n\n parts[4] = subMatch[3]; // column\n }\n } // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now\n // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)\n\n\n var _a = __read(extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]), 2),\n func = _a[0],\n filename = _a[1];\n\n return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined);\n }\n\n return;\n};\n\nexport var chromeStackParser = [CHROME_PRIORITY, chrome]; // gecko regex: `(?:bundle|\\d+\\.js)`: `bundle` is for react native, `\\d+\\.js` also but specifically for ram bundles because it\n// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js\n// We need this specific case for now because we want no other regex to match.\n\nvar geckoREgex = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\\/.*?|\\[native code\\]|[^@]*(?:bundle|\\d+\\.js)|\\/[\\w\\-. /=]+)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nvar geckoEvalRegex = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\n\nvar gecko = function gecko(line) {\n var _a;\n\n var parts = geckoREgex.exec(line);\n\n if (parts) {\n var isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n\n if (isEval) {\n var subMatch = geckoEvalRegex.exec(parts[3]);\n\n if (subMatch) {\n // throw out eval line/column and use top-most line number\n parts[1] = parts[1] || 'eval';\n parts[3] = subMatch[1];\n parts[4] = subMatch[2];\n parts[5] = ''; // no column when eval\n }\n }\n\n var filename = parts[3];\n var func = parts[1] || UNKNOWN_FUNCTION;\n _a = __read(extractSafariExtensionDetails(func, filename), 2), func = _a[0], filename = _a[1];\n return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined);\n }\n\n return;\n};\n\nexport var geckoStackParser = [GECKO_PRIORITY, gecko];\nvar winjsRegex = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nvar winjs = function winjs(line) {\n var parts = winjsRegex.exec(line);\n return parts ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined) : undefined;\n};\n\nexport var winjsStackParser = [WINJS_PRIORITY, winjs];\nvar opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i;\n\nvar opera10 = function opera10(line) {\n var parts = opera10Regex.exec(line);\n return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined;\n};\n\nexport var opera10StackParser = [OPERA10_PRIORITY, opera10];\nvar opera11Regex = / line (\\d+), column (\\d+)\\s*(?:in (?:]+)>|([^)]+))\\(.*\\))? in (.*):\\s*$/i;\n\nvar opera11 = function opera11(line) {\n var parts = opera11Regex.exec(line);\n return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;\n};\n\nexport var opera11StackParser = [OPERA11_PRIORITY, opera11];\n/**\n * Safari web extensions, starting version unknown, can produce \"frames-only\" stacktraces.\n * What it means, is that instead of format like:\n *\n * Error: wat\n * at function@url:row:col\n * at function@url:row:col\n * at function@url:row:col\n *\n * it produces something like:\n *\n * function@url:row:col\n * function@url:row:col\n * function@url:row:col\n *\n * Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch.\n * This function is extracted so that we can use it in both places without duplicating the logic.\n * Unfortunately \"just\" changing RegExp is too complicated now and making it pass all tests\n * and fix this case seems like an impossible, or at least way too time-consuming task.\n */\n\nvar extractSafariExtensionDetails = function extractSafariExtensionDetails(func, filename) {\n var isSafariExtension = func.indexOf('safari-extension') !== -1;\n var isSafariWebExtension = func.indexOf('safari-web-extension') !== -1;\n return isSafariExtension || isSafariWebExtension ? [func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION, isSafariExtension ? \"safari-extension:\" + filename : \"safari-web-extension:\" + filename] : [func, filename];\n};","import { __assign } from \"tslib\";\nimport { Severity } from '@sentry/types';\nimport { addExceptionMechanism, addExceptionTypeValue, createStackParser, extractExceptionKeysForMessage, isDOMError, isDOMException, isError, isErrorEvent, isEvent, isPlainObject, normalizeToSize, resolvedSyncPromise } from '@sentry/utils';\nimport { chromeStackParser, geckoStackParser, opera10StackParser, opera11StackParser, winjsStackParser } from './stack-parsers';\n/**\n * This function creates an exception from an TraceKitStackTrace\n * @param stacktrace TraceKitStackTrace that will be converted to an exception\n * @hidden\n */\n\nexport function exceptionFromError(ex) {\n // Get the frames first since Opera can lose the stack if we touch anything else first\n var frames = parseStackFrames(ex);\n var exception = {\n type: ex && ex.name,\n value: extractMessage(ex)\n };\n\n if (frames.length) {\n exception.stacktrace = {\n frames: frames\n };\n }\n\n if (exception.type === undefined && exception.value === '') {\n exception.value = 'Unrecoverable error caught';\n }\n\n return exception;\n}\n/**\n * @hidden\n */\n\nexport function eventFromPlainObject(exception, syntheticException, isUnhandledRejection) {\n var event = {\n exception: {\n values: [{\n type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',\n value: \"Non-Error \" + (isUnhandledRejection ? 'promise rejection' : 'exception') + \" captured with keys: \" + extractExceptionKeysForMessage(exception)\n }]\n },\n extra: {\n __serialized__: normalizeToSize(exception)\n }\n };\n\n if (syntheticException) {\n var frames_1 = parseStackFrames(syntheticException);\n\n if (frames_1.length) {\n event.stacktrace = {\n frames: frames_1\n };\n }\n }\n\n return event;\n}\n/**\n * @hidden\n */\n\nexport function eventFromError(ex) {\n return {\n exception: {\n values: [exceptionFromError(ex)]\n }\n };\n}\n/** Parses stack frames from an error */\n\nexport function parseStackFrames(ex) {\n // Access and store the stacktrace property before doing ANYTHING\n // else to it because Opera is not very good at providing it\n // reliably in other circumstances.\n var stacktrace = ex.stacktrace || ex.stack || '';\n var popSize = getPopSize(ex);\n\n try {\n return createStackParser(opera10StackParser, opera11StackParser, chromeStackParser, winjsStackParser, geckoStackParser)(stacktrace, popSize);\n } catch (e) {// no-empty\n }\n\n return [];\n} // Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108\n\nvar reactMinifiedRegexp = /Minified React error #\\d+;/i;\n\nfunction getPopSize(ex) {\n if (ex) {\n if (typeof ex.framesToPop === 'number') {\n return ex.framesToPop;\n }\n\n if (reactMinifiedRegexp.test(ex.message)) {\n return 1;\n }\n }\n\n return 0;\n}\n/**\n * There are cases where stacktrace.message is an Event object\n * https://github.com/getsentry/sentry-javascript/issues/1949\n * In this specific case we try to extract stacktrace.message.error.message\n */\n\n\nfunction extractMessage(ex) {\n var message = ex && ex.message;\n\n if (!message) {\n return 'No error message';\n }\n\n if (message.error && typeof message.error.message === 'string') {\n return message.error.message;\n }\n\n return message;\n}\n/**\n * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.\n * @hidden\n */\n\n\nexport function eventFromException(exception, hint, attachStacktrace) {\n var syntheticException = hint && hint.syntheticException || undefined;\n var event = eventFromUnknownInput(exception, syntheticException, attachStacktrace);\n addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }\n\n event.level = Severity.Error;\n\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n\n return resolvedSyncPromise(event);\n}\n/**\n * Builds and Event from a Message\n * @hidden\n */\n\nexport function eventFromMessage(message, level, hint, attachStacktrace) {\n if (level === void 0) {\n level = Severity.Info;\n }\n\n var syntheticException = hint && hint.syntheticException || undefined;\n var event = eventFromString(message, syntheticException, attachStacktrace);\n event.level = level;\n\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n\n return resolvedSyncPromise(event);\n}\n/**\n * @hidden\n */\n\nexport function eventFromUnknownInput(exception, syntheticException, attachStacktrace, isUnhandledRejection) {\n var event;\n\n if (isErrorEvent(exception) && exception.error) {\n // If it is an ErrorEvent with `error` property, extract it to get actual Error\n var errorEvent = exception;\n return eventFromError(errorEvent.error);\n } // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name\n // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be\n // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.\n //\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n // https://webidl.spec.whatwg.org/#es-DOMException-specialness\n\n\n if (isDOMError(exception) || isDOMException(exception)) {\n var domException = exception;\n\n if ('stack' in exception) {\n event = eventFromError(exception);\n } else {\n var name_1 = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');\n var message = domException.message ? name_1 + \": \" + domException.message : name_1;\n event = eventFromString(message, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, message);\n }\n\n if ('code' in domException) {\n event.tags = __assign(__assign({}, event.tags), {\n 'DOMException.code': \"\" + domException.code\n });\n }\n\n return event;\n }\n\n if (isError(exception)) {\n // we have a real Error object, do nothing\n return eventFromError(exception);\n }\n\n if (isPlainObject(exception) || isEvent(exception)) {\n // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize\n // it manually. This will allow us to group events based on top-level keys which is much better than creating a new\n // group on any key/value change.\n var objectException = exception;\n event = eventFromPlainObject(objectException, syntheticException, isUnhandledRejection);\n addExceptionMechanism(event, {\n synthetic: true\n });\n return event;\n } // If none of previous checks were valid, then it means that it's not:\n // - an instance of DOMError\n // - an instance of DOMException\n // - an instance of Event\n // - an instance of Error\n // - a valid ErrorEvent (one with an error property)\n // - a plain Object\n //\n // So bail out and capture it as a simple message:\n\n\n event = eventFromString(exception, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, \"\" + exception, undefined);\n addExceptionMechanism(event, {\n synthetic: true\n });\n return event;\n}\n/**\n * @hidden\n */\n\nexport function eventFromString(input, syntheticException, attachStacktrace) {\n var event = {\n message: input\n };\n\n if (attachStacktrace && syntheticException) {\n var frames_2 = parseStackFrames(syntheticException);\n\n if (frames_2.length) {\n event.stacktrace = {\n frames: frames_2\n };\n }\n }\n\n return event;\n}","import { dsnToString, makeDsn, urlEncode } from '@sentry/utils';\nvar SENTRY_API_VERSION = '7';\n/**\n * Helper class to provide urls, headers and metadata that can be used to form\n * different types of requests to Sentry endpoints.\n * Supports both envelopes and regular event requests.\n *\n * @deprecated Please use APIDetails\n **/\n\nvar API =\n/** @class */\nfunction () {\n /** Create a new instance of API */\n function API(dsn, metadata, tunnel) {\n if (metadata === void 0) {\n metadata = {};\n }\n\n this.dsn = dsn;\n this._dsnObject = makeDsn(dsn);\n this.metadata = metadata;\n this._tunnel = tunnel;\n }\n /** Returns the Dsn object. */\n\n\n API.prototype.getDsn = function () {\n return this._dsnObject;\n };\n /** Does this transport force envelopes? */\n\n\n API.prototype.forceEnvelope = function () {\n return !!this._tunnel;\n };\n /** Returns the prefix to construct Sentry ingestion API endpoints. */\n\n\n API.prototype.getBaseApiEndpoint = function () {\n return getBaseApiEndpoint(this._dsnObject);\n };\n /** Returns the store endpoint URL. */\n\n\n API.prototype.getStoreEndpoint = function () {\n return getStoreEndpoint(this._dsnObject);\n };\n /**\n * Returns the store endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\n\n\n API.prototype.getStoreEndpointWithUrlEncodedAuth = function () {\n return getStoreEndpointWithUrlEncodedAuth(this._dsnObject);\n };\n /**\n * Returns the envelope endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\n\n\n API.prototype.getEnvelopeEndpointWithUrlEncodedAuth = function () {\n return getEnvelopeEndpointWithUrlEncodedAuth(this._dsnObject, this._tunnel);\n };\n\n return API;\n}();\n\nexport { API };\n/** Initializes API Details */\n\nexport function initAPIDetails(dsn, metadata, tunnel) {\n return {\n initDsn: dsn,\n metadata: metadata || {},\n dsn: makeDsn(dsn),\n tunnel: tunnel\n };\n}\n/** Returns the prefix to construct Sentry ingestion API endpoints. */\n\nfunction getBaseApiEndpoint(dsn) {\n var protocol = dsn.protocol ? dsn.protocol + \":\" : '';\n var port = dsn.port ? \":\" + dsn.port : '';\n return protocol + \"//\" + dsn.host + port + (dsn.path ? \"/\" + dsn.path : '') + \"/api/\";\n}\n/** Returns the ingest API endpoint for target. */\n\n\nfunction _getIngestEndpoint(dsn, target) {\n return \"\" + getBaseApiEndpoint(dsn) + dsn.projectId + \"/\" + target + \"/\";\n}\n/** Returns a URL-encoded string with auth config suitable for a query string. */\n\n\nfunction _encodedAuth(dsn) {\n return urlEncode({\n // We send only the minimum set of required information. See\n // https://github.com/getsentry/sentry-javascript/issues/2572.\n sentry_key: dsn.publicKey,\n sentry_version: SENTRY_API_VERSION\n });\n}\n/** Returns the store endpoint URL. */\n\n\nfunction getStoreEndpoint(dsn) {\n return _getIngestEndpoint(dsn, 'store');\n}\n/**\n * Returns the store endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\n\n\nexport function getStoreEndpointWithUrlEncodedAuth(dsn) {\n return getStoreEndpoint(dsn) + \"?\" + _encodedAuth(dsn);\n}\n/** Returns the envelope endpoint URL. */\n\nfunction _getEnvelopeEndpoint(dsn) {\n return _getIngestEndpoint(dsn, 'envelope');\n}\n/**\n * Returns the envelope endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\n\n\nexport function getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnel) {\n return tunnel ? tunnel : _getEnvelopeEndpoint(dsn) + \"?\" + _encodedAuth(dsn);\n}\n/**\n * Returns an object that can be used in request headers.\n * This is needed for node and the old /store endpoint in sentry\n */\n\nexport function getRequestHeaders(dsn, clientName, clientVersion) {\n // CHANGE THIS to use metadata but keep clientName and clientVersion compatible\n var header = [\"Sentry sentry_version=\" + SENTRY_API_VERSION];\n header.push(\"sentry_client=\" + clientName + \"/\" + clientVersion);\n header.push(\"sentry_key=\" + dsn.publicKey);\n\n if (dsn.pass) {\n header.push(\"sentry_secret=\" + dsn.pass);\n }\n\n return {\n 'Content-Type': 'application/json',\n 'X-Sentry-Auth': header.join(', ')\n };\n}\n/** Returns the url to the report dialog endpoint. */\n\nexport function getReportDialogEndpoint(dsnLike, dialogOptions) {\n var dsn = makeDsn(dsnLike);\n var endpoint = getBaseApiEndpoint(dsn) + \"embed/error-page/\";\n var encodedOptions = \"dsn=\" + dsnToString(dsn);\n\n for (var key in dialogOptions) {\n if (key === 'dsn') {\n continue;\n }\n\n if (key === 'user') {\n if (!dialogOptions.user) {\n continue;\n }\n\n if (dialogOptions.user.name) {\n encodedOptions += \"&name=\" + encodeURIComponent(dialogOptions.user.name);\n }\n\n if (dialogOptions.user.email) {\n encodedOptions += \"&email=\" + encodeURIComponent(dialogOptions.user.email);\n }\n } else {\n encodedOptions += \"&\" + encodeURIComponent(key) + \"=\" + encodeURIComponent(dialogOptions[key]);\n }\n }\n\n return endpoint + \"?\" + encodedOptions;\n}","import { __read, __spread } from \"tslib\";\nimport { isPrimitive } from './is';\n/**\n * Creates an envelope.\n * Make sure to always explicitly provide the generic to this function\n * so that the envelope types resolve correctly.\n */\n\nexport function createEnvelope(headers, items) {\n if (items === void 0) {\n items = [];\n }\n\n return [headers, items];\n}\n/**\n * Add an item to an envelope.\n * Make sure to always explicitly provide the generic to this function\n * so that the envelope types resolve correctly.\n */\n\nexport function addItemToEnvelope(envelope, newItem) {\n var _a = __read(envelope, 2),\n headers = _a[0],\n items = _a[1];\n\n return [headers, __spread(items, [newItem])];\n}\n/**\n * Serializes an envelope into a string.\n */\n\nexport function serializeEnvelope(envelope) {\n var _a = __read(envelope, 2),\n headers = _a[0],\n items = _a[1];\n\n var serializedHeaders = JSON.stringify(headers); // Have to cast items to any here since Envelope is a union type\n // Fixed in Typescript 4.2\n // TODO: Remove any[] cast when we upgrade to TS 4.2\n // https://github.com/microsoft/TypeScript/issues/36390\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n return items.reduce(function (acc, item) {\n var _a = __read(item, 2),\n itemHeaders = _a[0],\n payload = _a[1]; // We do not serialize payloads that are primitives\n\n\n var serializedPayload = isPrimitive(payload) ? String(payload) : JSON.stringify(payload);\n return acc + \"\\n\" + JSON.stringify(itemHeaders) + \"\\n\" + serializedPayload;\n }, serializedHeaders);\n}","import { __assign, __read, __spread } from \"tslib\";\nimport { createEnvelope, dsnToString, normalize, serializeEnvelope } from '@sentry/utils';\nimport { getEnvelopeEndpointWithUrlEncodedAuth, getStoreEndpointWithUrlEncodedAuth } from './api';\n/** Extract sdk info from from the API metadata */\n\nfunction getSdkMetadataForEnvelopeHeader(api) {\n if (!api.metadata || !api.metadata.sdk) {\n return;\n }\n\n var _a = api.metadata.sdk,\n name = _a.name,\n version = _a.version;\n return {\n name: name,\n version: version\n };\n}\n/**\n * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.\n * Merge with existing data if any.\n **/\n\n\nfunction enhanceEventWithSdkInfo(event, sdkInfo) {\n if (!sdkInfo) {\n return event;\n }\n\n event.sdk = event.sdk || {};\n event.sdk.name = event.sdk.name || sdkInfo.name;\n event.sdk.version = event.sdk.version || sdkInfo.version;\n event.sdk.integrations = __spread(event.sdk.integrations || [], sdkInfo.integrations || []);\n event.sdk.packages = __spread(event.sdk.packages || [], sdkInfo.packages || []);\n return event;\n}\n/** Creates a SentryRequest from a Session. */\n\n\nexport function sessionToSentryRequest(session, api) {\n var sdkInfo = getSdkMetadataForEnvelopeHeader(api);\n\n var envelopeHeaders = __assign(__assign({\n sent_at: new Date().toISOString()\n }, sdkInfo && {\n sdk: sdkInfo\n }), !!api.tunnel && {\n dsn: dsnToString(api.dsn)\n }); // I know this is hacky but we don't want to add `sessions` to request type since it's never rate limited\n\n\n var type = 'aggregates' in session ? 'sessions' : 'session'; // TODO (v7) Have to cast type because envelope items do not accept a `SentryRequestType`\n\n var envelopeItem = [{\n type: type\n }, session];\n var envelope = createEnvelope(envelopeHeaders, [envelopeItem]);\n return {\n body: serializeEnvelope(envelope),\n type: type,\n url: getEnvelopeEndpointWithUrlEncodedAuth(api.dsn, api.tunnel)\n };\n}\n/** Creates a SentryRequest from an event. */\n\nexport function eventToSentryRequest(event, api) {\n var sdkInfo = getSdkMetadataForEnvelopeHeader(api);\n var eventType = event.type || 'event';\n var useEnvelope = eventType === 'transaction' || !!api.tunnel;\n var transactionSampling = (event.sdkProcessingMetadata || {}).transactionSampling;\n\n var _a = transactionSampling || {},\n samplingMethod = _a.method,\n sampleRate = _a.rate; // TODO: Below is a temporary hack in order to debug a serialization error - see\n // https://github.com/getsentry/sentry-javascript/issues/2809,\n // https://github.com/getsentry/sentry-javascript/pull/4425, and\n // https://github.com/getsentry/sentry-javascript/pull/4574.\n //\n // TL; DR: even though we normalize all events (which should prevent this), something is causing `JSON.stringify` to\n // throw a circular reference error.\n //\n // When it's time to remove it:\n // 1. Delete everything between here and where the request object `req` is created, EXCEPT the line deleting\n // `sdkProcessingMetadata`\n // 2. Restore the original version of the request body, which is commented out\n // 3. Search for either of the PR URLs above and pull out the companion hacks in the browser playwright tests and the\n // baseClient tests in this package\n\n\n enhanceEventWithSdkInfo(event, api.metadata.sdk);\n event.tags = event.tags || {};\n event.extra = event.extra || {}; // In theory, all events should be marked as having gone through normalization and so\n // we should never set this tag/extra data\n\n if (!(event.sdkProcessingMetadata && event.sdkProcessingMetadata.baseClientNormalized)) {\n event.tags.skippedNormalization = true;\n event.extra.normalizeDepth = event.sdkProcessingMetadata ? event.sdkProcessingMetadata.normalizeDepth : 'unset';\n } // prevent this data from being sent to sentry\n // TODO: This is NOT part of the hack - DO NOT DELETE\n\n\n delete event.sdkProcessingMetadata;\n var body;\n\n try {\n // 99.9% of events should get through just fine - no change in behavior for them\n body = JSON.stringify(event);\n } catch (err) {\n // Record data about the error without replacing original event data, then force renormalization\n event.tags.JSONStringifyError = true;\n event.extra.JSONStringifyError = err;\n\n try {\n body = JSON.stringify(normalize(event));\n } catch (newErr) {\n // At this point even renormalization hasn't worked, meaning something about the event data has gone very wrong.\n // Time to cut our losses and record only the new error. With luck, even in the problematic cases we're trying to\n // debug with this hack, we won't ever land here.\n var innerErr = newErr;\n body = JSON.stringify({\n message: 'JSON.stringify error after renormalization',\n // setting `extra: { innerErr }` here for some reason results in an empty object, so unpack manually\n extra: {\n message: innerErr.message,\n stack: innerErr.stack\n }\n });\n }\n }\n\n var req = {\n // this is the relevant line of code before the hack was added, to make it easy to undo said hack once we've solved\n // the mystery\n // body: JSON.stringify(sdkInfo ? enhanceEventWithSdkInfo(event, api.metadata.sdk) : event),\n body: body,\n type: eventType,\n url: useEnvelope ? getEnvelopeEndpointWithUrlEncodedAuth(api.dsn, api.tunnel) : getStoreEndpointWithUrlEncodedAuth(api.dsn)\n }; // https://develop.sentry.dev/sdk/envelopes/\n // Since we don't need to manipulate envelopes nor store them, there is no\n // exported concept of an Envelope with operations including serialization and\n // deserialization. Instead, we only implement a minimal subset of the spec to\n // serialize events inline here.\n\n if (useEnvelope) {\n var envelopeHeaders = __assign(__assign({\n event_id: event.event_id,\n sent_at: new Date().toISOString()\n }, sdkInfo && {\n sdk: sdkInfo\n }), !!api.tunnel && {\n dsn: dsnToString(api.dsn)\n });\n\n var eventItem = [{\n type: eventType,\n sample_rates: [{\n id: samplingMethod,\n rate: sampleRate\n }]\n }, req.body];\n var envelope = createEnvelope(envelopeHeaders, [eventItem]);\n req.body = serializeEnvelope(envelope);\n }\n\n return req;\n}","import { SentryError } from './error';\nimport { rejectedSyncPromise, resolvedSyncPromise, SyncPromise } from './syncpromise';\n/**\n * Creates an new PromiseBuffer object with the specified limit\n * @param limit max number of promises that can be stored in the buffer\n */\n\nexport function makePromiseBuffer(limit) {\n var buffer = [];\n\n function isReady() {\n return limit === undefined || buffer.length < limit;\n }\n /**\n * Remove a promise from the queue.\n *\n * @param task Can be any PromiseLike\n * @returns Removed promise.\n */\n\n\n function remove(task) {\n return buffer.splice(buffer.indexOf(task), 1)[0];\n }\n /**\n * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment.\n *\n * @param taskProducer A function producing any PromiseLike; In previous versions this used to be `task:\n * PromiseLike`, but under that model, Promises were instantly created on the call-site and their executor\n * functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By\n * requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer\n * limit check.\n * @returns The original promise.\n */\n\n\n function add(taskProducer) {\n if (!isReady()) {\n return rejectedSyncPromise(new SentryError('Not adding Promise due to buffer limit reached.'));\n } // start the task and add its promise to the queue\n\n\n var task = taskProducer();\n\n if (buffer.indexOf(task) === -1) {\n buffer.push(task);\n }\n\n void task.then(function () {\n return remove(task);\n }) // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike`\n // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't\n // have promises, so TS has to polyfill when down-compiling.)\n .then(null, function () {\n return remove(task).then(null, function () {// We have to add another catch here because `remove()` starts a new promise chain.\n });\n });\n return task;\n }\n /**\n * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first.\n *\n * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or\n * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to\n * `true`.\n * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and\n * `false` otherwise\n */\n\n\n function drain(timeout) {\n return new SyncPromise(function (resolve, reject) {\n var counter = buffer.length;\n\n if (!counter) {\n return resolve(true);\n } // wait for `timeout` ms and then resolve to `false` (if not cancelled first)\n\n\n var capturedSetTimeout = setTimeout(function () {\n if (timeout && timeout > 0) {\n resolve(false);\n }\n }, timeout); // if all promises resolve in time, cancel the timer and resolve to `true`\n\n buffer.forEach(function (item) {\n void resolvedSyncPromise(item).then(function () {\n // eslint-disable-next-line no-plusplus\n if (! --counter) {\n clearTimeout(capturedSetTimeout);\n resolve(true);\n }\n }, reject);\n });\n });\n }\n\n return {\n $: buffer,\n add: add,\n drain: drain\n };\n}","import { __assign, __values } from \"tslib\";\nexport var DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds\n\n/**\n * Extracts Retry-After value from the request header or returns default value\n * @param header string representation of 'Retry-After' header\n * @param now current unix timestamp\n *\n */\n\nexport function parseRetryAfterHeader(header, now) {\n if (now === void 0) {\n now = Date.now();\n }\n\n var headerDelay = parseInt(\"\" + header, 10);\n\n if (!isNaN(headerDelay)) {\n return headerDelay * 1000;\n }\n\n var headerDate = Date.parse(\"\" + header);\n\n if (!isNaN(headerDate)) {\n return headerDate - now;\n }\n\n return DEFAULT_RETRY_AFTER;\n}\n/**\n * Gets the time that given category is disabled until for rate limiting\n */\n\nexport function disabledUntil(limits, category) {\n return limits[category] || limits.all || 0;\n}\n/**\n * Checks if a category is rate limited\n */\n\nexport function isRateLimited(limits, category, now) {\n if (now === void 0) {\n now = Date.now();\n }\n\n return disabledUntil(limits, category) > now;\n}\n/**\n * Update ratelimits from incoming headers.\n * Returns true if headers contains a non-empty rate limiting header.\n */\n\nexport function updateRateLimits(limits, headers, now) {\n var e_1, _a, e_2, _b;\n\n if (now === void 0) {\n now = Date.now();\n }\n\n var updatedRateLimits = __assign({}, limits); // \"The name is case-insensitive.\"\n // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get\n\n\n var rateLimitHeader = headers['x-sentry-rate-limits'];\n var retryAfterHeader = headers['retry-after'];\n\n if (rateLimitHeader) {\n try {\n /**\n * rate limit headers are of the form\n *
,
,..\n * where each
is of the form\n * : : : \n * where\n * is a delay in seconds\n * is the event type(s) (error, transaction, etc) being rate limited and is of the form\n * ;;...\n * is what's being limited (org, project, or key) - ignored by SDK\n * is an arbitrary string like \"org_quota\" - ignored by SDK\n */\n for (var _c = __values(rateLimitHeader.trim().split(',')), _d = _c.next(); !_d.done; _d = _c.next()) {\n var limit = _d.value;\n var parameters = limit.split(':', 2);\n var headerDelay = parseInt(parameters[0], 10);\n var delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default\n\n if (!parameters[1]) {\n updatedRateLimits.all = now + delay;\n } else {\n try {\n for (var _e = (e_2 = void 0, __values(parameters[1].split(';'))), _f = _e.next(); !_f.done; _f = _e.next()) {\n var category = _f.value;\n updatedRateLimits[category] = now + delay;\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (_f && !_f.done && (_b = _e[\"return\"])) _b.call(_e);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_d && !_d.done && (_a = _c[\"return\"])) _a.call(_c);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n } else if (retryAfterHeader) {\n updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now);\n }\n\n return updatedRateLimits;\n}","import { forget, getGlobalObject, isDebugBuild, isNativeFetch, logger, supportsFetch } from '@sentry/utils';\nvar global = getGlobalObject();\nvar cachedFetchImpl;\n/**\n * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers.\n * Whenever someone wraps the Fetch API and returns the wrong promise chain,\n * this chain becomes orphaned and there is no possible way to capture it's rejections\n * other than allowing it bubble up to this very handler. eg.\n *\n * const f = window.fetch;\n * window.fetch = function () {\n * const p = f.apply(this, arguments);\n *\n * p.then(function() {\n * console.log('hi.');\n * });\n *\n * return p;\n * }\n *\n * `p.then(function () { ... })` is producing a completely separate promise chain,\n * however, what's returned is `p` - the result of original `fetch` call.\n *\n * This mean, that whenever we use the Fetch API to send our own requests, _and_\n * some ad-blocker blocks it, this orphaned chain will _always_ reject,\n * effectively causing another event to be captured.\n * This makes a whole process become an infinite loop, which we need to somehow\n * deal with, and break it in one way or another.\n *\n * To deal with this issue, we are making sure that we _always_ use the real\n * browser Fetch API, instead of relying on what `window.fetch` exposes.\n * The only downside to this would be missing our own requests as breadcrumbs,\n * but because we are already not doing this, it should be just fine.\n *\n * Possible failed fetch error messages per-browser:\n *\n * Chrome: Failed to fetch\n * Edge: Failed to Fetch\n * Firefox: NetworkError when attempting to fetch resource\n * Safari: resource blocked by content blocker\n */\n\nexport function getNativeFetchImplementation() {\n if (cachedFetchImpl) {\n return cachedFetchImpl;\n }\n /* eslint-disable @typescript-eslint/unbound-method */\n // Fast path to avoid DOM I/O\n\n\n if (isNativeFetch(global.fetch)) {\n return cachedFetchImpl = global.fetch.bind(global);\n }\n\n var document = global.document;\n var fetchImpl = global.fetch; // eslint-disable-next-line deprecation/deprecation\n\n if (document && typeof document.createElement === 'function') {\n try {\n var sandbox = document.createElement('iframe');\n sandbox.hidden = true;\n document.head.appendChild(sandbox);\n var contentWindow = sandbox.contentWindow;\n\n if (contentWindow && contentWindow.fetch) {\n fetchImpl = contentWindow.fetch;\n }\n\n document.head.removeChild(sandbox);\n } catch (e) {\n if (isDebugBuild()) {\n logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', e);\n }\n }\n }\n\n return cachedFetchImpl = fetchImpl.bind(global);\n /* eslint-enable @typescript-eslint/unbound-method */\n}\n/**\n * Sends sdk client report using sendBeacon or fetch as a fallback if available\n *\n * @param url report endpoint\n * @param body report payload\n */\n\nexport function sendReport(url, body) {\n var isRealNavigator = Object.prototype.toString.call(global && global.navigator) === '[object Navigator]';\n var hasSendBeacon = isRealNavigator && typeof global.navigator.sendBeacon === 'function';\n\n if (hasSendBeacon) {\n // Prevent illegal invocations - https://xgwang.me/posts/you-may-not-know-beacon/#it-may-throw-error%2C-be-sure-to-catch\n var sendBeacon = global.navigator.sendBeacon.bind(global.navigator);\n return sendBeacon(url, body);\n }\n\n if (supportsFetch()) {\n var fetch_1 = getNativeFetchImplementation();\n return forget(fetch_1(url, {\n body: body,\n method: 'POST',\n credentials: 'omit',\n keepalive: true\n }));\n }\n}","/**\n * Consumes the promise and logs the error when it rejects.\n * @param promise A promise to forget.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function forget(promise) {\n void promise.then(null, function (e) {\n // TODO: Use a better logging mechanism\n // eslint-disable-next-line no-console\n console.error(e);\n });\n}","import { __read, __values } from \"tslib\";\nimport { eventToSentryRequest, getEnvelopeEndpointWithUrlEncodedAuth, getStoreEndpointWithUrlEncodedAuth, initAPIDetails, sessionToSentryRequest } from '@sentry/core';\nimport { createClientReportEnvelope, dsnToString, eventStatusFromHttpCode, getGlobalObject, isDebugBuild, logger, makePromiseBuffer, parseRetryAfterHeader, serializeEnvelope } from '@sentry/utils';\nimport { sendReport } from './utils';\n\nfunction requestTypeToCategory(ty) {\n var tyStr = ty;\n return tyStr === 'event' ? 'error' : tyStr;\n}\n\nvar global = getGlobalObject();\n/** Base Transport class implementation */\n\nvar BaseTransport =\n/** @class */\nfunction () {\n function BaseTransport(options) {\n var _this = this;\n\n this.options = options;\n /** A simple buffer holding all requests. */\n\n this._buffer = makePromiseBuffer(30);\n /** Locks transport after receiving rate limits in a response */\n\n this._rateLimits = {};\n this._outcomes = {};\n this._api = initAPIDetails(options.dsn, options._metadata, options.tunnel); // eslint-disable-next-line deprecation/deprecation\n\n this.url = getStoreEndpointWithUrlEncodedAuth(this._api.dsn);\n\n if (this.options.sendClientReports && global.document) {\n global.document.addEventListener('visibilitychange', function () {\n if (global.document.visibilityState === 'hidden') {\n _this._flushOutcomes();\n }\n });\n }\n }\n /**\n * @inheritDoc\n */\n\n\n BaseTransport.prototype.sendEvent = function (event) {\n return this._sendRequest(eventToSentryRequest(event, this._api), event);\n };\n /**\n * @inheritDoc\n */\n\n\n BaseTransport.prototype.sendSession = function (session) {\n return this._sendRequest(sessionToSentryRequest(session, this._api), session);\n };\n /**\n * @inheritDoc\n */\n\n\n BaseTransport.prototype.close = function (timeout) {\n return this._buffer.drain(timeout);\n };\n /**\n * @inheritDoc\n */\n\n\n BaseTransport.prototype.recordLostEvent = function (reason, category) {\n var _a;\n\n if (!this.options.sendClientReports) {\n return;\n } // We want to track each category (event, transaction, session) separately\n // but still keep the distinction between different type of outcomes.\n // We could use nested maps, but it's much easier to read and type this way.\n // A correct type for map-based implementation if we want to go that route\n // would be `Partial>>>`\n\n\n var key = requestTypeToCategory(category) + \":\" + reason;\n logger.log(\"Adding outcome: \" + key);\n this._outcomes[key] = (_a = this._outcomes[key], _a !== null && _a !== void 0 ? _a : 0) + 1;\n };\n /**\n * Send outcomes as an envelope\n */\n\n\n BaseTransport.prototype._flushOutcomes = function () {\n if (!this.options.sendClientReports) {\n return;\n }\n\n var outcomes = this._outcomes;\n this._outcomes = {}; // Nothing to send\n\n if (!Object.keys(outcomes).length) {\n logger.log('No outcomes to flush');\n return;\n }\n\n logger.log(\"Flushing outcomes:\\n\" + JSON.stringify(outcomes, null, 2));\n var url = getEnvelopeEndpointWithUrlEncodedAuth(this._api.dsn, this._api.tunnel);\n var discardedEvents = Object.keys(outcomes).map(function (key) {\n var _a = __read(key.split(':'), 2),\n category = _a[0],\n reason = _a[1];\n\n return {\n reason: reason,\n category: category,\n quantity: outcomes[key]\n }; // TODO: Improve types on discarded_events to get rid of cast\n });\n var envelope = createClientReportEnvelope(discardedEvents, this._api.tunnel && dsnToString(this._api.dsn));\n\n try {\n sendReport(url, serializeEnvelope(envelope));\n } catch (e) {\n logger.error(e);\n }\n };\n /**\n * Handle Sentry repsonse for promise-based transports.\n */\n\n\n BaseTransport.prototype._handleResponse = function (_a) {\n var requestType = _a.requestType,\n response = _a.response,\n headers = _a.headers,\n resolve = _a.resolve,\n reject = _a.reject;\n var status = eventStatusFromHttpCode(response.status);\n /**\n * \"The name is case-insensitive.\"\n * https://developer.mozilla.org/en-US/docs/Web/API/Headers/get\n */\n\n var limited = this._handleRateLimit(headers);\n\n if (limited && isDebugBuild()) {\n logger.warn(\"Too many \" + requestType + \" requests, backing off until: \" + this._disabledUntil(requestType));\n }\n\n if (status === 'success') {\n resolve({\n status: status\n });\n return;\n }\n\n reject(response);\n };\n /**\n * Gets the time that given category is disabled until for rate limiting\n */\n\n\n BaseTransport.prototype._disabledUntil = function (requestType) {\n var category = requestTypeToCategory(requestType);\n return this._rateLimits[category] || this._rateLimits.all;\n };\n /**\n * Checks if a category is rate limited\n */\n\n\n BaseTransport.prototype._isRateLimited = function (requestType) {\n return this._disabledUntil(requestType) > new Date(Date.now());\n };\n /**\n * Sets internal _rateLimits from incoming headers. Returns true if headers contains a non-empty rate limiting header.\n */\n\n\n BaseTransport.prototype._handleRateLimit = function (headers) {\n var e_1, _a, e_2, _b;\n\n var now = Date.now();\n var rlHeader = headers['x-sentry-rate-limits'];\n var raHeader = headers['retry-after'];\n\n if (rlHeader) {\n try {\n // rate limit headers are of the form\n //
,
,..\n // where each
is of the form\n // : : : \n // where\n // is a delay in ms\n // is the event type(s) (error, transaction, etc) being rate limited and is of the form\n // ;;...\n // is what's being limited (org, project, or key) - ignored by SDK\n // is an arbitrary string like \"org_quota\" - ignored by SDK\n for (var _c = __values(rlHeader.trim().split(',')), _d = _c.next(); !_d.done; _d = _c.next()) {\n var limit = _d.value;\n var parameters = limit.split(':', 2);\n var headerDelay = parseInt(parameters[0], 10);\n var delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default\n\n try {\n for (var _e = (e_2 = void 0, __values(parameters[1].split(';'))), _f = _e.next(); !_f.done; _f = _e.next()) {\n var category = _f.value;\n this._rateLimits[category || 'all'] = new Date(now + delay);\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (_f && !_f.done && (_b = _e[\"return\"])) _b.call(_e);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_d && !_d.done && (_a = _c[\"return\"])) _a.call(_c);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n return true;\n } else if (raHeader) {\n this._rateLimits.all = new Date(now + parseRetryAfterHeader(raHeader, now));\n return true;\n }\n\n return false;\n };\n\n return BaseTransport;\n}();\n\nexport { BaseTransport };","import { createEnvelope } from './envelope';\nimport { dateTimestampInSeconds } from './time';\n/**\n * Creates client report envelope\n * @param discarded_events An array of discard events\n * @param dsn A DSN that can be set on the header. Optional.\n */\n\nexport function createClientReportEnvelope(discarded_events, dsn, timestamp) {\n var clientReportItem = [{\n type: 'client_report'\n }, {\n timestamp: timestamp || dateTimestampInSeconds(),\n discarded_events: discarded_events\n }];\n return createEnvelope(dsn ? {\n dsn: dsn\n } : {}, [clientReportItem]);\n}","/**\n * Converts an HTTP status code to sentry status {@link EventStatus}.\n *\n * @param code number HTTP status code\n * @returns EventStatus\n */\nexport function eventStatusFromHttpCode(code) {\n if (code >= 200 && code < 300) {\n return 'success';\n }\n\n if (code === 429) {\n return 'rate_limit';\n }\n\n if (code >= 400 && code < 500) {\n return 'invalid';\n }\n\n if (code >= 500) {\n return 'failed';\n }\n\n return 'unknown';\n}","import { __extends } from \"tslib\";\nimport { SentryError, supportsReferrerPolicy, SyncPromise } from '@sentry/utils';\nimport { BaseTransport } from './base';\nimport { getNativeFetchImplementation } from './utils';\n/** `fetch` based transport */\n\nvar FetchTransport =\n/** @class */\nfunction (_super) {\n __extends(FetchTransport, _super);\n\n function FetchTransport(options, fetchImpl) {\n if (fetchImpl === void 0) {\n fetchImpl = getNativeFetchImplementation();\n }\n\n var _this = _super.call(this, options) || this;\n\n _this._fetch = fetchImpl;\n return _this;\n }\n /**\n * @param sentryRequest Prepared SentryRequest to be delivered\n * @param originalPayload Original payload used to create SentryRequest\n */\n\n\n FetchTransport.prototype._sendRequest = function (sentryRequest, originalPayload) {\n var _this = this;\n\n if (this._isRateLimited(sentryRequest.type)) {\n this.recordLostEvent('ratelimit_backoff', sentryRequest.type);\n return Promise.reject({\n event: originalPayload,\n type: sentryRequest.type,\n reason: \"Transport for \" + sentryRequest.type + \" requests locked till \" + this._disabledUntil(sentryRequest.type) + \" due to too many requests.\",\n status: 429\n });\n }\n\n var options = {\n body: sentryRequest.body,\n method: 'POST',\n // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'\n // (see https://caniuse.com/#feat=referrer-policy),\n // it doesn't. And it throws an exception instead of ignoring this parameter...\n // REF: https://github.com/getsentry/raven-js/issues/1233\n referrerPolicy: supportsReferrerPolicy() ? 'origin' : ''\n };\n\n if (this.options.fetchParameters !== undefined) {\n Object.assign(options, this.options.fetchParameters);\n }\n\n if (this.options.headers !== undefined) {\n options.headers = this.options.headers;\n }\n\n return this._buffer.add(function () {\n return new SyncPromise(function (resolve, reject) {\n void _this._fetch(sentryRequest.url, options).then(function (response) {\n var headers = {\n 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n 'retry-after': response.headers.get('Retry-After')\n };\n\n _this._handleResponse({\n requestType: sentryRequest.type,\n response: response,\n headers: headers,\n resolve: resolve,\n reject: reject\n });\n })[\"catch\"](reject);\n });\n }).then(undefined, function (reason) {\n // It's either buffer rejection or any other xhr/fetch error, which are treated as NetworkError.\n if (reason instanceof SentryError) {\n _this.recordLostEvent('queue_overflow', sentryRequest.type);\n } else {\n _this.recordLostEvent('network_error', sentryRequest.type);\n }\n\n throw reason;\n });\n };\n\n return FetchTransport;\n}(BaseTransport);\n\nexport { FetchTransport };","import { __extends } from \"tslib\";\nimport { SentryError, SyncPromise } from '@sentry/utils';\nimport { BaseTransport } from './base';\n/** `XHR` based transport */\n\nvar XHRTransport =\n/** @class */\nfunction (_super) {\n __extends(XHRTransport, _super);\n\n function XHRTransport() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param sentryRequest Prepared SentryRequest to be delivered\n * @param originalPayload Original payload used to create SentryRequest\n */\n\n\n XHRTransport.prototype._sendRequest = function (sentryRequest, originalPayload) {\n var _this = this;\n\n if (this._isRateLimited(sentryRequest.type)) {\n this.recordLostEvent('ratelimit_backoff', sentryRequest.type);\n return Promise.reject({\n event: originalPayload,\n type: sentryRequest.type,\n reason: \"Transport for \" + sentryRequest.type + \" requests locked till \" + this._disabledUntil(sentryRequest.type) + \" due to too many requests.\",\n status: 429\n });\n }\n\n return this._buffer.add(function () {\n return new SyncPromise(function (resolve, reject) {\n var request = new XMLHttpRequest();\n\n request.onreadystatechange = function () {\n if (request.readyState === 4) {\n var headers = {\n 'x-sentry-rate-limits': request.getResponseHeader('X-Sentry-Rate-Limits'),\n 'retry-after': request.getResponseHeader('Retry-After')\n };\n\n _this._handleResponse({\n requestType: sentryRequest.type,\n response: request,\n headers: headers,\n resolve: resolve,\n reject: reject\n });\n }\n };\n\n request.open('POST', sentryRequest.url);\n\n for (var header in _this.options.headers) {\n if (Object.prototype.hasOwnProperty.call(_this.options.headers, header)) {\n request.setRequestHeader(header, _this.options.headers[header]);\n }\n }\n\n request.send(sentryRequest.body);\n });\n }).then(undefined, function (reason) {\n // It's either buffer rejection or any other xhr/fetch error, which are treated as NetworkError.\n if (reason instanceof SentryError) {\n _this.recordLostEvent('queue_overflow', sentryRequest.type);\n } else {\n _this.recordLostEvent('network_error', sentryRequest.type);\n }\n\n throw reason;\n });\n };\n\n return XHRTransport;\n}(BaseTransport);\n\nexport { XHRTransport };","import { __assign, __extends } from \"tslib\";\nimport { BaseBackend } from '@sentry/core';\nimport { Severity } from '@sentry/types';\nimport { supportsFetch } from '@sentry/utils';\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { FetchTransport, XHRTransport } from './transports';\n/**\n * The Sentry Browser SDK Backend.\n * @hidden\n */\n\nvar BrowserBackend =\n/** @class */\nfunction (_super) {\n __extends(BrowserBackend, _super);\n\n function BrowserBackend() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @inheritDoc\n */\n\n\n BrowserBackend.prototype.eventFromException = function (exception, hint) {\n return eventFromException(exception, hint, this._options.attachStacktrace);\n };\n /**\n * @inheritDoc\n */\n\n\n BrowserBackend.prototype.eventFromMessage = function (message, level, hint) {\n if (level === void 0) {\n level = Severity.Info;\n }\n\n return eventFromMessage(message, level, hint, this._options.attachStacktrace);\n };\n /**\n * @inheritDoc\n */\n\n\n BrowserBackend.prototype._setupTransport = function () {\n if (!this._options.dsn) {\n // We return the noop transport here in case there is no Dsn.\n return _super.prototype._setupTransport.call(this);\n }\n\n var transportOptions = __assign(__assign({}, this._options.transportOptions), {\n dsn: this._options.dsn,\n tunnel: this._options.tunnel,\n sendClientReports: this._options.sendClientReports,\n _metadata: this._options._metadata\n });\n\n if (this._options.transport) {\n return new this._options.transport(transportOptions);\n }\n\n if (supportsFetch()) {\n return new FetchTransport(transportOptions);\n }\n\n return new XHRTransport(transportOptions);\n };\n\n return BrowserBackend;\n}(BaseBackend);\n\nexport { BrowserBackend };","import { __assign, __read, __spread } from \"tslib\";\nimport { getCurrentHub } from '@sentry/hub';\n/**\n * This calls a function on the current hub.\n * @param method function to call on hub.\n * @param args to pass to function.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nfunction callOnHub(method) {\n var args = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n\n var hub = getCurrentHub();\n\n if (hub && hub[method]) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return hub[method].apply(hub, __spread(args));\n }\n\n throw new Error(\"No hub defined or \" + method + \" was not found on the hub, please open a bug report.\");\n}\n/**\n * Captures an exception event and sends it to Sentry.\n *\n * @param exception An exception-like object.\n * @returns The generated eventId.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n\n\nexport function captureException(exception, captureContext) {\n var syntheticException;\n\n try {\n throw new Error('Sentry syntheticException');\n } catch (exception) {\n syntheticException = exception;\n }\n\n return callOnHub('captureException', exception, {\n captureContext: captureContext,\n originalException: exception,\n syntheticException: syntheticException\n });\n}\n/**\n * Captures a message event and sends it to Sentry.\n *\n * @param message The message to send to Sentry.\n * @param Severity Define the level of the message.\n * @returns The generated eventId.\n */\n\nexport function captureMessage(message, captureContext) {\n var syntheticException;\n\n try {\n throw new Error(message);\n } catch (exception) {\n syntheticException = exception;\n } // This is necessary to provide explicit scopes upgrade, without changing the original\n // arity of the `captureMessage(message, level)` method.\n\n\n var level = typeof captureContext === 'string' ? captureContext : undefined;\n var context = typeof captureContext !== 'string' ? {\n captureContext: captureContext\n } : undefined;\n return callOnHub('captureMessage', message, level, __assign({\n originalException: message,\n syntheticException: syntheticException\n }, context));\n}\n/**\n * Captures a manually created event and sends it to Sentry.\n *\n * @param event The event to send to Sentry.\n * @returns The generated eventId.\n */\n\nexport function captureEvent(event) {\n return callOnHub('captureEvent', event);\n}\n/**\n * Callback to set context information onto the scope.\n * @param callback Callback function that receives Scope.\n */\n\nexport function configureScope(callback) {\n callOnHub('configureScope', callback);\n}\n/**\n * Records a new breadcrumb which will be attached to future events.\n *\n * Breadcrumbs will be added to subsequent events to provide more context on\n * user's actions prior to an error or crash.\n *\n * @param breadcrumb The breadcrumb to record.\n */\n\nexport function addBreadcrumb(breadcrumb) {\n callOnHub('addBreadcrumb', breadcrumb);\n}\n/**\n * Sets context data with the given name.\n * @param name of the context\n * @param context Any kind of data. This data will be normalized.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nexport function setContext(name, context) {\n callOnHub('setContext', name, context);\n}\n/**\n * Set an object that will be merged sent as extra data with the event.\n * @param extras Extras object to merge into current context.\n */\n\nexport function setExtras(extras) {\n callOnHub('setExtras', extras);\n}\n/**\n * Set an object that will be merged sent as tags data with the event.\n * @param tags Tags context object to merge into current context.\n */\n\nexport function setTags(tags) {\n callOnHub('setTags', tags);\n}\n/**\n * Set key:value that will be sent as extra data with the event.\n * @param key String of extra\n * @param extra Any kind of data. This data will be normalized.\n */\n\nexport function setExtra(key, extra) {\n callOnHub('setExtra', key, extra);\n}\n/**\n * Set key:value that will be sent as tags data with the event.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key String key of tag\n * @param value Value of tag\n */\n\nexport function setTag(key, value) {\n callOnHub('setTag', key, value);\n}\n/**\n * Updates user context information for future events.\n *\n * @param user User context object to be set in the current context. Pass `null` to unset the user.\n */\n\nexport function setUser(user) {\n callOnHub('setUser', user);\n}\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n * pushScope();\n * callback();\n * popScope();\n *\n * @param callback that will be enclosed into push/popScope.\n */\n\nexport function withScope(callback) {\n callOnHub('withScope', callback);\n}\n/**\n * Calls a function on the latest client. Use this with caution, it's meant as\n * in \"internal\" helper so we don't need to expose every possible function in\n * the shim. It is not guaranteed that the client actually implements the\n * function.\n *\n * @param method The method to call on the client/client.\n * @param args Arguments to pass to the client/fontend.\n * @hidden\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nexport function _callOnClient(method) {\n var args = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n\n callOnHub.apply(void 0, __spread(['_invokeClient', method], args));\n}\n/**\n * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.\n *\n * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a\n * new child span within the transaction or any span, call the respective `.startChild()` method.\n *\n * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.\n *\n * The transaction must be finished with a call to its `.finish()` method, at which point the transaction with all its\n * finished child spans will be sent to Sentry.\n *\n * @param context Properties of the new `Transaction`.\n * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent\n * default values). See {@link Options.tracesSampler}.\n *\n * @returns The transaction which was just started\n */\n\nexport function startTransaction(context, customSamplingContext) {\n return callOnHub('startTransaction', __assign({}, context), customSamplingContext);\n}","import { __assign } from \"tslib\";\nimport { captureException, getReportDialogEndpoint, withScope } from '@sentry/core';\nimport { addExceptionMechanism, addExceptionTypeValue, addNonEnumerableProperty, getGlobalObject, getOriginalFunction, isDebugBuild, logger, markFunctionWrapped } from '@sentry/utils';\nvar global = getGlobalObject();\nvar ignoreOnError = 0;\n/**\n * @hidden\n */\n\nexport function shouldIgnoreOnError() {\n return ignoreOnError > 0;\n}\n/**\n * @hidden\n */\n\nexport function ignoreNextOnError() {\n // onerror should trigger before setTimeout\n ignoreOnError += 1;\n setTimeout(function () {\n ignoreOnError -= 1;\n });\n}\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap.\n * @returns The wrapped function.\n * @hidden\n */\n\nexport function wrap(fn, options, before) {\n // for future readers what this does is wrap a function and then create\n // a bi-directional wrapping between them.\n //\n // example: wrapped = wrap(original);\n // original.__sentry_wrapped__ -> wrapped\n // wrapped.__sentry_original__ -> original\n if (options === void 0) {\n options = {};\n }\n\n if (typeof fn !== 'function') {\n return fn;\n }\n\n try {\n // if we're dealing with a function that was previously wrapped, return\n // the original wrapper.\n var wrapper = fn.__sentry_wrapped__;\n\n if (wrapper) {\n return wrapper;\n } // We don't wanna wrap it twice\n\n\n if (getOriginalFunction(fn)) {\n return fn;\n }\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n // Bail on wrapping and return the function as-is (defers to window.onerror).\n return fn;\n }\n /* eslint-disable prefer-rest-params */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n var sentryWrapped = function sentryWrapped() {\n var args = Array.prototype.slice.call(arguments);\n\n try {\n if (before && typeof before === 'function') {\n before.apply(this, arguments);\n } // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n\n\n var wrappedArguments = args.map(function (arg) {\n return wrap(arg, options);\n }); // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n\n return fn.apply(this, wrappedArguments);\n } catch (ex) {\n ignoreNextOnError();\n withScope(function (scope) {\n scope.addEventProcessor(function (event) {\n if (options.mechanism) {\n addExceptionTypeValue(event, undefined, undefined);\n addExceptionMechanism(event, options.mechanism);\n }\n\n event.extra = __assign(__assign({}, event.extra), {\n arguments: args\n });\n return event;\n });\n captureException(ex);\n });\n throw ex;\n }\n };\n /* eslint-enable prefer-rest-params */\n // Accessing some objects may throw\n // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n\n\n try {\n for (var property in fn) {\n if (Object.prototype.hasOwnProperty.call(fn, property)) {\n sentryWrapped[property] = fn[property];\n }\n }\n } catch (_oO) {} // eslint-disable-line no-empty\n // Signal that this function has been wrapped/filled already\n // for both debugging and to prevent it to being wrapped/filled twice\n\n\n markFunctionWrapped(sentryWrapped, fn);\n addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped); // Restore original function name (not all browsers allow that)\n\n try {\n var descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name');\n\n if (descriptor.configurable) {\n Object.defineProperty(sentryWrapped, 'name', {\n get: function get() {\n return fn.name;\n }\n });\n } // eslint-disable-next-line no-empty\n\n } catch (_oO) {}\n\n return sentryWrapped;\n}\n/**\n * Injects the Report Dialog script\n * @hidden\n */\n\nexport function injectReportDialog(options) {\n if (options === void 0) {\n options = {};\n }\n\n if (!global.document) {\n return;\n }\n\n if (!options.eventId) {\n if (isDebugBuild()) {\n logger.error('Missing eventId option in showReportDialog call');\n }\n\n return;\n }\n\n if (!options.dsn) {\n if (isDebugBuild()) {\n logger.error('Missing dsn option in showReportDialog call');\n }\n\n return;\n }\n\n var script = global.document.createElement('script');\n script.async = true;\n script.src = getReportDialogEndpoint(options.dsn, options);\n\n if (options.onLoad) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n script.onload = options.onLoad;\n }\n\n var injectionPoint = global.document.head || global.document.body;\n\n if (injectionPoint) {\n injectionPoint.appendChild(script);\n }\n}","export var SeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug', 'critical'];","import { Severity } from '@sentry/types';\nimport { SeverityLevels } from './enums';\n\nfunction isSupportedSeverity(level) {\n return SeverityLevels.indexOf(level) !== -1;\n}\n/**\n * Converts a string-based level into a {@link Severity}.\n *\n * @param level string representation of Severity\n * @returns Severity\n */\n\n\nexport function severityFromString(level) {\n if (level === 'warn') return Severity.Warning;\n\n if (isSupportedSeverity(level)) {\n return level;\n }\n\n return Severity.Log;\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport { __assign } from \"tslib\";\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\n/* eslint-disable max-lines */\n\nimport { getCurrentHub } from '@sentry/core';\nimport { Severity } from '@sentry/types';\nimport { addInstrumentationHandler, getEventDescription, getGlobalObject, htmlTreeAsString, parseUrl, safeJoin, severityFromString } from '@sentry/utils';\n/**\n * Default Breadcrumbs instrumentations\n * TODO: Deprecated - with v6, this will be renamed to `Instrument`\n */\n\nvar Breadcrumbs =\n/** @class */\nfunction () {\n /**\n * @inheritDoc\n */\n function Breadcrumbs(options) {\n /**\n * @inheritDoc\n */\n this.name = Breadcrumbs.id;\n this._options = __assign({\n console: true,\n dom: true,\n fetch: true,\n history: true,\n sentry: true,\n xhr: true\n }, options);\n }\n /**\n * Create a breadcrumb of `sentry` from the events themselves\n */\n\n\n Breadcrumbs.prototype.addSentryBreadcrumb = function (event) {\n if (!this._options.sentry) {\n return;\n }\n\n getCurrentHub().addBreadcrumb({\n category: \"sentry.\" + (event.type === 'transaction' ? 'transaction' : 'event'),\n event_id: event.event_id,\n level: event.level,\n message: getEventDescription(event)\n }, {\n event: event\n });\n };\n /**\n * Instrument browser built-ins w/ breadcrumb capturing\n * - Console API\n * - DOM API (click/typing)\n * - XMLHttpRequest API\n * - Fetch API\n * - History API\n */\n\n\n Breadcrumbs.prototype.setupOnce = function () {\n if (this._options.console) {\n addInstrumentationHandler('console', _consoleBreadcrumb);\n }\n\n if (this._options.dom) {\n addInstrumentationHandler('dom', _domBreadcrumb(this._options.dom));\n }\n\n if (this._options.xhr) {\n addInstrumentationHandler('xhr', _xhrBreadcrumb);\n }\n\n if (this._options.fetch) {\n addInstrumentationHandler('fetch', _fetchBreadcrumb);\n }\n\n if (this._options.history) {\n addInstrumentationHandler('history', _historyBreadcrumb);\n }\n };\n /**\n * @inheritDoc\n */\n\n\n Breadcrumbs.id = 'Breadcrumbs';\n return Breadcrumbs;\n}();\n\nexport { Breadcrumbs };\n/**\n * A HOC that creaes a function that creates breadcrumbs from DOM API calls.\n * This is a HOC so that we get access to dom options in the closure.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nfunction _domBreadcrumb(dom) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _innerDomBreadcrumb(handlerData) {\n var target;\n var keyAttrs = _typeof(dom) === 'object' ? dom.serializeAttribute : undefined;\n\n if (typeof keyAttrs === 'string') {\n keyAttrs = [keyAttrs];\n } // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n\n\n try {\n target = handlerData.event.target ? htmlTreeAsString(handlerData.event.target, keyAttrs) : htmlTreeAsString(handlerData.event, keyAttrs);\n } catch (e) {\n target = '';\n }\n\n if (target.length === 0) {\n return;\n }\n\n getCurrentHub().addBreadcrumb({\n category: \"ui.\" + handlerData.name,\n message: target\n }, {\n event: handlerData.event,\n name: handlerData.name,\n global: handlerData.global\n });\n }\n\n return _innerDomBreadcrumb;\n}\n/**\n * Creates breadcrumbs from console API calls\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\nfunction _consoleBreadcrumb(handlerData) {\n var breadcrumb = {\n category: 'console',\n data: {\n arguments: handlerData.args,\n logger: 'console'\n },\n level: severityFromString(handlerData.level),\n message: safeJoin(handlerData.args, ' ')\n };\n\n if (handlerData.level === 'assert') {\n if (handlerData.args[0] === false) {\n breadcrumb.message = \"Assertion failed: \" + (safeJoin(handlerData.args.slice(1), ' ') || 'console.assert');\n breadcrumb.data.arguments = handlerData.args.slice(1);\n } else {\n // Don't capture a breadcrumb for passed assertions\n return;\n }\n }\n\n getCurrentHub().addBreadcrumb(breadcrumb, {\n input: handlerData.args,\n level: handlerData.level\n });\n}\n/**\n * Creates breadcrumbs from XHR API calls\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\nfunction _xhrBreadcrumb(handlerData) {\n if (handlerData.endTimestamp) {\n // We only capture complete, non-sentry requests\n if (handlerData.xhr.__sentry_own_request__) {\n return;\n }\n\n var _a = handlerData.xhr.__sentry_xhr__ || {},\n method = _a.method,\n url = _a.url,\n status_code = _a.status_code,\n body = _a.body;\n\n getCurrentHub().addBreadcrumb({\n category: 'xhr',\n data: {\n method: method,\n url: url,\n status_code: status_code\n },\n type: 'http'\n }, {\n xhr: handlerData.xhr,\n input: body\n });\n return;\n }\n}\n/**\n * Creates breadcrumbs from fetch API calls\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\nfunction _fetchBreadcrumb(handlerData) {\n // We only capture complete fetch requests\n if (!handlerData.endTimestamp) {\n return;\n }\n\n if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {\n // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)\n return;\n }\n\n if (handlerData.error) {\n getCurrentHub().addBreadcrumb({\n category: 'fetch',\n data: handlerData.fetchData,\n level: Severity.Error,\n type: 'http'\n }, {\n data: handlerData.error,\n input: handlerData.args\n });\n } else {\n getCurrentHub().addBreadcrumb({\n category: 'fetch',\n data: __assign(__assign({}, handlerData.fetchData), {\n status_code: handlerData.response.status\n }),\n type: 'http'\n }, {\n input: handlerData.args,\n response: handlerData.response\n });\n }\n}\n/**\n * Creates breadcrumbs from history API calls\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\nfunction _historyBreadcrumb(handlerData) {\n var global = getGlobalObject();\n var from = handlerData.from;\n var to = handlerData.to;\n var parsedLoc = parseUrl(global.location.href);\n var parsedFrom = parseUrl(from);\n var parsedTo = parseUrl(to); // Initial pushState doesn't provide `from` information\n\n if (!parsedFrom.path) {\n parsedFrom = parsedLoc;\n } // Use only the path component of the URL if the URL matches the current\n // document (almost all the time when using pushState)\n\n\n if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {\n to = parsedTo.relative;\n }\n\n if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {\n from = parsedFrom.relative;\n }\n\n getCurrentHub().addBreadcrumb({\n category: 'navigation',\n data: {\n from: from,\n to: to\n }\n });\n}","import { __assign, __extends } from \"tslib\";\nimport { BaseClient, SDK_VERSION } from '@sentry/core';\nimport { getGlobalObject, logger } from '@sentry/utils';\nimport { BrowserBackend } from './backend';\nimport { injectReportDialog } from './helpers';\nimport { Breadcrumbs } from './integrations';\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\n\nvar BrowserClient =\n/** @class */\nfunction (_super) {\n __extends(BrowserClient, _super);\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n\n\n function BrowserClient(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _this = this;\n\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || {\n name: 'sentry.javascript.browser',\n packages: [{\n name: 'npm:@sentry/browser',\n version: SDK_VERSION\n }],\n version: SDK_VERSION\n };\n _this = _super.call(this, BrowserBackend, options) || this;\n return _this;\n }\n /**\n * Show a report dialog to the user to send feedback to a specific event.\n *\n * @param options Set individual options for the dialog\n */\n\n\n BrowserClient.prototype.showReportDialog = function (options) {\n if (options === void 0) {\n options = {};\n } // doesn't work without a document (React Native)\n\n\n var document = getGlobalObject().document;\n\n if (!document) {\n return;\n }\n\n if (!this._isEnabled()) {\n logger.error('Trying to call showReportDialog with Sentry Client disabled');\n return;\n }\n\n injectReportDialog(__assign(__assign({}, options), {\n dsn: options.dsn || this.getDsn()\n }));\n };\n /**\n * @inheritDoc\n */\n\n\n BrowserClient.prototype._prepareEvent = function (event, scope, hint) {\n event.platform = event.platform || 'javascript';\n return _super.prototype._prepareEvent.call(this, event, scope, hint);\n };\n /**\n * @inheritDoc\n */\n\n\n BrowserClient.prototype._sendEvent = function (event) {\n var integration = this.getIntegration(Breadcrumbs);\n\n if (integration) {\n integration.addSentryBreadcrumb(event);\n }\n\n _super.prototype._sendEvent.call(this, event);\n };\n\n return BrowserClient;\n}(BaseClient);\n\nexport { BrowserClient };","import { __assign } from \"tslib\";\nimport { fill, getFunctionName, getGlobalObject, getOriginalFunction } from '@sentry/utils';\nimport { wrap } from '../helpers';\nvar DEFAULT_EVENT_TARGET = ['EventTarget', 'Window', 'Node', 'ApplicationCache', 'AudioTrackList', 'ChannelMergerNode', 'CryptoOperation', 'EventSource', 'FileReader', 'HTMLUnknownElement', 'IDBDatabase', 'IDBRequest', 'IDBTransaction', 'KeyOperation', 'MediaController', 'MessagePort', 'ModalWindow', 'Notification', 'SVGElementInstance', 'Screen', 'TextTrack', 'TextTrackCue', 'TextTrackList', 'WebSocket', 'WebSocketWorker', 'Worker', 'XMLHttpRequest', 'XMLHttpRequestEventTarget', 'XMLHttpRequestUpload'];\n/** Wrap timer functions and event targets to catch errors and provide better meta data */\n\nvar TryCatch =\n/** @class */\nfunction () {\n /**\n * @inheritDoc\n */\n function TryCatch(options) {\n /**\n * @inheritDoc\n */\n this.name = TryCatch.id;\n this._options = __assign({\n XMLHttpRequest: true,\n eventTarget: true,\n requestAnimationFrame: true,\n setInterval: true,\n setTimeout: true\n }, options);\n }\n /**\n * Wrap timer functions and event targets to catch errors\n * and provide better metadata.\n */\n\n\n TryCatch.prototype.setupOnce = function () {\n var global = getGlobalObject();\n\n if (this._options.setTimeout) {\n fill(global, 'setTimeout', _wrapTimeFunction);\n }\n\n if (this._options.setInterval) {\n fill(global, 'setInterval', _wrapTimeFunction);\n }\n\n if (this._options.requestAnimationFrame) {\n fill(global, 'requestAnimationFrame', _wrapRAF);\n }\n\n if (this._options.XMLHttpRequest && 'XMLHttpRequest' in global) {\n fill(XMLHttpRequest.prototype, 'send', _wrapXHR);\n }\n\n var eventTargetOption = this._options.eventTarget;\n\n if (eventTargetOption) {\n var eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET;\n eventTarget.forEach(_wrapEventTarget);\n }\n };\n /**\n * @inheritDoc\n */\n\n\n TryCatch.id = 'TryCatch';\n return TryCatch;\n}();\n\nexport { TryCatch };\n/** JSDoc */\n\nfunction _wrapTimeFunction(original) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var originalCallback = args[0];\n args[0] = wrap(originalCallback, {\n mechanism: {\n data: {\n \"function\": getFunctionName(original)\n },\n handled: true,\n type: 'instrument'\n }\n });\n return original.apply(this, args);\n };\n}\n/** JSDoc */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\nfunction _wrapRAF(original) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function (callback) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return original.call(this, wrap(callback, {\n mechanism: {\n data: {\n \"function\": 'requestAnimationFrame',\n handler: getFunctionName(original)\n },\n handled: true,\n type: 'instrument'\n }\n }));\n };\n}\n/** JSDoc */\n\n\nfunction _wrapXHR(originalSend) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n } // eslint-disable-next-line @typescript-eslint/no-this-alias\n\n\n var xhr = this;\n var xmlHttpRequestProps = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];\n xmlHttpRequestProps.forEach(function (prop) {\n if (prop in xhr && typeof xhr[prop] === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fill(xhr, prop, function (original) {\n var wrapOptions = {\n mechanism: {\n data: {\n \"function\": prop,\n handler: getFunctionName(original)\n },\n handled: true,\n type: 'instrument'\n }\n }; // If Instrument integration has been called before TryCatch, get the name of original function\n\n var originalFunction = getOriginalFunction(original);\n\n if (originalFunction) {\n wrapOptions.mechanism.data.handler = getFunctionName(originalFunction);\n } // Otherwise wrap directly\n\n\n return wrap(original, wrapOptions);\n });\n }\n });\n return originalSend.apply(this, args);\n };\n}\n/** JSDoc */\n\n\nfunction _wrapEventTarget(target) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var global = getGlobalObject(); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\n var proto = global[target] && global[target].prototype; // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function (original) {\n return function (eventName, fn, options) {\n try {\n if (typeof fn.handleEvent === 'function') {\n fn.handleEvent = wrap(fn.handleEvent.bind(fn), {\n mechanism: {\n data: {\n \"function\": 'handleEvent',\n handler: getFunctionName(fn),\n target: target\n },\n handled: true,\n type: 'instrument'\n }\n });\n }\n } catch (err) {// can sometimes get 'Permission denied to access property \"handle Event'\n }\n\n return original.call(this, eventName, // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wrap(fn, {\n mechanism: {\n data: {\n \"function\": 'addEventListener',\n handler: getFunctionName(fn),\n target: target\n },\n handled: true,\n type: 'instrument'\n }\n }), options);\n };\n });\n fill(proto, 'removeEventListener', function (originalRemoveEventListener) {\n return function (eventName, fn, options) {\n /**\n * There are 2 possible scenarios here:\n *\n * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified\n * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function\n * as a pass-through, and call original `removeEventListener` with it.\n *\n * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using\n * our wrapped version of `addEventListener`, which internally calls `wrap` helper.\n * This helper \"wraps\" whole callback inside a try/catch statement, and attached appropriate metadata to it,\n * in order for us to make a distinction between wrapped/non-wrapped functions possible.\n * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.\n *\n * When someone adds a handler prior to initialization, and then do it again, but after,\n * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible\n * to get rid of the initial handler and it'd stick there forever.\n */\n var wrappedEventHandler = fn;\n\n try {\n var originalEventHandler = wrappedEventHandler && wrappedEventHandler.__sentry_wrapped__;\n\n if (originalEventHandler) {\n originalRemoveEventListener.call(this, eventName, originalEventHandler, options);\n }\n } catch (e) {// ignore, accessing __sentry_wrapped__ will throw in some Selenium environments\n }\n\n return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options);\n };\n });\n}","import { __assign, __read } from \"tslib\";\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\nimport { getCurrentHub } from '@sentry/core';\nimport { Severity } from '@sentry/types';\nimport { addExceptionMechanism, addInstrumentationHandler, getLocationHref, isDebugBuild, isErrorEvent, isPrimitive, isString, logger } from '@sentry/utils';\nimport { eventFromUnknownInput } from '../eventbuilder';\nimport { shouldIgnoreOnError } from '../helpers';\n/** Global handlers */\n\nvar GlobalHandlers =\n/** @class */\nfunction () {\n /** JSDoc */\n function GlobalHandlers(options) {\n /**\n * @inheritDoc\n */\n this.name = GlobalHandlers.id;\n /**\n * Stores references functions to installing handlers. Will set to undefined\n * after they have been run so that they are not used twice.\n */\n\n this._installFunc = {\n onerror: _installGlobalOnErrorHandler,\n onunhandledrejection: _installGlobalOnUnhandledRejectionHandler\n };\n this._options = __assign({\n onerror: true,\n onunhandledrejection: true\n }, options);\n }\n /**\n * @inheritDoc\n */\n\n\n GlobalHandlers.prototype.setupOnce = function () {\n Error.stackTraceLimit = 50;\n var options = this._options; // We can disable guard-for-in as we construct the options object above + do checks against\n // `this._installFunc` for the property.\n // eslint-disable-next-line guard-for-in\n\n for (var key in options) {\n var installFunc = this._installFunc[key];\n\n if (installFunc && options[key]) {\n globalHandlerLog(key);\n installFunc();\n this._installFunc[key] = undefined;\n }\n }\n };\n /**\n * @inheritDoc\n */\n\n\n GlobalHandlers.id = 'GlobalHandlers';\n return GlobalHandlers;\n}();\n\nexport { GlobalHandlers };\n/** JSDoc */\n\nfunction _installGlobalOnErrorHandler() {\n addInstrumentationHandler('error', // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function (data) {\n var _a = __read(getHubAndAttachStacktrace(), 2),\n hub = _a[0],\n attachStacktrace = _a[1];\n\n if (!hub.getIntegration(GlobalHandlers)) {\n return;\n }\n\n var msg = data.msg,\n url = data.url,\n line = data.line,\n column = data.column,\n error = data.error;\n\n if (shouldIgnoreOnError() || error && error.__sentry_own_request__) {\n return;\n }\n\n var event = error === undefined && isString(msg) ? _eventFromIncompleteOnError(msg, url, line, column) : _enhanceEventWithInitialFrame(eventFromUnknownInput(error || msg, undefined, attachStacktrace, false), url, line, column);\n event.level = Severity.Error;\n addMechanismAndCapture(hub, error, event, 'onerror');\n });\n}\n/** JSDoc */\n\n\nfunction _installGlobalOnUnhandledRejectionHandler() {\n addInstrumentationHandler('unhandledrejection', // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function (e) {\n var _a = __read(getHubAndAttachStacktrace(), 2),\n hub = _a[0],\n attachStacktrace = _a[1];\n\n if (!hub.getIntegration(GlobalHandlers)) {\n return;\n }\n\n var error = e; // dig the object of the rejection out of known event types\n\n try {\n // PromiseRejectionEvents store the object of the rejection under 'reason'\n // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent\n if ('reason' in e) {\n error = e.reason;\n } // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents\n // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into\n // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec\n // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and\n // https://github.com/getsentry/sentry-javascript/issues/2380\n else if ('detail' in e && 'reason' in e.detail) {\n error = e.detail.reason;\n }\n } catch (_oO) {// no-empty\n }\n\n if (shouldIgnoreOnError() || error && error.__sentry_own_request__) {\n return true;\n }\n\n var event = isPrimitive(error) ? _eventFromRejectionWithPrimitive(error) : eventFromUnknownInput(error, undefined, attachStacktrace, true);\n event.level = Severity.Error;\n addMechanismAndCapture(hub, error, event, 'onunhandledrejection');\n return;\n });\n}\n/**\n * Create an event from a promise rejection where the `reason` is a primitive.\n *\n * @param reason: The `reason` property of the promise rejection\n * @returns An Event object with an appropriate `exception` value\n */\n\n\nfunction _eventFromRejectionWithPrimitive(reason) {\n return {\n exception: {\n values: [{\n type: 'UnhandledRejection',\n // String() is needed because the Primitive type includes symbols (which can't be automatically stringified)\n value: \"Non-Error promise rejection captured with value: \" + String(reason)\n }]\n }\n };\n}\n/**\n * This function creates a stack from an old, error-less onerror handler.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\nfunction _eventFromIncompleteOnError(msg, url, line, column) {\n var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i; // If 'message' is ErrorEvent, get real message from inside\n\n var message = isErrorEvent(msg) ? msg.message : msg;\n var name = 'Error';\n var groups = message.match(ERROR_TYPES_RE);\n\n if (groups) {\n name = groups[1];\n message = groups[2];\n }\n\n var event = {\n exception: {\n values: [{\n type: name,\n value: message\n }]\n }\n };\n return _enhanceEventWithInitialFrame(event, url, line, column);\n}\n/** JSDoc */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\nfunction _enhanceEventWithInitialFrame(event, url, line, column) {\n // event.exception\n var e = event.exception = event.exception || {}; // event.exception.values\n\n var ev = e.values = e.values || []; // event.exception.values[0]\n\n var ev0 = ev[0] = ev[0] || {}; // event.exception.values[0].stacktrace\n\n var ev0s = ev0.stacktrace = ev0.stacktrace || {}; // event.exception.values[0].stacktrace.frames\n\n var ev0sf = ev0s.frames = ev0s.frames || [];\n var colno = isNaN(parseInt(column, 10)) ? undefined : column;\n var lineno = isNaN(parseInt(line, 10)) ? undefined : line;\n var filename = isString(url) && url.length > 0 ? url : getLocationHref(); // event.exception.values[0].stacktrace.frames\n\n if (ev0sf.length === 0) {\n ev0sf.push({\n colno: colno,\n filename: filename,\n \"function\": '?',\n in_app: true,\n lineno: lineno\n });\n }\n\n return event;\n}\n\nfunction globalHandlerLog(type) {\n if (isDebugBuild()) {\n logger.log(\"Global Handler attached: \" + type);\n }\n}\n\nfunction addMechanismAndCapture(hub, error, event, type) {\n addExceptionMechanism(event, {\n handled: false,\n type: type\n });\n hub.captureEvent(event, {\n originalException: error\n });\n}\n\nfunction getHubAndAttachStacktrace() {\n var hub = getCurrentHub();\n var client = hub.getClient();\n var attachStacktrace = client && client.getOptions().attachStacktrace;\n return [hub, attachStacktrace];\n}","import { __read, __spread } from \"tslib\";\nimport { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport { isInstanceOf } from '@sentry/utils';\nimport { exceptionFromError } from '../eventbuilder';\nvar DEFAULT_KEY = 'cause';\nvar DEFAULT_LIMIT = 5;\n/** Adds SDK info to an event. */\n\nvar LinkedErrors =\n/** @class */\nfunction () {\n /**\n * @inheritDoc\n */\n function LinkedErrors(options) {\n if (options === void 0) {\n options = {};\n }\n /**\n * @inheritDoc\n */\n\n\n this.name = LinkedErrors.id;\n this._key = options.key || DEFAULT_KEY;\n this._limit = options.limit || DEFAULT_LIMIT;\n }\n /**\n * @inheritDoc\n */\n\n\n LinkedErrors.prototype.setupOnce = function () {\n addGlobalEventProcessor(function (event, hint) {\n var self = getCurrentHub().getIntegration(LinkedErrors);\n return self ? _handler(self._key, self._limit, event, hint) : event;\n });\n };\n /**\n * @inheritDoc\n */\n\n\n LinkedErrors.id = 'LinkedErrors';\n return LinkedErrors;\n}();\n\nexport { LinkedErrors };\n/**\n * @inheritDoc\n */\n\nexport function _handler(key, limit, event, hint) {\n if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n return event;\n }\n\n var linkedErrors = _walkErrorTree(limit, hint.originalException, key);\n\n event.exception.values = __spread(linkedErrors, event.exception.values);\n return event;\n}\n/**\n * JSDOC\n */\n\nexport function _walkErrorTree(limit, error, key, stack) {\n if (stack === void 0) {\n stack = [];\n }\n\n if (!isInstanceOf(error[key], Error) || stack.length + 1 >= limit) {\n return stack;\n }\n\n var exception = exceptionFromError(error[key]);\n return _walkErrorTree(limit, error[key], key, __spread([exception], stack));\n}","import { logger } from '@sentry/utils';\n/** Deduplication filter */\n\nvar Dedupe =\n/** @class */\nfunction () {\n function Dedupe() {\n /**\n * @inheritDoc\n */\n this.name = Dedupe.id;\n }\n /**\n * @inheritDoc\n */\n\n\n Dedupe.prototype.setupOnce = function (addGlobalEventProcessor, getCurrentHub) {\n addGlobalEventProcessor(function (currentEvent) {\n var self = getCurrentHub().getIntegration(Dedupe);\n\n if (self) {\n // Juuust in case something goes wrong\n try {\n if (_shouldDropEvent(currentEvent, self._previousEvent)) {\n logger.warn('Event dropped due to being a duplicate of previously captured event.');\n return null;\n }\n } catch (_oO) {\n return self._previousEvent = currentEvent;\n }\n\n return self._previousEvent = currentEvent;\n }\n\n return currentEvent;\n });\n };\n /**\n * @inheritDoc\n */\n\n\n Dedupe.id = 'Dedupe';\n return Dedupe;\n}();\n\nexport { Dedupe };\n/** JSDoc */\n\nfunction _shouldDropEvent(currentEvent, previousEvent) {\n if (!previousEvent) {\n return false;\n }\n\n if (_isSameMessageEvent(currentEvent, previousEvent)) {\n return true;\n }\n\n if (_isSameExceptionEvent(currentEvent, previousEvent)) {\n return true;\n }\n\n return false;\n}\n/** JSDoc */\n\n\nfunction _isSameMessageEvent(currentEvent, previousEvent) {\n var currentMessage = currentEvent.message;\n var previousMessage = previousEvent.message; // If neither event has a message property, they were both exceptions, so bail out\n\n if (!currentMessage && !previousMessage) {\n return false;\n } // If only one event has a stacktrace, but not the other one, they are not the same\n\n\n if (currentMessage && !previousMessage || !currentMessage && previousMessage) {\n return false;\n }\n\n if (currentMessage !== previousMessage) {\n return false;\n }\n\n if (!_isSameFingerprint(currentEvent, previousEvent)) {\n return false;\n }\n\n if (!_isSameStacktrace(currentEvent, previousEvent)) {\n return false;\n }\n\n return true;\n}\n/** JSDoc */\n\n\nfunction _isSameExceptionEvent(currentEvent, previousEvent) {\n var previousException = _getExceptionFromEvent(previousEvent);\n\n var currentException = _getExceptionFromEvent(currentEvent);\n\n if (!previousException || !currentException) {\n return false;\n }\n\n if (previousException.type !== currentException.type || previousException.value !== currentException.value) {\n return false;\n }\n\n if (!_isSameFingerprint(currentEvent, previousEvent)) {\n return false;\n }\n\n if (!_isSameStacktrace(currentEvent, previousEvent)) {\n return false;\n }\n\n return true;\n}\n/** JSDoc */\n\n\nfunction _isSameStacktrace(currentEvent, previousEvent) {\n var currentFrames = _getFramesFromEvent(currentEvent);\n\n var previousFrames = _getFramesFromEvent(previousEvent); // If neither event has a stacktrace, they are assumed to be the same\n\n\n if (!currentFrames && !previousFrames) {\n return true;\n } // If only one event has a stacktrace, but not the other one, they are not the same\n\n\n if (currentFrames && !previousFrames || !currentFrames && previousFrames) {\n return false;\n }\n\n currentFrames = currentFrames;\n previousFrames = previousFrames; // If number of frames differ, they are not the same\n\n if (previousFrames.length !== currentFrames.length) {\n return false;\n } // Otherwise, compare the two\n\n\n for (var i = 0; i < previousFrames.length; i++) {\n var frameA = previousFrames[i];\n var frameB = currentFrames[i];\n\n if (frameA.filename !== frameB.filename || frameA.lineno !== frameB.lineno || frameA.colno !== frameB.colno || frameA[\"function\"] !== frameB[\"function\"]) {\n return false;\n }\n }\n\n return true;\n}\n/** JSDoc */\n\n\nfunction _isSameFingerprint(currentEvent, previousEvent) {\n var currentFingerprint = currentEvent.fingerprint;\n var previousFingerprint = previousEvent.fingerprint; // If neither event has a fingerprint, they are assumed to be the same\n\n if (!currentFingerprint && !previousFingerprint) {\n return true;\n } // If only one event has a fingerprint, but not the other one, they are not the same\n\n\n if (currentFingerprint && !previousFingerprint || !currentFingerprint && previousFingerprint) {\n return false;\n }\n\n currentFingerprint = currentFingerprint;\n previousFingerprint = previousFingerprint; // Otherwise, compare the two\n\n try {\n return !!(currentFingerprint.join('') === previousFingerprint.join(''));\n } catch (_oO) {\n return false;\n }\n}\n/** JSDoc */\n\n\nfunction _getExceptionFromEvent(event) {\n return event.exception && event.exception.values && event.exception.values[0];\n}\n/** JSDoc */\n\n\nfunction _getFramesFromEvent(event) {\n var exception = event.exception;\n\n if (exception) {\n try {\n // @ts-ignore Object could be undefined\n return exception.values[0].stacktrace.frames;\n } catch (_oO) {\n return undefined;\n }\n } else if (event.stacktrace) {\n return event.stacktrace.frames;\n }\n\n return undefined;\n}","import { __assign } from \"tslib\";\nimport { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport { getGlobalObject } from '@sentry/utils';\nvar global = getGlobalObject();\n/** UserAgent */\n\nvar UserAgent =\n/** @class */\nfunction () {\n function UserAgent() {\n /**\n * @inheritDoc\n */\n this.name = UserAgent.id;\n }\n /**\n * @inheritDoc\n */\n\n\n UserAgent.prototype.setupOnce = function () {\n addGlobalEventProcessor(function (event) {\n if (getCurrentHub().getIntegration(UserAgent)) {\n // if none of the information we want exists, don't bother\n if (!global.navigator && !global.location && !global.document) {\n return event;\n } // grab as much info as exists and add it to the event\n\n\n var url = event.request && event.request.url || global.location && global.location.href;\n var referrer = (global.document || {}).referrer;\n var userAgent = (global.navigator || {}).userAgent;\n\n var headers = __assign(__assign(__assign({}, event.request && event.request.headers), referrer && {\n Referer: referrer\n }), userAgent && {\n 'User-Agent': userAgent\n });\n\n var request = __assign(__assign({}, url && {\n url: url\n }), {\n headers: headers\n });\n\n return __assign(__assign({}, event), {\n request: request\n });\n }\n\n return event;\n });\n };\n /**\n * @inheritDoc\n */\n\n\n UserAgent.id = 'UserAgent';\n return UserAgent;\n}();\n\nexport { UserAgent };","import { __assign } from \"tslib\";\nimport { getCurrentHub, initAndBind, Integrations as CoreIntegrations } from '@sentry/core';\nimport { addInstrumentationHandler, getGlobalObject, isDebugBuild, logger, resolvedSyncPromise } from '@sentry/utils';\nimport { BrowserClient } from './client';\nimport { wrap as internalWrap } from './helpers';\nimport { Breadcrumbs, Dedupe, GlobalHandlers, LinkedErrors, TryCatch, UserAgent } from './integrations';\nexport var defaultIntegrations = [new CoreIntegrations.InboundFilters(), new CoreIntegrations.FunctionToString(), new TryCatch(), new Breadcrumbs(), new GlobalHandlers(), new LinkedErrors(), new Dedupe(), new UserAgent()];\n/**\n * The Sentry Browser SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible when\n * loading the web page. To set context information or send manual events, use\n * the provided methods.\n *\n * @example\n *\n * ```\n *\n * import { init } from '@sentry/browser';\n *\n * init({\n * dsn: '__DSN__',\n * // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { configureScope } from '@sentry/browser';\n * configureScope((scope: Scope) => {\n * scope.setExtra({ battery: 0.7 });\n * scope.setTag({ user_mode: 'admin' });\n * scope.setUser({ id: '4711' });\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { addBreadcrumb } from '@sentry/browser';\n * addBreadcrumb({\n * message: 'My Breadcrumb',\n * // ...\n * });\n * ```\n *\n * @example\n *\n * ```\n *\n * import * as Sentry from '@sentry/browser';\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n * message: 'Manual',\n * stacktrace: [\n * // ...\n * ],\n * });\n * ```\n *\n * @see {@link BrowserOptions} for documentation on configuration options.\n */\n\nexport function init(options) {\n if (options === void 0) {\n options = {};\n }\n\n if (options.defaultIntegrations === undefined) {\n options.defaultIntegrations = defaultIntegrations;\n }\n\n if (options.release === undefined) {\n var window_1 = getGlobalObject(); // This supports the variable that sentry-webpack-plugin injects\n\n if (window_1.SENTRY_RELEASE && window_1.SENTRY_RELEASE.id) {\n options.release = window_1.SENTRY_RELEASE.id;\n }\n }\n\n if (options.autoSessionTracking === undefined) {\n options.autoSessionTracking = true;\n }\n\n if (options.sendClientReports === undefined) {\n options.sendClientReports = true;\n }\n\n initAndBind(BrowserClient, options);\n\n if (options.autoSessionTracking) {\n startSessionTracking();\n }\n}\n/**\n * Present the user with a report dialog.\n *\n * @param options Everything is optional, we try to fetch all info need from the global scope.\n */\n\nexport function showReportDialog(options) {\n if (options === void 0) {\n options = {};\n }\n\n var hub = getCurrentHub();\n var scope = hub.getScope();\n\n if (scope) {\n options.user = __assign(__assign({}, scope.getUser()), options.user);\n }\n\n if (!options.eventId) {\n options.eventId = hub.lastEventId();\n }\n\n var client = hub.getClient();\n\n if (client) {\n client.showReportDialog(options);\n }\n}\n/**\n * This is the getter for lastEventId.\n *\n * @returns The last event id of a captured event.\n */\n\nexport function lastEventId() {\n return getCurrentHub().lastEventId();\n}\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\n\nexport function forceLoad() {} // Noop\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\n\nexport function onLoad(callback) {\n callback();\n}\n/**\n * Call `flush()` on the current client, if there is one. See {@link Client.flush}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause\n * the client to wait until all events are sent before resolving the promise.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\n\nexport function flush(timeout) {\n var client = getCurrentHub().getClient();\n\n if (client) {\n return client.flush(timeout);\n }\n\n if (isDebugBuild()) {\n logger.warn('Cannot flush events. No client defined.');\n }\n\n return resolvedSyncPromise(false);\n}\n/**\n * Call `close()` on the current client, if there is one. See {@link Client.close}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this\n * parameter will cause the client to wait until all events are sent before disabling itself.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\n\nexport function close(timeout) {\n var client = getCurrentHub().getClient();\n\n if (client) {\n return client.close(timeout);\n }\n\n if (isDebugBuild()) {\n logger.warn('Cannot flush events and disable SDK. No client defined.');\n }\n\n return resolvedSyncPromise(false);\n}\n/**\n * Wrap code within a try/catch block so the SDK is able to capture errors.\n *\n * @param fn A function to wrap.\n *\n * @returns The result of wrapped function call.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nexport function wrap(fn) {\n return internalWrap(fn)();\n}\n\nfunction startSessionOnHub(hub) {\n hub.startSession({\n ignoreDuration: true\n });\n hub.captureSession();\n}\n/**\n * Enable automatic Session Tracking for the initial page load.\n */\n\n\nfunction startSessionTracking() {\n var window = getGlobalObject();\n var document = window.document;\n\n if (typeof document === 'undefined') {\n if (isDebugBuild()) {\n logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');\n }\n\n return;\n }\n\n var hub = getCurrentHub(); // The only way for this to be false is for there to be a version mismatch between @sentry/browser (>= 6.0.0) and\n // @sentry/hub (< 5.27.0). In the simple case, there won't ever be such a mismatch, because the two packages are\n // pinned at the same version in package.json, but there are edge cases where it's possible. See\n // https://github.com/getsentry/sentry-javascript/issues/3207 and\n // https://github.com/getsentry/sentry-javascript/issues/3234 and\n // https://github.com/getsentry/sentry-javascript/issues/3278.\n\n if (!hub.captureSession) {\n return;\n } // The session duration for browser sessions does not track a meaningful\n // concept that can be used as a metric.\n // Automatically captured sessions are akin to page views, and thus we\n // discard their duration.\n\n\n startSessionOnHub(hub); // We want to create a session for every navigation as well\n\n addInstrumentationHandler('history', function (_a) {\n var from = _a.from,\n to = _a.to; // Don't create an additional session for the initial route or if the location did not change\n\n if (!(from === undefined || from === to)) {\n startSessionOnHub(getCurrentHub());\n }\n });\n}","import { getCurrentHub } from '@sentry/hub';\nimport { logger } from '@sentry/utils';\n/**\n * Internal function to create a new SDK client instance. The client is\n * installed and then bound to the current scope.\n *\n * @param clientClass The client class to instantiate.\n * @param options Options to pass to the client.\n */\n\nexport function initAndBind(clientClass, options) {\n if (options.debug === true) {\n logger.enable();\n }\n\n var hub = getCurrentHub();\n var scope = hub.getScope();\n\n if (scope) {\n scope.update(options.initialScope);\n }\n\n var client = new clientClass(options);\n hub.bindClient(client);\n}","import * as Sentry from '@sentry/browser';\n\nif (\"production\" == 'staging' || \"production\" == 'production') {\n Sentry.init({\n dsn: \"\"\n });\n}\n","/**\n * This module mostly exists for optimizations in the build process\n * through rollup and terser. We define some global constants which\n * are normally undefined. However terser overrides these with global\n * definitions which can be evaluated by the static analyzer when\n * creating a bundle.\n *\n * In turn the `isDebugBuild` and `isBrowserBundle` functions are pure\n * and can help us remove unused code from the bundles.\n */\n\n/**\n * Figures out if we're building with debug functionality.\n *\n * @returns true if this is a debug build\n */\nexport function isDebugBuild() {\n return typeof __SENTRY_NO_DEBUG__ !== 'undefined' && !__SENTRY_BROWSER_BUNDLE__;\n}\n/**\n * Figures out if we're building a browser bundle.\n *\n * @returns true if this is a browser bundle build.\n */\n\nexport function isBrowserBundle() {\n return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__;\n}","import { isRegExp, isString } from './is';\n/**\n * Truncates given string to the maximum characters count\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string (0 = unlimited)\n * @returns string Encoded\n */\n\nexport function truncate(str, max) {\n if (max === void 0) {\n max = 0;\n }\n\n if (typeof str !== 'string' || max === 0) {\n return str;\n }\n\n return str.length <= max ? str : str.substr(0, max) + \"...\";\n}\n/**\n * This is basically just `trim_line` from\n * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\n\nexport function snipLine(line, colno) {\n var newLine = line;\n var lineLength = newLine.length;\n\n if (lineLength <= 150) {\n return newLine;\n }\n\n if (colno > lineLength) {\n // eslint-disable-next-line no-param-reassign\n colno = lineLength;\n }\n\n var start = Math.max(colno - 60, 0);\n\n if (start < 5) {\n start = 0;\n }\n\n var end = Math.min(start + 140, lineLength);\n\n if (end > lineLength - 5) {\n end = lineLength;\n }\n\n if (end === lineLength) {\n start = Math.max(end - 140, 0);\n }\n\n newLine = newLine.slice(start, end);\n\n if (start > 0) {\n newLine = \"'{snip} \" + newLine;\n }\n\n if (end < lineLength) {\n newLine += ' {snip}';\n }\n\n return newLine;\n}\n/**\n * Join values in array\n * @param input array of values to be joined together\n * @param delimiter string to be placed in-between values\n * @returns Joined values\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nexport function safeJoin(input, delimiter) {\n if (!Array.isArray(input)) {\n return '';\n }\n\n var output = []; // eslint-disable-next-line @typescript-eslint/prefer-for-of\n\n for (var i = 0; i < input.length; i++) {\n var value = input[i];\n\n try {\n output.push(String(value));\n } catch (e) {\n output.push('[value cannot be serialized]');\n }\n }\n\n return output.join(delimiter);\n}\n/**\n * Checks if the value matches a regex or includes the string\n * @param value The string value to be checked against\n * @param pattern Either a regex or a string that must be contained in value\n */\n\nexport function isMatchingPattern(value, pattern) {\n if (!isString(value)) {\n return false;\n }\n\n if (isRegExp(pattern)) {\n return pattern.test(value);\n }\n\n if (typeof pattern === 'string') {\n return value.indexOf(pattern) !== -1;\n }\n\n return false;\n}\n/**\n * Given a string, escape characters which have meaning in the regex grammar, such that the result is safe to feed to\n * `new RegExp()`.\n *\n * Based on https://github.com/sindresorhus/escape-string-regexp. Vendored to a) reduce the size by skipping the runtime\n * type-checking, and b) ensure it gets down-compiled for old versions of Node (the published package only supports Node\n * 12+).\n *\n * @param regexString The string to escape\n * @returns An version of the string with all special regex characters escaped\n */\n\nexport function escapeStringForRegex(regexString) {\n // escape the hyphen separately so we can also replace it with a unicode literal hyphen, to avoid the problems\n // discussed in https://github.com/sindresorhus/escape-string-regexp/issues/20.\n return regexString.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&').replace(/-/g, '\\\\x2d');\n}"],"sourceRoot":""}