autotel-subscribers 41.0.3 → 41.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/amplitude.cjs +2 -2
  2. package/dist/amplitude.cjs.map +1 -1
  3. package/dist/amplitude.js +2 -2
  4. package/dist/architecture-snapshot.cjs +6 -6
  5. package/dist/architecture-snapshot.cjs.map +1 -1
  6. package/dist/architecture-snapshot.js +3 -3
  7. package/dist/architecture-snapshot.js.map +1 -1
  8. package/dist/{cjs-BS1fE_MP.js → cjs-Bef2t9Tr.js} +348 -109
  9. package/dist/cjs-Bef2t9Tr.js.map +1 -0
  10. package/dist/{cjs-CC1S3xV3.cjs → cjs-C2fugEI8.cjs} +169 -164
  11. package/dist/{cjs-CC1S3xV3.cjs.map → cjs-C2fugEI8.cjs.map} +1 -1
  12. package/dist/{cjs-BVWTUHeD.cjs → cjs-C5tev9Yr.cjs} +458 -219
  13. package/dist/cjs-C5tev9Yr.cjs.map +1 -0
  14. package/dist/{cjs-j3aHAiuq.js → cjs-CY69zXGd.js} +20 -15
  15. package/dist/{cjs-j3aHAiuq.js.map → cjs-CY69zXGd.js.map} +1 -1
  16. package/dist/factories.cjs +2 -2
  17. package/dist/factories.d.cts +1 -1
  18. package/dist/factories.d.ts +1 -1
  19. package/dist/factories.js +1 -1
  20. package/dist/file.cjs +2 -2
  21. package/dist/index.cjs +2 -2
  22. package/dist/index.d.cts +1 -1
  23. package/dist/index.d.ts +1 -1
  24. package/dist/index.js +1 -1
  25. package/dist/{index.node-T6N3xCyo.js → index.node-BF2WkODf.js} +368 -148
  26. package/dist/index.node-BF2WkODf.js.map +1 -0
  27. package/dist/{index.node-CVFSZNnN.cjs → index.node-DOkEUdYV.cjs} +369 -149
  28. package/dist/index.node-DOkEUdYV.cjs.map +1 -0
  29. package/dist/middleware.cjs +1 -1
  30. package/dist/{mixpanel-node-CTaHqgil.cjs → mixpanel-node-BVS2X-h7.cjs} +32 -31
  31. package/dist/{mixpanel-node-CTaHqgil.cjs.map → mixpanel-node-BVS2X-h7.cjs.map} +1 -1
  32. package/dist/{mixpanel-node-2RXHuOWK.js → mixpanel-node-BltEtoG6.js} +5 -4
  33. package/dist/{mixpanel-node-2RXHuOWK.js.map → mixpanel-node-BltEtoG6.js.map} +1 -1
  34. package/dist/mixpanel.cjs +2 -2
  35. package/dist/mixpanel.cjs.map +1 -1
  36. package/dist/mixpanel.js +2 -2
  37. package/dist/{posthog-DTpCMk3r.js → posthog-C9M1c_oG.js} +2 -2
  38. package/dist/{posthog-DTpCMk3r.js.map → posthog-C9M1c_oG.js.map} +1 -1
  39. package/dist/{posthog-DLBf2UJJ.d.ts → posthog-DCV5Arkw.d.ts} +217 -24
  40. package/dist/posthog-DCV5Arkw.d.ts.map +1 -0
  41. package/dist/{posthog-Duh9pZs7.d.cts → posthog-DRYlG5fG.d.cts} +217 -24
  42. package/dist/posthog-DRYlG5fG.d.cts.map +1 -0
  43. package/dist/{posthog-Bz9XTdX5.cjs → posthog-DZfoAW1q.cjs} +4 -4
  44. package/dist/{posthog-Bz9XTdX5.cjs.map → posthog-DZfoAW1q.cjs.map} +1 -1
  45. package/dist/posthog.cjs +2 -2
  46. package/dist/posthog.d.cts +1 -1
  47. package/dist/posthog.d.ts +1 -1
  48. package/dist/posthog.js +1 -1
  49. package/dist/{chunk-CiiB0FCw.js → rolldown-runtime-BHkdefai.js} +9 -2
  50. package/dist/{chunk-BIkA7V7q.cjs → rolldown-runtime-CfAboj1T.cjs} +8 -1
  51. package/dist/security.cjs +1 -1
  52. package/dist/segment.cjs +2 -2
  53. package/dist/segment.cjs.map +1 -1
  54. package/dist/segment.js +2 -2
  55. package/dist/slack.cjs +1 -1
  56. package/dist/{tslib.es6-Ck6tgf4J.cjs → tslib.es6-02HJIdSd.cjs} +4 -4
  57. package/dist/{tslib.es6-Ck6tgf4J.cjs.map → tslib.es6-02HJIdSd.cjs.map} +1 -1
  58. package/dist/{tslib.es6-13Ha9x3r.js → tslib.es6-Dvm0j0am.js} +2 -2
  59. package/dist/{tslib.es6-13Ha9x3r.js.map → tslib.es6-Dvm0j0am.js.map} +1 -1
  60. package/dist/webhook.cjs +1 -1
  61. package/package.json +15 -15
  62. package/dist/cjs-BS1fE_MP.js.map +0 -1
  63. package/dist/cjs-BVWTUHeD.cjs.map +0 -1
  64. package/dist/index.node-CVFSZNnN.cjs.map +0 -1
  65. package/dist/index.node-T6N3xCyo.js.map +0 -1
  66. package/dist/posthog-DLBf2UJJ.d.ts.map +0 -1
  67. package/dist/posthog-Duh9pZs7.d.cts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.node-T6N3xCyo.js","names":["PostHogPersistedProperty","ErrorTracking.ReduceableCache","error_tracking","#_","ErrorTracking.ErrorPropertiesBuilder","ErrorTracking.EventCoercer","ErrorTracking.ErrorCoercer","ErrorTracking.ObjectCoercer","ErrorTracking.StringCoercer","ErrorTracking.PrimitiveCoercer","ErrorTracking.createStackParser","ErrorTracking.nodeStackLineParser"],"sources":["../../../node_modules/.pnpm/posthog-node@5.36.4_rxjs@7.8.2/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/featureFlagUtils.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/types.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/gzip.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/utils/bot-detection.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/utils/type-utils.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/utils/number-utils.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/vendor/uuidv7.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/utils/promise-queue.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/utils/logger.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/utils/index.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/logs/logs-utils.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/eventemitter.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/error-tracking/types.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/error-tracking/utils.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/error-tracking/exception-steps.mjs","../../../node_modules/.pnpm/@posthog+core@1.30.10/node_modules/@posthog/core/dist/posthog-core-stateless.mjs","../../../node_modules/.pnpm/posthog-node@5.36.4_rxjs@7.8.2/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/context-lines.node.mjs","../../../node_modules/.pnpm/posthog-node@5.36.4_rxjs@7.8.2/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/relative-path.node.mjs","../../../node_modules/.pnpm/posthog-node@5.36.4_rxjs@7.8.2/node_modules/posthog-node/dist/version.mjs","../../../node_modules/.pnpm/posthog-node@5.36.4_rxjs@7.8.2/node_modules/posthog-node/dist/types.mjs","../../../node_modules/.pnpm/posthog-node@5.36.4_rxjs@7.8.2/node_modules/posthog-node/dist/feature-flag-evaluations.mjs","../../../node_modules/.pnpm/posthog-node@5.36.4_rxjs@7.8.2/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs","../../../node_modules/.pnpm/posthog-node@5.36.4_rxjs@7.8.2/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs","../../../node_modules/.pnpm/posthog-node@5.36.4_rxjs@7.8.2/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs","../../../node_modules/.pnpm/posthog-node@5.36.4_rxjs@7.8.2/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs","../../../node_modules/.pnpm/posthog-node@5.36.4_rxjs@7.8.2/node_modules/posthog-node/dist/storage-memory.mjs","../../../node_modules/.pnpm/posthog-node@5.36.4_rxjs@7.8.2/node_modules/posthog-node/dist/client.mjs","../../../node_modules/.pnpm/posthog-node@5.36.4_rxjs@7.8.2/node_modules/posthog-node/dist/extensions/context/context.mjs","../../../node_modules/.pnpm/posthog-node@5.36.4_rxjs@7.8.2/node_modules/posthog-node/dist/extensions/sentry-integration.mjs","../../../node_modules/.pnpm/posthog-node@5.36.4_rxjs@7.8.2/node_modules/posthog-node/dist/entrypoints/index.node.mjs"],"sourcesContent":["import { dirname, posix, sep } from \"path\";\nfunction createModulerModifier() {\n const getModuleFromFileName = createGetModuleFromFilename();\n return async (frames)=>{\n for (const frame of frames)frame.module = getModuleFromFileName(frame.filename);\n return frames;\n };\n}\nfunction createGetModuleFromFilename(basePath = process.argv[1] ? dirname(process.argv[1]) : process.cwd(), isWindows = '\\\\' === sep) {\n const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;\n return (filename)=>{\n if (!filename) return;\n const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename;\n let { dir, base: file, ext } = posix.parse(normalizedFilename);\n if ('.js' === ext || '.mjs' === ext || '.cjs' === ext) file = file.slice(0, -1 * ext.length);\n const decodedFile = decodeURIComponent(file);\n if (!dir) dir = '.';\n const n = dir.lastIndexOf('/node_modules');\n if (n > -1) return `${dir.slice(n + 14).replace(/\\//g, '.')}:${decodedFile}`;\n if (dir.startsWith(normalizedBase)) {\n const moduleName = dir.slice(normalizedBase.length + 1).replace(/\\//g, '.');\n return moduleName ? `${moduleName}:${decodedFile}` : decodedFile;\n }\n return decodedFile;\n };\n}\nfunction normalizeWindowsPath(path) {\n return path.replace(/^[A-Z]:/, '').replace(/\\\\/g, '/');\n}\nexport { createModulerModifier };\n","const normalizeFlagsResponse = (flagsResponse)=>{\n if ('flags' in flagsResponse) {\n const featureFlags = getFlagValuesFromFlags(flagsResponse.flags);\n const featureFlagPayloads = getPayloadsFromFlags(flagsResponse.flags);\n return {\n ...flagsResponse,\n featureFlags,\n featureFlagPayloads\n };\n }\n {\n const featureFlags = flagsResponse.featureFlags ?? {};\n const featureFlagPayloads = Object.fromEntries(Object.entries(flagsResponse.featureFlagPayloads || {}).map(([k, v])=>[\n k,\n parsePayload(v)\n ]));\n const flags = Object.fromEntries(Object.entries(featureFlags).map(([key, value])=>[\n key,\n getFlagDetailFromFlagAndPayload(key, value, featureFlagPayloads[key])\n ]));\n return {\n ...flagsResponse,\n featureFlags,\n featureFlagPayloads,\n flags\n };\n }\n};\nfunction getFlagDetailFromFlagAndPayload(key, value, payload) {\n return {\n key: key,\n enabled: 'string' == typeof value ? true : value,\n variant: 'string' == typeof value ? value : void 0,\n reason: void 0,\n metadata: {\n id: void 0,\n version: void 0,\n payload: payload ? JSON.stringify(payload) : void 0,\n description: void 0\n }\n };\n}\nconst getFlagValuesFromFlags = (flags)=>Object.fromEntries(Object.entries(flags ?? {}).map(([key, detail])=>[\n key,\n getFeatureFlagValue(detail)\n ]).filter(([, value])=>void 0 !== value));\nconst getPayloadsFromFlags = (flags)=>{\n const safeFlags = flags ?? {};\n return Object.fromEntries(Object.keys(safeFlags).filter((flag)=>{\n const details = safeFlags[flag];\n return details.enabled && details.metadata && void 0 !== details.metadata.payload;\n }).map((flag)=>{\n const payload = safeFlags[flag].metadata?.payload;\n return [\n flag,\n payload ? parsePayload(payload) : void 0\n ];\n }));\n};\nconst getFlagDetailsFromFlagsAndPayloads = (flagsResponse)=>{\n const flags = flagsResponse.featureFlags ?? {};\n const payloads = flagsResponse.featureFlagPayloads ?? {};\n return Object.fromEntries(Object.entries(flags).map(([key, value])=>[\n key,\n {\n key: key,\n enabled: 'string' == typeof value ? true : value,\n variant: 'string' == typeof value ? value : void 0,\n reason: void 0,\n metadata: {\n id: void 0,\n version: void 0,\n payload: payloads?.[key] ? JSON.stringify(payloads[key]) : void 0,\n description: void 0\n }\n }\n ]));\n};\nconst getFeatureFlagValue = (detail)=>void 0 === detail ? void 0 : detail.variant ?? detail.enabled;\nconst parsePayload = (response)=>{\n if ('string' != typeof response) return response;\n try {\n return JSON.parse(response);\n } catch {\n return response;\n }\n};\nconst createFlagsResponseFromFlagsAndPayloads = (featureFlags, featureFlagPayloads)=>{\n const allKeys = [\n ...new Set([\n ...Object.keys(featureFlags ?? {}),\n ...Object.keys(featureFlagPayloads ?? {})\n ])\n ];\n const enabledFlags = allKeys.filter((flag)=>!!featureFlags[flag] || !!featureFlagPayloads[flag]).reduce((res, key)=>(res[key] = featureFlags[key] ?? true, res), {});\n const flagDetails = {\n featureFlags: enabledFlags,\n featureFlagPayloads: featureFlagPayloads ?? {}\n };\n return normalizeFlagsResponse(flagDetails);\n};\nconst updateFlagValue = (flag, value)=>({\n ...flag,\n enabled: getEnabledFromValue(value),\n variant: getVariantFromValue(value)\n });\nfunction getEnabledFromValue(value) {\n return 'string' == typeof value ? true : value;\n}\nfunction getVariantFromValue(value) {\n return 'string' == typeof value ? value : void 0;\n}\nexport { createFlagsResponseFromFlagsAndPayloads, getEnabledFromValue, getFeatureFlagValue, getFlagDetailsFromFlagsAndPayloads, getFlagValuesFromFlags, getPayloadsFromFlags, getVariantFromValue, normalizeFlagsResponse, parsePayload, updateFlagValue };\n","var types_PostHogPersistedProperty = /*#__PURE__*/ function(PostHogPersistedProperty) {\n PostHogPersistedProperty[\"AnonymousId\"] = \"anonymous_id\";\n PostHogPersistedProperty[\"DistinctId\"] = \"distinct_id\";\n PostHogPersistedProperty[\"Props\"] = \"props\";\n PostHogPersistedProperty[\"EnablePersonProcessing\"] = \"enable_person_processing\";\n PostHogPersistedProperty[\"PersonMode\"] = \"person_mode\";\n PostHogPersistedProperty[\"FeatureFlagDetails\"] = \"feature_flag_details\";\n PostHogPersistedProperty[\"FeatureFlags\"] = \"feature_flags\";\n PostHogPersistedProperty[\"FeatureFlagPayloads\"] = \"feature_flag_payloads\";\n PostHogPersistedProperty[\"BootstrapFeatureFlagDetails\"] = \"bootstrap_feature_flag_details\";\n PostHogPersistedProperty[\"BootstrapFeatureFlags\"] = \"bootstrap_feature_flags\";\n PostHogPersistedProperty[\"BootstrapFeatureFlagPayloads\"] = \"bootstrap_feature_flag_payloads\";\n PostHogPersistedProperty[\"OverrideFeatureFlags\"] = \"override_feature_flags\";\n PostHogPersistedProperty[\"Queue\"] = \"queue\";\n PostHogPersistedProperty[\"LogsQueue\"] = \"logs_queue\";\n PostHogPersistedProperty[\"OptedOut\"] = \"opted_out\";\n PostHogPersistedProperty[\"SessionId\"] = \"session_id\";\n PostHogPersistedProperty[\"SessionStartTimestamp\"] = \"session_start_timestamp\";\n PostHogPersistedProperty[\"SessionLastTimestamp\"] = \"session_timestamp\";\n PostHogPersistedProperty[\"PersonProperties\"] = \"person_properties\";\n PostHogPersistedProperty[\"GroupProperties\"] = \"group_properties\";\n PostHogPersistedProperty[\"InstalledAppBuild\"] = \"installed_app_build\";\n PostHogPersistedProperty[\"InstalledAppVersion\"] = \"installed_app_version\";\n PostHogPersistedProperty[\"SessionReplay\"] = \"session_replay\";\n PostHogPersistedProperty[\"SurveyLastSeenDate\"] = \"survey_last_seen_date\";\n PostHogPersistedProperty[\"SurveysSeen\"] = \"surveys_seen\";\n PostHogPersistedProperty[\"Surveys\"] = \"surveys\";\n PostHogPersistedProperty[\"RemoteConfig\"] = \"remote_config\";\n PostHogPersistedProperty[\"FlagsEndpointWasHit\"] = \"flags_endpoint_was_hit\";\n PostHogPersistedProperty[\"DeviceId\"] = \"device_id\";\n return PostHogPersistedProperty;\n}({});\nvar types_Compression = /*#__PURE__*/ function(Compression) {\n Compression[\"GZipJS\"] = \"gzip-js\";\n Compression[\"Base64\"] = \"base64\";\n return Compression;\n}({});\nconst FeatureFlagError = {\n ERRORS_WHILE_COMPUTING: 'errors_while_computing_flags',\n FLAG_MISSING: 'flag_missing',\n QUOTA_LIMITED: 'quota_limited',\n TIMEOUT: 'timeout',\n CONNECTION_ERROR: 'connection_error',\n UNKNOWN_ERROR: 'unknown_error',\n apiError: (status)=>`api_error_${status}`\n};\nvar types_SurveyPosition = /*#__PURE__*/ function(SurveyPosition) {\n SurveyPosition[\"TopLeft\"] = \"top_left\";\n SurveyPosition[\"TopCenter\"] = \"top_center\";\n SurveyPosition[\"TopRight\"] = \"top_right\";\n SurveyPosition[\"MiddleLeft\"] = \"middle_left\";\n SurveyPosition[\"MiddleCenter\"] = \"middle_center\";\n SurveyPosition[\"MiddleRight\"] = \"middle_right\";\n SurveyPosition[\"Left\"] = \"left\";\n SurveyPosition[\"Right\"] = \"right\";\n SurveyPosition[\"Center\"] = \"center\";\n return SurveyPosition;\n}({});\nvar types_SurveyWidgetType = /*#__PURE__*/ function(SurveyWidgetType) {\n SurveyWidgetType[\"Button\"] = \"button\";\n SurveyWidgetType[\"Tab\"] = \"tab\";\n SurveyWidgetType[\"Selector\"] = \"selector\";\n return SurveyWidgetType;\n}({});\nvar types_SurveyType = /*#__PURE__*/ function(SurveyType) {\n SurveyType[\"Popover\"] = \"popover\";\n SurveyType[\"API\"] = \"api\";\n SurveyType[\"Widget\"] = \"widget\";\n SurveyType[\"ExternalSurvey\"] = \"external_survey\";\n return SurveyType;\n}({});\nvar types_SurveyQuestionDescriptionContentType = /*#__PURE__*/ function(SurveyQuestionDescriptionContentType) {\n SurveyQuestionDescriptionContentType[\"Html\"] = \"html\";\n SurveyQuestionDescriptionContentType[\"Text\"] = \"text\";\n return SurveyQuestionDescriptionContentType;\n}({});\nvar types_SurveyValidationType = /*#__PURE__*/ function(SurveyValidationType) {\n SurveyValidationType[\"MinLength\"] = \"min_length\";\n SurveyValidationType[\"MaxLength\"] = \"max_length\";\n return SurveyValidationType;\n}({});\nvar types_SurveyRatingDisplay = /*#__PURE__*/ function(SurveyRatingDisplay) {\n SurveyRatingDisplay[\"Number\"] = \"number\";\n SurveyRatingDisplay[\"Emoji\"] = \"emoji\";\n return SurveyRatingDisplay;\n}({});\nvar types_SurveyQuestionType = /*#__PURE__*/ function(SurveyQuestionType) {\n SurveyQuestionType[\"Open\"] = \"open\";\n SurveyQuestionType[\"MultipleChoice\"] = \"multiple_choice\";\n SurveyQuestionType[\"SingleChoice\"] = \"single_choice\";\n SurveyQuestionType[\"Rating\"] = \"rating\";\n SurveyQuestionType[\"Link\"] = \"link\";\n return SurveyQuestionType;\n}({});\nvar types_SurveyQuestionBranchingType = /*#__PURE__*/ function(SurveyQuestionBranchingType) {\n SurveyQuestionBranchingType[\"NextQuestion\"] = \"next_question\";\n SurveyQuestionBranchingType[\"End\"] = \"end\";\n SurveyQuestionBranchingType[\"ResponseBased\"] = \"response_based\";\n SurveyQuestionBranchingType[\"SpecificQuestion\"] = \"specific_question\";\n return SurveyQuestionBranchingType;\n}({});\nvar types_SurveyMatchType = /*#__PURE__*/ function(SurveyMatchType) {\n SurveyMatchType[\"Regex\"] = \"regex\";\n SurveyMatchType[\"NotRegex\"] = \"not_regex\";\n SurveyMatchType[\"Exact\"] = \"exact\";\n SurveyMatchType[\"IsNot\"] = \"is_not\";\n SurveyMatchType[\"Icontains\"] = \"icontains\";\n SurveyMatchType[\"NotIcontains\"] = \"not_icontains\";\n return SurveyMatchType;\n}({});\nvar types_SurveySchedule = /*#__PURE__*/ function(SurveySchedule) {\n SurveySchedule[\"Once\"] = \"once\";\n SurveySchedule[\"Recurring\"] = \"recurring\";\n SurveySchedule[\"Always\"] = \"always\";\n return SurveySchedule;\n}({});\nvar types_ActionStepStringMatching = /*#__PURE__*/ function(ActionStepStringMatching) {\n ActionStepStringMatching[\"Contains\"] = \"contains\";\n ActionStepStringMatching[\"Exact\"] = \"exact\";\n ActionStepStringMatching[\"Regex\"] = \"regex\";\n return ActionStepStringMatching;\n}({});\nconst knownUnsafeEditableEvent = [\n '$snapshot',\n '$pageview',\n '$pageleave',\n '$set',\n 'survey dismissed',\n 'survey sent',\n 'survey shown',\n '$identify',\n '$groupidentify',\n '$create_alias',\n '$$client_ingestion_warning',\n '$web_experiment_applied',\n '$feature_enrollment_update',\n '$feature_flag_called'\n];\nexport { types_ActionStepStringMatching as ActionStepStringMatching, types_Compression as Compression, FeatureFlagError, types_PostHogPersistedProperty as PostHogPersistedProperty, types_SurveyMatchType as SurveyMatchType, types_SurveyPosition as SurveyPosition, types_SurveyQuestionBranchingType as SurveyQuestionBranchingType, types_SurveyQuestionDescriptionContentType as SurveyQuestionDescriptionContentType, types_SurveyQuestionType as SurveyQuestionType, types_SurveyRatingDisplay as SurveyRatingDisplay, types_SurveySchedule as SurveySchedule, types_SurveyType as SurveyType, types_SurveyValidationType as SurveyValidationType, types_SurveyWidgetType as SurveyWidgetType, knownUnsafeEditableEvent };\n","import { Compression } from \"./types.mjs\";\nfunction isGzipSupported() {\n return 'CompressionStream' in globalThis && 'TextEncoder' in globalThis && 'Response' in globalThis && 'function' == typeof Response.prototype.blob;\n}\nconst NATIVE_GZIP_VALIDATION_ERROR = 'NativeGzipValidationError';\nconst GZIP_MAGIC_FIRST_BYTE = 0x1f;\nconst GZIP_MAGIC_SECOND_BYTE = 0x8b;\nconst GZIP_DEFLATE_METHOD = 0x08;\nconst hasGzipMagic = (bytes)=>bytes.length >= 2 && bytes[0] === GZIP_MAGIC_FIRST_BYTE && bytes[1] === GZIP_MAGIC_SECOND_BYTE;\nconst isGzipData = (body)=>{\n if (body instanceof ArrayBuffer) return hasGzipMagic(new Uint8Array(body));\n if (ArrayBuffer.isView(body)) return hasGzipMagic(new Uint8Array(body.buffer, body.byteOffset, body.byteLength));\n return false;\n};\nconst isGzipRequest = (compression, urlCompression)=>compression === Compression.GZipJS || urlCompression === Compression.GZipJS || 'gzip' === urlCompression;\nconst isNativeAsyncGzipReadError = (error)=>{\n if (!error || 'object' != typeof error) return false;\n const name = 'name' in error ? String(error.name) : '';\n return 'NotReadableError' === name;\n};\nconst isNativeAsyncGzipError = (error)=>{\n if (!error || 'object' != typeof error) return false;\n const name = 'name' in error ? String(error.name) : '';\n return isNativeAsyncGzipReadError(error) || name === NATIVE_GZIP_VALIDATION_ERROR;\n};\nlet crc32Table;\nconst getCrc32Table = ()=>{\n if (crc32Table) return crc32Table;\n crc32Table = [];\n for(let i = 0; i < 256; i++){\n let crc = i;\n for(let j = 0; j < 8; j++)crc = 1 & crc ? 0xedb88320 ^ crc >>> 1 : crc >>> 1;\n crc32Table[i] = crc >>> 0;\n }\n return crc32Table;\n};\nconst crc32 = (bytes)=>{\n const table = getCrc32Table();\n let crc = 0xffffffff;\n for(let i = 0; i < bytes.length; i++)crc = table[(crc ^ bytes[i]) & 0xff] ^ crc >>> 8;\n return (0xffffffff ^ crc) >>> 0;\n};\nconst throwNativeGzipValidationError = (reason)=>{\n const error = new Error(`Native gzip produced invalid output: ${reason}`);\n error.name = NATIVE_GZIP_VALIDATION_ERROR;\n throw error;\n};\nconst validateNativeGzip = async (compressed, inputBytes)=>{\n if (compressed.size < 18) throwNativeGzipValidationError('too-short');\n const header = new Uint8Array(await compressed.slice(0, 10).arrayBuffer());\n if (!hasGzipMagic(header) || header[2] !== GZIP_DEFLATE_METHOD) throwNativeGzipValidationError('invalid-header');\n const trailer = new DataView(await compressed.slice(compressed.size - 8).arrayBuffer());\n if (trailer.getUint32(0, true) !== crc32(inputBytes)) throwNativeGzipValidationError('invalid-crc');\n const inputSize = inputBytes.length >>> 0;\n if (trailer.getUint32(4, true) !== inputSize) throwNativeGzipValidationError('invalid-size');\n};\nasync function gzipCompress(input, isDebug = true, options) {\n try {\n const inputBytes = new TextEncoder().encode(input);\n const compressedStream = new CompressionStream('gzip');\n const writer = compressedStream.writable.getWriter();\n const writePromise = writer.write(inputBytes).then(()=>writer.close()).catch(async (err)=>{\n try {\n await writer.abort(err);\n } catch {}\n throw err;\n });\n const responsePromise = new Response(compressedStream.readable).blob();\n const [compressed] = await Promise.all([\n responsePromise,\n writePromise\n ]);\n await validateNativeGzip(compressed, inputBytes);\n return compressed;\n } catch (error) {\n if (options?.rethrow) throw error;\n if (isDebug) console.error('Failed to gzip compress data', error);\n return null;\n }\n}\nexport { gzipCompress, isGzipData, isGzipRequest, isGzipSupported, isNativeAsyncGzipError, isNativeAsyncGzipReadError };\n","const DEFAULT_BLOCKED_UA_STRS = [\n 'amazonbot',\n 'amazonproductbot',\n 'app.hypefactors.com',\n 'applebot',\n 'archive.org_bot',\n 'awariobot',\n 'backlinksextendedbot',\n 'baiduspider',\n 'bingbot',\n 'bingpreview',\n 'chrome-lighthouse',\n 'dataforseobot',\n 'deepscan',\n 'duckduckbot',\n 'facebookexternal',\n 'facebookcatalog',\n 'http://yandex.com/bots',\n 'hubspot',\n 'ia_archiver',\n 'leikibot',\n 'linkedinbot',\n 'meta-externalagent',\n 'mj12bot',\n 'msnbot',\n 'nessus',\n 'petalbot',\n 'pinterest',\n 'prerender',\n 'rogerbot',\n 'screaming frog',\n 'sebot-wa',\n 'sitebulb',\n 'slackbot',\n 'slurp',\n 'trendictionbot',\n 'turnitin',\n 'twitterbot',\n 'vercel-screenshot',\n 'vercelbot',\n 'yahoo! slurp',\n 'yandexbot',\n 'zoombot',\n 'bot.htm',\n 'bot.php',\n '(bot;',\n 'bot/',\n 'crawler',\n 'ahrefsbot',\n 'ahrefssiteaudit',\n 'semrushbot',\n 'siteauditbot',\n 'splitsignalbot',\n 'gptbot',\n 'oai-searchbot',\n 'chatgpt-user',\n 'perplexitybot',\n 'better uptime bot',\n 'sentryuptimebot',\n 'uptimerobot',\n 'headlesschrome',\n 'cypress',\n 'google-hoteladsverifier',\n 'adsbot-google',\n 'apis-google',\n 'duplexweb-google',\n 'feedfetcher-google',\n 'google favicon',\n 'google web preview',\n 'google-read-aloud',\n 'googlebot',\n 'googleother',\n 'google-cloudvertexbot',\n 'googleweblight',\n 'mediapartners-google',\n 'storebot-google',\n 'google-inspectiontool',\n 'bytespider'\n];\nconst isBlockedUA = function(ua, customBlockedUserAgents = []) {\n if (!ua) return false;\n const uaLower = ua.toLowerCase();\n return DEFAULT_BLOCKED_UA_STRS.concat(customBlockedUserAgents).some((blockedUA)=>{\n const blockedUaLower = blockedUA.toLowerCase();\n return -1 !== uaLower.indexOf(blockedUaLower);\n });\n};\nexport { DEFAULT_BLOCKED_UA_STRS, isBlockedUA };\n","import { knownUnsafeEditableEvent } from \"../types.mjs\";\nimport { includes } from \"./string-utils.mjs\";\nconst nativeIsArray = Array.isArray;\nconst ObjProto = Object.prototype;\nconst type_utils_hasOwnProperty = ObjProto.hasOwnProperty;\nconst type_utils_toString = ObjProto.toString;\nconst isArray = nativeIsArray || function(obj) {\n return '[object Array]' === type_utils_toString.call(obj);\n};\nconst isFunction = (x)=>'function' == typeof x;\nconst isNativeFunction = (x)=>isFunction(x) && -1 !== x.toString().indexOf('[native code]');\nconst isObject = (x)=>x === Object(x) && !isArray(x);\nconst isEmptyObject = (x)=>{\n if (isObject(x)) {\n for(const key in x)if (type_utils_hasOwnProperty.call(x, key)) return false;\n return true;\n }\n return false;\n};\nconst isUndefined = (x)=>void 0 === x;\nconst isString = (x)=>'[object String]' == type_utils_toString.call(x);\nconst isEmptyString = (x)=>isString(x) && 0 === x.trim().length;\nconst isNull = (x)=>null === x;\nconst isNullish = (x)=>isUndefined(x) || isNull(x);\nconst isNumber = (x)=>'[object Number]' == type_utils_toString.call(x) && x === x;\nconst isPositiveNumber = (value)=>isNumber(value) && value > 0;\nconst isBoolean = (x)=>'[object Boolean]' === type_utils_toString.call(x);\nconst isFormData = (x)=>x instanceof FormData;\nconst isFile = (x)=>x instanceof File;\nconst isPlainError = (x)=>x instanceof Error;\nconst isKnownUnsafeEditableEvent = (x)=>includes(knownUnsafeEditableEvent, x);\nfunction isPrimitive(value) {\n return null === value || 'object' != typeof value;\n}\nfunction isBuiltin(candidate, className) {\n return Object.prototype.toString.call(candidate) === `[object ${className}]`;\n}\nfunction isError(candidate) {\n switch(Object.prototype.toString.call(candidate)){\n case '[object Error]':\n case '[object Exception]':\n case '[object DOMException]':\n case '[object DOMError]':\n case '[object WebAssembly.Exception]':\n return true;\n default:\n return isInstanceOf(candidate, Error);\n }\n}\nfunction isErrorEvent(event) {\n return isBuiltin(event, 'ErrorEvent');\n}\nfunction isEvent(candidate) {\n return 'undefined' != typeof Event && isInstanceOf(candidate, Event);\n}\nfunction isPlainObject(candidate) {\n return isBuiltin(candidate, 'Object');\n}\nfunction isInstanceOf(candidate, base) {\n try {\n return candidate instanceof base;\n } catch {\n return false;\n }\n}\nconst yesLikeValues = [\n true,\n 'true',\n 1,\n '1',\n 'yes'\n];\nconst isYesLike = (val)=>includes(yesLikeValues, val);\nconst noLikeValues = [\n false,\n 'false',\n 0,\n '0',\n 'no'\n];\nconst isNoLike = (val)=>includes(noLikeValues, val);\nexport { type_utils_hasOwnProperty as hasOwnProperty, isArray, isBoolean, isBuiltin, isEmptyObject, isEmptyString, isError, isErrorEvent, isEvent, isFile, isFormData, isFunction, isKnownUnsafeEditableEvent, isNativeFunction, isNoLike, isNull, isNullish, isNumber, isObject, isPlainError, isPlainObject, isPositiveNumber, isPrimitive, isString, isUndefined, isYesLike, noLikeValues, yesLikeValues };\n","import { isNumber } from \"./type-utils.mjs\";\nfunction clampToRange(value, min, max, logger, fallbackValue) {\n if (min > max) {\n logger.warn('min cannot be greater than max.');\n min = max;\n }\n if (isNumber(value)) if (value > max) {\n logger.warn(' cannot be greater than max: ' + max + '. Using max value instead.');\n return max;\n } else {\n if (!(value < min)) return value;\n logger.warn(' cannot be less than min: ' + min + '. Using min value instead.');\n return min;\n }\n logger.warn(' must be a number. using max or fallback. max: ' + max + ', fallback: ' + fallbackValue);\n return clampToRange(fallbackValue || max, min, max, logger);\n}\nfunction getRemoteConfigBool(field, key, defaultValue = true) {\n if (null == field) return defaultValue;\n if ('boolean' == typeof field) return field;\n if ('object' == typeof field) {\n const value = field[key];\n return 'boolean' == typeof value ? value : defaultValue;\n }\n return defaultValue;\n}\nfunction getRemoteConfigNumber(field, key) {\n if (null == field || 'object' != typeof field) return;\n const value = field[key];\n if ('number' == typeof value && Number.isFinite(value)) return value;\n if ('string' == typeof value) {\n const trimmed = value.trim();\n if ('' === trimmed) return;\n const parsed = Number(trimmed);\n return Number.isFinite(parsed) ? parsed : void 0;\n }\n}\nfunction isValidSampleRate(value) {\n return 'number' == typeof value && Number.isFinite(value) && value >= 0 && value <= 1;\n}\nexport { clampToRange, getRemoteConfigBool, getRemoteConfigNumber, isValidSampleRate };\n","import { clampToRange } from \"./number-utils.mjs\";\nconst ONE_DAY_IN_MS = 86400000;\nclass BucketedRateLimiter {\n constructor(options){\n this._buckets = {};\n this._onBucketRateLimited = options._onBucketRateLimited;\n this._bucketSize = clampToRange(options.bucketSize, 0, 100, options._logger);\n this._refillRate = clampToRange(options.refillRate, 0, this._bucketSize, options._logger);\n this._refillInterval = clampToRange(options.refillInterval, 0, ONE_DAY_IN_MS, options._logger);\n }\n _applyRefill(bucket, now) {\n const elapsedMs = now - bucket.lastAccess;\n const refillIntervals = Math.floor(elapsedMs / this._refillInterval);\n if (refillIntervals > 0) {\n const tokensToAdd = refillIntervals * this._refillRate;\n bucket.tokens = Math.min(bucket.tokens + tokensToAdd, this._bucketSize);\n bucket.lastAccess = bucket.lastAccess + refillIntervals * this._refillInterval;\n }\n }\n consumeRateLimit(key) {\n const now = Date.now();\n const keyStr = String(key);\n let bucket = this._buckets[keyStr];\n if (bucket) this._applyRefill(bucket, now);\n else {\n bucket = {\n tokens: this._bucketSize,\n lastAccess: now\n };\n this._buckets[keyStr] = bucket;\n }\n if (0 === bucket.tokens) return true;\n bucket.tokens--;\n if (0 === bucket.tokens) this._onBucketRateLimited?.(key);\n return 0 === bucket.tokens;\n }\n stop() {\n this._buckets = {};\n }\n}\nexport { BucketedRateLimiter };\n","/*! For license information please see uuidv7.mjs.LICENSE.txt */\n/**\n * uuidv7: An experimental implementation of the proposed UUID Version 7\n *\n * @license Apache-2.0\n * @copyright 2021-2023 LiosK\n * @packageDocumentation\n */ const DIGITS = \"0123456789abcdef\";\nclass UUID {\n constructor(bytes){\n this.bytes = bytes;\n }\n static ofInner(bytes) {\n if (16 === bytes.length) return new UUID(bytes);\n throw new TypeError(\"not 128-bit length\");\n }\n static fromFieldsV7(unixTsMs, randA, randBHi, randBLo) {\n if (!Number.isInteger(unixTsMs) || !Number.isInteger(randA) || !Number.isInteger(randBHi) || !Number.isInteger(randBLo) || unixTsMs < 0 || randA < 0 || randBHi < 0 || randBLo < 0 || unixTsMs > 0xffffffffffff || randA > 0xfff || randBHi > 0x3fffffff || randBLo > 0xffffffff) throw new RangeError(\"invalid field value\");\n const bytes = new Uint8Array(16);\n bytes[0] = unixTsMs / 2 ** 40;\n bytes[1] = unixTsMs / 2 ** 32;\n bytes[2] = unixTsMs / 2 ** 24;\n bytes[3] = unixTsMs / 2 ** 16;\n bytes[4] = unixTsMs / 256;\n bytes[5] = unixTsMs;\n bytes[6] = 0x70 | randA >>> 8;\n bytes[7] = randA;\n bytes[8] = 0x80 | randBHi >>> 24;\n bytes[9] = randBHi >>> 16;\n bytes[10] = randBHi >>> 8;\n bytes[11] = randBHi;\n bytes[12] = randBLo >>> 24;\n bytes[13] = randBLo >>> 16;\n bytes[14] = randBLo >>> 8;\n bytes[15] = randBLo;\n return new UUID(bytes);\n }\n static parse(uuid) {\n let hex;\n switch(uuid.length){\n case 32:\n hex = /^[0-9a-f]{32}$/i.exec(uuid)?.[0];\n break;\n case 36:\n hex = /^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(uuid)?.slice(1, 6).join(\"\");\n break;\n case 38:\n hex = /^\\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\\}$/i.exec(uuid)?.slice(1, 6).join(\"\");\n break;\n case 45:\n hex = /^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(uuid)?.slice(1, 6).join(\"\");\n break;\n default:\n break;\n }\n if (hex) {\n const inner = new Uint8Array(16);\n for(let i = 0; i < 16; i += 4){\n const n = parseInt(hex.substring(2 * i, 2 * i + 8), 16);\n inner[i + 0] = n >>> 24;\n inner[i + 1] = n >>> 16;\n inner[i + 2] = n >>> 8;\n inner[i + 3] = n;\n }\n return new UUID(inner);\n }\n throw new SyntaxError(\"could not parse UUID string\");\n }\n toString() {\n let text = \"\";\n for(let i = 0; i < this.bytes.length; i++){\n text += DIGITS.charAt(this.bytes[i] >>> 4);\n text += DIGITS.charAt(0xf & this.bytes[i]);\n if (3 === i || 5 === i || 7 === i || 9 === i) text += \"-\";\n }\n return text;\n }\n toHex() {\n let text = \"\";\n for(let i = 0; i < this.bytes.length; i++){\n text += DIGITS.charAt(this.bytes[i] >>> 4);\n text += DIGITS.charAt(0xf & this.bytes[i]);\n }\n return text;\n }\n toJSON() {\n return this.toString();\n }\n getVariant() {\n const n = this.bytes[8] >>> 4;\n if (n < 0) throw new Error(\"unreachable\");\n if (n <= 7) return this.bytes.every((e)=>0 === e) ? \"NIL\" : \"VAR_0\";\n if (n <= 11) return \"VAR_10\";\n if (n <= 13) return \"VAR_110\";\n if (n <= 15) return this.bytes.every((e)=>0xff === e) ? \"MAX\" : \"VAR_RESERVED\";\n else throw new Error(\"unreachable\");\n }\n getVersion() {\n return \"VAR_10\" === this.getVariant() ? this.bytes[6] >>> 4 : void 0;\n }\n clone() {\n return new UUID(this.bytes.slice(0));\n }\n equals(other) {\n return 0 === this.compareTo(other);\n }\n compareTo(other) {\n for(let i = 0; i < 16; i++){\n const diff = this.bytes[i] - other.bytes[i];\n if (0 !== diff) return Math.sign(diff);\n }\n return 0;\n }\n}\nclass V7Generator {\n constructor(randomNumberGenerator){\n this.timestamp = 0;\n this.counter = 0;\n this.random = randomNumberGenerator ?? getDefaultRandom();\n }\n generate() {\n return this.generateOrResetCore(Date.now(), 10000);\n }\n generateOrAbort() {\n return this.generateOrAbortCore(Date.now(), 10000);\n }\n generateOrResetCore(unixTsMs, rollbackAllowance) {\n let value = this.generateOrAbortCore(unixTsMs, rollbackAllowance);\n if (void 0 === value) {\n this.timestamp = 0;\n value = this.generateOrAbortCore(unixTsMs, rollbackAllowance);\n }\n return value;\n }\n generateOrAbortCore(unixTsMs, rollbackAllowance) {\n const MAX_COUNTER = 0x3ffffffffff;\n if (!Number.isInteger(unixTsMs) || unixTsMs < 1 || unixTsMs > 0xffffffffffff) throw new RangeError(\"`unixTsMs` must be a 48-bit positive integer\");\n if (rollbackAllowance < 0 || rollbackAllowance > 0xffffffffffff) throw new RangeError(\"`rollbackAllowance` out of reasonable range\");\n if (unixTsMs > this.timestamp) {\n this.timestamp = unixTsMs;\n this.resetCounter();\n } else {\n if (!(unixTsMs + rollbackAllowance >= this.timestamp)) return;\n this.counter++;\n if (this.counter > MAX_COUNTER) {\n this.timestamp++;\n this.resetCounter();\n }\n }\n return UUID.fromFieldsV7(this.timestamp, Math.trunc(this.counter / 2 ** 30), this.counter & 2 ** 30 - 1, this.random.nextUint32());\n }\n resetCounter() {\n this.counter = 0x400 * this.random.nextUint32() + (0x3ff & this.random.nextUint32());\n }\n generateV4() {\n const bytes = new Uint8Array(Uint32Array.of(this.random.nextUint32(), this.random.nextUint32(), this.random.nextUint32(), this.random.nextUint32()).buffer);\n bytes[6] = 0x40 | bytes[6] >>> 4;\n bytes[8] = 0x80 | bytes[8] >>> 2;\n return UUID.ofInner(bytes);\n }\n}\nconst getDefaultRandom = ()=>({\n nextUint32: ()=>0x10000 * Math.trunc(0x10000 * Math.random()) + Math.trunc(0x10000 * Math.random())\n });\nlet defaultGenerator;\nconst uuidv7 = ()=>uuidv7obj().toString();\nconst uuidv7obj = ()=>(defaultGenerator || (defaultGenerator = new V7Generator())).generate();\nconst uuidv4 = ()=>uuidv4obj().toString();\nconst uuidv4obj = ()=>(defaultGenerator || (defaultGenerator = new V7Generator())).generateV4();\nexport { UUID, V7Generator, uuidv4, uuidv4obj, uuidv7, uuidv7obj };\n","import { uuidv7 } from \"../vendor/uuidv7.mjs\";\nclass PromiseQueue {\n add(promise) {\n const promiseUUID = uuidv7();\n this.promiseByIds[promiseUUID] = promise;\n promise.catch(()=>{}).finally(()=>{\n delete this.promiseByIds[promiseUUID];\n });\n return promise;\n }\n async join() {\n let promises = Object.values(this.promiseByIds);\n let length = promises.length;\n while(length > 0){\n await Promise.all(promises);\n promises = Object.values(this.promiseByIds);\n length = promises.length;\n }\n }\n get length() {\n return Object.keys(this.promiseByIds).length;\n }\n constructor(){\n this.promiseByIds = {};\n }\n}\nexport { PromiseQueue };\n","function createConsole(consoleLike = console) {\n const lockedMethods = {\n log: consoleLike.log.bind(consoleLike),\n warn: consoleLike.warn.bind(consoleLike),\n error: consoleLike.error.bind(consoleLike),\n debug: consoleLike.debug.bind(consoleLike)\n };\n return lockedMethods;\n}\nconst _createLogger = (prefix, maybeCall, consoleLike)=>{\n function _log(level, ...args) {\n maybeCall(()=>{\n const consoleMethod = consoleLike[level];\n consoleMethod(prefix, ...args);\n });\n }\n const logger = {\n debug: (...args)=>{\n _log('debug', ...args);\n },\n info: (...args)=>{\n _log('log', ...args);\n },\n warn: (...args)=>{\n _log('warn', ...args);\n },\n error: (...args)=>{\n _log('error', ...args);\n },\n critical: (...args)=>{\n consoleLike['error'](prefix, ...args);\n },\n createLogger: (additionalPrefix)=>_createLogger(`${prefix} ${additionalPrefix}`, maybeCall, consoleLike)\n };\n return logger;\n};\nconst passThrough = (fn)=>fn();\nfunction createLogger(prefix, maybeCall = passThrough) {\n return _createLogger(prefix, maybeCall, createConsole());\n}\nexport { _createLogger, createLogger };\n","import { includes } from \"./string-utils.mjs\";\nimport { isFunction, isUndefined } from \"./type-utils.mjs\";\nconst FACEBOOK = 'Facebook';\nconst MOBILE = 'Mobile';\nconst IOS = 'iOS';\nconst ANDROID = 'Android';\nconst TABLET = 'Tablet';\nconst ANDROID_TABLET = ANDROID + ' ' + TABLET;\nconst IPAD = 'iPad';\nconst APPLE = 'Apple';\nconst APPLE_WATCH = APPLE + ' Watch';\nconst SAFARI = 'Safari';\nconst BLACKBERRY = 'BlackBerry';\nconst SAMSUNG = 'Samsung';\nconst SAMSUNG_BROWSER = SAMSUNG + 'Browser';\nconst SAMSUNG_INTERNET = SAMSUNG + ' Internet';\nconst CHROME = 'Chrome';\nconst CHROME_OS = CHROME + ' OS';\nconst CHROME_IOS = CHROME + ' ' + IOS;\nconst INTERNET_EXPLORER = 'Internet Explorer';\nconst INTERNET_EXPLORER_MOBILE = INTERNET_EXPLORER + ' ' + MOBILE;\nconst OPERA = 'Opera';\nconst OPERA_MINI = OPERA + ' Mini';\nconst EDGE = 'Edge';\nconst MICROSOFT_EDGE = 'Microsoft ' + EDGE;\nconst FIREFOX = 'Firefox';\nconst FIREFOX_IOS = FIREFOX + ' ' + IOS;\nconst NINTENDO = 'Nintendo';\nconst PLAYSTATION = 'PlayStation';\nconst XBOX = 'Xbox';\nconst ANDROID_MOBILE = ANDROID + ' ' + MOBILE;\nconst MOBILE_SAFARI = MOBILE + ' ' + SAFARI;\nconst WINDOWS = 'Windows';\nconst WINDOWS_PHONE = WINDOWS + ' Phone';\nconst NOKIA = 'Nokia';\nconst OUYA = 'Ouya';\nconst GENERIC = 'Generic';\nconst GENERIC_MOBILE = GENERIC + ' ' + MOBILE.toLowerCase();\nconst GENERIC_TABLET = GENERIC + ' ' + TABLET.toLowerCase();\nconst KONQUEROR = 'Konqueror';\nconst OCULUS_BROWSER = 'Oculus Browser';\nconst VIVALDI = 'Vivaldi';\nconst YANDEX = 'Yandex';\nconst WHALE = 'Whale';\nconst DUCKDUCKGO = 'DuckDuckGo';\nconst PALE_MOON = 'Pale Moon';\nconst WATERFOX = 'Waterfox';\nconst BRAVE = 'Brave';\nconst BROWSER_VERSION_REGEX_SUFFIX = '(\\\\d+(\\\\.\\\\d+)?)';\nconst DEFAULT_BROWSER_VERSION_REGEX = new RegExp('Version/' + BROWSER_VERSION_REGEX_SUFFIX);\nfunction browserFromHints(hints) {\n if (hints?.brave) return BRAVE;\n return null;\n}\nconst XBOX_REGEX = new RegExp(XBOX, 'i');\nconst PLAYSTATION_REGEX = new RegExp(PLAYSTATION + ' \\\\w+', 'i');\nconst NINTENDO_REGEX = new RegExp(NINTENDO + ' \\\\w+', 'i');\nconst BLACKBERRY_REGEX = new RegExp(BLACKBERRY + '|PlayBook|BB10', 'i');\nconst windowsVersionMap = {\n 'NT3.51': 'NT 3.11',\n 'NT4.0': 'NT 4.0',\n '5.0': '2000',\n '5.1': 'XP',\n '5.2': 'XP',\n '6.0': 'Vista',\n '6.1': '7',\n '6.2': '8',\n '6.3': '8.1',\n '6.4': '10',\n '10.0': '10'\n};\nfunction isSafari(userAgent) {\n return includes(userAgent, SAFARI) && !includes(userAgent, CHROME) && !includes(userAgent, ANDROID);\n}\nconst safariCheck = (ua, vendor)=>vendor && includes(vendor, APPLE) || isSafari(ua);\nconst detectBrowser = function(user_agent, vendor, hints) {\n vendor = vendor || '';\n const fromHints = browserFromHints(hints);\n if (fromHints) return fromHints;\n if (includes(user_agent, ' OPR/') && includes(user_agent, 'Mini')) return OPERA_MINI;\n if (includes(user_agent, ' OPR/')) return OPERA;\n if (BLACKBERRY_REGEX.test(user_agent)) return BLACKBERRY;\n if (includes(user_agent, 'IE' + MOBILE) || includes(user_agent, 'WPDesktop')) return INTERNET_EXPLORER_MOBILE;\n if (includes(user_agent, 'OculusBrowser')) return OCULUS_BROWSER;\n else if (includes(user_agent, SAMSUNG_BROWSER)) return SAMSUNG_INTERNET;\n else if (includes(user_agent, EDGE) || includes(user_agent, 'Edg/')) return MICROSOFT_EDGE;\n else if (includes(user_agent, VIVALDI + '/')) return VIVALDI;\n else if (includes(user_agent, 'YaBrowser/')) return YANDEX;\n else if (includes(user_agent, WHALE + '/')) return WHALE;\n else if (includes(user_agent, DUCKDUCKGO + '/') || includes(user_agent, 'Ddg/')) return DUCKDUCKGO;\n else if (includes(user_agent, 'FBIOS')) return FACEBOOK + ' ' + MOBILE;\n else if (includes(user_agent, 'UCWEB') || includes(user_agent, 'UCBrowser')) return 'UC Browser';\n else if (includes(user_agent, 'CriOS')) return CHROME_IOS;\n else if (includes(user_agent, 'CrMo')) return CHROME;\n else if (includes(user_agent, CHROME)) return CHROME;\n else if (includes(user_agent, ANDROID) && includes(user_agent, SAFARI)) return ANDROID_MOBILE;\n else if (includes(user_agent, 'FxiOS')) return FIREFOX_IOS;\n else if (includes(user_agent.toLowerCase(), KONQUEROR.toLowerCase())) return KONQUEROR;\n else if (includes(user_agent, BRAVE + '/')) return BRAVE;\n else if (safariCheck(user_agent, vendor)) return includes(user_agent, MOBILE) ? MOBILE_SAFARI : SAFARI;\n else if (includes(user_agent, 'PaleMoon/')) return PALE_MOON;\n else if (includes(user_agent, WATERFOX + '/')) return WATERFOX;\n else if (includes(user_agent, FIREFOX)) return FIREFOX;\n else if (includes(user_agent, 'MSIE') || includes(user_agent, 'Trident/')) return INTERNET_EXPLORER;\n else if (includes(user_agent, 'Gecko')) return FIREFOX;\n return '';\n};\nconst versionRegexes = {\n [INTERNET_EXPLORER_MOBILE]: [\n new RegExp('rv:' + BROWSER_VERSION_REGEX_SUFFIX)\n ],\n [MICROSOFT_EDGE]: [\n new RegExp(EDGE + '?\\\\/' + BROWSER_VERSION_REGEX_SUFFIX)\n ],\n [CHROME]: [\n new RegExp('(' + CHROME + '|CrMo)\\\\/' + BROWSER_VERSION_REGEX_SUFFIX)\n ],\n [CHROME_IOS]: [\n new RegExp('CriOS\\\\/' + BROWSER_VERSION_REGEX_SUFFIX)\n ],\n 'UC Browser': [\n new RegExp('(UCBrowser|UCWEB)\\\\/' + BROWSER_VERSION_REGEX_SUFFIX)\n ],\n [SAFARI]: [\n DEFAULT_BROWSER_VERSION_REGEX\n ],\n [MOBILE_SAFARI]: [\n DEFAULT_BROWSER_VERSION_REGEX\n ],\n [OPERA]: [\n new RegExp('(' + OPERA + '|OPR)\\\\/' + BROWSER_VERSION_REGEX_SUFFIX)\n ],\n [FIREFOX]: [\n new RegExp(FIREFOX + '\\\\/' + BROWSER_VERSION_REGEX_SUFFIX)\n ],\n [FIREFOX_IOS]: [\n new RegExp('FxiOS\\\\/' + BROWSER_VERSION_REGEX_SUFFIX)\n ],\n [KONQUEROR]: [\n new RegExp('Konqueror[:/]?' + BROWSER_VERSION_REGEX_SUFFIX, 'i')\n ],\n [BLACKBERRY]: [\n new RegExp(BLACKBERRY + ' ' + BROWSER_VERSION_REGEX_SUFFIX),\n DEFAULT_BROWSER_VERSION_REGEX\n ],\n [ANDROID_MOBILE]: [\n new RegExp('android\\\\s' + BROWSER_VERSION_REGEX_SUFFIX, 'i')\n ],\n [SAMSUNG_INTERNET]: [\n new RegExp(SAMSUNG_BROWSER + '\\\\/' + BROWSER_VERSION_REGEX_SUFFIX)\n ],\n [OCULUS_BROWSER]: [\n new RegExp('OculusBrowser\\\\/' + BROWSER_VERSION_REGEX_SUFFIX)\n ],\n [VIVALDI]: [\n new RegExp(VIVALDI + '\\\\/' + BROWSER_VERSION_REGEX_SUFFIX)\n ],\n [YANDEX]: [\n new RegExp('YaBrowser\\\\/' + BROWSER_VERSION_REGEX_SUFFIX)\n ],\n [WHALE]: [\n new RegExp(WHALE + '\\\\/' + BROWSER_VERSION_REGEX_SUFFIX)\n ],\n [BRAVE]: [\n new RegExp(BRAVE + '\\\\/' + BROWSER_VERSION_REGEX_SUFFIX)\n ],\n [DUCKDUCKGO]: [\n new RegExp('(DuckDuckGo|Ddg)\\\\/' + BROWSER_VERSION_REGEX_SUFFIX)\n ],\n [PALE_MOON]: [\n new RegExp('PaleMoon\\\\/' + BROWSER_VERSION_REGEX_SUFFIX)\n ],\n [WATERFOX]: [\n new RegExp(WATERFOX + '\\\\/' + BROWSER_VERSION_REGEX_SUFFIX)\n ],\n [INTERNET_EXPLORER]: [\n new RegExp('(rv:|MSIE )' + BROWSER_VERSION_REGEX_SUFFIX)\n ],\n Mozilla: [\n new RegExp('rv:' + BROWSER_VERSION_REGEX_SUFFIX)\n ]\n};\nconst detectBrowserVersion = function(userAgent, vendor, hints) {\n const browser = detectBrowser(userAgent, vendor, hints);\n const regexes = versionRegexes[browser];\n if (isUndefined(regexes)) return null;\n for(let i = 0; i < regexes.length; i++){\n const regex = regexes[i];\n const matches = userAgent.match(regex);\n if (matches) return parseFloat(matches[matches.length - 2]);\n }\n return null;\n};\nconst osMatchers = [\n [\n new RegExp(XBOX + '; ' + XBOX + ' (.*?)[);]', 'i'),\n (match)=>[\n XBOX,\n match && match[1] || ''\n ]\n ],\n [\n new RegExp(NINTENDO, 'i'),\n [\n NINTENDO,\n ''\n ]\n ],\n [\n new RegExp(PLAYSTATION, 'i'),\n [\n PLAYSTATION,\n ''\n ]\n ],\n [\n BLACKBERRY_REGEX,\n [\n BLACKBERRY,\n ''\n ]\n ],\n [\n new RegExp(WINDOWS, 'i'),\n (_, user_agent)=>{\n if (/Phone/.test(user_agent) || /WPDesktop/.test(user_agent)) return [\n WINDOWS_PHONE,\n ''\n ];\n if (new RegExp(MOBILE).test(user_agent) && !/IEMobile\\b/.test(user_agent)) return [\n WINDOWS + ' ' + MOBILE,\n ''\n ];\n const match = /Windows NT ([0-9.]+)/i.exec(user_agent);\n if (match && match[1]) {\n const version = match[1];\n let osVersion = windowsVersionMap[version] || '';\n if (/arm/i.test(user_agent)) osVersion = 'RT';\n return [\n WINDOWS,\n osVersion\n ];\n }\n return [\n WINDOWS,\n ''\n ];\n }\n ],\n [\n /((iPhone|iPad|iPod).*?OS (\\d+)_(\\d+)_?(\\d+)?|iPhone)/,\n (match)=>{\n if (match && match[3]) {\n const versionParts = [\n match[3],\n match[4],\n match[5] || '0'\n ];\n return [\n IOS,\n versionParts.join('.')\n ];\n }\n return [\n IOS,\n ''\n ];\n }\n ],\n [\n /(watch.*\\/(\\d+\\.\\d+\\.\\d+)|watch os,(\\d+\\.\\d+),)/i,\n (match)=>{\n let version = '';\n if (match && match.length >= 3) version = isUndefined(match[2]) ? match[3] : match[2];\n return [\n 'watchOS',\n version\n ];\n }\n ],\n [\n new RegExp('(' + ANDROID + ' (\\\\d+)\\\\.(\\\\d+)\\\\.?(\\\\d+)?|' + ANDROID + ')', 'i'),\n (match)=>{\n if (match && match[2]) {\n const versionParts = [\n match[2],\n match[3],\n match[4] || '0'\n ];\n return [\n ANDROID,\n versionParts.join('.')\n ];\n }\n return [\n ANDROID,\n ''\n ];\n }\n ],\n [\n /Mac OS X (\\d+)[_.](\\d+)[_.]?(\\d+)?/i,\n (match)=>{\n const result = [\n 'Mac OS X',\n ''\n ];\n if (match && match[1]) {\n const versionParts = [\n match[1],\n match[2],\n match[3] || '0'\n ];\n result[1] = versionParts.join('.');\n }\n return result;\n }\n ],\n [\n /Mac/i,\n [\n 'Mac OS X',\n ''\n ]\n ],\n [\n /CrOS/,\n [\n CHROME_OS,\n ''\n ]\n ],\n [\n /Linux|debian/i,\n [\n 'Linux',\n ''\n ]\n ]\n];\nconst detectOS = function(user_agent) {\n for(let i = 0; i < osMatchers.length; i++){\n const [rgex, resultOrFn] = osMatchers[i];\n const match = rgex.exec(user_agent);\n const result = match && (isFunction(resultOrFn) ? resultOrFn(match, user_agent) : resultOrFn);\n if (result) return result;\n }\n return [\n '',\n ''\n ];\n};\nconst detectDevice = function(user_agent) {\n if (NINTENDO_REGEX.test(user_agent)) return NINTENDO;\n if (PLAYSTATION_REGEX.test(user_agent)) return PLAYSTATION;\n if (XBOX_REGEX.test(user_agent)) return XBOX;\n if (new RegExp(OUYA, 'i').test(user_agent)) return OUYA;\n if (new RegExp('(' + WINDOWS_PHONE + '|WPDesktop)', 'i').test(user_agent)) return WINDOWS_PHONE;\n else if (/iPad/.test(user_agent)) return IPAD;\n else if (/iPod/.test(user_agent)) return 'iPod Touch';\n else if (/iPhone/.test(user_agent)) return 'iPhone';\n else if (/(watch)(?: ?os[,/]|\\d,\\d\\/)[\\d.]+/i.test(user_agent)) return APPLE_WATCH;\n else if (BLACKBERRY_REGEX.test(user_agent)) return BLACKBERRY;\n else if (/(kobo)\\s(ereader|touch)/i.test(user_agent)) return 'Kobo';\n else if (new RegExp(NOKIA, 'i').test(user_agent)) return NOKIA;\n else if (/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\\))/i.test(user_agent) || /(kf[a-z]+)( bui|\\)).+silk\\//i.test(user_agent)) return 'Kindle Fire';\n else if (/(Android|ZTE)/i.test(user_agent)) if (!(!new RegExp(MOBILE).test(user_agent) || /(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(user_agent))) return ANDROID;\n else {\n if (/pixel[\\daxl ]{1,6}/i.test(user_agent) && !/pixel c/i.test(user_agent) || /(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(user_agent) || /lmy47v/i.test(user_agent) && !/QTAQZ3/i.test(user_agent)) return ANDROID;\n return ANDROID_TABLET;\n }\n else if (new RegExp('(pda|' + MOBILE + ')', 'i').test(user_agent)) return GENERIC_MOBILE;\n else if (new RegExp(TABLET, 'i').test(user_agent) && !new RegExp(TABLET + ' pc', 'i').test(user_agent)) return GENERIC_TABLET;\n else return '';\n};\nconst detectDeviceType = function(user_agent, options) {\n const device = detectDevice(user_agent);\n if (device === IPAD || device === ANDROID_TABLET || 'Kobo' === device || 'Kindle Fire' === device || device === GENERIC_TABLET) return TABLET;\n if (device === NINTENDO || device === XBOX || device === PLAYSTATION || device === OUYA) return 'Console';\n if (device === APPLE_WATCH) return 'Wearable';\n if (device) return MOBILE;\n if (options?.userAgentDataPlatform === 'Android' && (options?.maxTouchPoints ?? 0) > 0) {\n const shortSide = Math.min(options?.screenWidth ?? 0, options?.screenHeight ?? 0);\n const shortSideDp = shortSide / (options?.devicePixelRatio ?? 1);\n return shortSideDp >= 600 ? TABLET : MOBILE;\n }\n return 'Desktop';\n};\nexport { detectBrowser, detectBrowserVersion, detectDevice, detectDeviceType, detectOS };\n","export * from \"./bot-detection.mjs\";\nexport * from \"./bucketed-rate-limiter.mjs\";\nexport * from \"./number-utils.mjs\";\nexport * from \"./string-utils.mjs\";\nexport * from \"./type-utils.mjs\";\nexport * from \"./promise-queue.mjs\";\nexport * from \"./logger.mjs\";\nexport * from \"./user-agent-utils.mjs\";\nconst STRING_FORMAT = 'utf8';\nfunction assert(truthyValue, message) {\n if (!truthyValue || 'string' != typeof truthyValue || isEmpty(truthyValue)) throw new Error(message);\n}\nfunction isEmpty(truthyValue) {\n if (0 === truthyValue.trim().length) return true;\n return false;\n}\nfunction removeTrailingSlash(url) {\n return url?.replace(/\\/+$/, '');\n}\nasync function retriable(fn, props) {\n let lastError = null;\n for(let i = 0; i < props.retryCount + 1; i++){\n if (i > 0) await new Promise((r)=>setTimeout(r, props.retryDelay));\n try {\n const res = await fn();\n return res;\n } catch (e) {\n lastError = e;\n if (!props.retryCheck(e)) throw e;\n }\n }\n throw lastError;\n}\nfunction currentTimestamp() {\n return new Date().getTime();\n}\nfunction currentISOTime() {\n return new Date().toISOString();\n}\nfunction safeSetTimeout(fn, timeout) {\n const t = setTimeout(fn, timeout);\n t?.unref && t?.unref();\n return t;\n}\nconst isPromise = (obj)=>obj && 'function' == typeof obj.then;\nconst isError = (x)=>x instanceof Error;\nfunction getFetch() {\n return 'undefined' != typeof fetch ? fetch : void 0 !== globalThis.fetch ? globalThis.fetch : void 0;\n}\nfunction allSettled(promises) {\n return Promise.all(promises.map((p)=>(p ?? Promise.resolve()).then((value)=>({\n status: 'fulfilled',\n value\n }), (reason)=>({\n status: 'rejected',\n reason\n }))));\n}\nexport { STRING_FORMAT, allSettled, assert, currentISOTime, currentTimestamp, getFetch, isError, isPromise, removeTrailingSlash, retriable, safeSetTimeout };\n","import { isArray, isBoolean, isNull, isUndefined } from \"../utils/index.mjs\";\nconst OTLP_SEVERITY_MAP = {\n trace: {\n text: 'TRACE',\n number: 1\n },\n debug: {\n text: 'DEBUG',\n number: 5\n },\n info: {\n text: 'INFO',\n number: 9\n },\n warn: {\n text: 'WARN',\n number: 13\n },\n error: {\n text: 'ERROR',\n number: 17\n },\n fatal: {\n text: 'FATAL',\n number: 21\n }\n};\nconst DEFAULT_OTLP_SEVERITY = OTLP_SEVERITY_MAP.info;\nfunction getOtlpSeverityText(level) {\n return (OTLP_SEVERITY_MAP[level] || DEFAULT_OTLP_SEVERITY).text;\n}\nfunction getOtlpSeverityNumber(level) {\n return (OTLP_SEVERITY_MAP[level] || DEFAULT_OTLP_SEVERITY).number;\n}\nfunction toOtlpAnyValue(value) {\n if (isBoolean(value)) return {\n boolValue: value\n };\n if ('number' == typeof value) {\n if (!Number.isFinite(value)) return {\n stringValue: String(value)\n };\n if (Number.isInteger(value)) return {\n intValue: value\n };\n return {\n doubleValue: value\n };\n }\n if ('string' == typeof value) return {\n stringValue: value\n };\n if (isArray(value)) return {\n arrayValue: {\n values: value.map((v)=>toOtlpAnyValue(v))\n }\n };\n try {\n return {\n stringValue: JSON.stringify(value)\n };\n } catch {\n return {\n stringValue: String(value)\n };\n }\n}\nfunction toOtlpKeyValueList(attrs) {\n const result = [];\n for(const key in attrs){\n const value = attrs[key];\n if (!(isNull(value) || isUndefined(value))) result.push({\n key,\n value: toOtlpAnyValue(value)\n });\n }\n return result;\n}\nfunction timestampToUnixNano() {\n return String(Date.now()) + '000000';\n}\nfunction buildOtlpLogRecord(options, sdkContext) {\n const level = options.level || 'info';\n const { text: severityText, number: severityNumber } = OTLP_SEVERITY_MAP[level] || DEFAULT_OTLP_SEVERITY;\n const now = timestampToUnixNano();\n const autoAttributes = {};\n if (sdkContext.distinctId) autoAttributes.posthogDistinctId = sdkContext.distinctId;\n if (sdkContext.sessionId) autoAttributes.sessionId = sdkContext.sessionId;\n if (sdkContext.currentUrl) autoAttributes['url.full'] = sdkContext.currentUrl;\n if (sdkContext.screenName) autoAttributes['screen.name'] = sdkContext.screenName;\n if (sdkContext.appState) autoAttributes['app.state'] = sdkContext.appState;\n if (sdkContext.activeFeatureFlags && sdkContext.activeFeatureFlags.length > 0) autoAttributes.feature_flags = sdkContext.activeFeatureFlags;\n const mergedAttributes = {\n ...autoAttributes,\n ...options.attributes || {}\n };\n const record = {\n timeUnixNano: now,\n observedTimeUnixNano: now,\n severityNumber,\n severityText,\n body: {\n stringValue: options.body\n },\n attributes: toOtlpKeyValueList(mergedAttributes)\n };\n if (options.trace_id) record.traceId = options.trace_id;\n if (options.span_id) record.spanId = options.span_id;\n if (!isUndefined(options.trace_flags)) record.flags = options.trace_flags;\n return record;\n}\nfunction buildOtlpLogsPayload(logRecords, resourceAttributes, scopeName, scopeVersion) {\n return {\n resourceLogs: [\n {\n resource: {\n attributes: toOtlpKeyValueList(resourceAttributes)\n },\n scopeLogs: [\n {\n scope: {\n name: scopeName,\n version: scopeVersion\n },\n logRecords\n }\n ]\n }\n ]\n };\n}\nexport { buildOtlpLogRecord, buildOtlpLogsPayload, getOtlpSeverityNumber, getOtlpSeverityText, toOtlpAnyValue, toOtlpKeyValueList };\n","class SimpleEventEmitter {\n constructor(){\n this.events = {};\n this.events = {};\n }\n on(event, listener) {\n if (!this.events[event]) this.events[event] = [];\n this.events[event].push(listener);\n return ()=>{\n this.events[event] = this.events[event].filter((x)=>x !== listener);\n };\n }\n emit(event, payload) {\n for (const listener of this.events[event] || [])listener(payload);\n for (const listener of this.events['*'] || [])listener(event, payload);\n }\n}\nexport { SimpleEventEmitter };\n","let parsedStackResults;\nlet lastKeysCount;\nlet cachedFilenameChunkIds;\nfunction getFilenameToChunkIdMap(stackParser) {\n const chunkIdMap = globalThis._posthogChunkIds;\n if (!chunkIdMap) return;\n const chunkIdKeys = Object.keys(chunkIdMap);\n if (cachedFilenameChunkIds && chunkIdKeys.length === lastKeysCount) return cachedFilenameChunkIds;\n lastKeysCount = chunkIdKeys.length;\n cachedFilenameChunkIds = chunkIdKeys.reduce((acc, stackKey)=>{\n if (!parsedStackResults) parsedStackResults = {};\n const result = parsedStackResults[stackKey];\n if (result) acc[result[0]] = result[1];\n else {\n const parsedStack = stackParser(stackKey);\n for(let i = parsedStack.length - 1; i >= 0; i--){\n const stackFrame = parsedStack[i];\n const filename = stackFrame?.filename;\n const chunkId = chunkIdMap[stackKey];\n if (filename && chunkId) {\n acc[filename] = chunkId;\n parsedStackResults[stackKey] = [\n filename,\n chunkId\n ];\n break;\n }\n }\n }\n return acc;\n }, {});\n return cachedFilenameChunkIds;\n}\nexport { getFilenameToChunkIdMap };\n","import { isArray } from \"../utils/index.mjs\";\nimport { getFilenameToChunkIdMap } from \"./chunk-ids.mjs\";\nconst MAX_CAUSE_RECURSION = 4;\nclass ErrorPropertiesBuilder {\n constructor(coercers, stackParser, modifiers = []){\n this.coercers = coercers;\n this.stackParser = stackParser;\n this.modifiers = modifiers;\n }\n buildFromUnknown(input, hint = {}) {\n const providedMechanism = hint && hint.mechanism;\n const mechanism = providedMechanism || {\n handled: true,\n type: 'generic'\n };\n const coercingContext = this.buildCoercingContext(mechanism, hint, 0);\n const exceptionWithCause = coercingContext.apply(input);\n const parsingContext = this.buildParsingContext(hint);\n const exceptionWithStack = this.parseStacktrace(exceptionWithCause, parsingContext);\n const exceptionList = this.convertToExceptionList(exceptionWithStack, mechanism);\n return {\n $exception_list: exceptionList,\n $exception_level: 'error'\n };\n }\n async modifyFrames(exceptionList) {\n for (const exc of exceptionList)if (exc.stacktrace && exc.stacktrace.frames && isArray(exc.stacktrace.frames)) exc.stacktrace.frames = await this.applyModifiers(exc.stacktrace.frames);\n return exceptionList;\n }\n coerceFallback(ctx) {\n return {\n type: 'Error',\n value: 'Unknown error',\n stack: ctx.syntheticException?.stack,\n synthetic: true\n };\n }\n parseStacktrace(err, ctx) {\n let cause;\n if (null != err.cause) cause = this.parseStacktrace(err.cause, ctx);\n let stack;\n if ('' != err.stack && null != err.stack) stack = this.applyChunkIds(this.stackParser(err.stack, err.synthetic ? ctx.skipFirstLines : 0), ctx.chunkIdMap);\n return {\n ...err,\n cause,\n stack\n };\n }\n applyChunkIds(frames, chunkIdMap) {\n return frames.map((frame)=>{\n if (frame.filename && chunkIdMap) frame.chunk_id = chunkIdMap[frame.filename];\n return frame;\n });\n }\n applyCoercers(input, ctx) {\n for (const adapter of this.coercers)if (adapter.match(input)) return adapter.coerce(input, ctx);\n return this.coerceFallback(ctx);\n }\n async applyModifiers(frames) {\n let newFrames = frames;\n for (const modifier of this.modifiers)newFrames = await modifier(newFrames);\n return newFrames;\n }\n convertToExceptionList(exceptionWithStack, mechanism) {\n const currentException = {\n type: exceptionWithStack.type,\n value: exceptionWithStack.value,\n mechanism: {\n type: mechanism.type ?? 'generic',\n handled: mechanism.handled ?? true,\n synthetic: exceptionWithStack.synthetic ?? false\n }\n };\n if (exceptionWithStack.stack) currentException.stacktrace = {\n type: 'raw',\n frames: exceptionWithStack.stack\n };\n const exceptionList = [\n currentException\n ];\n if (null != exceptionWithStack.cause) exceptionList.push(...this.convertToExceptionList(exceptionWithStack.cause, {\n ...mechanism,\n handled: true\n }));\n return exceptionList;\n }\n buildParsingContext(hint) {\n const context = {\n chunkIdMap: getFilenameToChunkIdMap(this.stackParser),\n skipFirstLines: hint.skipFirstLines ?? 1\n };\n return context;\n }\n buildCoercingContext(mechanism, hint, depth = 0) {\n const coerce = (input, depth)=>{\n if (!(depth <= MAX_CAUSE_RECURSION)) return;\n {\n const ctx = this.buildCoercingContext(mechanism, hint, depth);\n return this.applyCoercers(input, ctx);\n }\n };\n const context = {\n ...hint,\n syntheticException: 0 == depth ? hint.syntheticException : void 0,\n mechanism,\n apply: (input)=>coerce(input, depth),\n next: (input)=>coerce(input, depth + 1)\n };\n return context;\n }\n}\nexport { ErrorPropertiesBuilder };\n","import { isUndefined } from \"../../utils/index.mjs\";\nconst UNKNOWN_FUNCTION = '?';\nfunction createFrame(platform, filename, func, lineno, colno) {\n const frame = {\n platform,\n filename,\n function: '<anonymous>' === func ? UNKNOWN_FUNCTION : func,\n in_app: true\n };\n if (!isUndefined(lineno)) frame.lineno = lineno;\n if (!isUndefined(colno)) frame.colno = colno;\n return frame;\n}\nexport { UNKNOWN_FUNCTION, createFrame };\n","import { UNKNOWN_FUNCTION } from \"./base.mjs\";\nconst extractSafariExtensionDetails = (func, filename)=>{\n const isSafariExtension = -1 !== func.indexOf('safari-extension');\n const isSafariWebExtension = -1 !== func.indexOf('safari-web-extension');\n return isSafariExtension || isSafariWebExtension ? [\n -1 !== func.indexOf('@') ? func.split('@')[0] : UNKNOWN_FUNCTION,\n isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}`\n ] : [\n func,\n filename\n ];\n};\nexport { extractSafariExtensionDetails };\n","import { UNKNOWN_FUNCTION, createFrame } from \"./base.mjs\";\nimport { extractSafariExtensionDetails } from \"./safari.mjs\";\nconst chromeRegexNoFnName = /^\\s*at (\\S+?)(?::(\\d+))(?::(\\d+))\\s*$/i;\nconst chromeRegex = /^\\s*at (?:(.+?\\)(?: \\[.+\\])?|.*?) ?\\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\\/)?.*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\nconst chromeEvalRegex = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\nconst chromeStackLineParser = (line, platform)=>{\n const noFnParts = chromeRegexNoFnName.exec(line);\n if (noFnParts) {\n const [, filename, line, col] = noFnParts;\n return createFrame(platform, filename, UNKNOWN_FUNCTION, +line, +col);\n }\n const parts = chromeRegex.exec(line);\n if (parts) {\n const isEval = parts[2] && 0 === parts[2].indexOf('eval');\n if (isEval) {\n const subMatch = chromeEvalRegex.exec(parts[2]);\n if (subMatch) {\n parts[2] = subMatch[1];\n parts[3] = subMatch[2];\n parts[4] = subMatch[3];\n }\n }\n const [func, filename] = extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]);\n return createFrame(platform, filename, func, parts[3] ? +parts[3] : void 0, parts[4] ? +parts[4] : void 0);\n }\n};\nexport { chromeStackLineParser };\n","import { UNKNOWN_FUNCTION, createFrame } from \"./base.mjs\";\nimport { extractSafariExtensionDetails } from \"./safari.mjs\";\nconst geckoREgex = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)?((?:[-a-z]+)?:\\/.*?|\\[native code\\]|[^@]*(?:bundle|\\d+\\.js)|\\/[\\w\\-. /=]+)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nconst geckoEvalRegex = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\nconst geckoStackLineParser = (line, platform)=>{\n const parts = geckoREgex.exec(line);\n if (parts) {\n const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n if (isEval) {\n const subMatch = geckoEvalRegex.exec(parts[3]);\n if (subMatch) {\n parts[1] = parts[1] || 'eval';\n parts[3] = subMatch[1];\n parts[4] = subMatch[2];\n parts[5] = '';\n }\n }\n let filename = parts[3];\n let func = parts[1] || UNKNOWN_FUNCTION;\n [func, filename] = extractSafariExtensionDetails(func, filename);\n return createFrame(platform, filename, func, parts[4] ? +parts[4] : void 0, parts[5] ? +parts[5] : void 0);\n }\n};\nexport { geckoStackLineParser };\n","import { UNKNOWN_FUNCTION } from \"./base.mjs\";\nconst FILENAME_MATCH = /^\\s*[-]{4,}$/;\nconst FULL_MATCH = /at (?:async )?(?:(.+?)\\s+\\()?(?:(.+):(\\d+):(\\d+)?|([^)]+))\\)?/;\nconst nodeStackLineParser = (line, platform)=>{\n const lineMatch = line.match(FULL_MATCH);\n if (lineMatch) {\n let object;\n let method;\n let functionName;\n let typeName;\n let methodName;\n if (lineMatch[1]) {\n functionName = lineMatch[1];\n let methodStart = functionName.lastIndexOf('.');\n if ('.' === functionName[methodStart - 1]) methodStart--;\n if (methodStart > 0) {\n object = functionName.slice(0, methodStart);\n method = functionName.slice(methodStart + 1);\n const objectEnd = object.indexOf('.Module');\n if (objectEnd > 0) {\n functionName = functionName.slice(objectEnd + 1);\n object = object.slice(0, objectEnd);\n }\n }\n typeName = void 0;\n }\n if (method) {\n typeName = object;\n methodName = method;\n }\n if ('<anonymous>' === method) {\n methodName = void 0;\n functionName = void 0;\n }\n if (void 0 === functionName) {\n methodName = methodName || UNKNOWN_FUNCTION;\n functionName = typeName ? `${typeName}.${methodName}` : methodName;\n }\n let filename = lineMatch[2]?.startsWith('file://') ? lineMatch[2].slice(7) : lineMatch[2];\n const isNative = 'native' === lineMatch[5];\n if (filename?.match(/\\/[A-Z]:/)) filename = filename.slice(1);\n if (!filename && lineMatch[5] && !isNative) filename = lineMatch[5];\n return {\n filename: filename ? decodeURI(filename) : void 0,\n module: void 0,\n function: functionName,\n lineno: _parseIntOrUndefined(lineMatch[3]),\n colno: _parseIntOrUndefined(lineMatch[4]),\n in_app: filenameIsInApp(filename || '', isNative),\n platform: platform\n };\n }\n if (line.match(FILENAME_MATCH)) return {\n filename: line,\n platform: platform\n };\n};\nfunction filenameIsInApp(filename, isNative = false) {\n const isInternal = isNative || filename && !filename.startsWith('/') && !filename.match(/^[A-Z]:/) && !filename.startsWith('.') && !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\\-+])*:\\/\\//);\n return !isInternal && void 0 !== filename && !filename.includes('node_modules/');\n}\nfunction _parseIntOrUndefined(input) {\n return parseInt(input || '', 10) || void 0;\n}\nexport { nodeStackLineParser };\n","import { UNKNOWN_FUNCTION } from \"./base.mjs\";\nimport { chromeStackLineParser } from \"./chrome.mjs\";\nimport { geckoStackLineParser } from \"./gecko.mjs\";\nimport { winjsStackLineParser } from \"./winjs.mjs\";\nimport { opera10StackLineParser, opera11StackLineParser } from \"./opera.mjs\";\nimport { nodeStackLineParser } from \"./node.mjs\";\nconst WEBPACK_ERROR_REGEXP = /\\(error: (.*)\\)/;\nconst STACKTRACE_FRAME_LIMIT = 50;\nfunction reverseAndStripFrames(stack) {\n if (!stack.length) return [];\n const localStack = Array.from(stack);\n localStack.reverse();\n return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map((frame)=>({\n ...frame,\n filename: frame.filename || getLastStackFrame(localStack).filename,\n function: frame.function || UNKNOWN_FUNCTION\n }));\n}\nfunction getLastStackFrame(arr) {\n return arr[arr.length - 1] || {};\n}\nfunction createDefaultStackParser() {\n return createStackParser(\"web:javascript\", chromeStackLineParser, geckoStackLineParser);\n}\nfunction createStackParser(platform, ...parsers) {\n return (stack, skipFirstLines = 0)=>{\n const frames = [];\n const lines = stack.split('\\n');\n for(let i = skipFirstLines; i < lines.length; i++){\n const line = lines[i];\n if (line.length > 1024) continue;\n const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, '$1') : line;\n if (!cleanedLine.match(/\\S*Error: /)) {\n for (const parser of parsers){\n const frame = parser(cleanedLine, platform);\n if (frame) {\n frames.push(frame);\n break;\n }\n }\n if (frames.length >= STACKTRACE_FRAME_LIMIT) break;\n }\n }\n return reverseAndStripFrames(frames);\n };\n}\nexport { chromeStackLineParser, createDefaultStackParser, createStackParser, geckoStackLineParser, nodeStackLineParser, opera10StackLineParser, opera11StackLineParser, reverseAndStripFrames, winjsStackLineParser };\n","import { isPlainError } from \"../../utils/index.mjs\";\nclass ErrorCoercer {\n match(err) {\n return isPlainError(err);\n }\n coerce(err, ctx) {\n return {\n type: this.getType(err),\n value: this.getMessage(err, ctx),\n stack: this.getStack(err),\n cause: err.cause ? ctx.next(err.cause) : void 0,\n synthetic: false\n };\n }\n getType(err) {\n return err.name || err.constructor.name;\n }\n getMessage(err, _ctx) {\n const message = err.message;\n if (message.error && 'string' == typeof message.error.message) return String(message.error.message);\n return String(message);\n }\n getStack(err) {\n return err.stacktrace || err.stack || void 0;\n }\n}\nexport { ErrorCoercer };\n","const ERROR_TYPES_PATTERN = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;\nclass StringCoercer {\n match(input) {\n return 'string' == typeof input;\n }\n coerce(input, ctx) {\n const [type, value] = this.getInfos(input);\n return {\n type: type ?? 'Error',\n value: value ?? input,\n stack: ctx.syntheticException?.stack,\n synthetic: true\n };\n }\n getInfos(candidate) {\n let type = 'Error';\n let value = candidate;\n const groups = candidate.match(ERROR_TYPES_PATTERN);\n if (groups) {\n type = groups[1];\n value = groups[2];\n }\n return [\n type,\n value\n ];\n }\n}\nexport { StringCoercer };\n","const severityLevels = [\n 'fatal',\n 'error',\n 'warning',\n 'log',\n 'info',\n 'debug'\n];\nexport { severityLevels };\n","function truncate(str, max = 0) {\n if ('string' != typeof str || 0 === max) return str;\n return str.length <= max ? str : `${str.slice(0, max)}...`;\n}\nfunction extractExceptionKeysForMessage(err, maxLength = 40) {\n const keys = Object.keys(err);\n keys.sort();\n if (!keys.length) return '[object has no keys]';\n for(let i = keys.length; i > 0; i--){\n const serialized = keys.slice(0, i).join(', ');\n if (!(serialized.length > maxLength)) {\n if (i === keys.length) return serialized;\n return serialized.length <= maxLength ? serialized : `${serialized.slice(0, maxLength)}...`;\n }\n }\n return '';\n}\nexport { extractExceptionKeysForMessage, truncate };\n","import { isEmptyString, isError, isEvent, isString } from \"../../utils/index.mjs\";\nimport { severityLevels } from \"../types.mjs\";\nimport { extractExceptionKeysForMessage } from \"./utils.mjs\";\nclass ObjectCoercer {\n match(candidate) {\n return 'object' == typeof candidate && null !== candidate;\n }\n coerce(candidate, ctx) {\n const errorProperty = this.getErrorPropertyFromObject(candidate);\n if (errorProperty) return ctx.apply(errorProperty);\n return {\n type: this.getType(candidate),\n value: this.getValue(candidate),\n stack: ctx.syntheticException?.stack,\n level: this.isSeverityLevel(candidate.level) ? candidate.level : 'error',\n synthetic: true\n };\n }\n getType(err) {\n return isEvent(err) ? err.constructor.name : 'Error';\n }\n getValue(err) {\n if ('name' in err && 'string' == typeof err.name) {\n let message = `'${err.name}' captured as exception`;\n if ('message' in err && 'string' == typeof err.message) message += ` with message: '${err.message}'`;\n return message;\n }\n if ('message' in err && 'string' == typeof err.message) return err.message;\n const className = this.getObjectClassName(err);\n const keys = extractExceptionKeysForMessage(err);\n return `${className && 'Object' !== className ? `'${className}'` : 'Object'} captured as exception with keys: ${keys}`;\n }\n isSeverityLevel(x) {\n return isString(x) && !isEmptyString(x) && severityLevels.indexOf(x) >= 0;\n }\n getErrorPropertyFromObject(obj) {\n for(const prop in obj)if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n const value = obj[prop];\n if (isError(value)) return value;\n }\n }\n getObjectClassName(obj) {\n try {\n const prototype = Object.getPrototypeOf(obj);\n return prototype ? prototype.constructor.name : void 0;\n } catch (e) {\n return;\n }\n }\n}\nexport { ObjectCoercer };\n","import { isEvent } from \"../../utils/index.mjs\";\nimport { extractExceptionKeysForMessage } from \"./utils.mjs\";\nclass EventCoercer {\n match(err) {\n return isEvent(err);\n }\n coerce(evt, ctx) {\n const constructorName = evt.constructor.name;\n return {\n type: constructorName,\n value: `${constructorName} captured as exception with keys: ${extractExceptionKeysForMessage(evt)}`,\n stack: ctx.syntheticException?.stack,\n synthetic: true\n };\n }\n}\nexport { EventCoercer };\n","import { isPrimitive } from \"../../utils/index.mjs\";\nclass PrimitiveCoercer {\n match(candidate) {\n return isPrimitive(candidate);\n }\n coerce(value, ctx) {\n return {\n type: 'Error',\n value: `Primitive value captured as exception: ${String(value)}`,\n stack: ctx.syntheticException?.stack,\n synthetic: true\n };\n }\n}\nexport { PrimitiveCoercer };\n","class ReduceableCache {\n constructor(_maxSize){\n this._maxSize = _maxSize;\n this._cache = new Map();\n }\n get(key) {\n const value = this._cache.get(key);\n if (void 0 === value) return;\n this._cache.delete(key);\n this._cache.set(key, value);\n return value;\n }\n set(key, value) {\n this._cache.set(key, value);\n }\n reduce() {\n while(this._cache.size >= this._maxSize){\n const value = this._cache.keys().next().value;\n if (value) this._cache.delete(value);\n }\n }\n}\nexport { ReduceableCache };\n","import { isNumber, isObject, isString } from \"../utils/index.mjs\";\nconst EXCEPTION_STEP_INTERNAL_FIELDS = {\n MESSAGE: '$message',\n TIMESTAMP: '$timestamp'\n};\nconst RESERVED_EXCEPTION_STEP_KEYS = new Set([\n EXCEPTION_STEP_INTERNAL_FIELDS.MESSAGE,\n EXCEPTION_STEP_INTERNAL_FIELDS.TIMESTAMP\n]);\nconst DEFAULT_EXCEPTION_STEPS_CONFIG = {\n enabled: true,\n max_bytes: 32768\n};\nfunction resolveExceptionStepsConfig(config) {\n if (!config) return {\n ...DEFAULT_EXCEPTION_STEPS_CONFIG\n };\n return {\n enabled: config.enabled ?? DEFAULT_EXCEPTION_STEPS_CONFIG.enabled,\n max_bytes: normalizePositiveInteger(config.max_bytes, DEFAULT_EXCEPTION_STEPS_CONFIG.max_bytes)\n };\n}\nfunction stripReservedExceptionStepFields(properties) {\n if (!properties) return {\n sanitizedProperties: {},\n droppedKeys: []\n };\n const droppedKeys = [];\n const sanitizedProperties = Object.keys(properties).reduce((acc, key)=>{\n if (RESERVED_EXCEPTION_STEP_KEYS.has(key)) {\n droppedKeys.push(key);\n return acc;\n }\n acc[key] = properties[key];\n return acc;\n }, {});\n return {\n sanitizedProperties,\n droppedKeys\n };\n}\nclass ExceptionStepsBuffer {\n constructor(config){\n this._entries = [];\n this._totalBytes = 0;\n this._config = resolveExceptionStepsConfig(config);\n }\n setConfig(config) {\n this._config = resolveExceptionStepsConfig(config);\n this._trimToMaxBytes();\n }\n add(step) {\n const serialized = normalizeAndSerializeStep(step);\n if (!serialized) return;\n const bytes = getUtf8ByteLength(serialized.json);\n if (bytes > this._config.max_bytes) return;\n this._entries.push({\n step: serialized.step,\n bytes\n });\n this._totalBytes += bytes;\n this._trimToMaxBytes();\n }\n getAttachable() {\n return this._entries.map((e)=>e.step);\n }\n clear() {\n this._entries = [];\n this._totalBytes = 0;\n }\n size() {\n return this._entries.length;\n }\n _trimToMaxBytes() {\n while(this._totalBytes > this._config.max_bytes && this._entries.length > 0){\n const evicted = this._entries.shift();\n if (evicted) this._totalBytes -= evicted.bytes;\n }\n }\n}\nfunction normalizePositiveInteger(input, fallback) {\n if (!isNumber(input) || input === 1 / 0 || input === -1 / 0) return fallback;\n const normalized = Math.floor(input);\n if (normalized < 0) return fallback;\n return normalized;\n}\nfunction normalizeAndSerializeStep(step) {\n const json = safeStringify(step);\n if (!json) return;\n try {\n const parsed = JSON.parse(json);\n if (!isObject(parsed)) return;\n const parsedStep = parsed;\n const message = parsedStep[EXCEPTION_STEP_INTERNAL_FIELDS.MESSAGE];\n const timestamp = parsedStep[EXCEPTION_STEP_INTERNAL_FIELDS.TIMESTAMP];\n if (!isString(message) || 0 === message.trim().length) return;\n if (!isString(timestamp) && !isNumber(timestamp)) return;\n return {\n step: parsedStep,\n json\n };\n } catch {\n return;\n }\n}\nfunction safeStringify(value) {\n const seen = new WeakSet();\n try {\n return JSON.stringify(value, (_key, replacementValue)=>{\n if ('bigint' == typeof replacementValue) return replacementValue.toString();\n if ('function' == typeof replacementValue || 'symbol' == typeof replacementValue) return;\n if (replacementValue instanceof Date) return replacementValue.toISOString();\n if (replacementValue instanceof Error) return {\n name: replacementValue.name,\n message: replacementValue.message,\n stack: replacementValue.stack\n };\n if (replacementValue && 'object' == typeof replacementValue) {\n if (seen.has(replacementValue)) return '[Circular]';\n seen.add(replacementValue);\n }\n return replacementValue;\n });\n } catch {\n return;\n }\n}\nfunction getUtf8ByteLength(value) {\n if ('undefined' != typeof TextEncoder) return new TextEncoder().encode(value).length;\n const encoded = encodeURIComponent(value);\n let byteLength = 0;\n for(let i = 0; i < encoded.length; i++)if ('%' === encoded[i]) {\n byteLength += 1;\n i += 2;\n } else byteLength += 1;\n return byteLength;\n}\nexport { DEFAULT_EXCEPTION_STEPS_CONFIG, EXCEPTION_STEP_INTERNAL_FIELDS, ExceptionStepsBuffer, getUtf8ByteLength, resolveExceptionStepsConfig, stripReservedExceptionStepFields };\n","import { SimpleEventEmitter } from \"./eventemitter.mjs\";\nimport { getFeatureFlagValue, normalizeFlagsResponse } from \"./featureFlagUtils.mjs\";\nimport { gzipCompress, isGzipSupported } from \"./gzip.mjs\";\nimport { PostHogPersistedProperty } from \"./types.mjs\";\nimport { PromiseQueue, STRING_FORMAT, allSettled, createLogger, currentISOTime, removeTrailingSlash, retriable, safeSetTimeout } from \"./utils/index.mjs\";\nimport { uuidv7 } from \"./vendor/uuidv7.mjs\";\nimport { ErrorCoercer, ErrorPropertiesBuilder, ObjectCoercer, PrimitiveCoercer, StringCoercer, createDefaultStackParser } from \"./error-tracking/index.mjs\";\nclass PostHogFetchHttpError extends Error {\n constructor(response, reqByteLength){\n super('HTTP error while fetching PostHog: status=' + response.status + ', reqByteLength=' + reqByteLength), this.response = response, this.reqByteLength = reqByteLength, this.name = 'PostHogFetchHttpError';\n }\n get status() {\n return this.response.status;\n }\n get text() {\n return this.response.text();\n }\n get json() {\n return this.response.json();\n }\n}\nclass PostHogFetchNetworkError extends Error {\n constructor(error){\n super('Network error while fetching PostHog', error instanceof Error ? {\n cause: error\n } : {}), this.error = error, this.name = 'PostHogFetchNetworkError';\n }\n}\nconst maybeAdd = (key, value)=>void 0 !== value ? {\n [key]: value\n } : {};\nasync function logFlushError(err) {\n if (err instanceof PostHogFetchHttpError) {\n let text = '';\n try {\n text = await err.text;\n } catch {}\n console.error(`Error while flushing PostHog: message=${err.message}, response body=${text}`, err);\n } else console.error('Error while flushing PostHog', err);\n return Promise.resolve();\n}\nfunction isPostHogFetchError(err) {\n return 'object' == typeof err && (err instanceof PostHogFetchHttpError || isPostHogFetchNetworkError(err));\n}\nfunction isPostHogFetchNetworkError(err) {\n return err instanceof PostHogFetchNetworkError;\n}\nfunction isPostHogFetchContentTooLargeError(err) {\n return 'object' == typeof err && err instanceof PostHogFetchHttpError && 413 === err.status;\n}\nvar posthog_core_stateless_QuotaLimitedFeature = /*#__PURE__*/ function(QuotaLimitedFeature) {\n QuotaLimitedFeature[\"FeatureFlags\"] = \"feature_flags\";\n QuotaLimitedFeature[\"Recordings\"] = \"recordings\";\n return QuotaLimitedFeature;\n}({});\nclass PostHogCoreStateless {\n getErrorPropertiesBuilder() {\n if (!this._errorPropertiesBuilder) this._errorPropertiesBuilder = this.createErrorPropertiesBuilder();\n return this._errorPropertiesBuilder;\n }\n createErrorPropertiesBuilder() {\n return new ErrorPropertiesBuilder([\n new ErrorCoercer(),\n new ObjectCoercer(),\n new StringCoercer(),\n new PrimitiveCoercer()\n ], createDefaultStackParser());\n }\n constructor(apiKey, options = {}){\n this.flushPromise = null;\n this.shutdownPromise = null;\n this.promiseQueue = new PromiseQueue();\n this._events = new SimpleEventEmitter();\n this._isInitialized = false;\n const normalizedApiKey = 'string' == typeof apiKey ? apiKey.trim() : '';\n const normalizedHost = 'string' == typeof options.host ? options.host.trim() : '';\n const missingApiKey = !normalizedApiKey;\n this._logger = createLogger('[PostHog]', this.logMsgIfDebug.bind(this));\n if (missingApiKey) this._logger.error(\"You must pass your PostHog project's api key. The client will be disabled.\");\n this.apiKey = normalizedApiKey;\n this.host = removeTrailingSlash(normalizedHost || 'https://us.i.posthog.com');\n this.flushAt = options.flushAt ? Math.max(options.flushAt, 1) : 20;\n this.maxBatchSize = Math.max(this.flushAt, options.maxBatchSize ?? 100);\n this.maxQueueSize = Math.max(this.flushAt, options.maxQueueSize ?? 1000);\n this.flushInterval = options.flushInterval ?? 10000;\n this.preloadFeatureFlags = options.preloadFeatureFlags ?? true;\n this.defaultOptIn = options.defaultOptIn ?? true;\n this.disableSurveys = options.disableSurveys ?? false;\n this._retryOptions = {\n retryCount: options.fetchRetryCount ?? 3,\n retryDelay: options.fetchRetryDelay ?? 3000,\n retryCheck: isPostHogFetchError\n };\n this.requestTimeout = options.requestTimeout ?? 10000;\n this.featureFlagsRequestTimeoutMs = options.featureFlagsRequestTimeoutMs ?? 3000;\n this.remoteConfigRequestTimeoutMs = options.remoteConfigRequestTimeoutMs ?? 3000;\n this.disableGeoip = options.disableGeoip ?? true;\n this.disabled = (options.disabled ?? false) || missingApiKey;\n this.historicalMigration = options?.historicalMigration ?? false;\n this._initPromise = Promise.resolve();\n this._isInitialized = true;\n this.evaluationContexts = options?.evaluationContexts ?? options?.evaluationEnvironments;\n if (options?.evaluationEnvironments && !options?.evaluationContexts) this._logger.warn('evaluationEnvironments is deprecated. Use evaluationContexts instead. This property will be removed in a future version.');\n this.disableCompression = !isGzipSupported() || (options?.disableCompression ?? false);\n }\n logMsgIfDebug(fn) {\n if (this.isDebug) fn();\n }\n wrap(fn) {\n if (this.disabled) return void this._logger.warn('The client is disabled');\n if (this._isInitialized) return fn();\n this._initPromise.then(()=>fn());\n }\n getCommonEventProperties() {\n return {\n $lib: this.getLibraryId(),\n $lib_version: this.getLibraryVersion()\n };\n }\n get optedOut() {\n return this.getPersistedProperty(PostHogPersistedProperty.OptedOut) ?? !this.defaultOptIn;\n }\n async optIn() {\n this.wrap(()=>{\n this.setPersistedProperty(PostHogPersistedProperty.OptedOut, false);\n });\n }\n async optOut() {\n this.wrap(()=>{\n this.setPersistedProperty(PostHogPersistedProperty.OptedOut, true);\n });\n }\n on(event, cb) {\n return this._events.on(event, cb);\n }\n debug(enabled = true) {\n this.removeDebugCallback?.();\n if (enabled) {\n const removeDebugCallback = this.on('*', (event, payload)=>this._logger.info(event, payload));\n this.removeDebugCallback = ()=>{\n removeDebugCallback();\n this.removeDebugCallback = void 0;\n };\n }\n }\n get isDebug() {\n return !!this.removeDebugCallback;\n }\n get isDisabled() {\n return this.disabled;\n }\n buildPayload(payload) {\n return {\n distinct_id: payload.distinct_id,\n event: payload.event,\n properties: {\n ...payload.properties || {},\n ...this.getCommonEventProperties()\n }\n };\n }\n addPendingPromise(promise) {\n return this.promiseQueue.add(promise);\n }\n identifyStateless(distinctId, properties, options) {\n this.wrap(()=>{\n const payload = {\n ...this.buildPayload({\n distinct_id: distinctId,\n event: '$identify',\n properties\n })\n };\n this.enqueue('identify', payload, options);\n });\n }\n async identifyStatelessImmediate(distinctId, properties, options) {\n const payload = {\n ...this.buildPayload({\n distinct_id: distinctId,\n event: '$identify',\n properties\n })\n };\n await this.sendImmediate('identify', payload, options);\n }\n captureStateless(distinctId, event, properties, options) {\n this.wrap(()=>{\n const payload = this.buildPayload({\n distinct_id: distinctId,\n event,\n properties\n });\n this.enqueue('capture', payload, options);\n });\n }\n async captureStatelessImmediate(distinctId, event, properties, options) {\n const payload = this.buildPayload({\n distinct_id: distinctId,\n event,\n properties\n });\n await this.sendImmediate('capture', payload, options);\n }\n aliasStateless(alias, distinctId, properties, options) {\n this.wrap(()=>{\n const payload = this.buildPayload({\n event: '$create_alias',\n distinct_id: distinctId,\n properties: {\n ...properties || {},\n distinct_id: distinctId,\n alias\n }\n });\n this.enqueue('alias', payload, options);\n });\n }\n async aliasStatelessImmediate(alias, distinctId, properties, options) {\n const payload = this.buildPayload({\n event: '$create_alias',\n distinct_id: distinctId,\n properties: {\n ...properties || {},\n distinct_id: distinctId,\n alias\n }\n });\n await this.sendImmediate('alias', payload, options);\n }\n groupIdentifyStateless(groupType, groupKey, groupProperties, options, distinctId, eventProperties) {\n this.wrap(()=>{\n const payload = this.buildPayload({\n distinct_id: distinctId || `$${groupType}_${groupKey}`,\n event: '$groupidentify',\n properties: {\n $group_type: groupType,\n $group_key: groupKey,\n $group_set: groupProperties || {},\n ...eventProperties || {}\n }\n });\n this.enqueue('capture', payload, options);\n });\n }\n async getRemoteConfig() {\n await this._initPromise;\n let host = this.host;\n if ('https://us.i.posthog.com' === host) host = 'https://us-assets.i.posthog.com';\n else if ('https://eu.i.posthog.com' === host) host = 'https://eu-assets.i.posthog.com';\n const url = `${host}/array/${this.apiKey}/config`;\n const fetchOptions = {\n method: 'GET',\n headers: {\n ...this.getCustomHeaders(),\n 'Content-Type': 'application/json'\n }\n };\n return this.fetchWithRetry(url, fetchOptions, {\n retryCount: 0\n }, this.remoteConfigRequestTimeoutMs).then((response)=>response.json()).catch((error)=>{\n this._logger.error('Remote config could not be loaded', error);\n this._events.emit('error', error);\n });\n }\n async getFlags(distinctId, groups = {}, personProperties = {}, groupProperties = {}, extraPayload = {}, fetchConfig = false) {\n await this._initPromise;\n const configParam = fetchConfig ? '&config=true' : '';\n const url = `${this.host}/flags/?v=2${configParam}`;\n const requestData = {\n token: this.apiKey,\n distinct_id: distinctId,\n groups,\n person_properties: personProperties,\n group_properties: groupProperties,\n ...extraPayload\n };\n if (personProperties.$device_id) requestData.$device_id = personProperties.$device_id;\n if (this.evaluationContexts && this.evaluationContexts.length > 0) requestData.evaluation_contexts = this.evaluationContexts;\n const fetchOptions = {\n method: 'POST',\n headers: {\n ...this.getCustomHeaders(),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestData)\n };\n this._logger.info('Flags URL', url);\n return this.fetchWithRetry(url, fetchOptions, {\n retryCount: 0\n }, this.featureFlagsRequestTimeoutMs).then((response)=>response.json()).then((response)=>({\n success: true,\n response: normalizeFlagsResponse(response)\n })).catch((error)=>{\n this._events.emit('error', error);\n return {\n success: false,\n error: this.categorizeRequestError(error)\n };\n });\n }\n categorizeRequestError(error) {\n if (error instanceof PostHogFetchHttpError) return {\n type: 'api_error',\n statusCode: error.status\n };\n if (error instanceof PostHogFetchNetworkError) {\n const cause = error.error;\n if (cause instanceof Error && ('AbortError' === cause.name || 'TimeoutError' === cause.name)) return {\n type: 'timeout'\n };\n return {\n type: 'connection_error'\n };\n }\n return {\n type: 'unknown_error'\n };\n }\n async getFeatureFlagStateless(key, distinctId, groups = {}, personProperties = {}, groupProperties = {}, disableGeoip) {\n await this._initPromise;\n const flagDetailResponse = await this.getFeatureFlagDetailStateless(key, distinctId, groups, personProperties, groupProperties, disableGeoip);\n if (void 0 === flagDetailResponse) return {\n response: void 0,\n requestId: void 0\n };\n let response = getFeatureFlagValue(flagDetailResponse.response);\n if (void 0 === response) response = false;\n return {\n response,\n requestId: flagDetailResponse.requestId\n };\n }\n async getFeatureFlagDetailStateless(key, distinctId, groups = {}, personProperties = {}, groupProperties = {}, disableGeoip) {\n await this._initPromise;\n const flagsResponse = await this.getFeatureFlagDetailsStateless(distinctId, groups, personProperties, groupProperties, disableGeoip, [\n key\n ]);\n if (void 0 === flagsResponse) return;\n const featureFlags = flagsResponse.flags;\n const flagDetail = featureFlags[key];\n return {\n response: flagDetail,\n requestId: flagsResponse.requestId,\n evaluatedAt: flagsResponse.evaluatedAt\n };\n }\n async getFeatureFlagPayloadStateless(key, distinctId, groups = {}, personProperties = {}, groupProperties = {}, disableGeoip) {\n await this._initPromise;\n const payloads = await this.getFeatureFlagPayloadsStateless(distinctId, groups, personProperties, groupProperties, disableGeoip, [\n key\n ]);\n if (!payloads) return;\n const response = payloads[key];\n if (void 0 === response) return null;\n return response;\n }\n async getFeatureFlagPayloadsStateless(distinctId, groups = {}, personProperties = {}, groupProperties = {}, disableGeoip, flagKeysToEvaluate) {\n await this._initPromise;\n const payloads = (await this.getFeatureFlagsAndPayloadsStateless(distinctId, groups, personProperties, groupProperties, disableGeoip, flagKeysToEvaluate)).payloads;\n return payloads;\n }\n async getFeatureFlagsStateless(distinctId, groups = {}, personProperties = {}, groupProperties = {}, disableGeoip, flagKeysToEvaluate) {\n await this._initPromise;\n return await this.getFeatureFlagsAndPayloadsStateless(distinctId, groups, personProperties, groupProperties, disableGeoip, flagKeysToEvaluate);\n }\n async getFeatureFlagsAndPayloadsStateless(distinctId, groups = {}, personProperties = {}, groupProperties = {}, disableGeoip, flagKeysToEvaluate) {\n await this._initPromise;\n const featureFlagDetails = await this.getFeatureFlagDetailsStateless(distinctId, groups, personProperties, groupProperties, disableGeoip, flagKeysToEvaluate);\n if (!featureFlagDetails) return {\n flags: void 0,\n payloads: void 0,\n requestId: void 0\n };\n return {\n flags: featureFlagDetails.featureFlags,\n payloads: featureFlagDetails.featureFlagPayloads,\n requestId: featureFlagDetails.requestId\n };\n }\n async getFeatureFlagDetailsStateless(distinctId, groups = {}, personProperties = {}, groupProperties = {}, disableGeoip, flagKeysToEvaluate) {\n await this._initPromise;\n const extraPayload = {};\n if (disableGeoip ?? this.disableGeoip) extraPayload['geoip_disable'] = true;\n if (flagKeysToEvaluate) extraPayload['flag_keys_to_evaluate'] = flagKeysToEvaluate;\n const result = await this.getFlags(distinctId, groups, personProperties, groupProperties, extraPayload);\n if (!result.success) return;\n const flagsResponse = result.response;\n if (flagsResponse.errorsWhileComputingFlags) console.error('[FEATURE FLAGS] Error while computing feature flags, some flags may be missing or incorrect. Learn more at https://posthog.com/docs/feature-flags/best-practices');\n if (flagsResponse.quotaLimited?.includes(\"feature_flags\")) {\n console.warn('[FEATURE FLAGS] Feature flags quota limit exceeded - feature flags unavailable. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts');\n return {\n flags: {},\n featureFlags: {},\n featureFlagPayloads: {},\n requestId: flagsResponse?.requestId,\n quotaLimited: flagsResponse.quotaLimited\n };\n }\n return flagsResponse;\n }\n async getSurveysStateless() {\n await this._initPromise;\n if (this.disabled) return [];\n if (true === this.disableSurveys) {\n this._logger.info('Loading surveys is disabled.');\n return [];\n }\n const url = `${this.host}/api/surveys/?token=${this.apiKey}`;\n const fetchOptions = {\n method: 'GET',\n headers: {\n ...this.getCustomHeaders(),\n 'Content-Type': 'application/json'\n }\n };\n const response = await this.fetchWithRetry(url, fetchOptions).then((response)=>{\n if (200 !== response.status || !response.json) {\n const msg = `Surveys API could not be loaded: ${response.status}`;\n const error = new Error(msg);\n this._logger.error(error);\n this._events.emit('error', new Error(msg));\n return;\n }\n return response.json();\n }).catch((error)=>{\n this._logger.error('Surveys API could not be loaded', error);\n this._events.emit('error', error);\n });\n const newSurveys = response?.surveys;\n if (newSurveys) this._logger.info('Surveys fetched from API: ', JSON.stringify(newSurveys));\n return newSurveys ?? [];\n }\n get props() {\n if (!this._props) this._props = this.getPersistedProperty(PostHogPersistedProperty.Props);\n return this._props || {};\n }\n set props(val) {\n this._props = val;\n }\n async register(properties) {\n this.wrap(()=>{\n this.props = {\n ...this.props,\n ...properties\n };\n this.setPersistedProperty(PostHogPersistedProperty.Props, this.props);\n });\n }\n async unregister(property) {\n this.wrap(()=>{\n delete this.props[property];\n this.setPersistedProperty(PostHogPersistedProperty.Props, this.props);\n });\n }\n processBeforeEnqueue(message) {\n return message;\n }\n async flushStorage() {}\n enqueue(type, _message, options) {\n this.wrap(()=>{\n if (this.optedOut) return void this._events.emit(type, \"Library is disabled. Not sending event. To re-enable, call posthog.optIn()\");\n let message = this.prepareMessage(type, _message, options);\n message = this.processBeforeEnqueue(message);\n if (null === message) return;\n const queue = this.getPersistedProperty(PostHogPersistedProperty.Queue) || [];\n if (queue.length >= this.maxQueueSize) {\n queue.shift();\n this._logger.info('Queue is full, the oldest event is dropped.');\n }\n queue.push({\n message\n });\n this.setPersistedProperty(PostHogPersistedProperty.Queue, queue);\n this._events.emit(type, message);\n if (queue.length >= this.flushAt) this.flushBackground();\n if (this.flushInterval && !this._flushTimer) this._flushTimer = safeSetTimeout(()=>this.flushBackground(), this.flushInterval);\n });\n }\n async sendImmediate(type, _message, options) {\n if (this.disabled) return void this._logger.warn('The client is disabled');\n if (!this._isInitialized) await this._initPromise;\n if (this.optedOut) return void this._events.emit(type, \"Library is disabled. Not sending event. To re-enable, call posthog.optIn()\");\n let message = this.prepareMessage(type, _message, options);\n message = this.processBeforeEnqueue(message);\n if (null === message) return;\n const data = {\n api_key: this.apiKey,\n batch: [\n message\n ],\n sent_at: currentISOTime()\n };\n if (this.historicalMigration) data.historical_migration = true;\n const payload = JSON.stringify(data);\n const url = `${this.host}/batch/`;\n const gzippedPayload = this.disableCompression ? null : await gzipCompress(payload, this.isDebug);\n const fetchOptions = {\n method: 'POST',\n headers: {\n ...this.getCustomHeaders(),\n 'Content-Type': 'application/json',\n ...null !== gzippedPayload && {\n 'Content-Encoding': 'gzip'\n }\n },\n body: gzippedPayload || payload\n };\n try {\n const response = await this.fetchWithRetry(url, fetchOptions);\n await response.body?.cancel()?.catch(()=>{});\n } catch (err) {\n this._events.emit('error', err);\n }\n }\n prepareMessage(type, _message, options) {\n const message = {\n ..._message,\n type: type,\n library: this.getLibraryId(),\n library_version: this.getLibraryVersion(),\n timestamp: options?.timestamp ? options?.timestamp : currentISOTime(),\n uuid: options?.uuid ? options.uuid : uuidv7()\n };\n const addGeoipDisableProperty = options?.disableGeoip ?? this.disableGeoip;\n if (addGeoipDisableProperty) {\n if (!message.properties) message.properties = {};\n message['properties']['$geoip_disable'] = true;\n }\n if (message.distinctId) {\n message.distinct_id = message.distinctId;\n delete message.distinctId;\n }\n return message;\n }\n clearFlushTimer() {\n if (this._flushTimer) {\n clearTimeout(this._flushTimer);\n this._flushTimer = void 0;\n }\n }\n flushBackground() {\n this.flush().catch(async (err)=>{\n await logFlushError(err);\n });\n }\n async flush() {\n if (this.disabled) return;\n const nextFlushPromise = allSettled([\n this.flushPromise\n ]).then(()=>this._flush());\n this.flushPromise = nextFlushPromise;\n this.addPendingPromise(nextFlushPromise);\n allSettled([\n nextFlushPromise\n ]).then(()=>{\n if (this.flushPromise === nextFlushPromise) this.flushPromise = null;\n });\n return nextFlushPromise;\n }\n getCustomHeaders() {\n const customUserAgent = this.getCustomUserAgent();\n const headers = {};\n if (customUserAgent && '' !== customUserAgent) headers['User-Agent'] = customUserAgent;\n return headers;\n }\n async _flush() {\n this.clearFlushTimer();\n await this._initPromise;\n let queue = this.getPersistedProperty(PostHogPersistedProperty.Queue) || [];\n if (!queue.length) return;\n const sentMessages = [];\n const originalQueueLength = queue.length;\n while(queue.length > 0 && sentMessages.length < originalQueueLength){\n const batchItems = queue.slice(0, this.maxBatchSize);\n const batchMessages = batchItems.map((item)=>item.message);\n const persistQueueChange = async ()=>{\n const refreshedQueue = this.getPersistedProperty(PostHogPersistedProperty.Queue) || [];\n const newQueue = refreshedQueue.slice(batchItems.length);\n this.setPersistedProperty(PostHogPersistedProperty.Queue, newQueue);\n queue = newQueue;\n await this.flushStorage();\n };\n const data = {\n api_key: this.apiKey,\n batch: batchMessages,\n sent_at: currentISOTime()\n };\n if (this.historicalMigration) data.historical_migration = true;\n const payload = JSON.stringify(data);\n const url = `${this.host}/batch/`;\n const gzippedPayload = this.disableCompression ? null : await gzipCompress(payload, this.isDebug);\n const fetchOptions = {\n method: 'POST',\n headers: {\n ...this.getCustomHeaders(),\n 'Content-Type': 'application/json',\n ...null !== gzippedPayload && {\n 'Content-Encoding': 'gzip'\n }\n },\n body: gzippedPayload || payload\n };\n const retryOptions = {\n retryCheck: (err)=>{\n if (isPostHogFetchContentTooLargeError(err)) return false;\n return isPostHogFetchError(err);\n }\n };\n try {\n const response = await this.fetchWithRetry(url, fetchOptions, retryOptions);\n await response.body?.cancel()?.catch(()=>{});\n } catch (err) {\n if (isPostHogFetchContentTooLargeError(err) && batchMessages.length > 1) {\n this.maxBatchSize = Math.max(1, Math.floor(batchMessages.length / 2));\n this._logger.warn(`Received 413 when sending batch of size ${batchMessages.length}, reducing batch size to ${this.maxBatchSize}`);\n continue;\n }\n if (!(err instanceof PostHogFetchNetworkError)) await persistQueueChange();\n this._events.emit('error', err);\n throw err;\n }\n await persistQueueChange();\n sentMessages.push(...batchMessages);\n }\n this._events.emit('flush', sentMessages);\n }\n async _sendLogsBatch(payload) {\n if (this.disabled) return {\n kind: 'fatal',\n error: new Error('The client is disabled')\n };\n const serialized = JSON.stringify(payload);\n const url = `${this.host}/i/v1/logs?token=${encodeURIComponent(this.apiKey)}`;\n const gzippedPayload = this.disableCompression ? null : await gzipCompress(serialized, this.isDebug);\n const fetchOptions = {\n method: 'POST',\n headers: {\n ...this.getCustomHeaders(),\n 'Content-Type': 'application/json',\n ...null !== gzippedPayload && {\n 'Content-Encoding': 'gzip'\n }\n },\n body: gzippedPayload || serialized\n };\n try {\n await this.fetchWithRetry(url, fetchOptions, {\n retryCheck: (err)=>{\n if (isPostHogFetchContentTooLargeError(err)) return false;\n return isPostHogFetchError(err);\n }\n });\n return {\n kind: 'ok'\n };\n } catch (err) {\n if (isPostHogFetchContentTooLargeError(err)) return {\n kind: 'too-large'\n };\n if (err instanceof PostHogFetchNetworkError) return {\n kind: 'retry-later',\n error: err\n };\n return {\n kind: 'fatal',\n error: err\n };\n }\n }\n async fetchWithRetry(url, options, retryOptions, requestTimeout) {\n const body = options.body ? options.body : '';\n let reqByteLength = -1;\n try {\n reqByteLength = body instanceof Blob ? body.size : Buffer.byteLength(body, STRING_FORMAT);\n } catch {\n if (body instanceof Blob) reqByteLength = body.size;\n else {\n const encoded = new TextEncoder().encode(body);\n reqByteLength = encoded.length;\n }\n }\n return await retriable(async ()=>{\n const ctrl = new AbortController();\n const timeoutMs = requestTimeout ?? this.requestTimeout;\n const timer = safeSetTimeout(()=>ctrl.abort(), timeoutMs);\n let res = null;\n try {\n res = await this.fetch(url, {\n signal: ctrl.signal,\n ...options\n });\n } catch (e) {\n throw new PostHogFetchNetworkError(e);\n } finally{\n clearTimeout(timer);\n }\n const isNoCors = 'no-cors' === options.mode;\n if (!isNoCors && (res.status < 200 || res.status >= 400)) throw new PostHogFetchHttpError(res, reqByteLength);\n return res;\n }, {\n ...this._retryOptions,\n ...retryOptions\n });\n }\n async _shutdown(shutdownTimeoutMs = 30000) {\n await this._initPromise;\n let hasTimedOut = false;\n this.clearFlushTimer();\n if (this.disabled) return;\n const doShutdown = async ()=>{\n try {\n await this.promiseQueue.join();\n while(true){\n const queue = this.getPersistedProperty(PostHogPersistedProperty.Queue) || [];\n if (0 === queue.length) break;\n await this.flush();\n if (hasTimedOut) break;\n }\n } catch (e) {\n if (!isPostHogFetchError(e)) throw e;\n await logFlushError(e);\n }\n };\n let timeoutHandle;\n try {\n return await Promise.race([\n new Promise((_, reject)=>{\n timeoutHandle = safeSetTimeout(()=>{\n this._logger.error('Timed out while shutting down PostHog');\n hasTimedOut = true;\n reject('Timeout while shutting down PostHog. Some events may not have been sent.');\n }, shutdownTimeoutMs);\n }),\n doShutdown()\n ]);\n } finally{\n clearTimeout(timeoutHandle);\n }\n }\n async shutdown(shutdownTimeoutMs = 30000) {\n if (this.shutdownPromise) this._logger.warn('shutdown() called while already shutting down. shutdown() is meant to be called once before process exit - use flush() for per-request cleanup');\n else this.shutdownPromise = this._shutdown(shutdownTimeoutMs).finally(()=>{\n this.shutdownPromise = null;\n });\n return this.shutdownPromise;\n }\n}\nexport { PostHogCoreStateless, posthog_core_stateless_QuotaLimitedFeature as QuotaLimitedFeature, isPostHogFetchNetworkError, logFlushError, maybeAdd };\n","import { ErrorTracking } from \"@posthog/core\";\nimport { createReadStream } from \"node:fs\";\nimport { createInterface } from \"node:readline\";\nconst LRU_FILE_CONTENTS_CACHE = new ErrorTracking.ReduceableCache(25);\nconst LRU_FILE_CONTENTS_FS_READ_FAILED = new ErrorTracking.ReduceableCache(20);\nconst DEFAULT_LINES_OF_CONTEXT = 7;\nconst MAX_CONTEXTLINES_COLNO = 1000;\nconst MAX_CONTEXTLINES_LINENO = 10000;\nasync function addSourceContext(frames) {\n const filesToLines = {};\n for(let i = frames.length - 1; i >= 0; i--){\n const frame = frames[i];\n const filename = frame?.filename;\n if (!frame || 'string' != typeof filename || 'number' != typeof frame.lineno || shouldSkipContextLinesForFile(filename) || shouldSkipContextLinesForFrame(frame)) continue;\n const filesToLinesOutput = filesToLines[filename];\n if (!filesToLinesOutput) filesToLines[filename] = [];\n filesToLines[filename].push(frame.lineno);\n }\n const files = Object.keys(filesToLines);\n if (0 == files.length) return frames;\n const readlinePromises = [];\n for (const file of files){\n if (LRU_FILE_CONTENTS_FS_READ_FAILED.get(file)) continue;\n const filesToLineRanges = filesToLines[file];\n if (!filesToLineRanges) continue;\n filesToLineRanges.sort((a, b)=>a - b);\n const ranges = makeLineReaderRanges(filesToLineRanges);\n if (ranges.every((r)=>rangeExistsInContentCache(file, r))) continue;\n const cache = emplace(LRU_FILE_CONTENTS_CACHE, file, {});\n readlinePromises.push(getContextLinesFromFile(file, ranges, cache));\n }\n await Promise.all(readlinePromises).catch(()=>{});\n if (frames && frames.length > 0) addSourceContextToFrames(frames, LRU_FILE_CONTENTS_CACHE);\n LRU_FILE_CONTENTS_CACHE.reduce();\n return frames;\n}\nfunction getContextLinesFromFile(path, ranges, output) {\n return new Promise((resolve)=>{\n const stream = createReadStream(path);\n const lineReaded = createInterface({\n input: stream\n });\n function destroyStreamAndResolve() {\n stream.destroy();\n resolve();\n }\n let lineNumber = 0;\n let currentRangeIndex = 0;\n const range = ranges[currentRangeIndex];\n if (void 0 === range) return void destroyStreamAndResolve();\n let rangeStart = range[0];\n let rangeEnd = range[1];\n function onStreamError() {\n LRU_FILE_CONTENTS_FS_READ_FAILED.set(path, 1);\n lineReaded.close();\n lineReaded.removeAllListeners();\n destroyStreamAndResolve();\n }\n stream.on('error', onStreamError);\n lineReaded.on('error', onStreamError);\n lineReaded.on('close', destroyStreamAndResolve);\n lineReaded.on('line', (line)=>{\n lineNumber++;\n if (lineNumber < rangeStart) return;\n output[lineNumber] = snipLine(line, 0);\n if (lineNumber >= rangeEnd) {\n if (currentRangeIndex === ranges.length - 1) {\n lineReaded.close();\n lineReaded.removeAllListeners();\n return;\n }\n currentRangeIndex++;\n const range = ranges[currentRangeIndex];\n if (void 0 === range) {\n lineReaded.close();\n lineReaded.removeAllListeners();\n return;\n }\n rangeStart = range[0];\n rangeEnd = range[1];\n }\n });\n });\n}\nfunction addSourceContextToFrames(frames, cache) {\n for (const frame of frames)if (frame.filename && void 0 === frame.context_line && 'number' == typeof frame.lineno) {\n const contents = cache.get(frame.filename);\n if (void 0 === contents) continue;\n addContextToFrame(frame.lineno, frame, contents);\n }\n}\nfunction addContextToFrame(lineno, frame, contents) {\n if (void 0 === frame.lineno || void 0 === contents) return;\n frame.pre_context = [];\n for(let i = makeRangeStart(lineno); i < lineno; i++){\n const line = contents[i];\n if (void 0 === line) return void clearLineContext(frame);\n frame.pre_context.push(line);\n }\n if (void 0 === contents[lineno]) return void clearLineContext(frame);\n frame.context_line = contents[lineno];\n const end = makeRangeEnd(lineno);\n frame.post_context = [];\n for(let i = lineno + 1; i <= end; i++){\n const line = contents[i];\n if (void 0 === line) break;\n frame.post_context.push(line);\n }\n}\nfunction clearLineContext(frame) {\n delete frame.pre_context;\n delete frame.context_line;\n delete frame.post_context;\n}\nfunction shouldSkipContextLinesForFile(path) {\n return path.startsWith('node:') || path.endsWith('.min.js') || path.endsWith('.min.cjs') || path.endsWith('.min.mjs') || path.startsWith('data:');\n}\nfunction shouldSkipContextLinesForFrame(frame) {\n if (void 0 !== frame.lineno && frame.lineno > MAX_CONTEXTLINES_LINENO) return true;\n if (void 0 !== frame.colno && frame.colno > MAX_CONTEXTLINES_COLNO) return true;\n return false;\n}\nfunction rangeExistsInContentCache(file, range) {\n const contents = LRU_FILE_CONTENTS_CACHE.get(file);\n if (void 0 === contents) return false;\n for(let i = range[0]; i <= range[1]; i++)if (void 0 === contents[i]) return false;\n return true;\n}\nfunction makeLineReaderRanges(lines) {\n if (!lines.length) return [];\n let i = 0;\n const line = lines[0];\n if ('number' != typeof line) return [];\n let current = makeContextRange(line);\n const out = [];\n while(true){\n if (i === lines.length - 1) {\n out.push(current);\n break;\n }\n const next = lines[i + 1];\n if ('number' != typeof next) break;\n if (next <= current[1]) current[1] = next + DEFAULT_LINES_OF_CONTEXT;\n else {\n out.push(current);\n current = makeContextRange(next);\n }\n i++;\n }\n return out;\n}\nfunction makeContextRange(line) {\n return [\n makeRangeStart(line),\n makeRangeEnd(line)\n ];\n}\nfunction makeRangeStart(line) {\n return Math.max(1, line - DEFAULT_LINES_OF_CONTEXT);\n}\nfunction makeRangeEnd(line) {\n return line + DEFAULT_LINES_OF_CONTEXT;\n}\nfunction emplace(map, key, contents) {\n const value = map.get(key);\n if (void 0 === value) {\n map.set(key, contents);\n return contents;\n }\n return value;\n}\nfunction snipLine(line, colno) {\n let newLine = line;\n const lineLength = newLine.length;\n if (lineLength <= 150) return newLine;\n if (colno > lineLength) colno = lineLength;\n let start = Math.max(colno - 60, 0);\n if (start < 5) start = 0;\n let end = Math.min(start + 140, lineLength);\n if (end > lineLength - 5) end = lineLength;\n if (end === lineLength) start = Math.max(end - 140, 0);\n newLine = newLine.slice(start, end);\n if (start > 0) newLine = `...${newLine}`;\n if (end < lineLength) newLine += '...';\n return newLine;\n}\nexport { MAX_CONTEXTLINES_COLNO, MAX_CONTEXTLINES_LINENO, addSourceContext };\n","import { isAbsolute, relative, sep } from \"path\";\nfunction createRelativePathModifier(basePath = process.cwd()) {\n const isWindows = '\\\\' === sep;\n const toUnix = (p)=>isWindows ? p.replace(/\\\\/g, '/') : p;\n const normalizedBase = toUnix(basePath);\n return async (frames)=>{\n for (const frame of frames)if (!(!frame.filename || frame.filename.startsWith('node:') || frame.filename.startsWith('data:'))) {\n if (isAbsolute(frame.filename)) frame.filename = toUnix(relative(normalizedBase, toUnix(frame.filename)));\n }\n return frames;\n };\n}\nexport { createRelativePathModifier };\n","const version = '5.36.4';\nexport { version };\n","const FeatureFlagError = {\n ERRORS_WHILE_COMPUTING: 'errors_while_computing_flags',\n FLAG_MISSING: 'flag_missing',\n QUOTA_LIMITED: 'quota_limited',\n UNKNOWN_ERROR: 'unknown_error'\n};\nexport { FeatureFlagError };\n","import { FeatureFlagError } from \"./types.mjs\";\nclass FeatureFlagEvaluations {\n constructor(init){\n this._host = init.host;\n this._distinctId = init.distinctId;\n this._groups = init.groups;\n this._disableGeoip = init.disableGeoip;\n this._flags = init.flags;\n this._requestId = init.requestId;\n this._evaluatedAt = init.evaluatedAt;\n this._flagDefinitionsLoadedAt = init.flagDefinitionsLoadedAt;\n this._errorsWhileComputing = init.errorsWhileComputing ?? false;\n this._quotaLimited = init.quotaLimited ?? false;\n this._accessed = init.accessed ?? new Set();\n this._isSlice = init.isSlice ?? false;\n }\n isEnabled(key) {\n const flag = this._flags[key];\n this._recordAccess(key);\n return flag?.enabled ?? false;\n }\n getFlag(key) {\n const flag = this._flags[key];\n this._recordAccess(key);\n if (!flag) return;\n if (!flag.enabled) return false;\n return flag.variant ?? true;\n }\n getFlagPayload(key) {\n return this._flags[key]?.payload;\n }\n onlyAccessed() {\n const filtered = {};\n for (const key of this._accessed){\n const flag = this._flags[key];\n if (flag) filtered[key] = flag;\n }\n return this._cloneWith(filtered);\n }\n only(keys) {\n const filtered = {};\n const missing = [];\n for (const key of keys){\n const flag = this._flags[key];\n if (flag) filtered[key] = flag;\n else missing.push(key);\n }\n if (missing.length > 0) this._host.logWarning(`FeatureFlagEvaluations.only() was called with flag keys that are not in the evaluation set and will be dropped: ${missing.join(', ')}`);\n return this._cloneWith(filtered);\n }\n get keys() {\n return Object.keys(this._flags);\n }\n _getEventProperties() {\n const properties = {};\n const activeFlags = [];\n for (const [key, flag] of Object.entries(this._flags)){\n const value = false === flag.enabled ? false : flag.variant ?? true;\n properties[`$feature/${key}`] = value;\n if (flag.enabled) activeFlags.push(key);\n }\n if (activeFlags.length > 0) {\n activeFlags.sort();\n properties['$active_feature_flags'] = activeFlags;\n }\n return properties;\n }\n _cloneWith(flags) {\n return new FeatureFlagEvaluations({\n host: this._host,\n distinctId: this._distinctId,\n groups: this._groups,\n disableGeoip: this._disableGeoip,\n flags,\n requestId: this._requestId,\n evaluatedAt: this._evaluatedAt,\n flagDefinitionsLoadedAt: this._flagDefinitionsLoadedAt,\n errorsWhileComputing: this._errorsWhileComputing,\n quotaLimited: this._quotaLimited,\n accessed: new Set(this._accessed),\n isSlice: true\n });\n }\n _recordAccess(key) {\n this._accessed.add(key);\n if ('' === this._distinctId) return;\n if (this._isSlice && !(key in this._flags)) return;\n const flag = this._flags[key];\n const response = void 0 === flag ? void 0 : false === flag.enabled ? false : flag.variant ?? true;\n const properties = {\n $feature_flag: key,\n $feature_flag_response: response,\n $feature_flag_id: flag?.id,\n $feature_flag_version: flag?.version,\n $feature_flag_reason: flag?.reason,\n locally_evaluated: flag?.locallyEvaluated ?? false,\n [`$feature/${key}`]: response,\n $feature_flag_request_id: this._requestId,\n $feature_flag_evaluated_at: flag?.locallyEvaluated ? Date.now() : this._evaluatedAt\n };\n if (flag?.locallyEvaluated && void 0 !== this._flagDefinitionsLoadedAt) properties.$feature_flag_definitions_loaded_at = this._flagDefinitionsLoadedAt;\n const errors = [];\n if (this._errorsWhileComputing) errors.push(FeatureFlagError.ERRORS_WHILE_COMPUTING);\n if (this._quotaLimited) errors.push(FeatureFlagError.QUOTA_LIMITED);\n if (void 0 === flag) errors.push(FeatureFlagError.FLAG_MISSING);\n if (errors.length > 0) properties.$feature_flag_error = errors.join(',');\n this._host.captureFlagCalledEventIfNeeded({\n distinctId: this._distinctId,\n key,\n response,\n groups: this._groups,\n disableGeoip: this._disableGeoip,\n properties\n });\n }\n}\nexport { FeatureFlagEvaluations };\n","async function hashSHA1(text) {\n const subtle = globalThis.crypto?.subtle;\n if (!subtle) throw new Error('SubtleCrypto API not available');\n const hashBuffer = await subtle.digest('SHA-1', new TextEncoder().encode(text));\n const hashArray = Array.from(new Uint8Array(hashBuffer));\n return hashArray.map((byte)=>byte.toString(16).padStart(2, '0')).join('');\n}\nexport { hashSHA1 };\n","import { safeSetTimeout } from \"@posthog/core\";\nimport { hashSHA1 } from \"./crypto.mjs\";\nconst SIXTY_SECONDS = 60000;\nconst LONG_SCALE = 0xfffffffffffffff;\nconst NULL_VALUES_ALLOWED_OPERATORS = [\n 'is_not',\n 'is_set'\n];\nclass ClientError extends Error {\n constructor(message){\n super();\n Error.captureStackTrace(this, this.constructor);\n this.name = 'ClientError';\n this.message = message;\n Object.setPrototypeOf(this, ClientError.prototype);\n }\n}\nclass InconclusiveMatchError extends Error {\n constructor(message){\n super(message);\n this.name = this.constructor.name;\n Error.captureStackTrace(this, this.constructor);\n Object.setPrototypeOf(this, InconclusiveMatchError.prototype);\n }\n}\nclass RequiresServerEvaluation extends Error {\n constructor(message){\n super(message);\n this.name = this.constructor.name;\n Error.captureStackTrace(this, this.constructor);\n Object.setPrototypeOf(this, RequiresServerEvaluation.prototype);\n }\n}\nclass FeatureFlagsPoller {\n constructor({ pollingInterval, personalApiKey, projectApiKey, timeout, host, customHeaders, ...options }){\n this.debugMode = false;\n this.shouldBeginExponentialBackoff = false;\n this.backOffCount = 0;\n this.pollingInterval = pollingInterval;\n this.personalApiKey = personalApiKey;\n this.featureFlags = [];\n this.featureFlagsByKey = {};\n this.groupTypeMapping = {};\n this.cohorts = {};\n this.loadedSuccessfullyOnce = false;\n this.timeout = timeout;\n this.projectApiKey = projectApiKey;\n this.host = host;\n this.poller = void 0;\n this.fetch = options.fetch || fetch;\n this.onError = options.onError;\n this.customHeaders = customHeaders;\n this.onLoad = options.onLoad;\n this.cacheProvider = options.cacheProvider;\n this.strictLocalEvaluation = options.strictLocalEvaluation ?? false;\n this.loadFeatureFlags();\n }\n debug(enabled = true) {\n this.debugMode = enabled;\n }\n logMsgIfDebug(fn) {\n if (this.debugMode) fn();\n }\n createEvaluationContext(distinctId, groups = {}, personProperties = {}, groupProperties = {}, evaluationCache = {}) {\n return {\n distinctId,\n groups,\n personProperties,\n groupProperties,\n evaluationCache\n };\n }\n async getFeatureFlag(key, distinctId, groups = {}, personProperties = {}, groupProperties = {}) {\n await this.loadFeatureFlags();\n let response;\n let featureFlag;\n if (!this.loadedSuccessfullyOnce) return response;\n featureFlag = this.featureFlagsByKey[key];\n if (void 0 !== featureFlag) {\n const evaluationContext = this.createEvaluationContext(distinctId, groups, personProperties, groupProperties);\n try {\n const result = await this.computeFlagAndPayloadLocally(featureFlag, evaluationContext);\n response = result.value;\n this.logMsgIfDebug(()=>console.debug(`Successfully computed flag locally: ${key} -> ${response}`));\n } catch (e) {\n if (e instanceof RequiresServerEvaluation || e instanceof InconclusiveMatchError) this.logMsgIfDebug(()=>console.debug(`${e.name} when computing flag locally: ${key}: ${e.message}`));\n else if (e instanceof Error) this.onError?.(new Error(`Error computing flag locally: ${key}: ${e}`));\n }\n }\n return response;\n }\n async getAllFlagsAndPayloads(evaluationContext, flagKeysToExplicitlyEvaluate) {\n await this.loadFeatureFlags();\n const response = {};\n const payloads = {};\n let fallbackToFlags = 0 == this.featureFlags.length;\n const flagsToEvaluate = flagKeysToExplicitlyEvaluate ? flagKeysToExplicitlyEvaluate.map((key)=>this.featureFlagsByKey[key]).filter(Boolean) : this.featureFlags;\n const sharedEvaluationContext = {\n ...evaluationContext,\n evaluationCache: evaluationContext.evaluationCache ?? {}\n };\n await Promise.all(flagsToEvaluate.map(async (flag)=>{\n try {\n const { value: matchValue, payload: matchPayload } = await this.computeFlagAndPayloadLocally(flag, sharedEvaluationContext);\n response[flag.key] = matchValue;\n if (matchPayload) payloads[flag.key] = matchPayload;\n } catch (e) {\n if (e instanceof RequiresServerEvaluation || e instanceof InconclusiveMatchError) this.logMsgIfDebug(()=>console.debug(`${e.name} when computing flag locally: ${flag.key}: ${e.message}`));\n else if (e instanceof Error) this.onError?.(new Error(`Error computing flag locally: ${flag.key}: ${e}`));\n fallbackToFlags = true;\n }\n }));\n return {\n response,\n payloads,\n fallbackToFlags\n };\n }\n async computeFlagAndPayloadLocally(flag, evaluationContext, options = {}) {\n const { matchValue, skipLoadCheck = false } = options;\n if (!skipLoadCheck) await this.loadFeatureFlags();\n if (!this.loadedSuccessfullyOnce) return {\n value: false,\n payload: null\n };\n let flagValue;\n flagValue = void 0 !== matchValue ? matchValue : await this.computeFlagValueLocally(flag, evaluationContext);\n const payload = this.getFeatureFlagPayload(flag.key, flagValue);\n return {\n value: flagValue,\n payload\n };\n }\n async computeFlagValueLocally(flag, evaluationContext) {\n const { distinctId, groups, personProperties, groupProperties } = evaluationContext;\n if (!flag.active) return false;\n if (flag.ensure_experience_continuity) throw new InconclusiveMatchError('Flag has experience continuity enabled');\n const flagFilters = flag.filters || {};\n const aggregation_group_type_index = flagFilters.aggregation_group_type_index;\n if (void 0 != aggregation_group_type_index) {\n const groupName = this.groupTypeMapping[String(aggregation_group_type_index)];\n if (!groupName) {\n this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Unknown group type index ${aggregation_group_type_index} for feature flag ${flag.key}`));\n throw new InconclusiveMatchError('Flag has unknown group type index');\n }\n if (!(groupName in groups)) {\n this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Can't compute group feature flag: ${flag.key} without group names passed in`));\n return false;\n }\n if ('device_id' === flag.bucketing_identifier && (personProperties?.$device_id === void 0 || personProperties?.$device_id === null || personProperties?.$device_id === '')) this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Ignoring bucketing_identifier for group flag: ${flag.key}`));\n const focusedGroupProperties = groupProperties[groupName];\n return await this.matchFeatureFlagProperties(flag, groups[groupName], focusedGroupProperties, evaluationContext);\n }\n {\n const bucketingValue = this.getBucketingValueForFlag(flag, distinctId, personProperties);\n if (void 0 === bucketingValue) {\n this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Can't compute feature flag: ${flag.key} without $device_id, falling back to server evaluation`));\n throw new InconclusiveMatchError(`Can't compute feature flag: ${flag.key} without $device_id`);\n }\n return await this.matchFeatureFlagProperties(flag, bucketingValue, personProperties, evaluationContext);\n }\n }\n getBucketingValueForFlag(flag, distinctId, properties) {\n if (flag.filters?.aggregation_group_type_index != void 0) return distinctId;\n if ('device_id' === flag.bucketing_identifier) {\n const deviceId = properties?.$device_id;\n if (null == deviceId || '' === deviceId) return;\n return deviceId;\n }\n return distinctId;\n }\n getFeatureFlagPayload(key, flagValue) {\n let payload = null;\n if (false !== flagValue && null != flagValue) {\n if ('boolean' == typeof flagValue) payload = this.featureFlagsByKey?.[key]?.filters?.payloads?.[flagValue.toString()] || null;\n else if ('string' == typeof flagValue) payload = this.featureFlagsByKey?.[key]?.filters?.payloads?.[flagValue] || null;\n if (null != payload) {\n if ('object' == typeof payload) return payload;\n if ('string' == typeof payload) try {\n return JSON.parse(payload);\n } catch {}\n return payload;\n }\n }\n return null;\n }\n async evaluateFlagDependency(property, properties, evaluationContext) {\n const { evaluationCache } = evaluationContext;\n const targetFlagKey = property.key;\n if (!this.featureFlagsByKey) throw new InconclusiveMatchError('Feature flags not available for dependency evaluation');\n if (!('dependency_chain' in property)) throw new InconclusiveMatchError(`Flag dependency property for '${targetFlagKey}' is missing required 'dependency_chain' field`);\n const dependencyChain = property.dependency_chain;\n if (!Array.isArray(dependencyChain)) throw new InconclusiveMatchError(`Flag dependency property for '${targetFlagKey}' has an invalid 'dependency_chain' (expected array, got ${typeof dependencyChain})`);\n if (0 === dependencyChain.length) throw new InconclusiveMatchError(`Circular dependency detected for flag '${targetFlagKey}' (empty dependency chain)`);\n for (const depFlagKey of dependencyChain){\n if (!(depFlagKey in evaluationCache)) {\n const depFlag = this.featureFlagsByKey[depFlagKey];\n if (depFlag) if (depFlag.active) try {\n const depResult = await this.computeFlagValueLocally(depFlag, evaluationContext);\n evaluationCache[depFlagKey] = depResult;\n } catch (error) {\n throw new InconclusiveMatchError(`Error evaluating flag dependency '${depFlagKey}' for flag '${targetFlagKey}': ${error}`);\n }\n else evaluationCache[depFlagKey] = false;\n else throw new InconclusiveMatchError(`Missing flag dependency '${depFlagKey}' for flag '${targetFlagKey}'`);\n }\n const cachedResult = evaluationCache[depFlagKey];\n if (null == cachedResult) throw new InconclusiveMatchError(`Dependency '${depFlagKey}' could not be evaluated`);\n }\n const targetFlagValue = evaluationCache[targetFlagKey];\n return this.flagEvaluatesToExpectedValue(property.value, targetFlagValue);\n }\n flagEvaluatesToExpectedValue(expectedValue, flagValue) {\n if ('boolean' == typeof expectedValue) return expectedValue === flagValue || 'string' == typeof flagValue && '' !== flagValue && true === expectedValue;\n if ('string' == typeof expectedValue) return flagValue === expectedValue;\n return false;\n }\n async matchFeatureFlagProperties(flag, bucketingValue, properties, evaluationContext) {\n const flagFilters = flag.filters || {};\n const flagConditions = flagFilters.groups || [];\n const flagAggregation = flagFilters.aggregation_group_type_index;\n const { groups, groupProperties } = evaluationContext;\n let isInconclusive = false;\n let result;\n for (const condition of flagConditions)try {\n const conditionAggregation = void 0 !== condition.aggregation_group_type_index ? condition.aggregation_group_type_index : flagAggregation;\n let effectiveProperties = properties;\n let effectiveBucketingValue = bucketingValue;\n if (conditionAggregation !== flagAggregation) {\n if (null != conditionAggregation) {\n const groupName = this.groupTypeMapping[String(conditionAggregation)];\n if (!groupName || !(groupName in groups)) {\n this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] Skipping group condition for flag '${flag.key}': group type index ${conditionAggregation} not available`));\n continue;\n }\n if (!(groupName in groupProperties)) {\n isInconclusive = true;\n continue;\n }\n effectiveProperties = groupProperties[groupName];\n effectiveBucketingValue = groups[groupName];\n }\n }\n if (await this.isConditionMatch(flag, effectiveBucketingValue, condition, effectiveProperties, evaluationContext)) {\n const variantOverride = condition.variant;\n const flagVariants = flagFilters.multivariate?.variants || [];\n result = variantOverride && flagVariants.some((variant)=>variant.key === variantOverride) ? variantOverride : await this.getMatchingVariant(flag, effectiveBucketingValue) || true;\n break;\n }\n } catch (e) {\n if (e instanceof RequiresServerEvaluation) throw e;\n if (e instanceof InconclusiveMatchError) isInconclusive = true;\n else throw e;\n }\n if (void 0 !== result) return result;\n if (isInconclusive) throw new InconclusiveMatchError(\"Can't determine if feature flag is enabled or not with given properties\");\n return false;\n }\n async isConditionMatch(flag, bucketingValue, condition, properties, evaluationContext) {\n const rolloutPercentage = condition.rollout_percentage;\n const warnFunction = (msg)=>{\n this.logMsgIfDebug(()=>console.warn(msg));\n };\n if ((condition.properties || []).length > 0) {\n for (const prop of condition.properties){\n const propertyType = prop.type;\n let matches = false;\n matches = 'cohort' === propertyType ? await matchCohort(prop, properties, this.cohorts, this.debugMode, (depProp)=>this.evaluateFlagDependency(depProp, properties, evaluationContext)) : 'flag' === propertyType ? await this.evaluateFlagDependency(prop, properties, evaluationContext) : matchProperty(prop, properties, warnFunction);\n if (!matches) return false;\n }\n if (void 0 == rolloutPercentage) return true;\n }\n if (void 0 != rolloutPercentage && await _hash(flag.key, bucketingValue) > rolloutPercentage / 100.0) return false;\n return true;\n }\n async getMatchingVariant(flag, bucketingValue) {\n const hashValue = await _hash(flag.key, bucketingValue, 'variant');\n const matchingVariant = this.variantLookupTable(flag).find((variant)=>hashValue >= variant.valueMin && hashValue < variant.valueMax);\n if (matchingVariant) return matchingVariant.key;\n }\n variantLookupTable(flag) {\n const lookupTable = [];\n let valueMin = 0;\n let valueMax = 0;\n const flagFilters = flag.filters || {};\n const multivariates = flagFilters.multivariate?.variants || [];\n multivariates.forEach((variant)=>{\n valueMax = valueMin + variant.rollout_percentage / 100.0;\n lookupTable.push({\n valueMin,\n valueMax,\n key: variant.key\n });\n valueMin = valueMax;\n });\n return lookupTable;\n }\n updateFlagState(flagData) {\n this.featureFlags = flagData.flags;\n this.featureFlagsByKey = flagData.flags.reduce((acc, curr)=>(acc[curr.key] = curr, acc), {});\n this.groupTypeMapping = flagData.groupTypeMapping;\n this.cohorts = flagData.cohorts;\n this.loadedSuccessfullyOnce = true;\n }\n warnAboutExperienceContinuityFlags(flags) {\n if (this.strictLocalEvaluation) return;\n const experienceContinuityFlags = flags.filter((f)=>f.ensure_experience_continuity);\n if (experienceContinuityFlags.length > 0) console.warn(`[PostHog] You are using local evaluation but ${experienceContinuityFlags.length} flag(s) have experience continuity enabled: ${experienceContinuityFlags.map((f)=>f.key).join(', ')}. Experience continuity is incompatible with local evaluation and will cause a server request on every flag evaluation, negating local evaluation cost savings. To avoid server requests and unexpected costs, either disable experience continuity on these flags in PostHog, use strictLocalEvaluation: true in client init, or pass onlyEvaluateLocally: true per flag call (flags that cannot be evaluated locally will return undefined).`);\n }\n async loadFromCache(debugMessage) {\n if (!this.cacheProvider) return false;\n try {\n const cached = await this.cacheProvider.getFlagDefinitions();\n if (cached) {\n this.updateFlagState(cached);\n this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] ${debugMessage} (${cached.flags.length} flags)`));\n this.onLoad?.(this.featureFlags.length);\n this.warnAboutExperienceContinuityFlags(cached.flags);\n return true;\n }\n return false;\n } catch (err) {\n this.onError?.(new Error(`Failed to load from cache: ${err}`));\n return false;\n }\n }\n async loadFeatureFlags(forceReload = false) {\n if (this.loadedSuccessfullyOnce && !forceReload) return;\n if (!forceReload && this.nextFetchAllowedAt && Date.now() < this.nextFetchAllowedAt) return void this.logMsgIfDebug(()=>console.debug('[FEATURE FLAGS] Skipping fetch, in backoff period'));\n if (!this.loadingPromise) this.loadingPromise = this._loadFeatureFlags().catch((err)=>this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] Failed to load feature flags: ${err}`))).finally(()=>{\n this.loadingPromise = void 0;\n });\n return this.loadingPromise;\n }\n isLocalEvaluationReady() {\n return (this.loadedSuccessfullyOnce ?? false) && (this.featureFlags?.length ?? 0) > 0;\n }\n getFlagDefinitionsLoadedAt() {\n return this.flagDefinitionsLoadedAt;\n }\n getPollingInterval() {\n if (!this.shouldBeginExponentialBackoff) return this.pollingInterval;\n return Math.min(SIXTY_SECONDS, this.pollingInterval * 2 ** this.backOffCount);\n }\n beginBackoff() {\n this.shouldBeginExponentialBackoff = true;\n this.backOffCount += 1;\n this.nextFetchAllowedAt = Date.now() + this.getPollingInterval();\n }\n clearBackoff() {\n this.shouldBeginExponentialBackoff = false;\n this.backOffCount = 0;\n this.nextFetchAllowedAt = void 0;\n }\n async _loadFeatureFlags() {\n if (this.poller) {\n clearTimeout(this.poller);\n this.poller = void 0;\n }\n this.poller = setTimeout(()=>this.loadFeatureFlags(true), this.getPollingInterval());\n try {\n let shouldFetch = true;\n if (this.cacheProvider) try {\n shouldFetch = await this.cacheProvider.shouldFetchFlagDefinitions();\n } catch (err) {\n this.onError?.(new Error(`Error in shouldFetchFlagDefinitions: ${err}`));\n }\n if (!shouldFetch) {\n const loaded = await this.loadFromCache('Loaded flags from cache (skipped fetch)');\n if (loaded) return;\n if (this.loadedSuccessfullyOnce) return;\n }\n const res = await this._requestFeatureFlagDefinitions();\n if (!res) return;\n switch(res.status){\n case 304:\n this.logMsgIfDebug(()=>console.debug('[FEATURE FLAGS] Flags not modified (304), using cached data'));\n this.flagsEtag = res.headers?.get('ETag') ?? this.flagsEtag;\n this.loadedSuccessfullyOnce = true;\n this.clearBackoff();\n return;\n case 401:\n this.beginBackoff();\n throw new ClientError(`Your project key or personal API key is invalid. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);\n case 402:\n console.warn('[FEATURE FLAGS] Feature flags quota limit exceeded - unsetting all local flags. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts');\n this.featureFlags = [];\n this.featureFlagsByKey = {};\n this.groupTypeMapping = {};\n this.cohorts = {};\n return;\n case 403:\n this.beginBackoff();\n throw new ClientError(`Your personal API key does not have permission to fetch feature flag definitions for local evaluation. Setting next polling interval to ${this.getPollingInterval()}ms. Are you sure you're using the correct personal and Project API key pair? More information: https://posthog.com/docs/api/overview`);\n case 429:\n this.beginBackoff();\n throw new ClientError(`You are being rate limited. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);\n case 200:\n {\n const responseJson = await res.json() ?? {};\n if (!('flags' in responseJson)) return void this.onError?.(new Error(`Invalid response when getting feature flags: ${JSON.stringify(responseJson)}`));\n this.flagsEtag = res.headers?.get('ETag') ?? void 0;\n const flagData = {\n flags: responseJson.flags ?? [],\n groupTypeMapping: responseJson.group_type_mapping || {},\n cohorts: responseJson.cohorts || {}\n };\n this.updateFlagState(flagData);\n this.flagDefinitionsLoadedAt = Date.now();\n this.clearBackoff();\n if (this.cacheProvider && shouldFetch) try {\n await this.cacheProvider.onFlagDefinitionsReceived(flagData);\n } catch (err) {\n this.onError?.(new Error(`Failed to store in cache: ${err}`));\n }\n this.onLoad?.(this.featureFlags.length);\n this.warnAboutExperienceContinuityFlags(flagData.flags);\n break;\n }\n default:\n return;\n }\n } catch (err) {\n if (err instanceof ClientError) this.onError?.(err);\n }\n }\n getPersonalApiKeyRequestOptions(method = 'GET', etag) {\n const headers = {\n ...this.customHeaders,\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${this.personalApiKey}`\n };\n if (etag) headers['If-None-Match'] = etag;\n return {\n method,\n headers\n };\n }\n _requestFeatureFlagDefinitions() {\n const url = `${this.host}/flags/definitions?token=${this.projectApiKey}&send_cohorts`;\n const options = this.getPersonalApiKeyRequestOptions('GET', this.flagsEtag);\n let abortTimeout = null;\n if (this.timeout && 'number' == typeof this.timeout) {\n const controller = new AbortController();\n abortTimeout = safeSetTimeout(()=>{\n controller.abort();\n }, this.timeout);\n options.signal = controller.signal;\n }\n try {\n const fetch1 = this.fetch;\n return fetch1(url, options);\n } finally{\n clearTimeout(abortTimeout);\n }\n }\n async stopPoller(timeoutMs = 30000) {\n clearTimeout(this.poller);\n if (this.cacheProvider) try {\n const shutdownResult = this.cacheProvider.shutdown();\n if (shutdownResult instanceof Promise) await Promise.race([\n shutdownResult,\n new Promise((_, reject)=>setTimeout(()=>reject(new Error(`Cache shutdown timeout after ${timeoutMs}ms`)), timeoutMs))\n ]);\n } catch (err) {\n this.onError?.(new Error(`Error during cache shutdown: ${err}`));\n }\n }\n}\nasync function _hash(key, bucketingValue, salt = '') {\n const hashString = await hashSHA1(`${key}.${bucketingValue}${salt}`);\n return parseInt(hashString.slice(0, 15), 16) / LONG_SCALE;\n}\nfunction matchProperty(property, propertyValues, warnFunction) {\n const key = property.key;\n const value = property.value;\n const operator = property.operator || 'exact';\n if (key in propertyValues) {\n if ('is_not_set' === operator) return false;\n } else {\n if ('is_not_set' === operator) return true;\n throw new InconclusiveMatchError(`Property ${key} not found in propertyValues`);\n }\n const overrideValue = propertyValues[key];\n if (null == overrideValue && !NULL_VALUES_ALLOWED_OPERATORS.includes(operator)) {\n if (warnFunction) warnFunction(`Property ${key} cannot have a value of null/undefined with the ${operator} operator`);\n return false;\n }\n function computeExactMatch(value, overrideValue) {\n if (Array.isArray(value)) return value.map((val)=>String(val).toLowerCase()).includes(String(overrideValue).toLowerCase());\n return String(value).toLowerCase() === String(overrideValue).toLowerCase();\n }\n function compare(lhs, rhs, operator) {\n if ('gt' === operator) return lhs > rhs;\n if ('gte' === operator) return lhs >= rhs;\n if ('lt' === operator) return lhs < rhs;\n if ('lte' === operator) return lhs <= rhs;\n throw new Error(`Invalid operator: ${operator}`);\n }\n switch(operator){\n case 'exact':\n return computeExactMatch(value, overrideValue);\n case 'is_not':\n return !computeExactMatch(value, overrideValue);\n case 'is_set':\n return key in propertyValues;\n case 'icontains':\n return String(overrideValue).toLowerCase().includes(String(value).toLowerCase());\n case 'not_icontains':\n return !String(overrideValue).toLowerCase().includes(String(value).toLowerCase());\n case 'regex':\n return isValidRegex(String(value)) && null !== String(overrideValue).match(String(value));\n case 'not_regex':\n return isValidRegex(String(value)) && null === String(overrideValue).match(String(value));\n case 'gt':\n case 'gte':\n case 'lt':\n case 'lte':\n {\n const parsedValue = 'number' == typeof value ? value : parseFloat(String(value));\n let parsedOverride;\n parsedOverride = 'number' == typeof overrideValue ? overrideValue : null != overrideValue ? parseFloat(String(overrideValue)) : NaN;\n if (Number.isFinite(parsedValue) && Number.isFinite(parsedOverride)) return compare(parsedOverride, parsedValue, operator);\n return compare(String(overrideValue), String(value), operator);\n }\n case 'is_date_after':\n case 'is_date_before':\n {\n if ('boolean' == typeof value) throw new InconclusiveMatchError(\"Date operations cannot be performed on boolean values\");\n let parsedDate = relativeDateParseForFeatureFlagMatching(String(value));\n if (null == parsedDate) parsedDate = convertToDateTime(value);\n if (null == parsedDate) throw new InconclusiveMatchError(`Invalid date: ${value}`);\n const overrideDate = convertToDateTime(overrideValue);\n if ([\n 'is_date_before'\n ].includes(operator)) return overrideDate < parsedDate;\n return overrideDate > parsedDate;\n }\n case 'semver_eq':\n {\n const cmp = compareSemverTuples(parseSemver(String(overrideValue)), parseSemver(String(value)));\n return 0 === cmp;\n }\n case 'semver_neq':\n {\n const cmp = compareSemverTuples(parseSemver(String(overrideValue)), parseSemver(String(value)));\n return 0 !== cmp;\n }\n case 'semver_gt':\n {\n const cmp = compareSemverTuples(parseSemver(String(overrideValue)), parseSemver(String(value)));\n return cmp > 0;\n }\n case 'semver_gte':\n {\n const cmp = compareSemverTuples(parseSemver(String(overrideValue)), parseSemver(String(value)));\n return cmp >= 0;\n }\n case 'semver_lt':\n {\n const cmp = compareSemverTuples(parseSemver(String(overrideValue)), parseSemver(String(value)));\n return cmp < 0;\n }\n case 'semver_lte':\n {\n const cmp = compareSemverTuples(parseSemver(String(overrideValue)), parseSemver(String(value)));\n return cmp <= 0;\n }\n case 'semver_tilde':\n {\n const overrideParsed = parseSemver(String(overrideValue));\n const { lower, upper } = computeTildeBounds(String(value));\n return compareSemverTuples(overrideParsed, lower) >= 0 && compareSemverTuples(overrideParsed, upper) < 0;\n }\n case 'semver_caret':\n {\n const overrideParsed = parseSemver(String(overrideValue));\n const { lower, upper } = computeCaretBounds(String(value));\n return compareSemverTuples(overrideParsed, lower) >= 0 && compareSemverTuples(overrideParsed, upper) < 0;\n }\n case 'semver_wildcard':\n {\n const overrideParsed = parseSemver(String(overrideValue));\n const { lower, upper } = computeWildcardBounds(String(value));\n return compareSemverTuples(overrideParsed, lower) >= 0 && compareSemverTuples(overrideParsed, upper) < 0;\n }\n default:\n throw new InconclusiveMatchError(`Unknown operator: ${operator}`);\n }\n}\nfunction checkCohortExists(cohortId, cohortProperties) {\n if (!(cohortId in cohortProperties)) throw new RequiresServerEvaluation(`cohort ${cohortId} not found in local cohorts - likely a static cohort that requires server evaluation`);\n}\nasync function matchCohort(property, propertyValues, cohortProperties, debugMode = false, flagDependencyEvaluator) {\n const cohortId = String(property.value);\n checkCohortExists(cohortId, cohortProperties);\n const propertyGroup = cohortProperties[cohortId];\n return matchPropertyGroup(propertyGroup, propertyValues, cohortProperties, debugMode, flagDependencyEvaluator);\n}\nasync function matchPropertyGroup(propertyGroup, propertyValues, cohortProperties, debugMode = false, flagDependencyEvaluator) {\n if (!propertyGroup) return true;\n const propertyGroupType = propertyGroup.type;\n const properties = propertyGroup.values;\n if (!properties || 0 === properties.length) return true;\n let errorMatchingLocally = false;\n if ('values' in properties[0]) {\n for (const prop of properties)try {\n const matches = await matchPropertyGroup(prop, propertyValues, cohortProperties, debugMode, flagDependencyEvaluator);\n if ('AND' === propertyGroupType) {\n if (!matches) return false;\n } else if (matches) return true;\n } catch (err) {\n if (err instanceof RequiresServerEvaluation) throw err;\n if (err instanceof InconclusiveMatchError) {\n if (debugMode) console.debug(`Failed to compute property ${prop} locally: ${err}`);\n errorMatchingLocally = true;\n } else throw err;\n }\n if (errorMatchingLocally) throw new InconclusiveMatchError(\"Can't match cohort without a given cohort property value\");\n return 'AND' === propertyGroupType;\n }\n for (const prop of properties)try {\n let matches;\n if ('cohort' === prop.type) matches = await matchCohort(prop, propertyValues, cohortProperties, debugMode, flagDependencyEvaluator);\n else if ('flag' === prop.type) {\n if (!flagDependencyEvaluator) throw new InconclusiveMatchError(`Flag dependency '${prop.key || 'unknown'}' cannot be evaluated without a flag dependency evaluator`);\n matches = await flagDependencyEvaluator(prop);\n } else matches = matchProperty(prop, propertyValues);\n const negation = prop.negation || false;\n if ('AND' === propertyGroupType) {\n if (!matches && !negation) return false;\n if (matches && negation) return false;\n } else {\n if (matches && !negation) return true;\n if (!matches && negation) return true;\n }\n } catch (err) {\n if (err instanceof RequiresServerEvaluation) throw err;\n if (err instanceof InconclusiveMatchError) {\n if (debugMode) console.debug(`Failed to compute property ${prop} locally: ${err}`);\n errorMatchingLocally = true;\n } else throw err;\n }\n if (errorMatchingLocally) throw new InconclusiveMatchError(\"can't match cohort without a given cohort property value\");\n return 'AND' === propertyGroupType;\n}\nfunction isValidRegex(regex) {\n try {\n new RegExp(regex);\n return true;\n } catch (err) {\n return false;\n }\n}\nfunction parseSemverNumericIdentifier(part, raw) {\n if (!/^\\d+$/.test(part)) throw new InconclusiveMatchError(`Invalid semver: ${raw}`);\n if (part.length > 1 && '0' === part[0]) throw new InconclusiveMatchError(`Invalid semver: ${raw}`);\n return parseInt(part, 10);\n}\nfunction parseSemver(value) {\n const text = String(value).trim().replace(/^[vV]/, '');\n const baseVersion = text.split('-')[0].split('+')[0];\n if (!baseVersion || baseVersion.startsWith('.')) throw new InconclusiveMatchError(`Invalid semver: ${value}`);\n const parts = baseVersion.split('.');\n const parsePart = (part)=>{\n if (void 0 === part || '' === part) return 0;\n return parseSemverNumericIdentifier(part, value);\n };\n const major = parsePart(parts[0]);\n const minor = parsePart(parts[1]);\n const patch = parsePart(parts[2]);\n return [\n major,\n minor,\n patch\n ];\n}\nfunction compareSemverTuples(a, b) {\n for(let i = 0; i < 3; i++){\n if (a[i] < b[i]) return -1;\n if (a[i] > b[i]) return 1;\n }\n return 0;\n}\nfunction computeTildeBounds(value) {\n const parsed = parseSemver(value);\n const lower = [\n parsed[0],\n parsed[1],\n parsed[2]\n ];\n const upper = [\n parsed[0],\n parsed[1] + 1,\n 0\n ];\n return {\n lower,\n upper\n };\n}\nfunction computeCaretBounds(value) {\n const parsed = parseSemver(value);\n const [major, minor, patch] = parsed;\n const lower = [\n major,\n minor,\n patch\n ];\n let upper;\n upper = major > 0 ? [\n major + 1,\n 0,\n 0\n ] : minor > 0 ? [\n 0,\n minor + 1,\n 0\n ] : [\n 0,\n 0,\n patch + 1\n ];\n return {\n lower,\n upper\n };\n}\nfunction computeWildcardBounds(value) {\n const text = String(value).trim().replace(/^[vV]/, '');\n const cleanedText = text.replace(/\\.\\*$/, '').replace(/\\*$/, '');\n if (!cleanedText) throw new InconclusiveMatchError(`Invalid wildcard semver: ${value}`);\n const parts = cleanedText.split('.');\n const parseWildcardPart = (part)=>{\n try {\n return parseSemverNumericIdentifier(part, value);\n } catch {\n throw new InconclusiveMatchError(`Invalid wildcard semver: ${value}`);\n }\n };\n const major = parseWildcardPart(parts[0]);\n let lower;\n let upper;\n if (1 === parts.length) {\n lower = [\n major,\n 0,\n 0\n ];\n upper = [\n major + 1,\n 0,\n 0\n ];\n } else {\n const minor = parseWildcardPart(parts[1]);\n lower = [\n major,\n minor,\n 0\n ];\n upper = [\n major,\n minor + 1,\n 0\n ];\n }\n return {\n lower,\n upper\n };\n}\nfunction convertToDateTime(value) {\n if (value instanceof Date) return value;\n if ('string' == typeof value || 'number' == typeof value) {\n const date = new Date(value);\n if (!isNaN(date.valueOf())) return date;\n throw new InconclusiveMatchError(`${value} is in an invalid date format`);\n }\n throw new InconclusiveMatchError(`The date provided ${value} must be a string, number, or date object`);\n}\nfunction relativeDateParseForFeatureFlagMatching(value) {\n const regex = /^-?(?<number>[0-9]+)(?<interval>[a-z])$/;\n const match = value.match(regex);\n const parsedDt = new Date(new Date().toISOString());\n if (!match) return null;\n {\n if (!match.groups) return null;\n const number = parseInt(match.groups['number']);\n if (number >= 10000) return null;\n const interval = match.groups['interval'];\n if ('h' == interval) parsedDt.setUTCHours(parsedDt.getUTCHours() - number);\n else if ('d' == interval) parsedDt.setUTCDate(parsedDt.getUTCDate() - number);\n else if ('w' == interval) parsedDt.setUTCDate(parsedDt.getUTCDate() - 7 * number);\n else if ('m' == interval) parsedDt.setUTCMonth(parsedDt.getUTCMonth() - number);\n else {\n if ('y' != interval) return null;\n parsedDt.setUTCFullYear(parsedDt.getUTCFullYear() - number);\n }\n return parsedDt;\n }\n}\nexport { ClientError, FeatureFlagsPoller, InconclusiveMatchError, RequiresServerEvaluation, matchProperty, parseSemver, relativeDateParseForFeatureFlagMatching };\n","function makeUncaughtExceptionHandler(captureFn, onFatalFn) {\n let calledFatalError = false;\n return Object.assign((error)=>{\n const userProvidedListenersCount = global.process.listeners('uncaughtException').filter((listener)=>'domainUncaughtExceptionClear' !== listener.name && true !== listener._posthogErrorHandler).length;\n const processWouldExit = 0 === userProvidedListenersCount;\n captureFn(error, {\n mechanism: {\n type: 'onuncaughtexception',\n handled: false\n }\n });\n if (!calledFatalError && processWouldExit) {\n calledFatalError = true;\n onFatalFn(error);\n }\n }, {\n _posthogErrorHandler: true\n });\n}\nfunction addUncaughtExceptionListener(captureFn, onFatalFn) {\n globalThis.process?.on('uncaughtException', makeUncaughtExceptionHandler(captureFn, onFatalFn));\n}\nfunction addUnhandledRejectionListener(captureFn) {\n globalThis.process?.on('unhandledRejection', (reason)=>captureFn(reason, {\n mechanism: {\n type: 'onunhandledrejection',\n handled: false\n }\n }));\n}\nexport { addUncaughtExceptionListener, addUnhandledRejectionListener };\n","import { addUncaughtExceptionListener, addUnhandledRejectionListener } from \"./autocapture.mjs\";\nimport { BucketedRateLimiter, isObject } from \"@posthog/core\";\nconst SHUTDOWN_TIMEOUT = 2000;\nclass ErrorTracking {\n constructor(client, options, _logger){\n this.client = client;\n this._exceptionAutocaptureEnabled = options.enableExceptionAutocapture || false;\n this._logger = _logger;\n this._rateLimiter = new BucketedRateLimiter({\n refillRate: 1,\n bucketSize: 10,\n refillInterval: 10000,\n _logger: this._logger\n });\n this.startAutocaptureIfEnabled();\n }\n static isPreviouslyCapturedError(x) {\n return isObject(x) && '__posthog_previously_captured_error' in x && true === x.__posthog_previously_captured_error;\n }\n static async buildEventMessage(builder, error, hint, distinctId, additionalProperties) {\n const properties = {\n ...additionalProperties\n };\n const exceptionProperties = builder.buildFromUnknown(error, hint);\n exceptionProperties.$exception_list = await builder.modifyFrames(exceptionProperties.$exception_list);\n return {\n event: '$exception',\n distinctId: distinctId,\n properties: {\n ...exceptionProperties,\n ...properties\n },\n _originatedFromCaptureException: true\n };\n }\n startAutocaptureIfEnabled() {\n if (this.isEnabled()) {\n addUncaughtExceptionListener(this.onException.bind(this), this.onFatalError.bind(this));\n addUnhandledRejectionListener(this.onException.bind(this));\n }\n }\n onException(exception, hint) {\n this.client.addPendingPromise((async ()=>{\n if (!ErrorTracking.isPreviouslyCapturedError(exception)) {\n const eventMessage = await ErrorTracking.buildEventMessage(this.client.getErrorPropertiesBuilder(), exception, hint);\n const exceptionProperties = eventMessage.properties;\n const exceptionType = exceptionProperties?.$exception_list[0]?.type ?? 'Exception';\n const isRateLimited = this._rateLimiter.consumeRateLimit(exceptionType);\n if (isRateLimited) return void this._logger.info('Skipping exception capture because of client rate limiting.', {\n exception: exceptionType\n });\n return this.client.capture(eventMessage);\n }\n })());\n }\n async onFatalError(exception) {\n console.error(exception);\n await this.client.shutdown(SHUTDOWN_TIMEOUT);\n process.exit(1);\n }\n isEnabled() {\n return !this.client.isDisabled && this._exceptionAutocaptureEnabled;\n }\n shutdown() {\n this._rateLimiter.stop();\n }\n}\nexport { ErrorTracking as default };\n","class PostHogMemoryStorage {\n getProperty(key) {\n return this._memoryStorage[key];\n }\n setProperty(key, value) {\n this._memoryStorage[key] = null !== value ? value : void 0;\n }\n constructor(){\n this._memoryStorage = {};\n }\n}\nexport { PostHogMemoryStorage };\n","import { version } from \"./version.mjs\";\nimport { PostHogCoreStateless, isBlockedUA, isPlainObject, safeSetTimeout, uuidv7 } from \"@posthog/core\";\nimport { FeatureFlagError } from \"./types.mjs\";\nimport { FeatureFlagEvaluations } from \"./feature-flag-evaluations.mjs\";\nimport { FeatureFlagsPoller, InconclusiveMatchError, RequiresServerEvaluation } from \"./extensions/feature-flags/feature-flags.mjs\";\nimport error_tracking from \"./extensions/error-tracking/index.mjs\";\nimport { PostHogMemoryStorage } from \"./storage-memory.mjs\";\nconst MINIMUM_POLLING_INTERVAL = 100;\nconst THIRTY_SECONDS = 30000;\nconst MAX_CACHE_SIZE = 50000;\nconst WAITUNTIL_DEBOUNCE_MS = 50;\nconst WAITUNTIL_MAX_WAIT_MS = 500;\nconst DEFAULT_NODE_HOST = 'https://us.i.posthog.com';\nconst _emittedDeprecations = new Set();\nfunction emitDeprecationWarningOnce(id, message) {\n if (_emittedDeprecations.has(id)) return;\n _emittedDeprecations.add(id);\n console.warn(`[PostHog] ${message}`);\n}\nfunction _resetDeprecationWarningsForTests() {\n _emittedDeprecations.clear();\n}\nfunction normalizeApiKey(value) {\n return 'string' == typeof value ? value.trim() : '';\n}\nfunction normalizePersonalApiKey(value) {\n const normalizedValue = 'string' == typeof value ? value.trim() : '';\n return normalizedValue || void 0;\n}\nfunction normalizeHost(value) {\n const normalizedValue = 'string' == typeof value ? value.trim() : '';\n return normalizedValue || DEFAULT_NODE_HOST;\n}\nfunction buildFlagEventProperties(flagValues) {\n if (!flagValues) return {};\n const additionalProperties = {};\n for (const [feature, variant] of Object.entries(flagValues))additionalProperties[`$feature/${feature}`] = variant;\n const activeFlags = Object.keys(flagValues).filter((flag)=>false !== flagValues[flag]).sort();\n if (activeFlags.length > 0) additionalProperties['$active_feature_flags'] = activeFlags;\n return additionalProperties;\n}\nclass PostHogBackendClient extends PostHogCoreStateless {\n constructor(apiKey, options = {}){\n const normalizedApiKey = normalizeApiKey(apiKey);\n const normalizedOptions = {\n ...options,\n host: normalizeHost(options.host),\n personalApiKey: normalizePersonalApiKey(options.personalApiKey)\n };\n super(normalizedApiKey, normalizedOptions), this._memoryStorage = new PostHogMemoryStorage();\n this.options = normalizedOptions;\n this.context = this.initializeContext();\n this.options.featureFlagsPollingInterval = 'number' == typeof normalizedOptions.featureFlagsPollingInterval ? Math.max(normalizedOptions.featureFlagsPollingInterval, MINIMUM_POLLING_INTERVAL) : THIRTY_SECONDS;\n if ('number' == typeof normalizedOptions.waitUntilDebounceMs) this.options.waitUntilDebounceMs = Math.max(normalizedOptions.waitUntilDebounceMs, 0);\n if ('number' == typeof normalizedOptions.waitUntilMaxWaitMs) this.options.waitUntilMaxWaitMs = Math.max(normalizedOptions.waitUntilMaxWaitMs, 0);\n if (!this.disabled && normalizedOptions.personalApiKey) {\n if (normalizedOptions.personalApiKey.includes('phc_')) throw new Error('Your Personal API key is invalid. These keys are prefixed with \"phx_\" and can be created in PostHog project settings.');\n const shouldEnableLocalEvaluation = false !== normalizedOptions.enableLocalEvaluation;\n if (shouldEnableLocalEvaluation) this.featureFlagsPoller = new FeatureFlagsPoller({\n pollingInterval: this.options.featureFlagsPollingInterval,\n personalApiKey: normalizedOptions.personalApiKey,\n projectApiKey: normalizedApiKey,\n timeout: normalizedOptions.requestTimeout ?? 10000,\n host: this.host,\n fetch: normalizedOptions.fetch,\n onError: (err)=>{\n this._events.emit('error', err);\n },\n onLoad: (count)=>{\n this._events.emit('localEvaluationFlagsLoaded', count);\n },\n customHeaders: this.getCustomHeaders(),\n cacheProvider: normalizedOptions.flagDefinitionCacheProvider,\n strictLocalEvaluation: normalizedOptions.strictLocalEvaluation\n });\n }\n this.errorTracking = new error_tracking(this, normalizedOptions, this._logger);\n this.distinctIdHasSentFlagCalls = {};\n this.maxCacheSize = normalizedOptions.maxCacheSize || MAX_CACHE_SIZE;\n }\n enqueue(type, message, options) {\n super.enqueue(type, message, options);\n this.scheduleDebouncedFlush();\n }\n async flush() {\n const flushPromise = super.flush();\n const waitUntil = this.options.waitUntil;\n if (waitUntil && !this._waitUntilCycle) try {\n waitUntil(flushPromise.catch(()=>{}));\n } catch {}\n return flushPromise;\n }\n scheduleDebouncedFlush() {\n const waitUntil = this.options.waitUntil;\n if (!waitUntil) return;\n if (this.disabled || this.optedOut) return;\n if (!this._waitUntilCycle) {\n let resolve;\n const promise = new Promise((r)=>{\n resolve = r;\n });\n try {\n waitUntil(promise);\n } catch {\n return;\n }\n this._waitUntilCycle = {\n resolve: resolve,\n startedAt: Date.now(),\n timer: void 0\n };\n }\n const elapsed = Date.now() - this._waitUntilCycle.startedAt;\n const maxWaitMs = this.options.waitUntilMaxWaitMs ?? WAITUNTIL_MAX_WAIT_MS;\n const flushNow = elapsed >= maxWaitMs;\n if (void 0 !== this._waitUntilCycle.timer) clearTimeout(this._waitUntilCycle.timer);\n if (flushNow) return void this.resolveWaitUntilFlush();\n const debounceMs = this.options.waitUntilDebounceMs ?? WAITUNTIL_DEBOUNCE_MS;\n this._waitUntilCycle.timer = safeSetTimeout(()=>{\n this.resolveWaitUntilFlush();\n }, debounceMs);\n }\n _consumeWaitUntilCycle() {\n const cycle = this._waitUntilCycle;\n if (cycle) {\n clearTimeout(cycle.timer);\n this._waitUntilCycle = void 0;\n }\n return cycle?.resolve;\n }\n async resolveWaitUntilFlush() {\n const resolve = this._consumeWaitUntilCycle();\n try {\n await super.flush();\n } catch {} finally{\n resolve?.();\n }\n }\n getPersistedProperty(key) {\n return this._memoryStorage.getProperty(key);\n }\n setPersistedProperty(key, value) {\n return this._memoryStorage.setProperty(key, value);\n }\n fetch(url, options) {\n return this.options.fetch ? this.options.fetch(url, options) : fetch(url, options);\n }\n getLibraryVersion() {\n return version;\n }\n getCustomUserAgent() {\n return `${this.getLibraryId()}/${this.getLibraryVersion()}`;\n }\n getCommonEventProperties() {\n const commonProperties = super.getCommonEventProperties();\n if (this.options.isServer ?? true) commonProperties.$is_server = true;\n return commonProperties;\n }\n enable() {\n return super.optIn();\n }\n disable() {\n return super.optOut();\n }\n debug(enabled = true) {\n super.debug(enabled);\n this.featureFlagsPoller?.debug(enabled);\n }\n capture(props) {\n if ('string' == typeof props) this._logger.warn('Called capture() with a string as the first argument when an object was expected.');\n if ('$exception' === props.event && !props._originatedFromCaptureException) this._logger.warn(\"Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically.\");\n this.addPendingPromise(this.prepareEventMessage(props).then(({ distinctId, event, properties, options })=>super.captureStateless(distinctId, event, properties, {\n timestamp: options.timestamp,\n disableGeoip: options.disableGeoip,\n uuid: options.uuid\n })).catch((err)=>{\n if (err) console.error(err);\n }));\n }\n async captureImmediate(props) {\n if ('string' == typeof props) this._logger.warn('Called captureImmediate() with a string as the first argument when an object was expected.');\n if ('$exception' === props.event && !props._originatedFromCaptureException) this._logger.warn(\"Capturing a `$exception` event via `posthog.captureImmediate('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureExceptionImmediate(error)` instead, which attaches this metadata by default.\");\n return this.addPendingPromise(this.prepareEventMessage(props).then(({ distinctId, event, properties, options })=>super.captureStatelessImmediate(distinctId, event, properties, {\n timestamp: options.timestamp,\n disableGeoip: options.disableGeoip,\n uuid: options.uuid\n })).catch((err)=>{\n if (err) console.error(err);\n }));\n }\n identify({ distinctId, properties = {}, disableGeoip }) {\n const { $set, $set_once, $anon_distinct_id, ...rest } = properties;\n const setProps = $set || rest;\n const setOnceProps = $set_once || {};\n const eventProperties = {\n $set: setProps,\n $set_once: setOnceProps,\n $anon_distinct_id: $anon_distinct_id ?? void 0\n };\n super.identifyStateless(distinctId, eventProperties, {\n disableGeoip\n });\n }\n async identifyImmediate({ distinctId, properties = {}, disableGeoip }) {\n const { $set, $set_once, $anon_distinct_id, ...rest } = properties;\n const setProps = $set || rest;\n const setOnceProps = $set_once || {};\n const eventProperties = {\n $set: setProps,\n $set_once: setOnceProps,\n $anon_distinct_id: $anon_distinct_id ?? void 0\n };\n await super.identifyStatelessImmediate(distinctId, eventProperties, {\n disableGeoip\n });\n }\n alias(data) {\n super.aliasStateless(data.alias, data.distinctId, void 0, {\n disableGeoip: data.disableGeoip\n });\n }\n async aliasImmediate(data) {\n await super.aliasStatelessImmediate(data.alias, data.distinctId, void 0, {\n disableGeoip: data.disableGeoip\n });\n }\n isLocalEvaluationReady() {\n return this.featureFlagsPoller?.isLocalEvaluationReady() ?? false;\n }\n async waitForLocalEvaluationReady(timeoutMs = THIRTY_SECONDS) {\n if (this.isLocalEvaluationReady()) return true;\n if (void 0 === this.featureFlagsPoller) return false;\n return new Promise((resolve)=>{\n const timeout = setTimeout(()=>{\n cleanup();\n resolve(false);\n }, timeoutMs);\n const cleanup = this._events.on('localEvaluationFlagsLoaded', (count)=>{\n clearTimeout(timeout);\n cleanup();\n resolve(count > 0);\n });\n });\n }\n _resolveDistinctId(distinctIdOrOptions, options) {\n if ('string' == typeof distinctIdOrOptions) return {\n distinctId: distinctIdOrOptions,\n options\n };\n return {\n distinctId: this.context?.get()?.distinctId,\n options: distinctIdOrOptions\n };\n }\n async _getFeatureFlagResult(key, distinctId, options = {}, matchValue) {\n if (this.disabled) return void this._logger.warn('The client is disabled');\n const sendFeatureFlagEvents = options.sendFeatureFlagEvents ?? true;\n if (void 0 !== this._flagOverrides && key in this._flagOverrides) {\n const overrideValue = this._flagOverrides[key];\n if (void 0 === overrideValue) return;\n const overridePayload = this._payloadOverrides?.[key];\n return {\n key,\n enabled: false !== overrideValue,\n variant: 'string' == typeof overrideValue ? overrideValue : void 0,\n payload: overridePayload\n };\n }\n const { groups, disableGeoip } = options;\n let { onlyEvaluateLocally, personProperties, groupProperties } = options;\n const adjustedProperties = this.addLocalPersonAndGroupProperties(distinctId, groups, personProperties, groupProperties);\n personProperties = adjustedProperties.allPersonProperties;\n groupProperties = adjustedProperties.allGroupProperties;\n const evaluationContext = this.createFeatureFlagEvaluationContext(distinctId, groups, personProperties, groupProperties);\n if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;\n let result;\n let flagWasLocallyEvaluated = false;\n let requestId;\n let evaluatedAt;\n let featureFlagError;\n let flagId;\n let flagVersion;\n let flagReason;\n const localEvaluationEnabled = void 0 !== this.featureFlagsPoller;\n if (localEvaluationEnabled) {\n await this.featureFlagsPoller?.loadFeatureFlags();\n const flag = this.featureFlagsPoller?.featureFlagsByKey[key];\n if (flag) try {\n const localResult = await this.featureFlagsPoller?.computeFlagAndPayloadLocally(flag, evaluationContext, {\n matchValue\n });\n if (localResult) {\n flagWasLocallyEvaluated = true;\n const value = localResult.value;\n flagId = flag.id;\n flagReason = 'Evaluated locally';\n result = {\n key,\n enabled: false !== value,\n variant: 'string' == typeof value ? value : void 0,\n payload: localResult.payload ?? void 0\n };\n }\n } catch (e) {\n if (e instanceof RequiresServerEvaluation || e instanceof InconclusiveMatchError) this._logger?.info(`${e.name} when computing flag locally: ${key}: ${e.message}`);\n else throw e;\n }\n }\n if (!flagWasLocallyEvaluated && !onlyEvaluateLocally) {\n const flagsResponse = await super.getFeatureFlagDetailsStateless(evaluationContext.distinctId, evaluationContext.groups, evaluationContext.personProperties, evaluationContext.groupProperties, disableGeoip, [\n key\n ]);\n if (void 0 === flagsResponse) featureFlagError = FeatureFlagError.UNKNOWN_ERROR;\n else {\n requestId = flagsResponse.requestId;\n evaluatedAt = flagsResponse.evaluatedAt;\n const errors = [];\n if (flagsResponse.errorsWhileComputingFlags) errors.push(FeatureFlagError.ERRORS_WHILE_COMPUTING);\n if (flagsResponse.quotaLimited?.includes('feature_flags')) errors.push(FeatureFlagError.QUOTA_LIMITED);\n const flagDetail = flagsResponse.flags[key];\n if (void 0 === flagDetail) errors.push(FeatureFlagError.FLAG_MISSING);\n else {\n flagId = flagDetail.metadata?.id;\n flagVersion = flagDetail.metadata?.version;\n flagReason = flagDetail.reason?.description ?? flagDetail.reason?.code;\n let parsedPayload;\n if (flagDetail.metadata?.payload !== void 0) try {\n parsedPayload = JSON.parse(flagDetail.metadata.payload);\n } catch {\n parsedPayload = flagDetail.metadata.payload;\n }\n result = {\n key,\n enabled: flagDetail.enabled,\n variant: flagDetail.variant,\n payload: parsedPayload\n };\n }\n if (errors.length > 0) featureFlagError = errors.join(',');\n }\n }\n if (sendFeatureFlagEvents) {\n const response = void 0 === result ? void 0 : false === result.enabled ? false : result.variant ?? true;\n const properties = {\n $feature_flag: key,\n $feature_flag_response: response,\n $feature_flag_id: flagId,\n $feature_flag_version: flagVersion,\n $feature_flag_reason: flagReason,\n locally_evaluated: flagWasLocallyEvaluated,\n [`$feature/${key}`]: response,\n $feature_flag_request_id: requestId,\n $feature_flag_evaluated_at: flagWasLocallyEvaluated ? Date.now() : evaluatedAt\n };\n if (flagWasLocallyEvaluated && this.featureFlagsPoller) {\n const flagDefinitionsLoadedAt = this.featureFlagsPoller.getFlagDefinitionsLoadedAt();\n if (void 0 !== flagDefinitionsLoadedAt) properties.$feature_flag_definitions_loaded_at = flagDefinitionsLoadedAt;\n }\n if (featureFlagError) properties.$feature_flag_error = featureFlagError;\n this._captureFlagCalledEventIfNeeded({\n distinctId,\n key,\n response,\n groups,\n disableGeoip,\n properties\n });\n }\n if (void 0 !== result && void 0 !== this._payloadOverrides && key in this._payloadOverrides) result = {\n ...result,\n payload: this._payloadOverrides[key]\n };\n return result;\n }\n async getFeatureFlag(key, distinctId, options) {\n emitDeprecationWarningOnce('getFeatureFlag', \"`getFeatureFlag` is deprecated and will be removed in a future major version. Use `posthog.evaluateFlags(distinctId, ...)` and call `flags.getFlag(key)` instead — this consolidates flag evaluation into a single `/flags` request per incoming request.\");\n const result = await this._getFeatureFlagResult(key, distinctId, {\n ...options,\n sendFeatureFlagEvents: options?.sendFeatureFlagEvents ?? this.options.sendFeatureFlagEvent ?? true\n });\n if (void 0 === result) return;\n if (false === result.enabled) return false;\n return result.variant ?? true;\n }\n async getFeatureFlagPayload(key, distinctId, matchValue, options) {\n emitDeprecationWarningOnce('getFeatureFlagPayload', \"`getFeatureFlagPayload` is deprecated and will be removed in a future major version. Use `posthog.evaluateFlags(distinctId, ...)` and call `flags.getFlagPayload(key)` instead — this consolidates flag evaluation into a single `/flags` request per incoming request.\");\n if (void 0 !== this._payloadOverrides && key in this._payloadOverrides) return this._payloadOverrides[key];\n const result = await this._getFeatureFlagResult(key, distinctId, {\n ...options,\n sendFeatureFlagEvents: false\n }, matchValue);\n if (void 0 === result) return;\n return result.payload ?? null;\n }\n async getFeatureFlagResult(key, distinctIdOrOptions, options) {\n const { distinctId: resolvedDistinctId, options: resolvedOptions } = this._resolveDistinctId(distinctIdOrOptions, options);\n if (!resolvedDistinctId) return void this._logger.warn(\"[PostHog] distinctId is required \\u2014 pass it explicitly or use withContext()\");\n return this._getFeatureFlagResult(key, resolvedDistinctId, {\n ...resolvedOptions,\n sendFeatureFlagEvents: resolvedOptions?.sendFeatureFlagEvents ?? this.options.sendFeatureFlagEvent ?? true\n });\n }\n async getRemoteConfigPayload(flagKey) {\n if (this.disabled) return void this._logger.warn('The client is disabled');\n if (!this.options.personalApiKey) throw new Error('Personal API key is required for remote config payload decryption');\n const response = await this._requestRemoteConfigPayload(flagKey);\n if (!response) return;\n const parsed = await response.json();\n if ('string' == typeof parsed) try {\n return JSON.parse(parsed);\n } catch (e) {}\n return parsed;\n }\n async isFeatureEnabled(key, distinctId, options) {\n emitDeprecationWarningOnce('isFeatureEnabled', \"`isFeatureEnabled` is deprecated and will be removed in a future major version. Use `posthog.evaluateFlags(distinctId, ...)` and call `flags.isEnabled(key)` instead — this consolidates flag evaluation into a single `/flags` request per incoming request.\");\n const result = await this._getFeatureFlagResult(key, distinctId, {\n ...options,\n sendFeatureFlagEvents: options?.sendFeatureFlagEvents ?? this.options.sendFeatureFlagEvent ?? true\n });\n if (void 0 === result) return;\n if (false === result.enabled) return false;\n const feat = result.variant ?? true;\n return !!feat || false;\n }\n async getAllFlags(distinctIdOrOptions, options) {\n const { distinctId: resolvedDistinctId, options: resolvedOptions } = this._resolveDistinctId(distinctIdOrOptions, options);\n if (!resolvedDistinctId) {\n this._logger.warn(\"[PostHog] distinctId is required to get feature flags \\u2014 pass it explicitly or use withContext()\");\n return {};\n }\n const response = await this.getAllFlagsAndPayloads(resolvedDistinctId, resolvedOptions);\n return response.featureFlags || {};\n }\n async getAllFlagsAndPayloads(distinctIdOrOptions, options) {\n const { distinctId: resolvedDistinctId, options: resolvedOptions } = this._resolveDistinctId(distinctIdOrOptions, options);\n if (!resolvedDistinctId) {\n this._logger.warn(\"[PostHog] distinctId is required to get feature flags and payloads \\u2014 pass it explicitly or use withContext()\");\n return {\n featureFlags: {},\n featureFlagPayloads: {}\n };\n }\n if (this.disabled) {\n this._logger.warn('The client is disabled');\n return {\n featureFlags: {},\n featureFlagPayloads: {}\n };\n }\n const { groups, disableGeoip, flagKeys } = resolvedOptions || {};\n let { onlyEvaluateLocally, personProperties, groupProperties } = resolvedOptions || {};\n const adjustedProperties = this.addLocalPersonAndGroupProperties(resolvedDistinctId, groups, personProperties, groupProperties);\n personProperties = adjustedProperties.allPersonProperties;\n groupProperties = adjustedProperties.allGroupProperties;\n const evaluationContext = this.createFeatureFlagEvaluationContext(resolvedDistinctId, groups, personProperties, groupProperties);\n if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;\n const localEvaluationResult = await this.featureFlagsPoller?.getAllFlagsAndPayloads(evaluationContext, flagKeys);\n let featureFlags = {};\n let featureFlagPayloads = {};\n let fallbackToFlags = true;\n if (localEvaluationResult) {\n featureFlags = localEvaluationResult.response;\n featureFlagPayloads = localEvaluationResult.payloads;\n fallbackToFlags = localEvaluationResult.fallbackToFlags;\n }\n if (fallbackToFlags && !onlyEvaluateLocally) {\n const remoteEvaluationResult = await super.getFeatureFlagsAndPayloadsStateless(evaluationContext.distinctId, evaluationContext.groups, evaluationContext.personProperties, evaluationContext.groupProperties, disableGeoip, flagKeys);\n featureFlags = {\n ...featureFlags,\n ...remoteEvaluationResult.flags || {}\n };\n featureFlagPayloads = {\n ...featureFlagPayloads,\n ...remoteEvaluationResult.payloads || {}\n };\n }\n if (void 0 !== this._flagOverrides) featureFlags = {\n ...featureFlags,\n ...this._flagOverrides\n };\n if (void 0 !== this._payloadOverrides) featureFlagPayloads = {\n ...featureFlagPayloads,\n ...this._payloadOverrides\n };\n return {\n featureFlags,\n featureFlagPayloads\n };\n }\n async evaluateFlags(distinctIdOrOptions, options) {\n const { distinctId: resolvedDistinctId, options: resolvedOptions } = this._resolveDistinctId(distinctIdOrOptions, options);\n if (!resolvedDistinctId) {\n this._logger.warn(\"[PostHog] distinctId is required to evaluate feature flags \\u2014 pass it explicitly or use withContext()\");\n return new FeatureFlagEvaluations({\n host: this._getFeatureFlagEvaluationsHost(),\n distinctId: '',\n flags: {}\n });\n }\n if (this.disabled) {\n this._logger.warn('The client is disabled');\n return new FeatureFlagEvaluations({\n host: this._getFeatureFlagEvaluationsHost(),\n distinctId: resolvedDistinctId,\n flags: {}\n });\n }\n const { groups, disableGeoip, flagKeys } = resolvedOptions || {};\n let { onlyEvaluateLocally, personProperties, groupProperties } = resolvedOptions || {};\n const adjustedProperties = this.addLocalPersonAndGroupProperties(resolvedDistinctId, groups, personProperties, groupProperties);\n personProperties = adjustedProperties.allPersonProperties;\n groupProperties = adjustedProperties.allGroupProperties;\n const evaluationContext = this.createFeatureFlagEvaluationContext(resolvedDistinctId, groups, personProperties, groupProperties);\n if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;\n const records = {};\n let requestId;\n let evaluatedAt;\n let errorsWhileComputing = false;\n let quotaLimited = false;\n const localResult = await this.featureFlagsPoller?.getAllFlagsAndPayloads(evaluationContext, flagKeys);\n const locallyEvaluatedKeys = new Set();\n if (localResult) for (const [key, value] of Object.entries(localResult.response)){\n const flagDef = this.featureFlagsPoller?.featureFlagsByKey[key];\n records[key] = {\n key,\n enabled: false !== value,\n variant: 'string' == typeof value ? value : void 0,\n payload: localResult.payloads[key],\n id: flagDef?.id,\n version: void 0,\n reason: 'Evaluated locally',\n locallyEvaluated: true\n };\n locallyEvaluatedKeys.add(key);\n }\n const fallbackToFlags = localResult ? localResult.fallbackToFlags : true;\n if (fallbackToFlags && !onlyEvaluateLocally) {\n const details = await super.getFeatureFlagDetailsStateless(evaluationContext.distinctId, evaluationContext.groups, evaluationContext.personProperties, evaluationContext.groupProperties, disableGeoip, flagKeys);\n if (details) {\n requestId = details.requestId;\n evaluatedAt = details.evaluatedAt;\n errorsWhileComputing = Boolean(details.errorsWhileComputingFlags);\n quotaLimited = Array.isArray(details.quotaLimited) && details.quotaLimited.includes('feature_flags');\n for (const [key, detail] of Object.entries(details.flags)){\n if (locallyEvaluatedKeys.has(key)) continue;\n let parsedPayload;\n if (detail.metadata?.payload !== void 0) try {\n parsedPayload = JSON.parse(detail.metadata.payload);\n } catch {\n parsedPayload = detail.metadata.payload;\n }\n records[key] = {\n key,\n enabled: detail.enabled,\n variant: detail.variant,\n payload: parsedPayload,\n id: detail.metadata?.id,\n version: detail.metadata?.version,\n reason: detail.reason?.description ?? detail.reason?.code,\n locallyEvaluated: false\n };\n }\n }\n }\n if (void 0 !== this._flagOverrides) for (const [key, value] of Object.entries(this._flagOverrides)){\n if (void 0 === value) {\n delete records[key];\n continue;\n }\n const existing = records[key];\n records[key] = {\n key,\n enabled: false !== value,\n variant: 'string' == typeof value ? value : void 0,\n payload: existing?.payload,\n id: existing?.id,\n version: existing?.version,\n reason: existing?.reason,\n locallyEvaluated: existing?.locallyEvaluated ?? false\n };\n }\n if (void 0 !== this._payloadOverrides) for (const [key, payload] of Object.entries(this._payloadOverrides)){\n const existing = records[key];\n if (existing) records[key] = {\n ...existing,\n payload\n };\n }\n return new FeatureFlagEvaluations({\n host: this._getFeatureFlagEvaluationsHost(),\n distinctId: resolvedDistinctId,\n groups,\n disableGeoip,\n flags: records,\n requestId,\n evaluatedAt,\n flagDefinitionsLoadedAt: this.featureFlagsPoller?.getFlagDefinitionsLoadedAt(),\n errorsWhileComputing,\n quotaLimited\n });\n }\n _captureFlagCalledEventIfNeeded(params) {\n const { distinctId, key, response, groups, disableGeoip, properties } = params;\n const groupSuffix = groups && Object.keys(groups).length > 0 ? `_${JSON.stringify(Object.entries(groups).sort(([a], [b])=>a < b ? -1 : a > b ? 1 : 0))}` : '';\n const featureFlagReportedKey = `${key}_${response}${groupSuffix}`;\n if (distinctId in this.distinctIdHasSentFlagCalls && this.distinctIdHasSentFlagCalls[distinctId].has(featureFlagReportedKey)) return;\n if (Object.keys(this.distinctIdHasSentFlagCalls).length >= this.maxCacheSize) this.distinctIdHasSentFlagCalls = {};\n if (this.distinctIdHasSentFlagCalls[distinctId] instanceof Set) this.distinctIdHasSentFlagCalls[distinctId].add(featureFlagReportedKey);\n else this.distinctIdHasSentFlagCalls[distinctId] = new Set([\n featureFlagReportedKey\n ]);\n this.capture({\n distinctId,\n event: '$feature_flag_called',\n properties,\n groups,\n disableGeoip\n });\n }\n _getFeatureFlagEvaluationsHost() {\n if (!this._featureFlagEvaluationsHost) this._featureFlagEvaluationsHost = {\n captureFlagCalledEventIfNeeded: (params)=>this._captureFlagCalledEventIfNeeded(params),\n logWarning: (message)=>{\n if (false !== this.options.featureFlagsLogWarnings) console.warn(`[PostHog] ${message}`);\n }\n };\n return this._featureFlagEvaluationsHost;\n }\n groupIdentify({ groupType, groupKey, properties, distinctId, disableGeoip }) {\n super.groupIdentifyStateless(groupType, groupKey, properties, {\n disableGeoip\n }, distinctId);\n }\n async reloadFeatureFlags() {\n await this.featureFlagsPoller?.loadFeatureFlags(true);\n }\n overrideFeatureFlags(overrides) {\n const flagArrayToRecord = (flags)=>Object.fromEntries(flags.map((f)=>[\n f,\n true\n ]));\n if (false === overrides) {\n this._flagOverrides = void 0;\n this._payloadOverrides = void 0;\n return;\n }\n if (Array.isArray(overrides)) {\n this._flagOverrides = flagArrayToRecord(overrides);\n return;\n }\n if (this._isFeatureFlagOverrideOptions(overrides)) {\n if ('flags' in overrides) {\n if (false === overrides.flags) this._flagOverrides = void 0;\n else if (Array.isArray(overrides.flags)) this._flagOverrides = flagArrayToRecord(overrides.flags);\n else if (void 0 !== overrides.flags) this._flagOverrides = {\n ...overrides.flags\n };\n }\n if ('payloads' in overrides) {\n if (false === overrides.payloads) this._payloadOverrides = void 0;\n else if (void 0 !== overrides.payloads) this._payloadOverrides = {\n ...overrides.payloads\n };\n }\n return;\n }\n this._flagOverrides = {\n ...overrides\n };\n }\n _isFeatureFlagOverrideOptions(overrides) {\n if ('object' != typeof overrides || null === overrides || Array.isArray(overrides)) return false;\n const obj = overrides;\n if ('flags' in obj) {\n const flagsValue = obj['flags'];\n if (false === flagsValue || Array.isArray(flagsValue) || 'object' == typeof flagsValue && null !== flagsValue) return true;\n }\n if ('payloads' in obj) {\n const payloadsValue = obj['payloads'];\n if (false === payloadsValue || 'object' == typeof payloadsValue && null !== payloadsValue) return true;\n }\n return false;\n }\n withContext(data, fn, options) {\n if (!this.context) return fn();\n return this.context.run(data, fn, options);\n }\n getContext() {\n return this.context?.get();\n }\n enterContext(data, options) {\n this.context?.enter(data, options);\n }\n async _shutdown(shutdownTimeoutMs) {\n const resolve = this._consumeWaitUntilCycle();\n await this.featureFlagsPoller?.stopPoller(shutdownTimeoutMs);\n this.errorTracking.shutdown();\n try {\n return await super._shutdown(shutdownTimeoutMs);\n } finally{\n resolve?.();\n }\n }\n async _requestRemoteConfigPayload(flagKey) {\n if (this.disabled || !this.apiKey || !this.options.personalApiKey) return;\n const url = `${this.host}/api/projects/@current/feature_flags/${flagKey}/remote_config?token=${encodeURIComponent(this.apiKey)}`;\n const options = {\n method: 'GET',\n headers: {\n ...this.getCustomHeaders(),\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${this.options.personalApiKey}`\n }\n };\n let abortTimeout = null;\n if (this.options.requestTimeout && 'number' == typeof this.options.requestTimeout) {\n const controller = new AbortController();\n abortTimeout = safeSetTimeout(()=>{\n controller.abort();\n }, this.options.requestTimeout);\n options.signal = controller.signal;\n }\n try {\n return await this.fetch(url, options);\n } catch (error) {\n this._events.emit('error', error);\n return;\n } finally{\n if (abortTimeout) clearTimeout(abortTimeout);\n }\n }\n extractPropertiesFromEvent(eventProperties, groups) {\n if (!eventProperties) return {\n personProperties: {},\n groupProperties: {}\n };\n const personProperties = {};\n const groupProperties = {};\n for (const [key, value] of Object.entries(eventProperties))if (isPlainObject(value) && groups && key in groups) {\n const groupProps = {};\n for (const [groupKey, groupValue] of Object.entries(value))groupProps[String(groupKey)] = String(groupValue);\n groupProperties[String(key)] = groupProps;\n } else personProperties[String(key)] = String(value);\n return {\n personProperties,\n groupProperties\n };\n }\n async getFeatureFlagsForEvent(distinctId, groups, disableGeoip, sendFeatureFlagsOptions) {\n if (this.disabled || !this.apiKey) return void this._logger.warn('The client is disabled');\n const finalPersonProperties = sendFeatureFlagsOptions?.personProperties || {};\n const finalGroupProperties = sendFeatureFlagsOptions?.groupProperties || {};\n const flagKeys = sendFeatureFlagsOptions?.flagKeys;\n const onlyEvaluateLocally = sendFeatureFlagsOptions?.onlyEvaluateLocally ?? this.options.strictLocalEvaluation ?? false;\n if (onlyEvaluateLocally) if (!((this.featureFlagsPoller?.featureFlags?.length || 0) > 0)) return {};\n else {\n const groupsWithStringValues = {};\n for (const [key, value] of Object.entries(groups || {}))groupsWithStringValues[key] = String(value);\n return await this.getAllFlags(distinctId, {\n groups: groupsWithStringValues,\n personProperties: finalPersonProperties,\n groupProperties: finalGroupProperties,\n disableGeoip,\n onlyEvaluateLocally: true,\n flagKeys\n });\n }\n if ((this.featureFlagsPoller?.featureFlags?.length || 0) > 0) {\n const groupsWithStringValues = {};\n for (const [key, value] of Object.entries(groups || {}))groupsWithStringValues[key] = String(value);\n return await this.getAllFlags(distinctId, {\n groups: groupsWithStringValues,\n personProperties: finalPersonProperties,\n groupProperties: finalGroupProperties,\n disableGeoip,\n onlyEvaluateLocally: true,\n flagKeys\n });\n }\n return (await super.getFeatureFlagsStateless(distinctId, groups, finalPersonProperties, finalGroupProperties, disableGeoip)).flags;\n }\n addLocalPersonAndGroupProperties(distinctId, groups, personProperties, groupProperties) {\n const allPersonProperties = {\n distinct_id: distinctId,\n ...personProperties || {}\n };\n const allGroupProperties = {};\n if (groups) for (const groupName of Object.keys(groups))allGroupProperties[groupName] = {\n $group_key: groups[groupName],\n ...groupProperties?.[groupName] || {}\n };\n return {\n allPersonProperties,\n allGroupProperties\n };\n }\n createFeatureFlagEvaluationContext(distinctId, groups, personProperties, groupProperties) {\n return {\n distinctId,\n groups: groups || {},\n personProperties: personProperties || {},\n groupProperties: groupProperties || {},\n evaluationCache: {}\n };\n }\n captureException(error, distinctId, additionalProperties, uuid, flags) {\n if (!error_tracking.isPreviouslyCapturedError(error)) {\n const syntheticException = new Error('PostHog syntheticException');\n this.addPendingPromise(error_tracking.buildEventMessage(this.getErrorPropertiesBuilder(), error, {\n syntheticException\n }, distinctId, additionalProperties).then((msg)=>this.capture({\n ...msg,\n uuid,\n flags\n })));\n }\n }\n async captureExceptionImmediate(error, distinctId, additionalProperties, flags) {\n if (!error_tracking.isPreviouslyCapturedError(error)) {\n const syntheticException = new Error('PostHog syntheticException');\n return this.addPendingPromise(error_tracking.buildEventMessage(this.getErrorPropertiesBuilder(), error, {\n syntheticException\n }, distinctId, additionalProperties).then((msg)=>this.captureImmediate({\n ...msg,\n flags\n })));\n }\n }\n async prepareEventMessage(props) {\n const { distinctId, event, properties, groups, flags, sendFeatureFlags, timestamp, disableGeoip, uuid } = props;\n const contextData = this.context?.get();\n let mergedDistinctId = distinctId || contextData?.distinctId;\n const mergedProperties = {\n ...this.props,\n ...contextData?.properties || {},\n ...properties || {}\n };\n if (!mergedDistinctId) {\n mergedDistinctId = uuidv7();\n mergedProperties.$process_person_profile = false;\n }\n if (contextData?.sessionId && !mergedProperties.$session_id) mergedProperties.$session_id = contextData.sessionId;\n const eventMessage = this._runBeforeSend({\n distinctId: mergedDistinctId,\n event,\n properties: mergedProperties,\n groups,\n flags,\n sendFeatureFlags,\n timestamp,\n disableGeoip,\n uuid\n });\n if (!eventMessage) return Promise.reject(null);\n const eventProperties = await Promise.resolve().then(async ()=>{\n if (flags) {\n if (sendFeatureFlags) console.warn('[PostHog] Both `flags` and `sendFeatureFlags` were passed to capture(); using `flags` and ignoring `sendFeatureFlags`.');\n return flags._getEventProperties();\n }\n if (sendFeatureFlags) {\n emitDeprecationWarningOnce('sendFeatureFlags', \"`sendFeatureFlags` is deprecated and will be removed in a future major version. Pass a `flags` snapshot from `posthog.evaluateFlags(...)` instead — it avoids a second `/flags` request per capture and guarantees the event carries the exact flag values your code branched on.\");\n const sendFeatureFlagsOptions = 'object' == typeof sendFeatureFlags ? sendFeatureFlags : void 0;\n const flagValues = await this.getFeatureFlagsForEvent(eventMessage.distinctId, groups, disableGeoip, sendFeatureFlagsOptions);\n return buildFlagEventProperties(flagValues);\n }\n return {};\n }).catch(()=>({})).then((additionalProperties)=>{\n const props = {\n ...additionalProperties,\n ...eventMessage.properties || {},\n $groups: eventMessage.groups || groups\n };\n return props;\n });\n if ('$pageview' === eventMessage.event && this.options.__preview_capture_bot_pageviews && 'string' == typeof eventProperties.$raw_user_agent) {\n if (isBlockedUA(eventProperties.$raw_user_agent, this.options.custom_blocked_useragents || [])) {\n eventMessage.event = '$bot_pageview';\n eventProperties.$browser_type = 'bot';\n }\n }\n return {\n distinctId: eventMessage.distinctId,\n event: eventMessage.event,\n properties: eventProperties,\n options: {\n timestamp: eventMessage.timestamp,\n disableGeoip: eventMessage.disableGeoip,\n uuid: eventMessage.uuid\n }\n };\n }\n _runBeforeSend(eventMessage) {\n const beforeSend = this.options.before_send;\n if (!beforeSend) return eventMessage;\n const fns = Array.isArray(beforeSend) ? beforeSend : [\n beforeSend\n ];\n let result = eventMessage;\n for (const fn of fns){\n result = fn(result);\n if (!result) {\n this._logger.info(`Event '${eventMessage.event}' was rejected in beforeSend function`);\n return null;\n }\n if (!result.properties || 0 === Object.keys(result.properties).length) {\n const message = `Event '${result.event}' has no properties after beforeSend function, this is likely an error.`;\n this._logger.warn(message);\n }\n }\n return result;\n }\n}\nexport { PostHogBackendClient, _resetDeprecationWarningsForTests };\n","import { AsyncLocalStorage } from \"node:async_hooks\";\nclass PostHogContext {\n constructor(){\n this.storage = new AsyncLocalStorage();\n }\n get() {\n return this.storage.getStore();\n }\n run(context, fn, options) {\n return this.storage.run(this.resolve(context, options), fn);\n }\n enter(context, options) {\n this.storage.enterWith(this.resolve(context, options));\n }\n resolve(context, options) {\n if (options?.fresh === true) return context;\n const current = this.get() || {};\n return {\n distinctId: context.distinctId ?? current.distinctId,\n sessionId: context.sessionId ?? current.sessionId,\n properties: {\n ...current.properties || {},\n ...context.properties || {}\n }\n };\n }\n}\nexport { PostHogContext };\n","const NAME = 'posthog-node';\nfunction createEventProcessor(_posthog, { organization, projectId, prefix, severityAllowList = [\n 'error'\n], sendExceptionsToPostHog = true } = {}) {\n return (event)=>{\n const shouldProcessLevel = '*' === severityAllowList || severityAllowList.includes(event.level);\n if (!shouldProcessLevel) return event;\n if (!event.tags) event.tags = {};\n const userId = event.tags[PostHogSentryIntegration.POSTHOG_ID_TAG];\n if (void 0 === userId) return event;\n const uiHost = _posthog.options.host ?? 'https://us.i.posthog.com';\n const personUrl = new URL(`/project/${_posthog.apiKey}/person/${userId}`, uiHost).toString();\n event.tags['PostHog Person URL'] = personUrl;\n const exceptions = event.exception?.values || [];\n const exceptionList = exceptions.map((exception)=>({\n ...exception,\n stacktrace: exception.stacktrace ? {\n ...exception.stacktrace,\n type: 'raw',\n frames: (exception.stacktrace.frames || []).map((frame)=>({\n ...frame,\n platform: \"node:javascript\"\n }))\n } : void 0\n }));\n const properties = {\n $exception_message: exceptions[0]?.value || event.message,\n $exception_type: exceptions[0]?.type,\n $exception_level: event.level,\n $exception_list: exceptionList,\n $sentry_event_id: event.event_id,\n $sentry_exception: event.exception,\n $sentry_exception_message: exceptions[0]?.value || event.message,\n $sentry_exception_type: exceptions[0]?.type,\n $sentry_tags: event.tags\n };\n if (organization && projectId) properties['$sentry_url'] = (prefix || 'https://sentry.io/organizations/') + organization + '/issues/?project=' + projectId + '&query=' + event.event_id;\n if (sendExceptionsToPostHog) _posthog.capture({\n event: '$exception',\n distinctId: userId,\n properties\n });\n return event;\n };\n}\nfunction sentryIntegration(_posthog, options) {\n const processor = createEventProcessor(_posthog, options);\n return {\n name: NAME,\n processEvent (event) {\n return processor(event);\n }\n };\n}\nclass PostHogSentryIntegration {\n static #_ = this.POSTHOG_ID_TAG = 'posthog_distinct_id';\n constructor(_posthog, organization, prefix, severityAllowList, sendExceptionsToPostHog){\n this.name = NAME;\n this.name = NAME;\n this.setupOnce = function(addGlobalEventProcessor, getCurrentHub) {\n const projectId = getCurrentHub()?.getClient()?.getDsn()?.projectId;\n addGlobalEventProcessor(createEventProcessor(_posthog, {\n organization,\n projectId,\n prefix,\n severityAllowList,\n sendExceptionsToPostHog: sendExceptionsToPostHog ?? true\n }));\n };\n }\n}\nexport { PostHogSentryIntegration, createEventProcessor, sentryIntegration };\n","import { createModulerModifier } from \"../extensions/error-tracking/modifiers/module.node.mjs\";\nimport { addSourceContext } from \"../extensions/error-tracking/modifiers/context-lines.node.mjs\";\nimport { createRelativePathModifier } from \"../extensions/error-tracking/modifiers/relative-path.node.mjs\";\nimport { PostHogBackendClient } from \"../client.mjs\";\nimport { ErrorTracking } from \"@posthog/core\";\nimport { PostHogContext } from \"../extensions/context/context.mjs\";\nexport * from \"../exports.mjs\";\nclass PostHog extends PostHogBackendClient {\n getLibraryId() {\n return 'posthog-node';\n }\n initializeContext() {\n return new PostHogContext();\n }\n createErrorPropertiesBuilder() {\n return new ErrorTracking.ErrorPropertiesBuilder([\n new ErrorTracking.EventCoercer(),\n new ErrorTracking.ErrorCoercer(),\n new ErrorTracking.ObjectCoercer(),\n new ErrorTracking.StringCoercer(),\n new ErrorTracking.PrimitiveCoercer()\n ], ErrorTracking.createStackParser(\"node:javascript\", ErrorTracking.nodeStackLineParser), [\n createModulerModifier(),\n addSourceContext,\n createRelativePathModifier()\n ]);\n }\n}\nexport { PostHog };\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],"mappings":";;;;;;AACA,SAAS,wBAAwB;CAC7B,MAAM,wBAAwB,4BAA4B;CAC1D,OAAO,OAAO,WAAS;EACnB,KAAK,MAAM,SAAS,QAAO,MAAM,SAAS,sBAAsB,MAAM,QAAQ;EAC9E,OAAO;CACX;AACJ;AACA,SAAS,4BAA4B,WAAW,QAAQ,KAAK,KAA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