posthog-js 1.200.0 → 1.200.2

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 (62) hide show
  1. package/dist/all-external-dependencies.js +1 -1
  2. package/dist/all-external-dependencies.js.map +1 -1
  3. package/dist/array.full.es5.js +1 -1
  4. package/dist/array.full.es5.js.map +1 -1
  5. package/dist/array.full.js +1 -1
  6. package/dist/array.full.js.map +1 -1
  7. package/dist/array.full.no-external.js +1 -1
  8. package/dist/array.full.no-external.js.map +1 -1
  9. package/dist/array.js +1 -1
  10. package/dist/array.js.map +1 -1
  11. package/dist/array.no-external.js +1 -1
  12. package/dist/array.no-external.js.map +1 -1
  13. package/dist/customizations.full.js +1 -1
  14. package/dist/customizations.full.js.map +1 -1
  15. package/dist/dead-clicks-autocapture.js.map +1 -1
  16. package/dist/exception-autocapture.js.map +1 -1
  17. package/dist/external-scripts-loader.js.map +1 -1
  18. package/dist/main.js +1 -1
  19. package/dist/main.js.map +1 -1
  20. package/dist/module.d.ts +5 -0
  21. package/dist/module.full.d.ts +5 -0
  22. package/dist/module.full.js +1 -1
  23. package/dist/module.full.js.map +1 -1
  24. package/dist/module.full.no-external.d.ts +5 -0
  25. package/dist/module.full.no-external.js +1 -1
  26. package/dist/module.full.no-external.js.map +1 -1
  27. package/dist/module.js +1 -1
  28. package/dist/module.js.map +1 -1
  29. package/dist/module.no-external.d.ts +5 -0
  30. package/dist/module.no-external.js +1 -1
  31. package/dist/module.no-external.js.map +1 -1
  32. package/dist/recorder-v2.js.map +1 -1
  33. package/dist/recorder.js.map +1 -1
  34. package/dist/src/constants.d.ts +6 -0
  35. package/dist/src/entrypoints/tracing-headers.d.ts +2 -2
  36. package/dist/src/types.d.ts +5 -0
  37. package/dist/src/utils/globals.d.ts +2 -2
  38. package/dist/surveys-preview.js.map +1 -1
  39. package/dist/surveys.js.map +1 -1
  40. package/dist/tracing-headers.js +1 -1
  41. package/dist/tracing-headers.js.map +1 -1
  42. package/dist/web-vitals.js.map +1 -1
  43. package/lib/package.json +1 -1
  44. package/lib/src/constants.d.ts +6 -0
  45. package/lib/src/constants.js +6 -0
  46. package/lib/src/constants.js.map +1 -1
  47. package/lib/src/entrypoints/tracing-headers.d.ts +2 -2
  48. package/lib/src/entrypoints/tracing-headers.js +5 -3
  49. package/lib/src/entrypoints/tracing-headers.js.map +1 -1
  50. package/lib/src/extensions/replay/sessionrecording.js +3 -0
  51. package/lib/src/extensions/replay/sessionrecording.js.map +1 -1
  52. package/lib/src/extensions/tracing-headers.js +0 -1
  53. package/lib/src/extensions/tracing-headers.js.map +1 -1
  54. package/lib/src/posthog-core.js +36 -13
  55. package/lib/src/posthog-core.js.map +1 -1
  56. package/lib/src/sessionid.js +6 -0
  57. package/lib/src/sessionid.js.map +1 -1
  58. package/lib/src/types.d.ts +5 -0
  59. package/lib/src/types.js.map +1 -1
  60. package/lib/src/utils/globals.d.ts +2 -2
  61. package/lib/src/utils/globals.js.map +1 -1
  62. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- !function(){"use strict";function t(t,e,n,o,r,i,s){try{var u=t[i](s),a=u.value}catch(t){return void n(t)}u.done?e(a):Promise.resolve(a).then(o,r)}var e="undefined"!=typeof window?window:void 0,n="undefined"!=typeof globalThis?globalThis:e,o=null==n?void 0:n.navigator;null==n||n.document,null==n||n.location,null==n||n.fetch,null!=n&&n.XMLHttpRequest&&"withCredentials"in new n.XMLHttpRequest&&n.XMLHttpRequest,null==n||n.AbortController,null==o||o.userAgent;var r,i=null!=e?e:{};!function(t){t.GZipJS="gzip-js",t.Base64="base64"}(r||(r={}));function s(t,e,n){try{if(!(e in t))return()=>{};var o=t[e],r=n(o);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=r,()=>{t[e]=o}}catch(t){return()=>{}}}var u=(t,e)=>{var{sessionId:n,windowId:o}=t.checkAndGetSessionAndWindowId(!0);e.headers.set("X-POSTHOG-SESSION-ID",n),e.headers.set("X-POSTHOG-WINDOW-ID",o)};i.__PosthogExtensions__=i.__PosthogExtensions__||{};var a={_patchFetch:n=>s(e,"fetch",(e=>function(){var o,r=(o=function*(t,o){var r=new Request(t,o);return u(n,r),e(r)},function(){var e=this,n=arguments;return new Promise((function(r,i){var s=o.apply(e,n);function u(e){t(s,r,i,u,a,"next",e)}function a(e){t(s,r,i,u,a,"throw",e)}u(void 0)}))});return function(t,e){return r.apply(this,arguments)}}())),_patchXHR:t=>s(e.XMLHttpRequest.prototype,"open",(e=>function(n,o){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,a=new Request(o);return u(t,a),e.call(this,n,a.url,r,i,s)}))};i.__PosthogExtensions__.tracingHeadersPatchFns=a,i.postHogTracingHeadersPatchFns=a}();
1
+ !function(){"use strict";function t(t,e,n,o,r,i,s){try{var u=t[i](s),a=u.value}catch(t){return void n(t)}u.done?e(a):Promise.resolve(a).then(o,r)}var e="undefined"!=typeof window?window:void 0,n="undefined"!=typeof globalThis?globalThis:e,o=null==n?void 0:n.navigator;null==n||n.document,null==n||n.location,null==n||n.fetch,null!=n&&n.XMLHttpRequest&&"withCredentials"in new n.XMLHttpRequest&&n.XMLHttpRequest,null==n||n.AbortController,null==o||o.userAgent;var r,i=null!=e?e:{};!function(t){t.GZipJS="gzip-js",t.Base64="base64"}(r||(r={}));function s(t,e,n){try{if(!(e in t))return()=>{};var o=t[e],r=n(o);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=r,()=>{t[e]=o}}catch(t){return()=>{}}}var u=(t,e)=>{if(t){var{sessionId:n,windowId:o}=t.checkAndGetSessionAndWindowId(!0);e.headers.set("X-POSTHOG-SESSION-ID",n),e.headers.set("X-POSTHOG-WINDOW-ID",o)}};i.__PosthogExtensions__=i.__PosthogExtensions__||{};var a={_patchFetch:n=>s(e,"fetch",(e=>function(){var o,r=(o=function*(t,o){var r=new Request(t,o);return u(n,r),e(r)},function(){var e=this,n=arguments;return new Promise((function(r,i){var s=o.apply(e,n);function u(e){t(s,r,i,u,a,"next",e)}function a(e){t(s,r,i,u,a,"throw",e)}u(void 0)}))});return function(t,e){return r.apply(this,arguments)}}())),_patchXHR:t=>s(e.XMLHttpRequest.prototype,"open",(e=>function(n,o){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,a=new Request(o);return u(t,a),e.call(this,n,a.url,r,i,s)}))};i.__PosthogExtensions__.tracingHeadersPatchFns=a,i.postHogTracingHeadersPatchFns=a}();
2
2
  //# sourceMappingURL=tracing-headers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tracing-headers.js","sources":["../src/utils/globals.ts","../src/types.ts","../src/extensions/replay/rrweb-plugins/patch.ts","../src/utils/type-utils.ts","../src/entrypoints/tracing-headers.ts"],"sourcesContent":["import { ErrorProperties } from '../extensions/exception-autocapture/error-conversion'\nimport type { PostHog } from '../posthog-core'\nimport { SessionIdManager } from '../sessionid'\nimport {\n DeadClicksAutoCaptureConfig,\n ErrorEventArgs,\n ErrorMetadata,\n Properties,\n RemoteConfig,\n SiteAppLoader,\n} from '../types'\n\n/*\n * Global helpers to protect access to browser globals in a way that is safer for different targets\n * like DOM, SSR, Web workers etc.\n *\n * NOTE: Typically we want the \"window\" but globalThis works for both the typical browser context as\n * well as other contexts such as the web worker context. Window is still exported for any bits that explicitly require it.\n * If in doubt - export the global you need from this file and use that as an optional value. This way the code path is forced\n * to handle the case where the global is not available.\n */\n\n// eslint-disable-next-line no-restricted-globals\nconst win: (Window & typeof globalThis) | undefined = typeof window !== 'undefined' ? window : undefined\n\nexport type AssignableWindow = Window &\n typeof globalThis &\n Record<string, any> & {\n __PosthogExtensions__?: PostHogExtensions\n _POSTHOG_CONFIG?: RemoteConfig\n _POSTHOG_JS_APPS?: SiteAppLoader[]\n }\n\n/**\n * This is our contract between (potentially) lazily loaded extensions and the SDK\n * changes to this interface can be breaking changes for users of the SDK\n */\n\nexport type PostHogExtensionKind =\n | 'toolbar'\n | 'exception-autocapture'\n | 'web-vitals'\n | 'recorder'\n | 'tracing-headers'\n | 'surveys'\n | 'dead-clicks-autocapture'\n | 'remote-config'\n\nexport interface LazyLoadedDeadClicksAutocaptureInterface {\n start: (observerTarget: Node) => void\n stop: () => void\n}\n\ninterface PostHogExtensions {\n loadExternalDependency?: (\n posthog: PostHog,\n kind: PostHogExtensionKind,\n callback: (error?: string | Event, event?: Event) => void\n ) => void\n\n loadSiteApp?: (posthog: PostHog, appUrl: string, callback: (error?: string | Event, event?: Event) => void) => void\n\n parseErrorAsProperties?: (\n [event, source, lineno, colno, error]: ErrorEventArgs,\n metadata?: ErrorMetadata\n ) => ErrorProperties\n errorWrappingFunctions?: {\n wrapOnError: (captureFn: (props: Properties) => void) => () => void\n wrapUnhandledRejection: (captureFn: (props: Properties) => void) => () => void\n }\n rrweb?: { record: any; version: string }\n rrwebPlugins?: { getRecordConsolePlugin: any; getRecordNetworkPlugin?: any }\n canActivateRepeatedly?: (survey: any) => boolean\n generateSurveys?: (posthog: PostHog) => any | undefined\n postHogWebVitalsCallbacks?: {\n onLCP: (metric: any) => void\n onCLS: (metric: any) => void\n onFCP: (metric: any) => void\n onINP: (metric: any) => void\n }\n tracingHeadersPatchFns?: {\n _patchFetch: (sessionManager: SessionIdManager) => () => void\n _patchXHR: (sessionManager: any) => () => void\n }\n initDeadClicksAutocapture?: (\n ph: PostHog,\n config: DeadClicksAutoCaptureConfig\n ) => LazyLoadedDeadClicksAutocaptureInterface\n}\n\nconst global: typeof globalThis | undefined = typeof globalThis !== 'undefined' ? globalThis : win\n\nexport const ArrayProto = Array.prototype\nexport const nativeForEach = ArrayProto.forEach\nexport const nativeIndexOf = ArrayProto.indexOf\n\nexport const navigator = global?.navigator\nexport const document = global?.document\nexport const location = global?.location\nexport const fetch = global?.fetch\nexport const XMLHttpRequest =\n global?.XMLHttpRequest && 'withCredentials' in new global.XMLHttpRequest() ? global.XMLHttpRequest : undefined\nexport const AbortController = global?.AbortController\nexport const userAgent = navigator?.userAgent\nexport const assignableWindow: AssignableWindow = win ?? ({} as any)\n\nexport { win as window }\n","import { PostHog } from './posthog-core'\nimport type { SegmentAnalytics } from './extensions/segment-integration'\nimport { recordOptions } from './extensions/replay/sessionrecording-utils'\n\nexport type Property = any\nexport type Properties = Record<string, Property>\n\nexport const COPY_AUTOCAPTURE_EVENT = '$copy_autocapture'\n\nexport const 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] as const\n\n/**\n * These events can be processed by the `beforeCapture` function\n * but can cause unexpected confusion in data.\n *\n * Some features of PostHog rely on receiving 100% of these events\n */\nexport type KnownUnsafeEditableEvent = typeof knownUnsafeEditableEvent[number]\n\n/**\n * These are known events PostHog events that can be processed by the `beforeCapture` function\n * That means PostHog functionality does not rely on receiving 100% of these for calculations\n * So, it is safe to sample them to reduce the volume of events sent to PostHog\n */\nexport type KnownEventName =\n | '$heatmaps_data'\n | '$opt_in'\n | '$exception'\n | '$$heatmap'\n | '$web_vitals'\n | '$dead_click'\n | '$autocapture'\n | typeof COPY_AUTOCAPTURE_EVENT\n | '$rageclick'\n\nexport type EventName =\n | KnownUnsafeEditableEvent\n | KnownEventName\n // magic value so that the type of EventName is a set of known strings or any other string\n // which means you get autocomplete for known strings\n // but no type complaints when you add an arbitrary string\n | (string & {})\n\nexport interface CaptureResult {\n uuid: string\n event: EventName\n properties: Properties\n $set?: Properties\n $set_once?: Properties\n timestamp?: Date\n}\n\nexport type AutocaptureCompatibleElement = 'a' | 'button' | 'form' | 'input' | 'select' | 'textarea' | 'label'\nexport type DomAutocaptureEvents = 'click' | 'change' | 'submit'\n\n/**\n * If an array is passed for an allowlist, autocapture events will only be sent for elements matching\n * at least one of the elements in the array. Multiple allowlists can be used\n */\nexport interface AutocaptureConfig {\n /**\n * List of URLs to allow autocapture on, can be strings to match\n * or regexes e.g. ['https://example.com', 'test.com/.*']\n * this is useful when you want to autocapture on specific pages only\n *\n * if you set both url_allowlist and url_ignorelist,\n * we check the allowlist first and then the ignorelist.\n * the ignorelist can override the allowlist\n */\n url_allowlist?: (string | RegExp)[]\n\n /**\n * List of URLs to not allow autocapture on, can be strings to match\n * or regexes e.g. ['https://example.com', 'test.com/.*']\n * this is useful when you want to autocapture on most pages but not some specific ones\n *\n * if you set both url_allowlist and url_ignorelist,\n * we check the allowlist first and then the ignorelist.\n * the ignorelist can override the allowlist\n */\n url_ignorelist?: (string | RegExp)[]\n\n /**\n * List of DOM events to allow autocapture on e.g. ['click', 'change', 'submit']\n */\n dom_event_allowlist?: DomAutocaptureEvents[]\n\n /**\n * List of DOM elements to allow autocapture on\n * e.g. ['a', 'button', 'form', 'input', 'select', 'textarea', 'label']\n * we consider the tree of elements from the root to the target element of the click event\n * so for the tree div > div > button > svg\n * if the allowlist has button then we allow the capture when the button or the svg is the click target\n * but not if either of the divs are detected as the click target\n */\n element_allowlist?: AutocaptureCompatibleElement[]\n\n /**\n * List of CSS selectors to allow autocapture on\n * e.g. ['[ph-capture]']\n * we consider the tree of elements from the root to the target element of the click event\n * so for the tree div > div > button > svg\n * and allow list config `['[id]']`\n * we will capture the click if the click-target or its parents has any id\n */\n css_selector_allowlist?: string[]\n\n /**\n * Exclude certain element attributes from autocapture\n * E.g. ['aria-label'] or [data-attr-pii]\n */\n element_attribute_ignorelist?: string[]\n\n capture_copied_text?: boolean\n}\n\nexport interface BootstrapConfig {\n distinctID?: string\n isIdentifiedID?: boolean\n featureFlags?: Record<string, boolean | string>\n featureFlagPayloads?: Record<string, JsonType>\n /**\n * Optionally provide a sessionID, this is so that you can provide an existing sessionID here to continue a user's session across a domain or device. It MUST be:\n * - unique to this user\n * - a valid UUID v7\n * - the timestamp part must be <= the timestamp of the first event in the session\n * - the timestamp of the last event in the session must be < the timestamp part + 24 hours\n * **/\n sessionID?: string\n}\n\nexport type SupportedWebVitalsMetrics = 'LCP' | 'CLS' | 'FCP' | 'INP'\n\nexport interface PerformanceCaptureConfig {\n /** works with session replay to use the browser's native performance observer to capture performance metrics */\n network_timing?: boolean\n /** use chrome's web vitals library to wrap fetch and capture web vitals */\n web_vitals?: boolean\n /**\n * We observe very large values reported by the Chrome web vitals library\n * These outliers are likely not real, useful values, and we exclude them\n * You can set this to 0 in order to include all values, NB this is not recommended\n * if not set this defaults to 15 minutes\n */\n __web_vitals_max_value?: number\n /**\n * By default all 4 metrics are captured\n * You can set this config to restrict which metrics are captured\n * e.g. ['CLS', 'FCP'] to only capture those two metrics\n * NB setting this does not override whether the capture is enabled\n */\n web_vitals_allowed_metrics?: SupportedWebVitalsMetrics[]\n /**\n * we delay flushing web vitals metrics to reduce the number of events we send\n * this is the maximum time we will wait before sending the metrics\n * if not set it defaults to 5 seconds\n */\n web_vitals_delayed_flush_ms?: number\n}\n\nexport interface DeadClickCandidate {\n node: Element\n originalEvent: MouseEvent\n timestamp: number\n // time between click and the most recent scroll\n scrollDelayMs?: number\n // time between click and the most recent mutation\n mutationDelayMs?: number\n // time between click and the most recent selection changed event\n selectionChangedDelayMs?: number\n // if neither scroll nor mutation seen before threshold passed\n absoluteDelayMs?: number\n}\n\nexport type DeadClicksAutoCaptureConfig = {\n // by default if a click is followed by a sroll within 100ms it is not a dead click\n scroll_threshold_ms?: number\n // by default if a click is followed by a selection change within 100ms it is not a dead click\n selection_change_threshold_ms?: number\n // by default if a click is followed by a mutation within 2500ms it is not a dead click\n mutation_threshold_ms?: number\n /**\n * Allows setting behavior for when a dead click is captured.\n * For e.g. to support capture to heatmaps\n *\n * If not provided the default behavior is to auto-capture dead click events\n *\n * Only intended to be provided by the SDK\n */\n __onCapture?: ((click: DeadClickCandidate, properties: Properties) => void) | undefined\n} & Pick<AutocaptureConfig, 'element_attribute_ignorelist'>\n\nexport interface HeatmapConfig {\n /*\n * how often to send batched data in $$heatmap_data events\n * if set to 0 or not set, sends using the default interval of 1 second\n * */\n flush_interval_milliseconds: number\n}\n\nexport type BeforeSendFn = (cr: CaptureResult | null) => CaptureResult | null\n\nexport interface PostHogConfig {\n api_host: string\n /** @deprecated - This property is no longer supported */\n api_method?: string\n api_transport?: 'XHR' | 'fetch'\n ui_host: string | null\n token: string\n autocapture: boolean | AutocaptureConfig\n rageclick: boolean\n cross_subdomain_cookie: boolean\n persistence: 'localStorage' | 'cookie' | 'memory' | 'localStorage+cookie' | 'sessionStorage'\n persistence_name: string\n /** @deprecated - Use 'persistence_name' instead */\n cookie_name?: string\n loaded: (posthog_instance: PostHog) => void\n store_google: boolean\n custom_campaign_params: string[]\n // a list of strings to be tested against navigator.userAgent to determine if the source is a bot\n // this is **added to** the default list of bots that we check\n // defaults to the empty array\n custom_blocked_useragents: string[]\n save_referrer: boolean\n verbose: boolean\n capture_pageview: boolean\n capture_pageleave: boolean | 'if_capture_pageview'\n debug: boolean\n cookie_expiration: number\n upgrade: boolean\n disable_session_recording: boolean\n disable_persistence: boolean\n /** @deprecated - use `disable_persistence` instead */\n disable_cookie?: boolean\n disable_surveys: boolean\n disable_web_experiments: boolean\n /** If set, posthog-js will never load external scripts such as those needed for Session Replay or Surveys. */\n disable_external_dependency_loading?: boolean\n enable_recording_console_log?: boolean\n secure_cookie: boolean\n ip: boolean\n /** Starts the SDK in an opted out state requiring opt_in_capturing() to be called before events will b captured */\n opt_out_capturing_by_default: boolean\n opt_out_capturing_persistence_type: 'localStorage' | 'cookie'\n /** If set to true this will disable persistence if the user is opted out of capturing. @default false */\n opt_out_persistence_by_default?: boolean\n /** Opt out of user agent filtering such as googlebot or other bots. Defaults to `false` */\n opt_out_useragent_filter: boolean\n\n opt_out_capturing_cookie_prefix: string | null\n opt_in_site_apps: boolean\n respect_dnt: boolean\n /** @deprecated - use `property_denylist` instead */\n property_blacklist?: string[]\n property_denylist: string[]\n request_headers: { [header_name: string]: string }\n on_request_error?: (error: RequestResponse) => void\n /** @deprecated - use `request_headers` instead */\n xhr_headers?: { [header_name: string]: string }\n /** @deprecated - use `on_request_error` instead */\n on_xhr_error?: (failedRequest: XMLHttpRequest) => void\n inapp_protocol: string\n inapp_link_new_window: boolean\n request_batching: boolean\n sanitize_properties: ((properties: Properties, event_name: string) => Properties) | null\n properties_string_max_length: number\n session_recording: SessionRecordingOptions\n session_idle_timeout_seconds: number\n mask_all_element_attributes: boolean\n mask_all_text: boolean\n advanced_disable_decide: boolean\n advanced_disable_feature_flags: boolean\n advanced_disable_feature_flags_on_first_load: boolean\n advanced_disable_toolbar_metrics: boolean\n feature_flag_request_timeout_ms: number\n get_device_id: (uuid: string) => string\n name: string\n /**\n * this is a read-only function that can be used to react to event capture\n * @deprecated - use `before_send` instead - NB before_send is not read only\n */\n _onCapture: (eventName: string, eventData: CaptureResult) => void\n /**\n * This function or array of functions - if provided - are called immediately before sending data to the server.\n * It allows you to edit data before it is sent, or choose not to send it all.\n * if provided as an array the functions are called in the order they are provided\n * any one function returning null means the event will not be sent\n */\n before_send?: BeforeSendFn | BeforeSendFn[]\n capture_performance?: boolean | PerformanceCaptureConfig\n // Should only be used for testing. Could negatively impact performance.\n disable_compression: boolean\n bootstrap: BootstrapConfig\n segment?: SegmentAnalytics\n __preview_send_client_session_params?: boolean\n /* @deprecated - use `capture_heatmaps` instead */\n enable_heatmaps?: boolean\n capture_heatmaps?: boolean | HeatmapConfig\n capture_dead_clicks?: boolean | DeadClicksAutoCaptureConfig\n disable_scroll_properties?: boolean\n // Let the pageview scroll stats use a custom css selector for the root element, e.g. `main`\n scroll_root_selector?: string | string[]\n\n /** You can control whether events from PostHog-js have person processing enabled with the `person_profiles` config setting. There are three options:\n * - `person_profiles: 'always'` _(default)_ - we will process persons data for all events\n * - `person_profiles: 'never'` - we won't process persons for any event. This means that anonymous users will not be merged once they sign up or login, so you lose the ability to create funnels that track users from anonymous to identified. All events (including `$identify`) will be sent with `$process_person_profile: False`.\n * - `person_profiles: 'identified_only'` - we will only process persons when you call `posthog.identify`, `posthog.alias`, `posthog.setPersonProperties`, `posthog.group`, `posthog.setPersonPropertiesForFlags` or `posthog.setGroupPropertiesForFlags` Anonymous users won't get person profiles.\n */\n person_profiles?: 'always' | 'never' | 'identified_only'\n /** @deprecated - use `person_profiles` instead */\n process_person?: 'always' | 'never' | 'identified_only'\n\n /** Client side rate limiting */\n rate_limiting?: {\n /** The average number of events per second that should be permitted (defaults to 10) */\n events_per_second?: number\n /** How many events can be captured in a burst. This defaults to 10 times the events_per_second count */\n events_burst_limit?: number\n }\n\n /** Used when sending data via `fetch`, use with care, this is intentionally meant to be used with NextJS `fetch`\n * Incorrect usage may cause out-of-date data for feature flags, actions tracking, etc.\n * See https://nextjs.org/docs/app/api-reference/functions/fetch#fetchurl-options\n */\n fetch_options?: {\n cache?: RequestInit['cache']\n next_options?: NextOptions\n }\n\n /**\n * PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION\n * whether to wrap fetch and add tracing headers to the request\n * */\n __add_tracing_headers?: boolean\n\n /**\n * PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION\n * enables the new RemoteConfig approach to loading config instead of decide\n * */\n __preview_remote_config?: boolean\n}\n\nexport interface OptInOutCapturingOptions {\n capture: (event: string, properties: Properties, options: CaptureOptions) => void\n capture_event_name: string\n capture_properties: Properties\n enable_persistence: boolean\n clear_persistence: boolean\n persistence_type: 'cookie' | 'localStorage' | 'localStorage+cookie'\n cookie_prefix: string\n cookie_expiration: number\n cross_subdomain_cookie: boolean\n secure_cookie: boolean\n}\n\nexport interface IsFeatureEnabledOptions {\n send_event: boolean\n}\n\nexport interface SessionRecordingOptions {\n blockClass?: string | RegExp\n blockSelector?: string | null\n ignoreClass?: string\n maskTextClass?: string | RegExp\n maskTextSelector?: string | null\n maskTextFn?: ((text: string, element: HTMLElement | null) => string) | null\n maskAllInputs?: boolean\n maskInputOptions?: recordOptions['maskInputOptions']\n maskInputFn?: ((text: string, element?: HTMLElement) => string) | null\n slimDOMOptions?: recordOptions['slimDOMOptions']\n collectFonts?: boolean\n inlineStylesheet?: boolean\n recordCrossOriginIframes?: boolean\n /**\n * Allows local config to override remote canvas recording settings from the decide response\n */\n captureCanvas?: SessionRecordingCanvasOptions\n /** @deprecated - use maskCapturedNetworkRequestFn instead */\n maskNetworkRequestFn?: ((data: NetworkRequest) => NetworkRequest | null | undefined) | null\n /** Modify the network request before it is captured. Returning null or undefined stops it being captured */\n maskCapturedNetworkRequestFn?: ((data: CapturedNetworkRequest) => CapturedNetworkRequest | null | undefined) | null\n // our settings here only support a subset of those proposed for rrweb's network capture plugin\n recordHeaders?: boolean\n recordBody?: boolean\n // ADVANCED: while a user is active we take a full snapshot of the browser every interval. For very few sites playback performance might be better with different interval. Set to 0 to disable\n full_snapshot_interval_millis?: number\n /*\n ADVANCED: whether to partially compress rrweb events before sending them to the server,\n defaults to true, can be set to false to disable partial compression\n NB requests are still compressed when sent to the server regardless of this setting\n */\n compress_events?: boolean\n /*\n ADVANCED: alters the threshold before a recording considers a user has become idle.\n Normally only altered alongside changes to session_idle_timeout_ms.\n Default is 5 minutes.\n */\n session_idle_threshold_ms?: number\n /*\n ADVANCED: alters the refill rate for the token bucket mutation throttling\n Normally only altered alongside posthog support guidance.\n Accepts values between 0 and 100\n Default is 10.\n */\n __mutationRateLimiterRefillRate?: number\n /*\n ADVANCED: alters the bucket size for the token bucket mutation throttling\n Normally only altered alongside posthog support guidance.\n Accepts values between 0 and 100\n Default is 100.\n */\n __mutationRateLimiterBucketSize?: number\n}\n\nexport type SessionIdChangedCallback = (\n sessionId: string,\n windowId: string | null | undefined,\n changeReason?: { noSessionId: boolean; activityTimeout: boolean; sessionPastMaximumLength: boolean }\n) => void\n\nexport enum Compression {\n GZipJS = 'gzip-js',\n Base64 = 'base64',\n}\n\n// Request types - these should be kept minimal to what request.ts needs\n\n// Minimal class to allow interop between different request methods (xhr / fetch)\nexport interface RequestResponse {\n statusCode: number\n text?: string\n json?: any\n}\n\nexport type RequestCallback = (response: RequestResponse) => void\n\n// See https://nextjs.org/docs/app/api-reference/functions/fetch#fetchurl-options\ntype NextOptions = { revalidate: false | 0 | number; tags: string[] }\n\nexport interface RequestOptions {\n url: string\n // Data can be a single object or an array of objects when batched\n data?: Record<string, any> | Record<string, any>[]\n headers?: Record<string, any>\n transport?: 'XHR' | 'fetch' | 'sendBeacon'\n method?: 'POST' | 'GET'\n urlQueryArgs?: { compression: Compression }\n callback?: RequestCallback\n timeout?: number\n noRetries?: boolean\n compression?: Compression | 'best-available'\n fetchOptions?: {\n cache?: RequestInit['cache']\n next?: NextOptions\n }\n}\n\n// Queued request types - the same as a request but with additional queueing information\n\nexport interface QueuedRequestOptions extends RequestOptions {\n batchKey?: string /** key of queue, e.g. 'sessionRecording' vs 'event' */\n}\n\n// Used explicitly for retriable requests\nexport interface RetriableRequestOptions extends QueuedRequestOptions {\n retriesPerformedSoFar?: number\n}\n\nexport interface CaptureOptions {\n $set?: Properties /** used with $identify */\n $set_once?: Properties /** used with $identify */\n _url?: string /** Used to override the desired endpoint for the captured event */\n _batchKey?: string /** key of queue, e.g. 'sessionRecording' vs 'event' */\n _noTruncate?: boolean /** if set, overrides and disables config.properties_string_max_length */\n send_instantly?: boolean /** if set skips the batched queue */\n skip_client_rate_limiting?: boolean /** if set skips the client side rate limiting */\n transport?: RequestOptions['transport'] /** if set, overrides the desired transport method */\n timestamp?: Date\n}\n\nexport type FlagVariant = { flag: string; variant: string }\n\nexport type SessionRecordingCanvasOptions = {\n recordCanvas?: boolean | null\n canvasFps?: number | null\n // the API returns a decimal between 0 and 1 as a string\n canvasQuality?: string | null\n}\n\nexport interface RemoteConfig {\n supportedCompression: Compression[]\n autocapture_opt_out?: boolean\n /**\n * originally capturePerformance was replay only and so boolean true\n * is equivalent to { network_timing: true }\n * now capture performance can be separately enabled within replay\n * and as a standalone web vitals tracker\n * people can have them enabled separately\n * they work standalone but enhance each other\n * TODO: deprecate this so we make a new config that doesn't need this explanation\n */\n capturePerformance?: boolean | PerformanceCaptureConfig\n analytics?: {\n endpoint?: string\n }\n elementsChainAsString?: boolean\n // this is currently in development and may have breaking changes without a major version bump\n autocaptureExceptions?:\n | boolean\n | {\n endpoint?: string\n }\n sessionRecording?: SessionRecordingCanvasOptions & {\n endpoint?: string\n consoleLogRecordingEnabled?: boolean\n // the API returns a decimal between 0 and 1 as a string\n sampleRate?: string | null\n minimumDurationMilliseconds?: number\n linkedFlag?: string | FlagVariant | null\n networkPayloadCapture?: Pick<NetworkRecordOptions, 'recordBody' | 'recordHeaders'>\n urlTriggers?: SessionRecordingUrlTrigger[]\n scriptConfig?: { script?: string | undefined }\n urlBlocklist?: SessionRecordingUrlTrigger[]\n eventTriggers?: string[]\n }\n surveys?: boolean\n toolbarParams: ToolbarParams\n editorParams?: ToolbarParams /** @deprecated, renamed to toolbarParams, still present on older API responses */\n toolbarVersion: 'toolbar' /** @deprecated, moved to toolbarParams */\n isAuthenticated: boolean\n siteApps: { id: string; url: string }[]\n heatmaps?: boolean\n defaultIdentifiedOnly?: boolean\n captureDeadClicks?: boolean\n hasFeatureFlags?: boolean // Indicates if the team has any flags enabled (if not we don't need to load them)\n}\n\nexport interface DecideResponse extends RemoteConfig {\n featureFlags: Record<string, string | boolean>\n featureFlagPayloads: Record<string, JsonType>\n errorsWhileComputingFlags: boolean\n}\n\nexport type SiteAppGlobals = {\n event: {\n uuid: string\n event: EventName\n properties: Properties\n timestamp?: Date\n elements_chain?: string\n distinct_id?: string\n }\n person: {\n properties: Properties\n }\n groups: Record<string, { id: string; type: string; properties: Properties }>\n}\n\nexport type SiteAppLoader = {\n id: string\n init: (config: { posthog: PostHog; callback: (success: boolean) => void }) => {\n processEvent?: (globals: SiteAppGlobals) => void\n }\n}\n\nexport type SiteApp = {\n id: string\n loaded: boolean\n errored: boolean\n processEvent?: (globals: SiteAppGlobals) => void\n}\n\nexport type FeatureFlagsCallback = (\n flags: string[],\n variants: Record<string, string | boolean>,\n context?: {\n errorsLoading?: boolean\n }\n) => void\n\nexport interface PersistentStore {\n is_supported: () => boolean\n error: (error: any) => void\n parse: (name: string) => any\n get: (name: string) => any\n set: (\n name: string,\n value: any,\n expire_days?: number | null,\n cross_subdomain?: boolean,\n secure?: boolean,\n debug?: boolean\n ) => void\n remove: (name: string, cross_subdomain?: boolean) => void\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport type Breaker = {}\nexport type EventHandler = (event: Event) => boolean | void\n\nexport type ToolbarUserIntent = 'add-action' | 'edit-action'\nexport type ToolbarSource = 'url' | 'localstorage'\nexport type ToolbarVersion = 'toolbar'\n\n/* sync with posthog */\nexport interface ToolbarParams {\n token?: string /** public posthog-js token */\n temporaryToken?: string /** private temporary user token */\n actionId?: number\n userIntent?: ToolbarUserIntent\n source?: ToolbarSource\n toolbarVersion?: ToolbarVersion\n instrument?: boolean\n distinctId?: string\n userEmail?: string\n dataAttributes?: string[]\n featureFlags?: Record<string, string | boolean>\n}\n\nexport type SnippetArrayItem = [method: string, ...args: any[]]\n\nexport type JsonRecord = { [key: string]: JsonType }\nexport type JsonType = string | number | boolean | null | JsonRecord | Array<JsonType>\n\n/** A feature that isn't publicly available yet.*/\nexport interface EarlyAccessFeature {\n // Sync this with the backend's EarlyAccessFeatureSerializer!\n name: string\n description: string\n stage: 'concept' | 'alpha' | 'beta'\n documentationUrl: string | null\n flagKey: string | null\n}\n\nexport type EarlyAccessFeatureCallback = (earlyAccessFeatures: EarlyAccessFeature[]) => void\n\nexport interface EarlyAccessFeatureResponse {\n earlyAccessFeatures: EarlyAccessFeature[]\n}\n\nexport type Headers = Record<string, string>\n\n/* for rrweb/network@1\n ** when that is released as part of rrweb this can be removed\n ** don't rely on this type, it may change without notice\n */\nexport type InitiatorType =\n | 'audio'\n | 'beacon'\n | 'body'\n | 'css'\n | 'early-hint'\n | 'embed'\n | 'fetch'\n | 'frame'\n | 'iframe'\n | 'icon'\n | 'image'\n | 'img'\n | 'input'\n | 'link'\n | 'navigation'\n | 'object'\n | 'ping'\n | 'script'\n | 'track'\n | 'video'\n | 'xmlhttprequest'\n\nexport type NetworkRecordOptions = {\n initiatorTypes?: InitiatorType[]\n maskRequestFn?: (data: CapturedNetworkRequest) => CapturedNetworkRequest | undefined\n recordHeaders?: boolean | { request: boolean; response: boolean }\n recordBody?: boolean | string[] | { request: boolean | string[]; response: boolean | string[] }\n recordInitialRequests?: boolean\n /**\n * whether to record PerformanceEntry events for network requests\n */\n recordPerformance?: boolean\n /**\n * the PerformanceObserver will only observe these entry types\n */\n performanceEntryTypeToObserve: string[]\n /**\n * the maximum size of the request/response body to record\n * NB this will be at most 1MB even if set larger\n */\n payloadSizeLimitBytes: number\n /**\n * some domains we should never record the payload\n * for example other companies session replay ingestion payloads aren't super useful but are gigantic\n * if this isn't provided we use a default list\n * if this is provided - we add the provided list to the default list\n * i.e. we never record the payloads on the default deny list\n */\n payloadHostDenyList?: string[]\n}\n\n/** @deprecated - use CapturedNetworkRequest instead */\nexport type NetworkRequest = {\n url: string\n}\n\n// In rrweb this is called NetworkRequest, but we already exposed that as having only URL\n// we also want to vary from the rrweb NetworkRequest because we want to include\n// all PerformanceEntry properties too.\n// that has 4 required properties\n// readonly duration: DOMHighResTimeStamp;\n// readonly entryType: string;\n// readonly name: string;\n// readonly startTime: DOMHighResTimeStamp;\n// NB: properties below here are ALPHA, don't rely on them, they may change without notice\n\n// we mirror PerformanceEntry since we read into this type from a PerformanceObserver,\n// but we don't want to inherit its readonly-iness\ntype Writable<T> = { -readonly [P in keyof T]: T[P] }\n\nexport type CapturedNetworkRequest = Writable<Omit<PerformanceEntry, 'toJSON'>> & {\n // properties below here are ALPHA, don't rely on them, they may change without notice\n method?: string\n initiatorType?: InitiatorType\n status?: number\n timeOrigin?: number\n timestamp?: number\n startTime?: number\n endTime?: number\n requestHeaders?: Headers\n requestBody?: string | null\n responseHeaders?: Headers\n responseBody?: string | null\n // was this captured before fetch/xhr could have been wrapped\n isInitial?: boolean\n}\n\nexport type ErrorEventArgs = [\n event: string | Event,\n source?: string | undefined,\n lineno?: number | undefined,\n colno?: number | undefined,\n error?: Error | undefined\n]\n\nexport type ErrorMetadata = {\n handled?: boolean\n synthetic?: boolean\n syntheticException?: Error\n overrideExceptionType?: string\n overrideExceptionMessage?: string\n defaultExceptionType?: string\n defaultExceptionMessage?: string\n}\n\n// levels originally copied from Sentry to work with the sentry integration\n// and to avoid relying on a frequently changing @sentry/types dependency\n// but provided as an array of literal types, so we can constrain the level below\nexport const severityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug'] as const\nexport declare type SeverityLevel = typeof severityLevels[number]\n\nexport interface ErrorProperties {\n $exception_type: string\n $exception_message: string\n $exception_level: SeverityLevel\n $exception_source?: string\n $exception_lineno?: number\n $exception_colno?: number\n $exception_DOMException_code?: string\n $exception_is_synthetic?: boolean\n $exception_stack_trace_raw?: string\n $exception_handled?: boolean\n $exception_personURL?: string\n}\n\nexport interface ErrorConversions {\n errorToProperties: (args: ErrorEventArgs) => ErrorProperties\n unhandledRejectionToProperties: (args: [ev: PromiseRejectionEvent]) => ErrorProperties\n}\n\nexport interface SessionRecordingUrlTrigger {\n url: string\n matching: 'regex'\n}\n","// import { patch } from 'rrweb/typings/utils'\n// copied from https://github.com/rrweb-io/rrweb/blob/8aea5b00a4dfe5a6f59bd2ae72bb624f45e51e81/packages/rrweb/src/utils.ts#L129\n// which was copied from https://github.com/getsentry/sentry-javascript/blob/b2109071975af8bf0316d3b5b38f519bdaf5dc15/packages/utils/src/object.ts\nimport { isFunction } from '../../../utils/type-utils'\n\nexport function patch(\n source: { [key: string]: any },\n name: string,\n replacement: (...args: unknown[]) => unknown\n): () => void {\n try {\n if (!(name in source)) {\n return () => {\n //\n }\n }\n\n const original = source[name] as () => unknown\n const wrapped = replacement(original)\n\n // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n if (isFunction(wrapped)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n wrapped.prototype = wrapped.prototype || {}\n Object.defineProperties(wrapped, {\n __posthog_wrapped__: {\n enumerable: false,\n value: true,\n },\n })\n }\n\n source[name] = wrapped\n\n return () => {\n source[name] = original\n }\n } catch {\n return () => {\n //\n }\n // This can throw if multiple fill happens on a global object like XMLHttpRequest\n // Fixes https://github.com/getsentry/sentry-javascript/issues/2043\n }\n}\n","import { includes } from '.'\nimport { window } from './globals'\nimport { knownUnsafeEditableEvent, KnownUnsafeEditableEvent } from '../types'\n\n// eslint-disable-next-line posthog-js/no-direct-array-check\nconst nativeIsArray = Array.isArray\nconst ObjProto = Object.prototype\nexport const hasOwnProperty = ObjProto.hasOwnProperty\nconst toString = ObjProto.toString\n\nexport const isArray =\n nativeIsArray ||\n function (obj: any): obj is any[] {\n return toString.call(obj) === '[object Array]'\n }\n\n// from a comment on http://dbj.org/dbj/?p=286\n// fails on only one very rare and deliberate custom object:\n// let bomb = { toString : undefined, valueOf: function(o) { return \"function BOMBA!\"; }};\nexport const isFunction = (x: unknown): x is (...args: any[]) => any => {\n // eslint-disable-next-line posthog-js/no-direct-function-check\n return typeof x === 'function'\n}\n\nexport const isNativeFunction = (x: unknown): x is (...args: any[]) => any =>\n isFunction(x) && x.toString().indexOf('[native code]') !== -1\n\n// When angular patches functions they pass the above `isNativeFunction` check (at least the MutationObserver)\nexport const isAngularZonePresent = (): boolean => {\n return !!(window as any).Zone\n}\n\n// Underscore Addons\nexport const isObject = (x: unknown): x is Record<string, any> => {\n // eslint-disable-next-line posthog-js/no-direct-object-check\n return x === Object(x) && !isArray(x)\n}\nexport const isEmptyObject = (x: unknown): x is Record<string, any> => {\n if (isObject(x)) {\n for (const key in x) {\n if (hasOwnProperty.call(x, key)) {\n return false\n }\n }\n return true\n }\n return false\n}\nexport const isUndefined = (x: unknown): x is undefined => x === void 0\n\nexport const isString = (x: unknown): x is string => {\n // eslint-disable-next-line posthog-js/no-direct-string-check\n return toString.call(x) == '[object String]'\n}\n\nexport const isEmptyString = (x: unknown): boolean => isString(x) && x.trim().length === 0\n\nexport const isNull = (x: unknown): x is null => {\n // eslint-disable-next-line posthog-js/no-direct-null-check\n return x === null\n}\n\n/*\n sometimes you want to check if something is null or undefined\n that's what this is for\n */\nexport const isNullish = (x: unknown): x is null | undefined => isUndefined(x) || isNull(x)\n\nexport const isNumber = (x: unknown): x is number => {\n // eslint-disable-next-line posthog-js/no-direct-number-check\n return toString.call(x) == '[object Number]'\n}\nexport const isBoolean = (x: unknown): x is boolean => {\n // eslint-disable-next-line posthog-js/no-direct-boolean-check\n return toString.call(x) === '[object Boolean]'\n}\n\nexport const isDocument = (x: unknown): x is Document => {\n // eslint-disable-next-line posthog-js/no-direct-document-check\n return x instanceof Document\n}\n\nexport const isFormData = (x: unknown): x is FormData => {\n // eslint-disable-next-line posthog-js/no-direct-form-data-check\n return x instanceof FormData\n}\n\nexport const isFile = (x: unknown): x is File => {\n // eslint-disable-next-line posthog-js/no-direct-file-check\n return x instanceof File\n}\n\nexport const isKnownUnsafeEditableEvent = (x: unknown): x is KnownUnsafeEditableEvent => {\n return includes(knownUnsafeEditableEvent as unknown as string[], x)\n}\n","import { SessionIdManager } from '../sessionid'\nimport { patch } from '../extensions/replay/rrweb-plugins/patch'\nimport { assignableWindow, window } from '../utils/globals'\n\nconst addTracingHeaders = (sessionManager: SessionIdManager, req: Request) => {\n const { sessionId, windowId } = sessionManager.checkAndGetSessionAndWindowId(true)\n req.headers.set('X-POSTHOG-SESSION-ID', sessionId)\n req.headers.set('X-POSTHOG-WINDOW-ID', windowId)\n}\n\nconst patchFetch = (sessionManager: SessionIdManager): (() => void) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return patch(window, 'fetch', (originalFetch: typeof fetch) => {\n return async function (url: URL | RequestInfo, init?: RequestInit | undefined) {\n // check IE earlier than this, we only initialize if Request is present\n // eslint-disable-next-line compat/compat\n const req = new Request(url, init)\n\n addTracingHeaders(sessionManager, req)\n\n return originalFetch(req)\n }\n })\n}\n\nconst patchXHR = (sessionManager: SessionIdManager): (() => void) => {\n return patch(\n // we can assert this is present because we've checked previously\n window!.XMLHttpRequest.prototype,\n 'open',\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n (originalOpen: typeof XMLHttpRequest.prototype.open) => {\n return function (\n method: string,\n url: string | URL,\n async = true,\n username?: string | null,\n password?: string | null\n ) {\n // because this function is returned in its actual context `this` _is_ an XMLHttpRequest\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const xhr = this as XMLHttpRequest\n\n // check IE earlier than this, we only initialize if Request is present\n // eslint-disable-next-line compat/compat\n const req = new Request(url)\n\n addTracingHeaders(sessionManager, req)\n\n return originalOpen.call(xhr, method, req.url, async, username, password)\n }\n }\n )\n}\n\nassignableWindow.__PosthogExtensions__ = assignableWindow.__PosthogExtensions__ || {}\nconst patchFns = {\n _patchFetch: patchFetch,\n _patchXHR: patchXHR,\n}\nassignableWindow.__PosthogExtensions__.tracingHeadersPatchFns = patchFns\n\n// we used to put tracingHeadersPatchFns on window, and now we put it on __PosthogExtensions__\n// but that means that old clients which lazily load this extension are looking in the wrong place\n// yuck,\n// so we also put it directly on the window\n// when 1.161.1 is the oldest version seen in production we can remove this\nassignableWindow.postHogTracingHeadersPatchFns = patchFns\n\nexport default patchFns\n"],"names":["win","window","undefined","global","globalThis","navigator","document","location","fetch","XMLHttpRequest","AbortController","userAgent","Compression","assignableWindow","patch","source","name","replacement","original","wrapped","prototype","Object","defineProperties","__posthog_wrapped__","enumerable","value","_unused","addTracingHeaders","sessionManager","req","sessionId","windowId","checkAndGetSessionAndWindowId","headers","set","__PosthogExtensions__","patchFns","_patchFetch","originalFetch","_ref","url","init","Request","_x","_x2","apply","this","arguments","_patchXHR","originalOpen","method","async","length","username","password","call","tracingHeadersPatchFns","postHogTracingHeadersPatchFns"],"mappings":"kJAuBA,IAAMA,EAAkE,oBAAXC,OAAyBA,YAASC,EAmEzFC,EAA8D,oBAAfC,WAA6BA,WAAaJ,EAMlFK,EAAYF,aAAM,EAANA,EAAQE,UACTF,SAAAA,EAAQG,SACRH,SAAAA,EAAQI,SACXJ,SAAAA,EAAQK,MAEzBL,SAAAA,EAAQM,gBAAkB,oBAAqB,IAAIN,EAAOM,gBAAmBN,EAAOM,eACzDN,SAAAA,EAAQO,gBACdL,SAAAA,EAAWM,UAC7B,IC2UKC,ED3UCC,EAAqCb,QAAAA,EAAQ,CAAU,GCkVpE,SAPYY,GAAAA,EAAW,OAAA,UAAXA,EAAW,OAAA,QAAXA,CAOZ,CAPYA,IAAAA,EAgBZ,CAAA,IC9bO,SAASE,EACZC,EACAC,EACAC,GAEA,IACI,KAAMD,KAAQD,GACV,MAAO,OAKX,IAAMG,EAAWH,EAAOC,GAClBG,EAAUF,EAAYC,GAiB5B,MCdgB,mBDCDC,IAEXA,EAAQC,UAAYD,EAAQC,WAAa,CAAA,EACzCC,OAAOC,iBAAiBH,EAAS,CAC7BI,oBAAqB,CACjBC,YAAY,EACZC,OAAO,MAKnBV,EAAOC,GAAQG,EAER,KACHJ,EAAOC,GAAQE,CAAQ,CAE9B,CAAC,MAAAQ,GACE,MAAO,MAKX,CACJ,CEzCA,IAAMC,EAAoBA,CAACC,EAAkCC,KACzD,IAAMC,UAAEA,EAASC,SAAEA,GAAaH,EAAeI,+BAA8B,GAC7EH,EAAII,QAAQC,IAAI,uBAAwBJ,GACxCD,EAAII,QAAQC,IAAI,sBAAuBH,EAAS,EAmDpDlB,EAAiBsB,sBAAwBtB,EAAiBsB,uBAAyB,GACnF,IAAMC,EAAW,CACbC,YAlDgBT,GAGTd,EAAMb,EAAQ,SAAUqC,GAC3B,WAAA,MAAAC,KAAO,UAAgBC,EAAwBC,GAG3C,IAAMZ,EAAM,IAAIa,QAAQF,EAAKC,GAI7B,OAFAd,EAAkBC,EAAgBC,GAE3BS,EAAcT,mLACxB,OAAAc,SAAAA,EAAAC,GAAA,OAAAL,EAAAM,MAAAC,KAAAC,UAAA,CAAA,CARD,KA+CJC,UAnCcpB,GACPd,EAEHb,EAAQQ,eAAeW,UACvB,QAGC6B,GACU,SACHC,EACAV,GAIF,IAHEW,IAAKJ,UAAAK,OAAA,QAAAlD,IAAA6C,UAAA,KAAAA,UAAA,GACLM,EAAwBN,UAAAK,OAAAL,EAAAA,kBAAA7C,EACxBoD,EAAwBP,UAAAK,OAAAL,EAAAA,kBAAA7C,EASlB2B,EAAM,IAAIa,QAAQF,GAIxB,OAFAb,EAAkBC,EAAgBC,GAE3BoB,EAAaM,KARRT,KAQkBI,EAAQrB,EAAIW,IAAKW,EAAOE,EAAUC,OAWhFzC,EAAiBsB,sBAAsBqB,uBAAyBpB,EAOhEvB,EAAiB4C,8BAAgCrB"}
1
+ {"version":3,"file":"tracing-headers.js","sources":["../src/utils/globals.ts","../src/types.ts","../src/extensions/replay/rrweb-plugins/patch.ts","../src/utils/type-utils.ts","../src/entrypoints/tracing-headers.ts"],"sourcesContent":["import { ErrorProperties } from '../extensions/exception-autocapture/error-conversion'\nimport type { PostHog } from '../posthog-core'\nimport { SessionIdManager } from '../sessionid'\nimport {\n DeadClicksAutoCaptureConfig,\n ErrorEventArgs,\n ErrorMetadata,\n Properties,\n RemoteConfig,\n SiteAppLoader,\n} from '../types'\n\n/*\n * Global helpers to protect access to browser globals in a way that is safer for different targets\n * like DOM, SSR, Web workers etc.\n *\n * NOTE: Typically we want the \"window\" but globalThis works for both the typical browser context as\n * well as other contexts such as the web worker context. Window is still exported for any bits that explicitly require it.\n * If in doubt - export the global you need from this file and use that as an optional value. This way the code path is forced\n * to handle the case where the global is not available.\n */\n\n// eslint-disable-next-line no-restricted-globals\nconst win: (Window & typeof globalThis) | undefined = typeof window !== 'undefined' ? window : undefined\n\nexport type AssignableWindow = Window &\n typeof globalThis &\n Record<string, any> & {\n __PosthogExtensions__?: PostHogExtensions\n _POSTHOG_CONFIG?: RemoteConfig\n _POSTHOG_JS_APPS?: SiteAppLoader[]\n }\n\n/**\n * This is our contract between (potentially) lazily loaded extensions and the SDK\n * changes to this interface can be breaking changes for users of the SDK\n */\n\nexport type PostHogExtensionKind =\n | 'toolbar'\n | 'exception-autocapture'\n | 'web-vitals'\n | 'recorder'\n | 'tracing-headers'\n | 'surveys'\n | 'dead-clicks-autocapture'\n | 'remote-config'\n\nexport interface LazyLoadedDeadClicksAutocaptureInterface {\n start: (observerTarget: Node) => void\n stop: () => void\n}\n\ninterface PostHogExtensions {\n loadExternalDependency?: (\n posthog: PostHog,\n kind: PostHogExtensionKind,\n callback: (error?: string | Event, event?: Event) => void\n ) => void\n\n loadSiteApp?: (posthog: PostHog, appUrl: string, callback: (error?: string | Event, event?: Event) => void) => void\n\n parseErrorAsProperties?: (\n [event, source, lineno, colno, error]: ErrorEventArgs,\n metadata?: ErrorMetadata\n ) => ErrorProperties\n errorWrappingFunctions?: {\n wrapOnError: (captureFn: (props: Properties) => void) => () => void\n wrapUnhandledRejection: (captureFn: (props: Properties) => void) => () => void\n }\n rrweb?: { record: any; version: string }\n rrwebPlugins?: { getRecordConsolePlugin: any; getRecordNetworkPlugin?: any }\n canActivateRepeatedly?: (survey: any) => boolean\n generateSurveys?: (posthog: PostHog) => any | undefined\n postHogWebVitalsCallbacks?: {\n onLCP: (metric: any) => void\n onCLS: (metric: any) => void\n onFCP: (metric: any) => void\n onINP: (metric: any) => void\n }\n tracingHeadersPatchFns?: {\n _patchFetch: (sessionManager?: SessionIdManager) => () => void\n _patchXHR: (sessionManager?: SessionIdManager) => () => void\n }\n initDeadClicksAutocapture?: (\n ph: PostHog,\n config: DeadClicksAutoCaptureConfig\n ) => LazyLoadedDeadClicksAutocaptureInterface\n}\n\nconst global: typeof globalThis | undefined = typeof globalThis !== 'undefined' ? globalThis : win\n\nexport const ArrayProto = Array.prototype\nexport const nativeForEach = ArrayProto.forEach\nexport const nativeIndexOf = ArrayProto.indexOf\n\nexport const navigator = global?.navigator\nexport const document = global?.document\nexport const location = global?.location\nexport const fetch = global?.fetch\nexport const XMLHttpRequest =\n global?.XMLHttpRequest && 'withCredentials' in new global.XMLHttpRequest() ? global.XMLHttpRequest : undefined\nexport const AbortController = global?.AbortController\nexport const userAgent = navigator?.userAgent\nexport const assignableWindow: AssignableWindow = win ?? ({} as any)\n\nexport { win as window }\n","import { PostHog } from './posthog-core'\nimport type { SegmentAnalytics } from './extensions/segment-integration'\nimport { recordOptions } from './extensions/replay/sessionrecording-utils'\n\nexport type Property = any\nexport type Properties = Record<string, Property>\n\nexport const COPY_AUTOCAPTURE_EVENT = '$copy_autocapture'\n\nexport const 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] as const\n\n/**\n * These events can be processed by the `beforeCapture` function\n * but can cause unexpected confusion in data.\n *\n * Some features of PostHog rely on receiving 100% of these events\n */\nexport type KnownUnsafeEditableEvent = typeof knownUnsafeEditableEvent[number]\n\n/**\n * These are known events PostHog events that can be processed by the `beforeCapture` function\n * That means PostHog functionality does not rely on receiving 100% of these for calculations\n * So, it is safe to sample them to reduce the volume of events sent to PostHog\n */\nexport type KnownEventName =\n | '$heatmaps_data'\n | '$opt_in'\n | '$exception'\n | '$$heatmap'\n | '$web_vitals'\n | '$dead_click'\n | '$autocapture'\n | typeof COPY_AUTOCAPTURE_EVENT\n | '$rageclick'\n\nexport type EventName =\n | KnownUnsafeEditableEvent\n | KnownEventName\n // magic value so that the type of EventName is a set of known strings or any other string\n // which means you get autocomplete for known strings\n // but no type complaints when you add an arbitrary string\n | (string & {})\n\nexport interface CaptureResult {\n uuid: string\n event: EventName\n properties: Properties\n $set?: Properties\n $set_once?: Properties\n timestamp?: Date\n}\n\nexport type AutocaptureCompatibleElement = 'a' | 'button' | 'form' | 'input' | 'select' | 'textarea' | 'label'\nexport type DomAutocaptureEvents = 'click' | 'change' | 'submit'\n\n/**\n * If an array is passed for an allowlist, autocapture events will only be sent for elements matching\n * at least one of the elements in the array. Multiple allowlists can be used\n */\nexport interface AutocaptureConfig {\n /**\n * List of URLs to allow autocapture on, can be strings to match\n * or regexes e.g. ['https://example.com', 'test.com/.*']\n * this is useful when you want to autocapture on specific pages only\n *\n * if you set both url_allowlist and url_ignorelist,\n * we check the allowlist first and then the ignorelist.\n * the ignorelist can override the allowlist\n */\n url_allowlist?: (string | RegExp)[]\n\n /**\n * List of URLs to not allow autocapture on, can be strings to match\n * or regexes e.g. ['https://example.com', 'test.com/.*']\n * this is useful when you want to autocapture on most pages but not some specific ones\n *\n * if you set both url_allowlist and url_ignorelist,\n * we check the allowlist first and then the ignorelist.\n * the ignorelist can override the allowlist\n */\n url_ignorelist?: (string | RegExp)[]\n\n /**\n * List of DOM events to allow autocapture on e.g. ['click', 'change', 'submit']\n */\n dom_event_allowlist?: DomAutocaptureEvents[]\n\n /**\n * List of DOM elements to allow autocapture on\n * e.g. ['a', 'button', 'form', 'input', 'select', 'textarea', 'label']\n * we consider the tree of elements from the root to the target element of the click event\n * so for the tree div > div > button > svg\n * if the allowlist has button then we allow the capture when the button or the svg is the click target\n * but not if either of the divs are detected as the click target\n */\n element_allowlist?: AutocaptureCompatibleElement[]\n\n /**\n * List of CSS selectors to allow autocapture on\n * e.g. ['[ph-capture]']\n * we consider the tree of elements from the root to the target element of the click event\n * so for the tree div > div > button > svg\n * and allow list config `['[id]']`\n * we will capture the click if the click-target or its parents has any id\n */\n css_selector_allowlist?: string[]\n\n /**\n * Exclude certain element attributes from autocapture\n * E.g. ['aria-label'] or [data-attr-pii]\n */\n element_attribute_ignorelist?: string[]\n\n capture_copied_text?: boolean\n}\n\nexport interface BootstrapConfig {\n distinctID?: string\n isIdentifiedID?: boolean\n featureFlags?: Record<string, boolean | string>\n featureFlagPayloads?: Record<string, JsonType>\n /**\n * Optionally provide a sessionID, this is so that you can provide an existing sessionID here to continue a user's session across a domain or device. It MUST be:\n * - unique to this user\n * - a valid UUID v7\n * - the timestamp part must be <= the timestamp of the first event in the session\n * - the timestamp of the last event in the session must be < the timestamp part + 24 hours\n * **/\n sessionID?: string\n}\n\nexport type SupportedWebVitalsMetrics = 'LCP' | 'CLS' | 'FCP' | 'INP'\n\nexport interface PerformanceCaptureConfig {\n /** works with session replay to use the browser's native performance observer to capture performance metrics */\n network_timing?: boolean\n /** use chrome's web vitals library to wrap fetch and capture web vitals */\n web_vitals?: boolean\n /**\n * We observe very large values reported by the Chrome web vitals library\n * These outliers are likely not real, useful values, and we exclude them\n * You can set this to 0 in order to include all values, NB this is not recommended\n * if not set this defaults to 15 minutes\n */\n __web_vitals_max_value?: number\n /**\n * By default all 4 metrics are captured\n * You can set this config to restrict which metrics are captured\n * e.g. ['CLS', 'FCP'] to only capture those two metrics\n * NB setting this does not override whether the capture is enabled\n */\n web_vitals_allowed_metrics?: SupportedWebVitalsMetrics[]\n /**\n * we delay flushing web vitals metrics to reduce the number of events we send\n * this is the maximum time we will wait before sending the metrics\n * if not set it defaults to 5 seconds\n */\n web_vitals_delayed_flush_ms?: number\n}\n\nexport interface DeadClickCandidate {\n node: Element\n originalEvent: MouseEvent\n timestamp: number\n // time between click and the most recent scroll\n scrollDelayMs?: number\n // time between click and the most recent mutation\n mutationDelayMs?: number\n // time between click and the most recent selection changed event\n selectionChangedDelayMs?: number\n // if neither scroll nor mutation seen before threshold passed\n absoluteDelayMs?: number\n}\n\nexport type DeadClicksAutoCaptureConfig = {\n // by default if a click is followed by a sroll within 100ms it is not a dead click\n scroll_threshold_ms?: number\n // by default if a click is followed by a selection change within 100ms it is not a dead click\n selection_change_threshold_ms?: number\n // by default if a click is followed by a mutation within 2500ms it is not a dead click\n mutation_threshold_ms?: number\n /**\n * Allows setting behavior for when a dead click is captured.\n * For e.g. to support capture to heatmaps\n *\n * If not provided the default behavior is to auto-capture dead click events\n *\n * Only intended to be provided by the SDK\n */\n __onCapture?: ((click: DeadClickCandidate, properties: Properties) => void) | undefined\n} & Pick<AutocaptureConfig, 'element_attribute_ignorelist'>\n\nexport interface HeatmapConfig {\n /*\n * how often to send batched data in $$heatmap_data events\n * if set to 0 or not set, sends using the default interval of 1 second\n * */\n flush_interval_milliseconds: number\n}\n\nexport type BeforeSendFn = (cr: CaptureResult | null) => CaptureResult | null\n\nexport interface PostHogConfig {\n api_host: string\n /** @deprecated - This property is no longer supported */\n api_method?: string\n api_transport?: 'XHR' | 'fetch'\n ui_host: string | null\n token: string\n autocapture: boolean | AutocaptureConfig\n rageclick: boolean\n cross_subdomain_cookie: boolean\n persistence: 'localStorage' | 'cookie' | 'memory' | 'localStorage+cookie' | 'sessionStorage'\n persistence_name: string\n /** @deprecated - Use 'persistence_name' instead */\n cookie_name?: string\n loaded: (posthog_instance: PostHog) => void\n store_google: boolean\n custom_campaign_params: string[]\n // a list of strings to be tested against navigator.userAgent to determine if the source is a bot\n // this is **added to** the default list of bots that we check\n // defaults to the empty array\n custom_blocked_useragents: string[]\n save_referrer: boolean\n verbose: boolean\n capture_pageview: boolean\n capture_pageleave: boolean | 'if_capture_pageview'\n debug: boolean\n cookie_expiration: number\n upgrade: boolean\n disable_session_recording: boolean\n disable_persistence: boolean\n /** @deprecated - use `disable_persistence` instead */\n disable_cookie?: boolean\n disable_surveys: boolean\n disable_web_experiments: boolean\n /** If set, posthog-js will never load external scripts such as those needed for Session Replay or Surveys. */\n disable_external_dependency_loading?: boolean\n enable_recording_console_log?: boolean\n secure_cookie: boolean\n ip: boolean\n /** Starts the SDK in an opted out state requiring opt_in_capturing() to be called before events will b captured */\n opt_out_capturing_by_default: boolean\n opt_out_capturing_persistence_type: 'localStorage' | 'cookie'\n /** If set to true this will disable persistence if the user is opted out of capturing. @default false */\n opt_out_persistence_by_default?: boolean\n /** Opt out of user agent filtering such as googlebot or other bots. Defaults to `false` */\n opt_out_useragent_filter: boolean\n\n opt_out_capturing_cookie_prefix: string | null\n opt_in_site_apps: boolean\n respect_dnt: boolean\n /** @deprecated - use `property_denylist` instead */\n property_blacklist?: string[]\n property_denylist: string[]\n request_headers: { [header_name: string]: string }\n on_request_error?: (error: RequestResponse) => void\n /** @deprecated - use `request_headers` instead */\n xhr_headers?: { [header_name: string]: string }\n /** @deprecated - use `on_request_error` instead */\n on_xhr_error?: (failedRequest: XMLHttpRequest) => void\n inapp_protocol: string\n inapp_link_new_window: boolean\n request_batching: boolean\n sanitize_properties: ((properties: Properties, event_name: string) => Properties) | null\n properties_string_max_length: number\n session_recording: SessionRecordingOptions\n session_idle_timeout_seconds: number\n mask_all_element_attributes: boolean\n mask_all_text: boolean\n advanced_disable_decide: boolean\n advanced_disable_feature_flags: boolean\n advanced_disable_feature_flags_on_first_load: boolean\n advanced_disable_toolbar_metrics: boolean\n feature_flag_request_timeout_ms: number\n get_device_id: (uuid: string) => string\n name: string\n /**\n * this is a read-only function that can be used to react to event capture\n * @deprecated - use `before_send` instead - NB before_send is not read only\n */\n _onCapture: (eventName: string, eventData: CaptureResult) => void\n /**\n * This function or array of functions - if provided - are called immediately before sending data to the server.\n * It allows you to edit data before it is sent, or choose not to send it all.\n * if provided as an array the functions are called in the order they are provided\n * any one function returning null means the event will not be sent\n */\n before_send?: BeforeSendFn | BeforeSendFn[]\n capture_performance?: boolean | PerformanceCaptureConfig\n // Should only be used for testing. Could negatively impact performance.\n disable_compression: boolean\n bootstrap: BootstrapConfig\n segment?: SegmentAnalytics\n __preview_send_client_session_params?: boolean\n /* @deprecated - use `capture_heatmaps` instead */\n enable_heatmaps?: boolean\n capture_heatmaps?: boolean | HeatmapConfig\n capture_dead_clicks?: boolean | DeadClicksAutoCaptureConfig\n disable_scroll_properties?: boolean\n // Let the pageview scroll stats use a custom css selector for the root element, e.g. `main`\n scroll_root_selector?: string | string[]\n\n /** You can control whether events from PostHog-js have person processing enabled with the `person_profiles` config setting. There are three options:\n * - `person_profiles: 'always'` _(default)_ - we will process persons data for all events\n * - `person_profiles: 'never'` - we won't process persons for any event. This means that anonymous users will not be merged once they sign up or login, so you lose the ability to create funnels that track users from anonymous to identified. All events (including `$identify`) will be sent with `$process_person_profile: False`.\n * - `person_profiles: 'identified_only'` - we will only process persons when you call `posthog.identify`, `posthog.alias`, `posthog.setPersonProperties`, `posthog.group`, `posthog.setPersonPropertiesForFlags` or `posthog.setGroupPropertiesForFlags` Anonymous users won't get person profiles.\n */\n person_profiles?: 'always' | 'never' | 'identified_only'\n /** @deprecated - use `person_profiles` instead */\n process_person?: 'always' | 'never' | 'identified_only'\n\n /** Client side rate limiting */\n rate_limiting?: {\n /** The average number of events per second that should be permitted (defaults to 10) */\n events_per_second?: number\n /** How many events can be captured in a burst. This defaults to 10 times the events_per_second count */\n events_burst_limit?: number\n }\n\n /** Used when sending data via `fetch`, use with care, this is intentionally meant to be used with NextJS `fetch`\n * Incorrect usage may cause out-of-date data for feature flags, actions tracking, etc.\n * See https://nextjs.org/docs/app/api-reference/functions/fetch#fetchurl-options\n */\n fetch_options?: {\n cache?: RequestInit['cache']\n next_options?: NextOptions\n }\n\n /**\n * PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION\n * whether to wrap fetch and add tracing headers to the request\n * */\n __add_tracing_headers?: boolean\n\n /**\n * PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION\n * enables the new RemoteConfig approach to loading config instead of decide\n * */\n __preview_remote_config?: boolean\n\n /**\n * PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION\n * whether to send a sentinel value for distinct id, device id, and session id, which will be replaced server-side by a cookieless hash\n * */\n __preview_experimental_cookieless_mode?: boolean\n}\n\nexport interface OptInOutCapturingOptions {\n capture: (event: string, properties: Properties, options: CaptureOptions) => void\n capture_event_name: string\n capture_properties: Properties\n enable_persistence: boolean\n clear_persistence: boolean\n persistence_type: 'cookie' | 'localStorage' | 'localStorage+cookie'\n cookie_prefix: string\n cookie_expiration: number\n cross_subdomain_cookie: boolean\n secure_cookie: boolean\n}\n\nexport interface IsFeatureEnabledOptions {\n send_event: boolean\n}\n\nexport interface SessionRecordingOptions {\n blockClass?: string | RegExp\n blockSelector?: string | null\n ignoreClass?: string\n maskTextClass?: string | RegExp\n maskTextSelector?: string | null\n maskTextFn?: ((text: string, element: HTMLElement | null) => string) | null\n maskAllInputs?: boolean\n maskInputOptions?: recordOptions['maskInputOptions']\n maskInputFn?: ((text: string, element?: HTMLElement) => string) | null\n slimDOMOptions?: recordOptions['slimDOMOptions']\n collectFonts?: boolean\n inlineStylesheet?: boolean\n recordCrossOriginIframes?: boolean\n /**\n * Allows local config to override remote canvas recording settings from the decide response\n */\n captureCanvas?: SessionRecordingCanvasOptions\n /** @deprecated - use maskCapturedNetworkRequestFn instead */\n maskNetworkRequestFn?: ((data: NetworkRequest) => NetworkRequest | null | undefined) | null\n /** Modify the network request before it is captured. Returning null or undefined stops it being captured */\n maskCapturedNetworkRequestFn?: ((data: CapturedNetworkRequest) => CapturedNetworkRequest | null | undefined) | null\n // our settings here only support a subset of those proposed for rrweb's network capture plugin\n recordHeaders?: boolean\n recordBody?: boolean\n // ADVANCED: while a user is active we take a full snapshot of the browser every interval. For very few sites playback performance might be better with different interval. Set to 0 to disable\n full_snapshot_interval_millis?: number\n /*\n ADVANCED: whether to partially compress rrweb events before sending them to the server,\n defaults to true, can be set to false to disable partial compression\n NB requests are still compressed when sent to the server regardless of this setting\n */\n compress_events?: boolean\n /*\n ADVANCED: alters the threshold before a recording considers a user has become idle.\n Normally only altered alongside changes to session_idle_timeout_ms.\n Default is 5 minutes.\n */\n session_idle_threshold_ms?: number\n /*\n ADVANCED: alters the refill rate for the token bucket mutation throttling\n Normally only altered alongside posthog support guidance.\n Accepts values between 0 and 100\n Default is 10.\n */\n __mutationRateLimiterRefillRate?: number\n /*\n ADVANCED: alters the bucket size for the token bucket mutation throttling\n Normally only altered alongside posthog support guidance.\n Accepts values between 0 and 100\n Default is 100.\n */\n __mutationRateLimiterBucketSize?: number\n}\n\nexport type SessionIdChangedCallback = (\n sessionId: string,\n windowId: string | null | undefined,\n changeReason?: { noSessionId: boolean; activityTimeout: boolean; sessionPastMaximumLength: boolean }\n) => void\n\nexport enum Compression {\n GZipJS = 'gzip-js',\n Base64 = 'base64',\n}\n\n// Request types - these should be kept minimal to what request.ts needs\n\n// Minimal class to allow interop between different request methods (xhr / fetch)\nexport interface RequestResponse {\n statusCode: number\n text?: string\n json?: any\n}\n\nexport type RequestCallback = (response: RequestResponse) => void\n\n// See https://nextjs.org/docs/app/api-reference/functions/fetch#fetchurl-options\ntype NextOptions = { revalidate: false | 0 | number; tags: string[] }\n\nexport interface RequestOptions {\n url: string\n // Data can be a single object or an array of objects when batched\n data?: Record<string, any> | Record<string, any>[]\n headers?: Record<string, any>\n transport?: 'XHR' | 'fetch' | 'sendBeacon'\n method?: 'POST' | 'GET'\n urlQueryArgs?: { compression: Compression }\n callback?: RequestCallback\n timeout?: number\n noRetries?: boolean\n compression?: Compression | 'best-available'\n fetchOptions?: {\n cache?: RequestInit['cache']\n next?: NextOptions\n }\n}\n\n// Queued request types - the same as a request but with additional queueing information\n\nexport interface QueuedRequestOptions extends RequestOptions {\n batchKey?: string /** key of queue, e.g. 'sessionRecording' vs 'event' */\n}\n\n// Used explicitly for retriable requests\nexport interface RetriableRequestOptions extends QueuedRequestOptions {\n retriesPerformedSoFar?: number\n}\n\nexport interface CaptureOptions {\n $set?: Properties /** used with $identify */\n $set_once?: Properties /** used with $identify */\n _url?: string /** Used to override the desired endpoint for the captured event */\n _batchKey?: string /** key of queue, e.g. 'sessionRecording' vs 'event' */\n _noTruncate?: boolean /** if set, overrides and disables config.properties_string_max_length */\n send_instantly?: boolean /** if set skips the batched queue */\n skip_client_rate_limiting?: boolean /** if set skips the client side rate limiting */\n transport?: RequestOptions['transport'] /** if set, overrides the desired transport method */\n timestamp?: Date\n}\n\nexport type FlagVariant = { flag: string; variant: string }\n\nexport type SessionRecordingCanvasOptions = {\n recordCanvas?: boolean | null\n canvasFps?: number | null\n // the API returns a decimal between 0 and 1 as a string\n canvasQuality?: string | null\n}\n\nexport interface RemoteConfig {\n supportedCompression: Compression[]\n autocapture_opt_out?: boolean\n /**\n * originally capturePerformance was replay only and so boolean true\n * is equivalent to { network_timing: true }\n * now capture performance can be separately enabled within replay\n * and as a standalone web vitals tracker\n * people can have them enabled separately\n * they work standalone but enhance each other\n * TODO: deprecate this so we make a new config that doesn't need this explanation\n */\n capturePerformance?: boolean | PerformanceCaptureConfig\n analytics?: {\n endpoint?: string\n }\n elementsChainAsString?: boolean\n // this is currently in development and may have breaking changes without a major version bump\n autocaptureExceptions?:\n | boolean\n | {\n endpoint?: string\n }\n sessionRecording?: SessionRecordingCanvasOptions & {\n endpoint?: string\n consoleLogRecordingEnabled?: boolean\n // the API returns a decimal between 0 and 1 as a string\n sampleRate?: string | null\n minimumDurationMilliseconds?: number\n linkedFlag?: string | FlagVariant | null\n networkPayloadCapture?: Pick<NetworkRecordOptions, 'recordBody' | 'recordHeaders'>\n urlTriggers?: SessionRecordingUrlTrigger[]\n scriptConfig?: { script?: string | undefined }\n urlBlocklist?: SessionRecordingUrlTrigger[]\n eventTriggers?: string[]\n }\n surveys?: boolean\n toolbarParams: ToolbarParams\n editorParams?: ToolbarParams /** @deprecated, renamed to toolbarParams, still present on older API responses */\n toolbarVersion: 'toolbar' /** @deprecated, moved to toolbarParams */\n isAuthenticated: boolean\n siteApps: { id: string; url: string }[]\n heatmaps?: boolean\n defaultIdentifiedOnly?: boolean\n captureDeadClicks?: boolean\n hasFeatureFlags?: boolean // Indicates if the team has any flags enabled (if not we don't need to load them)\n}\n\nexport interface DecideResponse extends RemoteConfig {\n featureFlags: Record<string, string | boolean>\n featureFlagPayloads: Record<string, JsonType>\n errorsWhileComputingFlags: boolean\n}\n\nexport type SiteAppGlobals = {\n event: {\n uuid: string\n event: EventName\n properties: Properties\n timestamp?: Date\n elements_chain?: string\n distinct_id?: string\n }\n person: {\n properties: Properties\n }\n groups: Record<string, { id: string; type: string; properties: Properties }>\n}\n\nexport type SiteAppLoader = {\n id: string\n init: (config: { posthog: PostHog; callback: (success: boolean) => void }) => {\n processEvent?: (globals: SiteAppGlobals) => void\n }\n}\n\nexport type SiteApp = {\n id: string\n loaded: boolean\n errored: boolean\n processEvent?: (globals: SiteAppGlobals) => void\n}\n\nexport type FeatureFlagsCallback = (\n flags: string[],\n variants: Record<string, string | boolean>,\n context?: {\n errorsLoading?: boolean\n }\n) => void\n\nexport interface PersistentStore {\n is_supported: () => boolean\n error: (error: any) => void\n parse: (name: string) => any\n get: (name: string) => any\n set: (\n name: string,\n value: any,\n expire_days?: number | null,\n cross_subdomain?: boolean,\n secure?: boolean,\n debug?: boolean\n ) => void\n remove: (name: string, cross_subdomain?: boolean) => void\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport type Breaker = {}\nexport type EventHandler = (event: Event) => boolean | void\n\nexport type ToolbarUserIntent = 'add-action' | 'edit-action'\nexport type ToolbarSource = 'url' | 'localstorage'\nexport type ToolbarVersion = 'toolbar'\n\n/* sync with posthog */\nexport interface ToolbarParams {\n token?: string /** public posthog-js token */\n temporaryToken?: string /** private temporary user token */\n actionId?: number\n userIntent?: ToolbarUserIntent\n source?: ToolbarSource\n toolbarVersion?: ToolbarVersion\n instrument?: boolean\n distinctId?: string\n userEmail?: string\n dataAttributes?: string[]\n featureFlags?: Record<string, string | boolean>\n}\n\nexport type SnippetArrayItem = [method: string, ...args: any[]]\n\nexport type JsonRecord = { [key: string]: JsonType }\nexport type JsonType = string | number | boolean | null | JsonRecord | Array<JsonType>\n\n/** A feature that isn't publicly available yet.*/\nexport interface EarlyAccessFeature {\n // Sync this with the backend's EarlyAccessFeatureSerializer!\n name: string\n description: string\n stage: 'concept' | 'alpha' | 'beta'\n documentationUrl: string | null\n flagKey: string | null\n}\n\nexport type EarlyAccessFeatureCallback = (earlyAccessFeatures: EarlyAccessFeature[]) => void\n\nexport interface EarlyAccessFeatureResponse {\n earlyAccessFeatures: EarlyAccessFeature[]\n}\n\nexport type Headers = Record<string, string>\n\n/* for rrweb/network@1\n ** when that is released as part of rrweb this can be removed\n ** don't rely on this type, it may change without notice\n */\nexport type InitiatorType =\n | 'audio'\n | 'beacon'\n | 'body'\n | 'css'\n | 'early-hint'\n | 'embed'\n | 'fetch'\n | 'frame'\n | 'iframe'\n | 'icon'\n | 'image'\n | 'img'\n | 'input'\n | 'link'\n | 'navigation'\n | 'object'\n | 'ping'\n | 'script'\n | 'track'\n | 'video'\n | 'xmlhttprequest'\n\nexport type NetworkRecordOptions = {\n initiatorTypes?: InitiatorType[]\n maskRequestFn?: (data: CapturedNetworkRequest) => CapturedNetworkRequest | undefined\n recordHeaders?: boolean | { request: boolean; response: boolean }\n recordBody?: boolean | string[] | { request: boolean | string[]; response: boolean | string[] }\n recordInitialRequests?: boolean\n /**\n * whether to record PerformanceEntry events for network requests\n */\n recordPerformance?: boolean\n /**\n * the PerformanceObserver will only observe these entry types\n */\n performanceEntryTypeToObserve: string[]\n /**\n * the maximum size of the request/response body to record\n * NB this will be at most 1MB even if set larger\n */\n payloadSizeLimitBytes: number\n /**\n * some domains we should never record the payload\n * for example other companies session replay ingestion payloads aren't super useful but are gigantic\n * if this isn't provided we use a default list\n * if this is provided - we add the provided list to the default list\n * i.e. we never record the payloads on the default deny list\n */\n payloadHostDenyList?: string[]\n}\n\n/** @deprecated - use CapturedNetworkRequest instead */\nexport type NetworkRequest = {\n url: string\n}\n\n// In rrweb this is called NetworkRequest, but we already exposed that as having only URL\n// we also want to vary from the rrweb NetworkRequest because we want to include\n// all PerformanceEntry properties too.\n// that has 4 required properties\n// readonly duration: DOMHighResTimeStamp;\n// readonly entryType: string;\n// readonly name: string;\n// readonly startTime: DOMHighResTimeStamp;\n// NB: properties below here are ALPHA, don't rely on them, they may change without notice\n\n// we mirror PerformanceEntry since we read into this type from a PerformanceObserver,\n// but we don't want to inherit its readonly-iness\ntype Writable<T> = { -readonly [P in keyof T]: T[P] }\n\nexport type CapturedNetworkRequest = Writable<Omit<PerformanceEntry, 'toJSON'>> & {\n // properties below here are ALPHA, don't rely on them, they may change without notice\n method?: string\n initiatorType?: InitiatorType\n status?: number\n timeOrigin?: number\n timestamp?: number\n startTime?: number\n endTime?: number\n requestHeaders?: Headers\n requestBody?: string | null\n responseHeaders?: Headers\n responseBody?: string | null\n // was this captured before fetch/xhr could have been wrapped\n isInitial?: boolean\n}\n\nexport type ErrorEventArgs = [\n event: string | Event,\n source?: string | undefined,\n lineno?: number | undefined,\n colno?: number | undefined,\n error?: Error | undefined\n]\n\nexport type ErrorMetadata = {\n handled?: boolean\n synthetic?: boolean\n syntheticException?: Error\n overrideExceptionType?: string\n overrideExceptionMessage?: string\n defaultExceptionType?: string\n defaultExceptionMessage?: string\n}\n\n// levels originally copied from Sentry to work with the sentry integration\n// and to avoid relying on a frequently changing @sentry/types dependency\n// but provided as an array of literal types, so we can constrain the level below\nexport const severityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug'] as const\nexport declare type SeverityLevel = typeof severityLevels[number]\n\nexport interface ErrorProperties {\n $exception_type: string\n $exception_message: string\n $exception_level: SeverityLevel\n $exception_source?: string\n $exception_lineno?: number\n $exception_colno?: number\n $exception_DOMException_code?: string\n $exception_is_synthetic?: boolean\n $exception_stack_trace_raw?: string\n $exception_handled?: boolean\n $exception_personURL?: string\n}\n\nexport interface ErrorConversions {\n errorToProperties: (args: ErrorEventArgs) => ErrorProperties\n unhandledRejectionToProperties: (args: [ev: PromiseRejectionEvent]) => ErrorProperties\n}\n\nexport interface SessionRecordingUrlTrigger {\n url: string\n matching: 'regex'\n}\n","// import { patch } from 'rrweb/typings/utils'\n// copied from https://github.com/rrweb-io/rrweb/blob/8aea5b00a4dfe5a6f59bd2ae72bb624f45e51e81/packages/rrweb/src/utils.ts#L129\n// which was copied from https://github.com/getsentry/sentry-javascript/blob/b2109071975af8bf0316d3b5b38f519bdaf5dc15/packages/utils/src/object.ts\nimport { isFunction } from '../../../utils/type-utils'\n\nexport function patch(\n source: { [key: string]: any },\n name: string,\n replacement: (...args: unknown[]) => unknown\n): () => void {\n try {\n if (!(name in source)) {\n return () => {\n //\n }\n }\n\n const original = source[name] as () => unknown\n const wrapped = replacement(original)\n\n // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n if (isFunction(wrapped)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n wrapped.prototype = wrapped.prototype || {}\n Object.defineProperties(wrapped, {\n __posthog_wrapped__: {\n enumerable: false,\n value: true,\n },\n })\n }\n\n source[name] = wrapped\n\n return () => {\n source[name] = original\n }\n } catch {\n return () => {\n //\n }\n // This can throw if multiple fill happens on a global object like XMLHttpRequest\n // Fixes https://github.com/getsentry/sentry-javascript/issues/2043\n }\n}\n","import { includes } from '.'\nimport { window } from './globals'\nimport { knownUnsafeEditableEvent, KnownUnsafeEditableEvent } from '../types'\n\n// eslint-disable-next-line posthog-js/no-direct-array-check\nconst nativeIsArray = Array.isArray\nconst ObjProto = Object.prototype\nexport const hasOwnProperty = ObjProto.hasOwnProperty\nconst toString = ObjProto.toString\n\nexport const isArray =\n nativeIsArray ||\n function (obj: any): obj is any[] {\n return toString.call(obj) === '[object Array]'\n }\n\n// from a comment on http://dbj.org/dbj/?p=286\n// fails on only one very rare and deliberate custom object:\n// let bomb = { toString : undefined, valueOf: function(o) { return \"function BOMBA!\"; }};\nexport const isFunction = (x: unknown): x is (...args: any[]) => any => {\n // eslint-disable-next-line posthog-js/no-direct-function-check\n return typeof x === 'function'\n}\n\nexport const isNativeFunction = (x: unknown): x is (...args: any[]) => any =>\n isFunction(x) && x.toString().indexOf('[native code]') !== -1\n\n// When angular patches functions they pass the above `isNativeFunction` check (at least the MutationObserver)\nexport const isAngularZonePresent = (): boolean => {\n return !!(window as any).Zone\n}\n\n// Underscore Addons\nexport const isObject = (x: unknown): x is Record<string, any> => {\n // eslint-disable-next-line posthog-js/no-direct-object-check\n return x === Object(x) && !isArray(x)\n}\nexport const isEmptyObject = (x: unknown): x is Record<string, any> => {\n if (isObject(x)) {\n for (const key in x) {\n if (hasOwnProperty.call(x, key)) {\n return false\n }\n }\n return true\n }\n return false\n}\nexport const isUndefined = (x: unknown): x is undefined => x === void 0\n\nexport const isString = (x: unknown): x is string => {\n // eslint-disable-next-line posthog-js/no-direct-string-check\n return toString.call(x) == '[object String]'\n}\n\nexport const isEmptyString = (x: unknown): boolean => isString(x) && x.trim().length === 0\n\nexport const isNull = (x: unknown): x is null => {\n // eslint-disable-next-line posthog-js/no-direct-null-check\n return x === null\n}\n\n/*\n sometimes you want to check if something is null or undefined\n that's what this is for\n */\nexport const isNullish = (x: unknown): x is null | undefined => isUndefined(x) || isNull(x)\n\nexport const isNumber = (x: unknown): x is number => {\n // eslint-disable-next-line posthog-js/no-direct-number-check\n return toString.call(x) == '[object Number]'\n}\nexport const isBoolean = (x: unknown): x is boolean => {\n // eslint-disable-next-line posthog-js/no-direct-boolean-check\n return toString.call(x) === '[object Boolean]'\n}\n\nexport const isDocument = (x: unknown): x is Document => {\n // eslint-disable-next-line posthog-js/no-direct-document-check\n return x instanceof Document\n}\n\nexport const isFormData = (x: unknown): x is FormData => {\n // eslint-disable-next-line posthog-js/no-direct-form-data-check\n return x instanceof FormData\n}\n\nexport const isFile = (x: unknown): x is File => {\n // eslint-disable-next-line posthog-js/no-direct-file-check\n return x instanceof File\n}\n\nexport const isKnownUnsafeEditableEvent = (x: unknown): x is KnownUnsafeEditableEvent => {\n return includes(knownUnsafeEditableEvent as unknown as string[], x)\n}\n","import { SessionIdManager } from '../sessionid'\nimport { patch } from '../extensions/replay/rrweb-plugins/patch'\nimport { assignableWindow, window } from '../utils/globals'\n\nconst addTracingHeaders = (sessionManager: SessionIdManager | undefined, req: Request) => {\n if (sessionManager) {\n const { sessionId, windowId } = sessionManager.checkAndGetSessionAndWindowId(true)\n req.headers.set('X-POSTHOG-SESSION-ID', sessionId)\n req.headers.set('X-POSTHOG-WINDOW-ID', windowId)\n }\n}\n\nconst patchFetch = (sessionManager?: SessionIdManager): (() => void) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return patch(window, 'fetch', (originalFetch: typeof fetch) => {\n return async function (url: URL | RequestInfo, init?: RequestInit | undefined) {\n // check IE earlier than this, we only initialize if Request is present\n // eslint-disable-next-line compat/compat\n const req = new Request(url, init)\n\n addTracingHeaders(sessionManager, req)\n\n return originalFetch(req)\n }\n })\n}\n\nconst patchXHR = (sessionManager?: SessionIdManager): (() => void) => {\n return patch(\n // we can assert this is present because we've checked previously\n window!.XMLHttpRequest.prototype,\n 'open',\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n (originalOpen: typeof XMLHttpRequest.prototype.open) => {\n return function (\n method: string,\n url: string | URL,\n async = true,\n username?: string | null,\n password?: string | null\n ) {\n // because this function is returned in its actual context `this` _is_ an XMLHttpRequest\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const xhr = this as XMLHttpRequest\n\n // check IE earlier than this, we only initialize if Request is present\n // eslint-disable-next-line compat/compat\n const req = new Request(url)\n\n addTracingHeaders(sessionManager, req)\n\n return originalOpen.call(xhr, method, req.url, async, username, password)\n }\n }\n )\n}\n\nassignableWindow.__PosthogExtensions__ = assignableWindow.__PosthogExtensions__ || {}\nconst patchFns = {\n _patchFetch: patchFetch,\n _patchXHR: patchXHR,\n}\nassignableWindow.__PosthogExtensions__.tracingHeadersPatchFns = patchFns\n\n// we used to put tracingHeadersPatchFns on window, and now we put it on __PosthogExtensions__\n// but that means that old clients which lazily load this extension are looking in the wrong place\n// yuck,\n// so we also put it directly on the window\n// when 1.161.1 is the oldest version seen in production we can remove this\nassignableWindow.postHogTracingHeadersPatchFns = patchFns\n\nexport default patchFns\n"],"names":["win","window","undefined","global","globalThis","navigator","document","location","fetch","XMLHttpRequest","AbortController","userAgent","Compression","assignableWindow","patch","source","name","replacement","original","wrapped","prototype","Object","defineProperties","__posthog_wrapped__","enumerable","value","_unused","addTracingHeaders","sessionManager","req","sessionId","windowId","checkAndGetSessionAndWindowId","headers","set","__PosthogExtensions__","patchFns","_patchFetch","originalFetch","_ref","url","init","Request","_x","_x2","apply","this","arguments","_patchXHR","originalOpen","method","async","length","username","password","call","tracingHeadersPatchFns","postHogTracingHeadersPatchFns"],"mappings":"kJAuBA,IAAMA,EAAkE,oBAAXC,OAAyBA,YAASC,EAmEzFC,EAA8D,oBAAfC,WAA6BA,WAAaJ,EAMlFK,EAAYF,aAAM,EAANA,EAAQE,UACTF,SAAAA,EAAQG,SACRH,SAAAA,EAAQI,SACXJ,SAAAA,EAAQK,MAEzBL,SAAAA,EAAQM,gBAAkB,oBAAqB,IAAIN,EAAOM,gBAAmBN,EAAOM,eACzDN,SAAAA,EAAQO,gBACdL,SAAAA,EAAWM,UAC7B,ICiVKC,EDjVCC,EAAqCb,QAAAA,EAAQ,CAAU,GCwVpE,SAPYY,GAAAA,EAAW,OAAA,UAAXA,EAAW,OAAA,QAAXA,CAOZ,CAPYA,IAAAA,EAgBZ,CAAA,ICpcO,SAASE,EACZC,EACAC,EACAC,GAEA,IACI,KAAMD,KAAQD,GACV,MAAO,OAKX,IAAMG,EAAWH,EAAOC,GAClBG,EAAUF,EAAYC,GAiB5B,MCdgB,mBDCDC,IAEXA,EAAQC,UAAYD,EAAQC,WAAa,CAAA,EACzCC,OAAOC,iBAAiBH,EAAS,CAC7BI,oBAAqB,CACjBC,YAAY,EACZC,OAAO,MAKnBV,EAAOC,GAAQG,EAER,KACHJ,EAAOC,GAAQE,CAAQ,CAE9B,CAAC,MAAAQ,GACE,MAAO,MAKX,CACJ,CEzCA,IAAMC,EAAoBA,CAACC,EAA8CC,KACrE,GAAID,EAAgB,CAChB,IAAME,UAAEA,EAASC,SAAEA,GAAaH,EAAeI,+BAA8B,GAC7EH,EAAII,QAAQC,IAAI,uBAAwBJ,GACxCD,EAAII,QAAQC,IAAI,sBAAuBH,EAC3C,GAmDJlB,EAAiBsB,sBAAwBtB,EAAiBsB,uBAAyB,GACnF,IAAMC,EAAW,CACbC,YAlDgBT,GAGTd,EAAMb,EAAQ,SAAUqC,GAC3B,WAAA,MAAAC,KAAO,UAAgBC,EAAwBC,GAG3C,IAAMZ,EAAM,IAAIa,QAAQF,EAAKC,GAI7B,OAFAd,EAAkBC,EAAgBC,GAE3BS,EAAcT,mLACxB,OAAAc,SAAAA,EAAAC,GAAA,OAAAL,EAAAM,MAAAC,KAAAC,UAAA,CAAA,CARD,KA+CJC,UAnCcpB,GACPd,EAEHb,EAAQQ,eAAeW,UACvB,QAGC6B,GACU,SACHC,EACAV,GAIF,IAHEW,IAAKJ,UAAAK,OAAA,QAAAlD,IAAA6C,UAAA,KAAAA,UAAA,GACLM,EAAwBN,UAAAK,OAAAL,EAAAA,kBAAA7C,EACxBoD,EAAwBP,UAAAK,OAAAL,EAAAA,kBAAA7C,EASlB2B,EAAM,IAAIa,QAAQF,GAIxB,OAFAb,EAAkBC,EAAgBC,GAE3BoB,EAAaM,KARRT,KAQkBI,EAAQrB,EAAIW,IAAKW,EAAOE,EAAUC,OAWhFzC,EAAiBsB,sBAAsBqB,uBAAyBpB,EAOhEvB,EAAiB4C,8BAAgCrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"web-vitals.js","sources":["../node_modules/.pnpm/web-vitals@4.2.0/node_modules/web-vitals/dist/web-vitals.attribution.js","../src/utils/globals.ts","../src/entrypoints/web-vitals.ts"],"sourcesContent":["var t,e,n,r=function(){var t=self.performance&&performance.getEntriesByType&&performance.getEntriesByType(\"navigation\")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},i=function(t){if(\"loading\"===document.readyState)return\"loading\";var e=r();if(e){if(t<e.domInteractive)return\"loading\";if(0===e.domContentLoadedEventStart||t<e.domContentLoadedEventStart)return\"dom-interactive\";if(0===e.domComplete||t<e.domComplete)return\"dom-content-loaded\"}return\"complete\"},a=function(t){var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,\"\")},o=function(t,e){var n=\"\";try{for(;t&&9!==t.nodeType;){var r=t,i=r.id?\"#\"+r.id:a(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?\".\"+r.classList.value.trim().replace(/\\s+/g,\".\"):\"\");if(n.length+i.length>(e||100)-1)return n||i;if(n=n?i+\">\"+n:i,r.id)break;t=r.parentNode}}catch(t){}return n},c=-1,u=function(){return c},s=function(t){addEventListener(\"pageshow\",(function(e){e.persisted&&(c=e.timeStamp,t(e))}),!0)},f=function(){var t=r();return t&&t.activationStart||0},d=function(t,e){var n=r(),i=\"navigate\";u()>=0?i=\"back-forward-cache\":n&&(document.prerendering||f()>0?i=\"prerender\":document.wasDiscarded?i=\"restore\":n.type&&(i=n.type.replace(/_/g,\"-\")));return{name:t,value:void 0===e?-1:e,rating:\"good\",delta:0,entries:[],id:\"v4-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},l=function(t,e,n){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((function(t){Promise.resolve().then((function(){e(t.getEntries())}))}));return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch(t){}},m=function(t,e,n,r){var i,a;return function(o){e.value>=0&&(o||r)&&((a=e.value-(i||0))||void 0===i)&&(i=e.value,e.delta=a,e.rating=function(t,e){return t>e[1]?\"poor\":t>e[0]?\"needs-improvement\":\"good\"}(e.value,n),t(e))}},p=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},v=function(t){document.addEventListener(\"visibilitychange\",(function(){\"hidden\"===document.visibilityState&&t()}))},g=function(t){var e=!1;return function(){e||(t(),e=!0)}},h=-1,T=function(){return\"hidden\"!==document.visibilityState||document.prerendering?1/0:0},y=function(t){\"hidden\"===document.visibilityState&&h>-1&&(h=\"visibilitychange\"===t.type?t.timeStamp:0,S())},E=function(){addEventListener(\"visibilitychange\",y,!0),addEventListener(\"prerenderingchange\",y,!0)},S=function(){removeEventListener(\"visibilitychange\",y,!0),removeEventListener(\"prerenderingchange\",y,!0)},b=function(){return h<0&&(h=T(),E(),s((function(){setTimeout((function(){h=T(),E()}),0)}))),{get firstHiddenTime(){return h}}},L=function(t){document.prerendering?addEventListener(\"prerenderingchange\",(function(){return t()}),!0):t()},C=[1800,3e3],M=function(t,e){e=e||{},L((function(){var n,r=b(),i=d(\"FCP\"),a=l(\"paint\",(function(t){t.forEach((function(t){\"first-contentful-paint\"===t.name&&(a.disconnect(),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-f(),0),i.entries.push(t),n(!0)))}))}));a&&(n=m(t,i,C,e.reportAllChanges),s((function(r){i=d(\"FCP\"),n=m(t,i,C,e.reportAllChanges),p((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},D=[.1,.25],w=function(t,e){!function(t,e){e=e||{},M(g((function(){var n,r=d(\"CLS\",0),i=0,a=[],o=function(t){t.forEach((function(t){if(!t.hadRecentInput){var e=a[0],n=a[a.length-1];i&&t.startTime-n.startTime<1e3&&t.startTime-e.startTime<5e3?(i+=t.value,a.push(t)):(i=t.value,a=[t])}})),i>r.value&&(r.value=i,r.entries=a,n())},c=l(\"layout-shift\",o);c&&(n=m(t,r,D,e.reportAllChanges),v((function(){o(c.takeRecords()),n(!0)})),s((function(){i=0,r=d(\"CLS\",0),n=m(t,r,D,e.reportAllChanges),p((function(){return n()}))})),setTimeout(n,0))})))}((function(e){var n=function(t){var e,n={};if(t.entries.length){var r=t.entries.reduce((function(t,e){return t&&t.value>e.value?t:e}));if(r&&r.sources&&r.sources.length){var a=(e=r.sources).find((function(t){return t.node&&1===t.node.nodeType}))||e[0];a&&(n={largestShiftTarget:o(a.node),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:a,largestShiftEntry:r,loadState:i(r.startTime)})}}return Object.assign(t,{attribution:n})}(e);t(n)}),e)},x=function(t,e){M((function(e){var n=function(t){var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:i(u())};if(t.entries.length){var n=r(),a=t.entries[t.entries.length-1];if(n){var o=n.activationStart||0,c=Math.max(0,n.responseStart-o);e={timeToFirstByte:c,firstByteToFCP:t.value-c,loadState:i(t.entries[0].startTime),navigationEntry:n,fcpEntry:a}}}return Object.assign(t,{attribution:e})}(e);t(n)}),e)},I=0,k=1/0,A=0,F=function(t){t.forEach((function(t){t.interactionId&&(k=Math.min(k,t.interactionId),A=Math.max(A,t.interactionId),I=A?(A-k)/7+1:0)}))},P=function(){\"interactionCount\"in performance||t||(t=l(\"event\",F,{type:\"event\",buffered:!0,durationThreshold:0}))},B=[],O=new Map,R=0,j=function(){return(t?I:performance.interactionCount||0)-R},q=[],H=function(t){if(q.forEach((function(e){return e(t)})),t.interactionId||\"first-input\"===t.entryType){var e=B[B.length-1],n=O.get(t.interactionId);if(n||B.length<10||t.duration>e.latency){if(n)t.duration>n.latency?(n.entries=[t],n.latency=t.duration):t.duration===n.latency&&t.startTime===n.entries[0].startTime&&n.entries.push(t);else{var r={id:t.interactionId,latency:t.duration,entries:[t]};O.set(r.id,r),B.push(r)}B.sort((function(t,e){return e.latency-t.latency})),B.length>10&&B.splice(10).forEach((function(t){return O.delete(t.id)}))}}},N=function(t){var e=self.requestIdleCallback||self.setTimeout,n=-1;return t=g(t),\"hidden\"===document.visibilityState?t():(n=e(t),v(t)),n},W=[200,500],z=function(t,e){\"PerformanceEventTiming\"in self&&\"interactionId\"in PerformanceEventTiming.prototype&&(e=e||{},L((function(){var n;P();var r,i=d(\"INP\"),a=function(t){N((function(){t.forEach(H);var e,n=(e=Math.min(B.length-1,Math.floor(j()/50)),B[e]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())}))},o=l(\"event\",a,{durationThreshold:null!==(n=e.durationThreshold)&&void 0!==n?n:40});r=m(t,i,W,e.reportAllChanges),o&&(o.observe({type:\"first-input\",buffered:!0}),v((function(){a(o.takeRecords()),r(!0)})),s((function(){R=0,B.length=0,O.clear(),i=d(\"INP\"),r=m(t,i,W,e.reportAllChanges)})))})))},U=[],V=[],_=new WeakMap,G=new Map,J=-1,K=function(t){U=U.concat(t),Q()},Q=function(){J<0&&(J=N(X))},X=function(){G.size>10&&G.forEach((function(t,e){O.has(e)||G.delete(e)}));var t=B.map((function(t){return _.get(t.entries[0])})),e=V.length-50;V=V.filter((function(n,r){return r>=e||t.includes(n)}));for(var r=new Set,i=0;i<V.length;i++){var a=V[i];et(a.startTime,a.processingEnd).forEach((function(t){r.add(t)}))}for(var o=0;o<50;o++){var c=U[U.length-1-o];if(!c||c.startTime<n)break;r.add(c)}U=Array.from(r),J=-1};q.push((function(t){t.interactionId&&t.target&&!G.has(t.interactionId)&&G.set(t.interactionId,t.target)}),(function(t){var e,r=t.startTime+t.duration;n=Math.max(n,t.processingEnd);for(var i=V.length-1;i>=0;i--){var a=V[i];if(Math.abs(r-a.renderTime)<=8){(e=a).startTime=Math.min(t.startTime,e.startTime),e.processingStart=Math.min(t.processingStart,e.processingStart),e.processingEnd=Math.max(t.processingEnd,e.processingEnd),e.entries.push(t);break}}e||(e={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:[t]},V.push(e)),(t.interactionId||\"first-input\"===t.entryType)&&_.set(t,e),Q()}));var Y,Z,$,tt,et=function(t,e){for(var n,r=[],i=0;n=U[i];i++)if(!(n.startTime+n.duration<t)){if(n.startTime>e)break;r.push(n)}return r},nt=function(t,n){e||(e=l(\"long-animation-frame\",K)),z((function(e){var n=function(t){var e=t.entries[0],n=_.get(e),r=e.processingStart,a=n.processingEnd,c=n.entries.sort((function(t,e){return t.processingStart-e.processingStart})),u=et(e.startTime,a),s=t.entries.find((function(t){return t.target})),f=s&&s.target||G.get(e.interactionId),d=[e.startTime+e.duration,a].concat(u.map((function(t){return t.startTime+t.duration}))),l=Math.max.apply(Math,d),m={interactionTarget:o(f),interactionTargetElement:f,interactionType:e.name.startsWith(\"key\")?\"keyboard\":\"pointer\",interactionTime:e.startTime,nextPaintTime:l,processedEventEntries:c,longAnimationFrameEntries:u,inputDelay:r-e.startTime,processingDuration:a-r,presentationDelay:Math.max(l-a,0),loadState:i(e.startTime)};return Object.assign(t,{attribution:m})}(e);t(n)}),n)},rt=[2500,4e3],it={},at=function(t,e){!function(t,e){e=e||{},L((function(){var n,r=b(),i=d(\"LCP\"),a=function(t){e.reportAllChanges||(t=t.slice(-1)),t.forEach((function(t){t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-f(),0),i.entries=[t],n())}))},o=l(\"largest-contentful-paint\",a);if(o){n=m(t,i,rt,e.reportAllChanges);var c=g((function(){it[i.id]||(a(o.takeRecords()),o.disconnect(),it[i.id]=!0,n(!0))}));[\"keydown\",\"click\"].forEach((function(t){addEventListener(t,(function(){return N(c)}),!0)})),v(c),s((function(r){i=d(\"LCP\"),n=m(t,i,rt,e.reportAllChanges),p((function(){i.value=performance.now()-r.timeStamp,it[i.id]=!0,n(!0)}))}))}}))}((function(e){var n=function(t){var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var n=r();if(n){var i=n.activationStart||0,a=t.entries[t.entries.length-1],c=a.url&&performance.getEntriesByType(\"resource\").filter((function(t){return t.name===a.url}))[0],u=Math.max(0,n.responseStart-i),s=Math.max(u,c?(c.requestStart||c.startTime)-i:0),f=Math.max(s,c?c.responseEnd-i:0),d=Math.max(f,a.startTime-i);e={element:o(a.element),timeToFirstByte:u,resourceLoadDelay:s-u,resourceLoadDuration:f-s,elementRenderDelay:d-f,navigationEntry:n,lcpEntry:a},a.url&&(e.url=a.url),c&&(e.lcpResourceEntry=c)}}return Object.assign(t,{attribution:e})}(e);t(n)}),e)},ot=[800,1800],ct=function t(e){document.prerendering?L((function(){return t(e)})):\"complete\"!==document.readyState?addEventListener(\"load\",(function(){return t(e)}),!0):setTimeout(e,0)},ut=function(t,e){e=e||{};var n=d(\"TTFB\"),i=m(t,n,ot,e.reportAllChanges);ct((function(){var a=r();a&&(n.value=Math.max(a.responseStart-f(),0),n.entries=[a],i(!0),s((function(){n=d(\"TTFB\",0),(i=m(t,n,ot,e.reportAllChanges))(!0)})))}))},st=function(t,e){ut((function(e){var n=function(t){var e={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(t.entries.length){var n=t.entries[0],r=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-r,0),a=Math.max(n.domainLookupStart-r,0),o=Math.max(n.connectStart-r,0),c=Math.max(n.connectEnd-r,0);e={waitingDuration:i,cacheDuration:a-i,dnsDuration:o-a,connectionDuration:c-o,requestDuration:t.value-c,navigationEntry:n}}return Object.assign(t,{attribution:e})}(e);t(n)}),e)},ft={passive:!0,capture:!0},dt=new Date,lt=function(t,e){Y||(Y=e,Z=t,$=new Date,vt(removeEventListener),mt())},mt=function(){if(Z>=0&&Z<$-dt){var t={entryType:\"first-input\",name:Y.type,target:Y.target,cancelable:Y.cancelable,startTime:Y.timeStamp,processingStart:Y.timeStamp+Z};tt.forEach((function(e){e(t)})),tt=[]}},pt=function(t){if(t.cancelable){var e=(t.timeStamp>1e12?new Date:performance.now())-t.timeStamp;\"pointerdown\"==t.type?function(t,e){var n=function(){lt(t,e),i()},r=function(){i()},i=function(){removeEventListener(\"pointerup\",n,ft),removeEventListener(\"pointercancel\",r,ft)};addEventListener(\"pointerup\",n,ft),addEventListener(\"pointercancel\",r,ft)}(e,t):lt(e,t)}},vt=function(t){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(e){return t(e,pt,ft)}))},gt=[100,300],ht=function(t,e){e=e||{},L((function(){var n,r=b(),i=d(\"FID\"),a=function(t){t.startTime<r.firstHiddenTime&&(i.value=t.processingStart-t.startTime,i.entries.push(t),n(!0))},o=function(t){t.forEach(a)},c=l(\"first-input\",o);n=m(t,i,gt,e.reportAllChanges),c&&(v(g((function(){o(c.takeRecords()),c.disconnect()}))),s((function(){var r;i=d(\"FID\"),n=m(t,i,gt,e.reportAllChanges),tt=[],Z=-1,Y=null,vt(addEventListener),r=a,tt.push(r),mt()})))}))},Tt=function(t,e){ht((function(e){var n=function(t){var e=t.entries[0],n={eventTarget:o(e.target),eventType:e.name,eventTime:e.startTime,eventEntry:e,loadState:i(e.startTime)};return Object.assign(t,{attribution:n})}(e);t(n)}),e)};export{D as CLSThresholds,C as FCPThresholds,gt as FIDThresholds,W as INPThresholds,rt as LCPThresholds,ot as TTFBThresholds,w as onCLS,x as onFCP,Tt as onFID,nt as onINP,at as onLCP,st as onTTFB};\n","import { ErrorProperties } from '../extensions/exception-autocapture/error-conversion'\nimport type { PostHog } from '../posthog-core'\nimport { SessionIdManager } from '../sessionid'\nimport {\n DeadClicksAutoCaptureConfig,\n ErrorEventArgs,\n ErrorMetadata,\n Properties,\n RemoteConfig,\n SiteAppLoader,\n} from '../types'\n\n/*\n * Global helpers to protect access to browser globals in a way that is safer for different targets\n * like DOM, SSR, Web workers etc.\n *\n * NOTE: Typically we want the \"window\" but globalThis works for both the typical browser context as\n * well as other contexts such as the web worker context. Window is still exported for any bits that explicitly require it.\n * If in doubt - export the global you need from this file and use that as an optional value. This way the code path is forced\n * to handle the case where the global is not available.\n */\n\n// eslint-disable-next-line no-restricted-globals\nconst win: (Window & typeof globalThis) | undefined = typeof window !== 'undefined' ? window : undefined\n\nexport type AssignableWindow = Window &\n typeof globalThis &\n Record<string, any> & {\n __PosthogExtensions__?: PostHogExtensions\n _POSTHOG_CONFIG?: RemoteConfig\n _POSTHOG_JS_APPS?: SiteAppLoader[]\n }\n\n/**\n * This is our contract between (potentially) lazily loaded extensions and the SDK\n * changes to this interface can be breaking changes for users of the SDK\n */\n\nexport type PostHogExtensionKind =\n | 'toolbar'\n | 'exception-autocapture'\n | 'web-vitals'\n | 'recorder'\n | 'tracing-headers'\n | 'surveys'\n | 'dead-clicks-autocapture'\n | 'remote-config'\n\nexport interface LazyLoadedDeadClicksAutocaptureInterface {\n start: (observerTarget: Node) => void\n stop: () => void\n}\n\ninterface PostHogExtensions {\n loadExternalDependency?: (\n posthog: PostHog,\n kind: PostHogExtensionKind,\n callback: (error?: string | Event, event?: Event) => void\n ) => void\n\n loadSiteApp?: (posthog: PostHog, appUrl: string, callback: (error?: string | Event, event?: Event) => void) => void\n\n parseErrorAsProperties?: (\n [event, source, lineno, colno, error]: ErrorEventArgs,\n metadata?: ErrorMetadata\n ) => ErrorProperties\n errorWrappingFunctions?: {\n wrapOnError: (captureFn: (props: Properties) => void) => () => void\n wrapUnhandledRejection: (captureFn: (props: Properties) => void) => () => void\n }\n rrweb?: { record: any; version: string }\n rrwebPlugins?: { getRecordConsolePlugin: any; getRecordNetworkPlugin?: any }\n canActivateRepeatedly?: (survey: any) => boolean\n generateSurveys?: (posthog: PostHog) => any | undefined\n postHogWebVitalsCallbacks?: {\n onLCP: (metric: any) => void\n onCLS: (metric: any) => void\n onFCP: (metric: any) => void\n onINP: (metric: any) => void\n }\n tracingHeadersPatchFns?: {\n _patchFetch: (sessionManager: SessionIdManager) => () => void\n _patchXHR: (sessionManager: any) => () => void\n }\n initDeadClicksAutocapture?: (\n ph: PostHog,\n config: DeadClicksAutoCaptureConfig\n ) => LazyLoadedDeadClicksAutocaptureInterface\n}\n\nconst global: typeof globalThis | undefined = typeof globalThis !== 'undefined' ? globalThis : win\n\nexport const ArrayProto = Array.prototype\nexport const nativeForEach = ArrayProto.forEach\nexport const nativeIndexOf = ArrayProto.indexOf\n\nexport const navigator = global?.navigator\nexport const document = global?.document\nexport const location = global?.location\nexport const fetch = global?.fetch\nexport const XMLHttpRequest =\n global?.XMLHttpRequest && 'withCredentials' in new global.XMLHttpRequest() ? global.XMLHttpRequest : undefined\nexport const AbortController = global?.AbortController\nexport const userAgent = navigator?.userAgent\nexport const assignableWindow: AssignableWindow = win ?? ({} as any)\n\nexport { win as window }\n","import { onINP, onLCP, onCLS, onFCP } from 'web-vitals/attribution'\nimport { assignableWindow } from '../utils/globals'\n\nconst postHogWebVitalsCallbacks = {\n onLCP,\n onCLS,\n onFCP,\n onINP,\n}\n\nassignableWindow.__PosthogExtensions__ = assignableWindow.__PosthogExtensions__ || {}\nassignableWindow.__PosthogExtensions__.postHogWebVitalsCallbacks = postHogWebVitalsCallbacks\n\n// we used to put posthogWebVitalsCallbacks on window, and now we put it on __PosthogExtensions__\n// but that means that old clients which lazily load this extension are looking in the wrong place\n// yuck,\n// so we also put it directly on the window\n// when 1.161.1 is the oldest version seen in production we can remove this\nassignableWindow.postHogWebVitalsCallbacks = postHogWebVitalsCallbacks\n\nexport default postHogWebVitalsCallbacks\n"],"names":["t","e","n","r","self","performance","getEntriesByType","responseStart","now","i","document","readyState","domInteractive","domContentLoadedEventStart","domComplete","a","nodeName","nodeType","toLowerCase","toUpperCase","replace","o","id","classList","value","trim","length","parentNode","c","u","s","addEventListener","persisted","timeStamp","f","activationStart","d","prerendering","wasDiscarded","type","name","rating","delta","entries","concat","Date","Math","floor","random","navigationType","l","PerformanceObserver","supportedEntryTypes","includes","Promise","resolve","then","getEntries","observe","Object","assign","buffered","m","p","requestAnimationFrame","v","visibilityState","g","h","T","y","S","E","removeEventListener","b","setTimeout","firstHiddenTime","L","C","M","forEach","disconnect","startTime","max","push","reportAllChanges","D","I","k","A","F","interactionId","min","P","durationThreshold","B","O","Map","R","j","interactionCount","q","H","entryType","get","duration","latency","set","sort","splice","delete","N","requestIdleCallback","W","U","V","_","WeakMap","G","J","K","Q","X","size","has","map","filter","Set","et","processingEnd","add","Array","from","target","abs","renderTime","processingStart","rt","it","win","window","undefined","global","globalThis","navigator","location","fetch","XMLHttpRequest","AbortController","userAgent","assignableWindow","postHogWebVitalsCallbacks","slice","takeRecords","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","url","requestStart","responseEnd","element","navigationEntry","lcpEntry","lcpResourceEntry","attribution","hadRecentInput","reduce","sources","find","node","largestShiftTarget","largestShiftTime","largestShiftValue","largestShiftSource","largestShiftEntry","loadState","firstByteToFCP","fcpEntry","onINP","PerformanceEventTiming","prototype","clear","z","apply","interactionTarget","interactionTargetElement","interactionType","startsWith","interactionTime","nextPaintTime","processedEventEntries","longAnimationFrameEntries","inputDelay","processingDuration","presentationDelay","__PosthogExtensions__"],"mappings":"yBAAA,IAAIA,EAAEC,EAAEC,EAAEC,EAAE,WAAW,IAAIH,EAAEI,KAAKC,aAAaA,YAAYC,kBAAkBD,YAAYC,iBAAiB,cAAc,GAAG,GAAGN,GAAGA,EAAEO,cAAc,GAAGP,EAAEO,cAAcF,YAAYG,MAAM,OAAOR,CAAE,EAACS,EAAE,SAAST,GAAG,GAAG,YAAYU,SAASC,WAAW,MAAM,UAAU,IAAIV,EAAEE,IAAI,GAAGF,EAAE,CAAC,GAAGD,EAAEC,EAAEW,eAAe,MAAM,UAAU,GAAG,IAAIX,EAAEY,4BAA4Bb,EAAEC,EAAEY,2BAA2B,MAAM,kBAAkB,GAAG,IAAIZ,EAAEa,aAAad,EAAEC,EAAEa,YAAY,MAAM,oBAAoB,CAAC,MAAM,UAAW,EAACC,EAAE,SAASf,GAAG,IAAIC,EAAED,EAAEgB,SAAS,OAAO,IAAIhB,EAAEiB,SAAShB,EAAEiB,cAAcjB,EAAEkB,cAAcC,QAAQ,KAAK,GAAI,EAACC,EAAE,SAASrB,EAAEC,GAAG,IAAIC,EAAE,GAAG,IAAI,KAAKF,GAAG,IAAIA,EAAEiB,UAAU,CAAC,IAAId,EAAEH,EAAES,EAAEN,EAAEmB,GAAG,IAAInB,EAAEmB,GAAGP,EAAEZ,IAAIA,EAAEoB,WAAWpB,EAAEoB,UAAUC,OAAOrB,EAAEoB,UAAUC,MAAMC,QAAQtB,EAAEoB,UAAUC,MAAMC,OAAOC,OAAO,IAAIvB,EAAEoB,UAAUC,MAAMC,OAAOL,QAAQ,OAAO,KAAK,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AW,UAAUC,gBAAgB5L,EAAEiF,UAAU4G,cAAc5I,EAAE6I,sBAAsBnK,EAAEoK,0BAA0BnK,EAAEoK,WAAW9L,EAAEF,EAAEiF,UAAUgH,mBAAmBnL,EAAEZ,EAAEgM,kBAAkBrJ,KAAKqC,IAAIjC,EAAEnC,EAAE,GAAGiK,UAAUvK,EAAER,EAAEiF,YAAY,OAAOvB,OAAOC,OAAO5D,EAAE,CAACqK,YAAYvG,GAAI,CAAluB,CAAmuB7D,GAAGD,EAAEE,EAAG,GAAEA,KEU/xQoJ,GAAiB8C,sBAAwB9C,GAAiB8C,uBAAyB,GACnF9C,GAAiB8C,sBAAsB7C,0BAA4BA,GAOnED,GAAiBC,0BAA4BA","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"web-vitals.js","sources":["../node_modules/.pnpm/web-vitals@4.2.0/node_modules/web-vitals/dist/web-vitals.attribution.js","../src/utils/globals.ts","../src/entrypoints/web-vitals.ts"],"sourcesContent":["var t,e,n,r=function(){var t=self.performance&&performance.getEntriesByType&&performance.getEntriesByType(\"navigation\")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},i=function(t){if(\"loading\"===document.readyState)return\"loading\";var e=r();if(e){if(t<e.domInteractive)return\"loading\";if(0===e.domContentLoadedEventStart||t<e.domContentLoadedEventStart)return\"dom-interactive\";if(0===e.domComplete||t<e.domComplete)return\"dom-content-loaded\"}return\"complete\"},a=function(t){var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,\"\")},o=function(t,e){var n=\"\";try{for(;t&&9!==t.nodeType;){var r=t,i=r.id?\"#\"+r.id:a(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?\".\"+r.classList.value.trim().replace(/\\s+/g,\".\"):\"\");if(n.length+i.length>(e||100)-1)return n||i;if(n=n?i+\">\"+n:i,r.id)break;t=r.parentNode}}catch(t){}return n},c=-1,u=function(){return c},s=function(t){addEventListener(\"pageshow\",(function(e){e.persisted&&(c=e.timeStamp,t(e))}),!0)},f=function(){var t=r();return t&&t.activationStart||0},d=function(t,e){var n=r(),i=\"navigate\";u()>=0?i=\"back-forward-cache\":n&&(document.prerendering||f()>0?i=\"prerender\":document.wasDiscarded?i=\"restore\":n.type&&(i=n.type.replace(/_/g,\"-\")));return{name:t,value:void 0===e?-1:e,rating:\"good\",delta:0,entries:[],id:\"v4-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},l=function(t,e,n){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((function(t){Promise.resolve().then((function(){e(t.getEntries())}))}));return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch(t){}},m=function(t,e,n,r){var i,a;return function(o){e.value>=0&&(o||r)&&((a=e.value-(i||0))||void 0===i)&&(i=e.value,e.delta=a,e.rating=function(t,e){return t>e[1]?\"poor\":t>e[0]?\"needs-improvement\":\"good\"}(e.value,n),t(e))}},p=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},v=function(t){document.addEventListener(\"visibilitychange\",(function(){\"hidden\"===document.visibilityState&&t()}))},g=function(t){var e=!1;return function(){e||(t(),e=!0)}},h=-1,T=function(){return\"hidden\"!==document.visibilityState||document.prerendering?1/0:0},y=function(t){\"hidden\"===document.visibilityState&&h>-1&&(h=\"visibilitychange\"===t.type?t.timeStamp:0,S())},E=function(){addEventListener(\"visibilitychange\",y,!0),addEventListener(\"prerenderingchange\",y,!0)},S=function(){removeEventListener(\"visibilitychange\",y,!0),removeEventListener(\"prerenderingchange\",y,!0)},b=function(){return h<0&&(h=T(),E(),s((function(){setTimeout((function(){h=T(),E()}),0)}))),{get firstHiddenTime(){return h}}},L=function(t){document.prerendering?addEventListener(\"prerenderingchange\",(function(){return t()}),!0):t()},C=[1800,3e3],M=function(t,e){e=e||{},L((function(){var n,r=b(),i=d(\"FCP\"),a=l(\"paint\",(function(t){t.forEach((function(t){\"first-contentful-paint\"===t.name&&(a.disconnect(),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-f(),0),i.entries.push(t),n(!0)))}))}));a&&(n=m(t,i,C,e.reportAllChanges),s((function(r){i=d(\"FCP\"),n=m(t,i,C,e.reportAllChanges),p((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},D=[.1,.25],w=function(t,e){!function(t,e){e=e||{},M(g((function(){var n,r=d(\"CLS\",0),i=0,a=[],o=function(t){t.forEach((function(t){if(!t.hadRecentInput){var e=a[0],n=a[a.length-1];i&&t.startTime-n.startTime<1e3&&t.startTime-e.startTime<5e3?(i+=t.value,a.push(t)):(i=t.value,a=[t])}})),i>r.value&&(r.value=i,r.entries=a,n())},c=l(\"layout-shift\",o);c&&(n=m(t,r,D,e.reportAllChanges),v((function(){o(c.takeRecords()),n(!0)})),s((function(){i=0,r=d(\"CLS\",0),n=m(t,r,D,e.reportAllChanges),p((function(){return n()}))})),setTimeout(n,0))})))}((function(e){var n=function(t){var e,n={};if(t.entries.length){var r=t.entries.reduce((function(t,e){return t&&t.value>e.value?t:e}));if(r&&r.sources&&r.sources.length){var a=(e=r.sources).find((function(t){return t.node&&1===t.node.nodeType}))||e[0];a&&(n={largestShiftTarget:o(a.node),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:a,largestShiftEntry:r,loadState:i(r.startTime)})}}return Object.assign(t,{attribution:n})}(e);t(n)}),e)},x=function(t,e){M((function(e){var n=function(t){var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:i(u())};if(t.entries.length){var n=r(),a=t.entries[t.entries.length-1];if(n){var o=n.activationStart||0,c=Math.max(0,n.responseStart-o);e={timeToFirstByte:c,firstByteToFCP:t.value-c,loadState:i(t.entries[0].startTime),navigationEntry:n,fcpEntry:a}}}return Object.assign(t,{attribution:e})}(e);t(n)}),e)},I=0,k=1/0,A=0,F=function(t){t.forEach((function(t){t.interactionId&&(k=Math.min(k,t.interactionId),A=Math.max(A,t.interactionId),I=A?(A-k)/7+1:0)}))},P=function(){\"interactionCount\"in performance||t||(t=l(\"event\",F,{type:\"event\",buffered:!0,durationThreshold:0}))},B=[],O=new Map,R=0,j=function(){return(t?I:performance.interactionCount||0)-R},q=[],H=function(t){if(q.forEach((function(e){return e(t)})),t.interactionId||\"first-input\"===t.entryType){var e=B[B.length-1],n=O.get(t.interactionId);if(n||B.length<10||t.duration>e.latency){if(n)t.duration>n.latency?(n.entries=[t],n.latency=t.duration):t.duration===n.latency&&t.startTime===n.entries[0].startTime&&n.entries.push(t);else{var r={id:t.interactionId,latency:t.duration,entries:[t]};O.set(r.id,r),B.push(r)}B.sort((function(t,e){return e.latency-t.latency})),B.length>10&&B.splice(10).forEach((function(t){return O.delete(t.id)}))}}},N=function(t){var e=self.requestIdleCallback||self.setTimeout,n=-1;return t=g(t),\"hidden\"===document.visibilityState?t():(n=e(t),v(t)),n},W=[200,500],z=function(t,e){\"PerformanceEventTiming\"in self&&\"interactionId\"in PerformanceEventTiming.prototype&&(e=e||{},L((function(){var n;P();var r,i=d(\"INP\"),a=function(t){N((function(){t.forEach(H);var e,n=(e=Math.min(B.length-1,Math.floor(j()/50)),B[e]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())}))},o=l(\"event\",a,{durationThreshold:null!==(n=e.durationThreshold)&&void 0!==n?n:40});r=m(t,i,W,e.reportAllChanges),o&&(o.observe({type:\"first-input\",buffered:!0}),v((function(){a(o.takeRecords()),r(!0)})),s((function(){R=0,B.length=0,O.clear(),i=d(\"INP\"),r=m(t,i,W,e.reportAllChanges)})))})))},U=[],V=[],_=new WeakMap,G=new Map,J=-1,K=function(t){U=U.concat(t),Q()},Q=function(){J<0&&(J=N(X))},X=function(){G.size>10&&G.forEach((function(t,e){O.has(e)||G.delete(e)}));var t=B.map((function(t){return _.get(t.entries[0])})),e=V.length-50;V=V.filter((function(n,r){return r>=e||t.includes(n)}));for(var r=new Set,i=0;i<V.length;i++){var a=V[i];et(a.startTime,a.processingEnd).forEach((function(t){r.add(t)}))}for(var o=0;o<50;o++){var c=U[U.length-1-o];if(!c||c.startTime<n)break;r.add(c)}U=Array.from(r),J=-1};q.push((function(t){t.interactionId&&t.target&&!G.has(t.interactionId)&&G.set(t.interactionId,t.target)}),(function(t){var e,r=t.startTime+t.duration;n=Math.max(n,t.processingEnd);for(var i=V.length-1;i>=0;i--){var a=V[i];if(Math.abs(r-a.renderTime)<=8){(e=a).startTime=Math.min(t.startTime,e.startTime),e.processingStart=Math.min(t.processingStart,e.processingStart),e.processingEnd=Math.max(t.processingEnd,e.processingEnd),e.entries.push(t);break}}e||(e={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:[t]},V.push(e)),(t.interactionId||\"first-input\"===t.entryType)&&_.set(t,e),Q()}));var Y,Z,$,tt,et=function(t,e){for(var n,r=[],i=0;n=U[i];i++)if(!(n.startTime+n.duration<t)){if(n.startTime>e)break;r.push(n)}return r},nt=function(t,n){e||(e=l(\"long-animation-frame\",K)),z((function(e){var n=function(t){var e=t.entries[0],n=_.get(e),r=e.processingStart,a=n.processingEnd,c=n.entries.sort((function(t,e){return t.processingStart-e.processingStart})),u=et(e.startTime,a),s=t.entries.find((function(t){return t.target})),f=s&&s.target||G.get(e.interactionId),d=[e.startTime+e.duration,a].concat(u.map((function(t){return t.startTime+t.duration}))),l=Math.max.apply(Math,d),m={interactionTarget:o(f),interactionTargetElement:f,interactionType:e.name.startsWith(\"key\")?\"keyboard\":\"pointer\",interactionTime:e.startTime,nextPaintTime:l,processedEventEntries:c,longAnimationFrameEntries:u,inputDelay:r-e.startTime,processingDuration:a-r,presentationDelay:Math.max(l-a,0),loadState:i(e.startTime)};return Object.assign(t,{attribution:m})}(e);t(n)}),n)},rt=[2500,4e3],it={},at=function(t,e){!function(t,e){e=e||{},L((function(){var n,r=b(),i=d(\"LCP\"),a=function(t){e.reportAllChanges||(t=t.slice(-1)),t.forEach((function(t){t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-f(),0),i.entries=[t],n())}))},o=l(\"largest-contentful-paint\",a);if(o){n=m(t,i,rt,e.reportAllChanges);var c=g((function(){it[i.id]||(a(o.takeRecords()),o.disconnect(),it[i.id]=!0,n(!0))}));[\"keydown\",\"click\"].forEach((function(t){addEventListener(t,(function(){return N(c)}),!0)})),v(c),s((function(r){i=d(\"LCP\"),n=m(t,i,rt,e.reportAllChanges),p((function(){i.value=performance.now()-r.timeStamp,it[i.id]=!0,n(!0)}))}))}}))}((function(e){var n=function(t){var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var n=r();if(n){var i=n.activationStart||0,a=t.entries[t.entries.length-1],c=a.url&&performance.getEntriesByType(\"resource\").filter((function(t){return t.name===a.url}))[0],u=Math.max(0,n.responseStart-i),s=Math.max(u,c?(c.requestStart||c.startTime)-i:0),f=Math.max(s,c?c.responseEnd-i:0),d=Math.max(f,a.startTime-i);e={element:o(a.element),timeToFirstByte:u,resourceLoadDelay:s-u,resourceLoadDuration:f-s,elementRenderDelay:d-f,navigationEntry:n,lcpEntry:a},a.url&&(e.url=a.url),c&&(e.lcpResourceEntry=c)}}return Object.assign(t,{attribution:e})}(e);t(n)}),e)},ot=[800,1800],ct=function t(e){document.prerendering?L((function(){return t(e)})):\"complete\"!==document.readyState?addEventListener(\"load\",(function(){return t(e)}),!0):setTimeout(e,0)},ut=function(t,e){e=e||{};var n=d(\"TTFB\"),i=m(t,n,ot,e.reportAllChanges);ct((function(){var a=r();a&&(n.value=Math.max(a.responseStart-f(),0),n.entries=[a],i(!0),s((function(){n=d(\"TTFB\",0),(i=m(t,n,ot,e.reportAllChanges))(!0)})))}))},st=function(t,e){ut((function(e){var n=function(t){var e={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(t.entries.length){var n=t.entries[0],r=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-r,0),a=Math.max(n.domainLookupStart-r,0),o=Math.max(n.connectStart-r,0),c=Math.max(n.connectEnd-r,0);e={waitingDuration:i,cacheDuration:a-i,dnsDuration:o-a,connectionDuration:c-o,requestDuration:t.value-c,navigationEntry:n}}return Object.assign(t,{attribution:e})}(e);t(n)}),e)},ft={passive:!0,capture:!0},dt=new Date,lt=function(t,e){Y||(Y=e,Z=t,$=new Date,vt(removeEventListener),mt())},mt=function(){if(Z>=0&&Z<$-dt){var t={entryType:\"first-input\",name:Y.type,target:Y.target,cancelable:Y.cancelable,startTime:Y.timeStamp,processingStart:Y.timeStamp+Z};tt.forEach((function(e){e(t)})),tt=[]}},pt=function(t){if(t.cancelable){var e=(t.timeStamp>1e12?new Date:performance.now())-t.timeStamp;\"pointerdown\"==t.type?function(t,e){var n=function(){lt(t,e),i()},r=function(){i()},i=function(){removeEventListener(\"pointerup\",n,ft),removeEventListener(\"pointercancel\",r,ft)};addEventListener(\"pointerup\",n,ft),addEventListener(\"pointercancel\",r,ft)}(e,t):lt(e,t)}},vt=function(t){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(e){return t(e,pt,ft)}))},gt=[100,300],ht=function(t,e){e=e||{},L((function(){var n,r=b(),i=d(\"FID\"),a=function(t){t.startTime<r.firstHiddenTime&&(i.value=t.processingStart-t.startTime,i.entries.push(t),n(!0))},o=function(t){t.forEach(a)},c=l(\"first-input\",o);n=m(t,i,gt,e.reportAllChanges),c&&(v(g((function(){o(c.takeRecords()),c.disconnect()}))),s((function(){var r;i=d(\"FID\"),n=m(t,i,gt,e.reportAllChanges),tt=[],Z=-1,Y=null,vt(addEventListener),r=a,tt.push(r),mt()})))}))},Tt=function(t,e){ht((function(e){var n=function(t){var e=t.entries[0],n={eventTarget:o(e.target),eventType:e.name,eventTime:e.startTime,eventEntry:e,loadState:i(e.startTime)};return Object.assign(t,{attribution:n})}(e);t(n)}),e)};export{D as CLSThresholds,C as FCPThresholds,gt as FIDThresholds,W as INPThresholds,rt as LCPThresholds,ot as TTFBThresholds,w as onCLS,x as onFCP,Tt as onFID,nt as onINP,at as onLCP,st as onTTFB};\n","import { ErrorProperties } from '../extensions/exception-autocapture/error-conversion'\nimport type { PostHog } from '../posthog-core'\nimport { SessionIdManager } from '../sessionid'\nimport {\n DeadClicksAutoCaptureConfig,\n ErrorEventArgs,\n ErrorMetadata,\n Properties,\n RemoteConfig,\n SiteAppLoader,\n} from '../types'\n\n/*\n * Global helpers to protect access to browser globals in a way that is safer for different targets\n * like DOM, SSR, Web workers etc.\n *\n * NOTE: Typically we want the \"window\" but globalThis works for both the typical browser context as\n * well as other contexts such as the web worker context. Window is still exported for any bits that explicitly require it.\n * If in doubt - export the global you need from this file and use that as an optional value. This way the code path is forced\n * to handle the case where the global is not available.\n */\n\n// eslint-disable-next-line no-restricted-globals\nconst win: (Window & typeof globalThis) | undefined = typeof window !== 'undefined' ? window : undefined\n\nexport type AssignableWindow = Window &\n typeof globalThis &\n Record<string, any> & {\n __PosthogExtensions__?: PostHogExtensions\n _POSTHOG_CONFIG?: RemoteConfig\n _POSTHOG_JS_APPS?: SiteAppLoader[]\n }\n\n/**\n * This is our contract between (potentially) lazily loaded extensions and the SDK\n * changes to this interface can be breaking changes for users of the SDK\n */\n\nexport type PostHogExtensionKind =\n | 'toolbar'\n | 'exception-autocapture'\n | 'web-vitals'\n | 'recorder'\n | 'tracing-headers'\n | 'surveys'\n | 'dead-clicks-autocapture'\n | 'remote-config'\n\nexport interface LazyLoadedDeadClicksAutocaptureInterface {\n start: (observerTarget: Node) => void\n stop: () => void\n}\n\ninterface PostHogExtensions {\n loadExternalDependency?: (\n posthog: PostHog,\n kind: PostHogExtensionKind,\n callback: (error?: string | Event, event?: Event) => void\n ) => void\n\n loadSiteApp?: (posthog: PostHog, appUrl: string, callback: (error?: string | Event, event?: Event) => void) => void\n\n parseErrorAsProperties?: (\n [event, source, lineno, colno, error]: ErrorEventArgs,\n metadata?: ErrorMetadata\n ) => ErrorProperties\n errorWrappingFunctions?: {\n wrapOnError: (captureFn: (props: Properties) => void) => () => void\n wrapUnhandledRejection: (captureFn: (props: Properties) => void) => () => void\n }\n rrweb?: { record: any; version: string }\n rrwebPlugins?: { getRecordConsolePlugin: any; getRecordNetworkPlugin?: any }\n canActivateRepeatedly?: (survey: any) => boolean\n generateSurveys?: (posthog: PostHog) => any | undefined\n postHogWebVitalsCallbacks?: {\n onLCP: (metric: any) => void\n onCLS: (metric: any) => void\n onFCP: (metric: any) => void\n onINP: (metric: any) => void\n }\n tracingHeadersPatchFns?: {\n _patchFetch: (sessionManager?: SessionIdManager) => () => void\n _patchXHR: (sessionManager?: SessionIdManager) => () => void\n }\n initDeadClicksAutocapture?: (\n ph: PostHog,\n config: DeadClicksAutoCaptureConfig\n ) => LazyLoadedDeadClicksAutocaptureInterface\n}\n\nconst global: typeof globalThis | undefined = typeof globalThis !== 'undefined' ? globalThis : win\n\nexport const ArrayProto = Array.prototype\nexport const nativeForEach = ArrayProto.forEach\nexport const nativeIndexOf = ArrayProto.indexOf\n\nexport const navigator = global?.navigator\nexport const document = global?.document\nexport const location = global?.location\nexport const fetch = global?.fetch\nexport const XMLHttpRequest =\n global?.XMLHttpRequest && 'withCredentials' in new global.XMLHttpRequest() ? global.XMLHttpRequest : undefined\nexport const AbortController = global?.AbortController\nexport const userAgent = navigator?.userAgent\nexport const assignableWindow: AssignableWindow = win ?? ({} as any)\n\nexport { win as window }\n","import { onINP, onLCP, onCLS, onFCP } from 'web-vitals/attribution'\nimport { assignableWindow } from '../utils/globals'\n\nconst postHogWebVitalsCallbacks = {\n onLCP,\n onCLS,\n onFCP,\n onINP,\n}\n\nassignableWindow.__PosthogExtensions__ = assignableWindow.__PosthogExtensions__ || {}\nassignableWindow.__PosthogExtensions__.postHogWebVitalsCallbacks = postHogWebVitalsCallbacks\n\n// we used to put posthogWebVitalsCallbacks on window, and now we put it on __PosthogExtensions__\n// but that means that old clients which lazily load this extension are looking in the wrong place\n// yuck,\n// so we also put it directly on the window\n// when 1.161.1 is the oldest version seen in production we can remove this\nassignableWindow.postHogWebVitalsCallbacks = postHogWebVitalsCallbacks\n\nexport default postHogWebVitalsCallbacks\n"],"names":["t","e","n","r","self","performance","getEntriesByType","responseStart","now","i","document","readyState","domInteractive","domContentLoadedEventStart","domComplete","a","nodeName","nodeType","toLowerCase","toUpperCase","replace","o","id","classList","value","trim","length","parentNode","c","u","s","addEventListener","persisted","timeStamp","f","activationStart","d","prerendering","wasDiscarded","type","name","rating","delta","entries","concat","Date","Math","floor","random","navigationType","l","PerformanceObserver","supportedEntryTypes","includes","Promise","resolve","then","getEntries","observe","Object","assign","buffered","m","p","requestAnimationFrame","v","visibilityState","g","h","T","y","S","E","removeEventListener","b","setTimeout","firstHiddenTime","L","C","M","forEach","disconnect","startTime","max","push","reportAllChanges","D","I","k","A","F","interactionId","min","P","durationThreshold","B","O","Map","R","j","interactionCount","q","H","entryType","get","duration","latency","set","sort","splice","delete","N","requestIdleCallback","W","U","V","_","WeakMap","G","J","K","Q","X","size","has","map","filter","Set","et","processingEnd","add","Array","from","target","abs","renderTime","processingStart","rt","it","win","window","undefined","global","globalThis","navigator","location","fetch","XMLHttpRequest","AbortController","userAgent","assignableWindow","postHogWebVitalsCallbacks","slice","takeRecords","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","url","requestStart","responseEnd","element","navigationEntry","lcpEntry","lcpResourceEntry","attribution","hadRecentInput","reduce","sources","find","node","largestShiftTarget","largestShiftTime","largestShiftValue","largestShiftSource","largestShiftEntry","loadState","firstByteToFCP","fcpEntry","onINP","PerformanceEventTiming","prototype","clear","z","apply","interactionTarget","interactionTargetElement","interactionType","startsWith","interactionTime","nextPaintTime","processedEventEntries","longAnimationFrameEntries","inputDelay","processingDuration","presentationDelay","__PosthogExtensions__"],"mappings":"yBAAA,IAAIA,EAAEC,EAAEC,EAAEC,EAAE,WAAW,IAAIH,EAAEI,KAAKC,aAAaA,YAAYC,kBAAkBD,YAAYC,iBAAiB,cAAc,GAAG,GAAGN,GAAGA,EAAEO,cAAc,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4BA,GAOnED,GAAiBC,0BAA4BA","x_google_ignoreList":[0]}
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posthog-js",
3
- "version": "1.200.0",
3
+ "version": "1.200.2",
4
4
  "description": "Posthog-js allows you to automatically capture usage and send events to PostHog.",
5
5
  "repository": "https://github.com/PostHog/posthog-js",
6
6
  "author": "hey@posthog.com",
@@ -40,5 +40,11 @@ export declare const INITIAL_PERSON_INFO = "$initial_person_info";
40
40
  export declare const ENABLE_PERSON_PROCESSING = "$epp";
41
41
  export declare const TOOLBAR_ID = "__POSTHOG_TOOLBAR__";
42
42
  export declare const TOOLBAR_CONTAINER_CLASS = "toolbar-global-fade-container";
43
+ /**
44
+ * PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION
45
+ * Sentinel value for distinct id, device id, session id. Signals that the server should generate the value
46
+ * */
47
+ export declare const COOKIELESS_SENTINEL_VALUE = "$posthog_cklsh";
48
+ export declare const COOKIELESS_MODE_FLAG_PROPERTY = "$cklsh_mode";
43
49
  export declare const WEB_EXPERIMENTS = "$web_experiments";
44
50
  export declare const PERSISTENCE_RESERVED_PROPERTIES: string[];
@@ -45,6 +45,12 @@ export var INITIAL_PERSON_INFO = '$initial_person_info';
45
45
  export var ENABLE_PERSON_PROCESSING = '$epp';
46
46
  export var TOOLBAR_ID = '__POSTHOG_TOOLBAR__';
47
47
  export var TOOLBAR_CONTAINER_CLASS = 'toolbar-global-fade-container';
48
+ /**
49
+ * PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION
50
+ * Sentinel value for distinct id, device id, session id. Signals that the server should generate the value
51
+ * */
52
+ export var COOKIELESS_SENTINEL_VALUE = '$posthog_cklsh';
53
+ export var COOKIELESS_MODE_FLAG_PROPERTY = '$cklsh_mode';
48
54
  export var WEB_EXPERIMENTS = '$web_experiments';
49
55
  // These are properties that are reserved and will not be automatically included in events
50
56
  export var PERSISTENCE_RESERVED_PROP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AAU;IACV,qBAAqB;IACrB,UAAU;IACV,iCAAiC;IACjC,2BAA2B;IAC3B,4BAA4B;IAC5B,OAAO;IACP,kBAAkB;IAClB,oBAAoB;IACpB,kBAAkB;IAClB,uBAAuB;IACvB,qBAAqB;IACrB,wBAAwB;CAC3B,CAAA","sourcesContent":["/*\n * Constants\n */\n\n/* PROPERTY KEYS */\n\n// This key is deprecated, but we want to check for it to see whether aliasing is allowed.\nexport const PEOPLE_DISTINCT_ID_KEY = '$people_distinct_id'\nexport const DISTINCT_ID = 'distinct_id'\nexport const ALIAS_ID_KEY = '__alias'\nexport const CAMPAIGN_IDS_KEY = '__cmpns'\nexport const EVENT_TIMERS_KEY = '__timers'\nexport const AUTOCAPTURE_DISABLED_SERVER_SIDE = '$autocapture_disabled_server_side'\nexport const HEATMAPS_ENABLED_SERVER_SIDE = '$heatmaps_enabled_server_side'\nexport const EXCEPTION_CAPTURE_ENABLED_SERVER_SIDE = '$exception_capture_enabled_server_side'\nexport const WEB_VITALS_ENABLED_SERVER_SIDE = '$web_vitals_enabled_server_side'\nexport const DEAD_CLICKS_ENABLED_SERVER_SIDE = '$dead_clicks_enabled_server_side'\nexport const WEB_VITALS_ALLOWED_METRICS = '$web_vitals_allowed_metrics'\nexport const SESSION_RECORDING_ENABLED_SERVER_SIDE = '$session_recording_enabled_server_side'\nexport const CONSOLE_LOG_RECORDING_ENABLED_SERVER_SIDE = '$console_log_recording_enabled_server_side'\nexport const SESSION_RECORDING_NETWORK_PAYLOAD_CAPTURE = '$session_recording_network_payload_capture'\nexport const SESSION_RECORDING_CANVAS_RECORDING = '$session_recording_canvas_recording'\nexport const SESSION_RECORDING_SAMPLE_RATE = '$replay_sample_rate'\nexport const SESSION_RECORDING_MINIMUM_DURATION = '$replay_minimum_duration'\nexport const SESSION_RECORDING_SCRIPT_CONFIG = '$replay_script_config'\nexport const SESSION_ID = '$sesid'\nexport const SESSION_RECORDING_IS_SAMPLED = '$session_is_sampled'\nexport const SESSION_RECORDING_URL_TRIGGER_ACTIVATED_SESSION = '$session_recording_url_trigger_activated_session'\nexport const SESSION_RECORDING_URL_TRIGGER_STATUS = '$session_recording_url_trigger_status'\nexport const SESSION_RECORDING_EVENT_TRIGGER_ACTIVATED_SESSION = '$session_recording_event_trigger_activated_session'\nexport const SESSION_RECORDING_EVENT_TRIGGER_STATUS = '$session_recording_event_trigger_status'\nexport const ENABLED_FEATURE_FLAGS = '$enabled_feature_flags'\nexport const PERSISTENCE_EARLY_ACCESS_FEATURES = '$early_access_features'\nexport const STORED_PERSON_PROPERTIES_KEY = '$stored_person_properties'\nexport const STORED_GROUP_PROPERTIES_KEY = '$stored_group_properties'\nexport const SURVEYS = '$surveys'\nexport const SURVEYS_ACTIVATED = '$surveys_activated'\nexport const FLAG_CALL_REPORTED = '$flag_call_reported'\nexport const USER_STATE = '$user_state'\nexport const CLIENT_SESSION_PROPS = '$client_session_props'\nexport const CAPTURE_RATE_LIMIT = '$capture_rate_limit'\n\n/** @deprecated Delete this when INITIAL_PERSON_INFO has been around for long enough to ignore backwards compat */\nexport const INITIAL_CAMPAIGN_PARAMS = '$initial_campaign_params'\n/** @deprecated Delete this when INITIAL_PERSON_INFO has been around for long enough to ignore backwards compat */\nexport const INITIAL_REFERRER_INFO = '$initial_referrer_info'\nexport const INITIAL_PERSON_INFO = '$initial_person_info'\nexport const ENABLE_PERSON_PROCESSING = '$epp'\nexport const TOOLBAR_ID = '__POSTHOG_TOOLBAR__'\nexport const TOOLBAR_CONTAINER_CLASS = 'toolbar-global-fade-container'\n\nexport const WEB_EXPERIMENTS = '$web_experiments'\n\n// These are properties that are reserved and will not be automatically included in events\nexport const PERSISTENCE_RESERVED_PROPERTIES = [\n PEOPLE_DISTINCT_ID_KEY,\n ALIAS_ID_KEY,\n CAMPAIGN_IDS_KEY,\n EVENT_TIMERS_KEY,\n SESSION_RECORDING_ENABLED_SERVER_SIDE,\n HEATMAPS_ENABLED_SERVER_SIDE,\n SESSION_ID,\n ENABLED_FEATURE_FLAGS,\n USER_STATE,\n PERSISTENCE_EARLY_ACCESS_FEATURES,\n STORED_GROUP_PROPERTIES_KEY,\n STORED_PERSON_PROPERTIES_KEY,\n SURVEYS,\n FLAG_CALL_REPORTED,\n CLIENT_SESSION_PROPS,\n CAPTURE_RATE_LIMIT,\n INITIAL_CAMPAIGN_PARAMS,\n INITIAL_REFERRER_INFO,\n ENABLE_PERSON_PROCESSING,\n]\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,mBAAmB;AAEnB,0FAA0F;AAC1F,MAAM,CAAC,IAAM,sBAAsB,GAAG,qBAAqB,CAAA;AAC3D,MAAM,CAAC,IAAM,WAAW,GAAG,aAAa,CAAA;AACxC,MAAM,CAAC,IAAM,YAAY,GAAG,SAAS,CAAA;AACrC,MAAM,CAAC,IAAM,gBAAgB,GAAG,SAAS,CAAA;AACzC,MAAM,CAAC,IAAM,gBAAgB,GAAG,UAAU,CAAA;AAC1C,MAAM,CAAC,IAAM,gCAAgC,GAAG,mCAAmC,CAAA;AACnF,MAAM,CAAC,IAAM,4BAA4B,GAAG,+BAA+B,CAAA;AAC3E,MAAM,CAAC,IAAM,qCAAqC,GAAG,wCAAwC,CAAA;AAC7F,MAAM,CAAC,IAAM,8BAA8B,GAAG,iCAAiC,CAAA;AAC/E,MAAM,CAAC,IAAM,+BAA+B,GAAG,kCAAkC,CAAA;AACjF,MAAM,CAAC,IAAM,0BAA0B,GAAG,6BAA6B,CAAA;AACvE,MAAM,CAAC,IAAM,qCAAqC,GAAG,wCAAwC,CAAA;AAC7F,MAAM,CAAC,IAAM,yCAAyC,GAAG,4CAA4C,CAAA;AACrG,MAAM,CAAC,IAAM,yCAAyC,GAAG,4CAA4C,CAAA;AACrG,MAAM,CAAC,IAAM,kCAAkC,GAAG,qCAAqC,CAAA;AACvF,MAAM,CAAC,IAAM,6BAA6B,GAAG,qBAAqB,CAAA;AAClE,MAAM,CAAC,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,CAAC,IAAM,uBAAuB,GAAG,+BAA+B,CAAA;AAEtE;;;KAGK;AACL,MAAM,CAAC,IAAM,yBAAyB,GAAG,gBAAgB,CAAA;AACzD,MAAM,CAAC,IAAM,6BAA6B,GAAG,aAAa,CAAA;AAE1D,MAAM,CAAC,IAAM,eAAe,GAAG,kBAAkB,CAAA;AAEjD,0FAA0F;AAC1F,MAAM,CAAC,IAAM,+BAA+B,GAAG;IAC3C,sBAAsB;IACtB,YAAY;IACZ,gBAAgB;IAChB,gBAAgB;IAChB,qCAAqC;IACrC,4BAA4B;IAC5B,UAAU;IACV,qBAAqB;IACrB,UAAU;IACV,iCAAiC;IACjC,2BAA2B;IAC3B,4BAA4B;IAC5B,OAAO;IACP,kBAAkB;IAClB,oBAAoB;IACpB,kBAAkB;IAClB,uBAAuB;IACvB,qBAAqB;IACrB,wBAAwB;CAC3B,CAAA","sourcesContent":["/*\n * Constants\n */\n\n/* PROPERTY KEYS */\n\n// This key is deprecated, but we want to check for it to see whether aliasing is allowed.\nexport const PEOPLE_DISTINCT_ID_KEY = '$people_distinct_id'\nexport const DISTINCT_ID = 'distinct_id'\nexport const ALIAS_ID_KEY = '__alias'\nexport const CAMPAIGN_IDS_KEY = '__cmpns'\nexport const EVENT_TIMERS_KEY = '__timers'\nexport const AUTOCAPTURE_DISABLED_SERVER_SIDE = '$autocapture_disabled_server_side'\nexport const HEATMAPS_ENABLED_SERVER_SIDE = '$heatmaps_enabled_server_side'\nexport const EXCEPTION_CAPTURE_ENABLED_SERVER_SIDE = '$exception_capture_enabled_server_side'\nexport const WEB_VITALS_ENABLED_SERVER_SIDE = '$web_vitals_enabled_server_side'\nexport const DEAD_CLICKS_ENABLED_SERVER_SIDE = '$dead_clicks_enabled_server_side'\nexport const WEB_VITALS_ALLOWED_METRICS = '$web_vitals_allowed_metrics'\nexport const SESSION_RECORDING_ENABLED_SERVER_SIDE = '$session_recording_enabled_server_side'\nexport const CONSOLE_LOG_RECORDING_ENABLED_SERVER_SIDE = '$console_log_recording_enabled_server_side'\nexport const SESSION_RECORDING_NETWORK_PAYLOAD_CAPTURE = '$session_recording_network_payload_capture'\nexport const SESSION_RECORDING_CANVAS_RECORDING = '$session_recording_canvas_recording'\nexport const SESSION_RECORDING_SAMPLE_RATE = '$replay_sample_rate'\nexport const SESSION_RECORDING_MINIMUM_DURATION = '$replay_minimum_duration'\nexport const SESSION_RECORDING_SCRIPT_CONFIG = '$replay_script_config'\nexport const SESSION_ID = '$sesid'\nexport const SESSION_RECORDING_IS_SAMPLED = '$session_is_sampled'\nexport const SESSION_RECORDING_URL_TRIGGER_ACTIVATED_SESSION = '$session_recording_url_trigger_activated_session'\nexport const SESSION_RECORDING_URL_TRIGGER_STATUS = '$session_recording_url_trigger_status'\nexport const SESSION_RECORDING_EVENT_TRIGGER_ACTIVATED_SESSION = '$session_recording_event_trigger_activated_session'\nexport const SESSION_RECORDING_EVENT_TRIGGER_STATUS = '$session_recording_event_trigger_status'\nexport const ENABLED_FEATURE_FLAGS = '$enabled_feature_flags'\nexport const PERSISTENCE_EARLY_ACCESS_FEATURES = '$early_access_features'\nexport const STORED_PERSON_PROPERTIES_KEY = '$stored_person_properties'\nexport const STORED_GROUP_PROPERTIES_KEY = '$stored_group_properties'\nexport const SURVEYS = '$surveys'\nexport const SURVEYS_ACTIVATED = '$surveys_activated'\nexport const FLAG_CALL_REPORTED = '$flag_call_reported'\nexport const USER_STATE = '$user_state'\nexport const CLIENT_SESSION_PROPS = '$client_session_props'\nexport const CAPTURE_RATE_LIMIT = '$capture_rate_limit'\n\n/** @deprecated Delete this when INITIAL_PERSON_INFO has been around for long enough to ignore backwards compat */\nexport const INITIAL_CAMPAIGN_PARAMS = '$initial_campaign_params'\n/** @deprecated Delete this when INITIAL_PERSON_INFO has been around for long enough to ignore backwards compat */\nexport const INITIAL_REFERRER_INFO = '$initial_referrer_info'\nexport const INITIAL_PERSON_INFO = '$initial_person_info'\nexport const ENABLE_PERSON_PROCESSING = '$epp'\nexport const TOOLBAR_ID = '__POSTHOG_TOOLBAR__'\nexport const TOOLBAR_CONTAINER_CLASS = 'toolbar-global-fade-container'\n\n/**\n * PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION\n * Sentinel value for distinct id, device id, session id. Signals that the server should generate the value\n * */\nexport const COOKIELESS_SENTINEL_VALUE = '$posthog_cklsh'\nexport const COOKIELESS_MODE_FLAG_PROPERTY = '$cklsh_mode'\n\nexport const WEB_EXPERIMENTS = '$web_experiments'\n\n// These are properties that are reserved and will not be automatically included in events\nexport const PERSISTENCE_RESERVED_PROPERTIES = [\n PEOPLE_DISTINCT_ID_KEY,\n ALIAS_ID_KEY,\n CAMPAIGN_IDS_KEY,\n EVENT_TIMERS_KEY,\n SESSION_RECORDING_ENABLED_SERVER_SIDE,\n HEATMAPS_ENABLED_SERVER_SIDE,\n SESSION_ID,\n ENABLED_FEATURE_FLAGS,\n USER_STATE,\n PERSISTENCE_EARLY_ACCESS_FEATURES,\n STORED_GROUP_PROPERTIES_KEY,\n STORED_PERSON_PROPERTIES_KEY,\n SURVEYS,\n FLAG_CALL_REPORTED,\n CLIENT_SESSION_PROPS,\n CAPTURE_RATE_LIMIT,\n INITIAL_CAMPAIGN_PARAMS,\n INITIAL_REFERRER_INFO,\n ENABLE_PERSON_PROCESSING,\n]\n"]}
@@ -1,6 +1,6 @@
1
1
  import { SessionIdManager } from '../sessionid';
2
2
  declare const patchFns: {
3
- _patchFetch: (sessionManager: SessionIdManager) => (() => void);
4
- _patchXHR: (sessionManager: SessionIdManager) => (() => void);
3
+ _patchFetch: (sessionManager?: SessionIdManager) => (() => void);
4
+ _patchXHR: (sessionManager?: SessionIdManager) => (() => void);
5
5
  };
6
6
  export default patchFns;
@@ -37,9 +37,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  import { patch } from '../extensions/replay/rrweb-plugins/patch';
38
38
  import { assignableWindow, window } from '../utils/globals';
39
39
  var addTracingHeaders = function (sessionManager, req) {
40
- var _a = sessionManager.checkAndGetSessionAndWindowId(true), sessionId = _a.sessionId, windowId = _a.windowId;
41
- req.headers.set('X-POSTHOG-SESSION-ID', sessionId);
42
- req.headers.set('X-POSTHOG-WINDOW-ID', windowId);
40
+ if (sessionManager) {
41
+ var _a = sessionManager.checkAndGetSessionAndWindowId(true), sessionId = _a.sessionId, windowId = _a.windowId;
42
+ req.headers.set('X-POSTHOG-SESSION-ID', sessionId);
43
+ req.headers.set('X-POSTHOG-WINDOW-ID', windowId);
44
+ }
43
45
  };
44
46
  var patchFetch = function (sessionManager) {
45
47
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -1 +1 @@
1
- {"version":3,"file":"tracing-headers.js","sourceRoot":"","sources":["../../../src/entrypoints/tracing-headers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,MAAM,0CAA0C,CAAA;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAE3D,IAAM,iBAAiB,GAAG,UAAC,cAAgC,EAAE,GAAY;IAC/D,IAAA,KAA0B,cAAc,CAAC,6BAA6B,CAAC,IAAI,CAAC,EAA1E,SAAS,eAAA,EAAE,QAAQ,cAAuD,CAAA;IAClF,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAA;IAClD,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAA;AACpD,CAAC,CAAA;AAED,IAAM,UAAU,GAAG,UAAC,cAAgC;IAChD,6DAA6D;IAC7D,aAAa;IACb,OAAO,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,UAAC,aAA2B;QACtD,OAAO,UAAgB,GAAsB,EAAE,IAA8B;;;;oBAGnE,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;oBAElC,iBAAiB,CAAC,cAAc,E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'\nimport { assignableWindow, window } from '../utils/globals'\n\nconst addTracingHeaders = (sessionManager: SessionIdManager, req: Request) => {\n const { sessionId, windowId } = sessionManager.checkAndGetSessionAndWindowId(true)\n req.headers.set('X-POSTHOG-SESSION-ID', sessionId)\n req.headers.set('X-POSTHOG-WINDOW-ID', windowId)\n}\n\nconst patchFetch = (sessionManager: SessionIdManager): (() => void) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return patch(window, 'fetch', (originalFetch: typeof fetch) => {\n return async function (url: URL | RequestInfo, init?: RequestInit | undefined) {\n // check IE earlier than this, we only initialize if Request is present\n // eslint-disable-next-line compat/compat\n const req = new Request(url, init)\n\n addTracingHeaders(sessionManager, req)\n\n return originalFetch(req)\n }\n })\n}\n\nconst patchXHR = (sessionManager: SessionIdManager): (() => void) => {\n return patch(\n // we can assert this is present because we've checked previously\n window!.XMLHttpRequest.prototype,\n 'open',\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n (originalOpen: typeof XMLHttpRequest.prototype.open) => {\n return function (\n method: string,\n url: string | URL,\n async = true,\n username?: string | null,\n password?: string | null\n ) {\n // because this function is returned in its actual context `this` _is_ an XMLHttpRequest\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const xhr = this as XMLHttpRequest\n\n // check IE earlier than this, we only initialize if Request is present\n // eslint-disable-next-line compat/compat\n const req = new Request(url)\n\n addTracingHeaders(sessionManager, req)\n\n return originalOpen.call(xhr, method, req.url, async, username, password)\n }\n }\n )\n}\n\nassignableWindow.__PosthogExtensions__ = assignableWindow.__PosthogExtensions__ || {}\nconst patchFns = {\n _patchFetch: patchFetch,\n _patchXHR: patchXHR,\n}\nassignableWindow.__PosthogExtensions__.tracingHeadersPatchFns = patchFns\n\n// we used to put tracingHeadersPatchFns on window, and now we put it on __PosthogExtensions__\n// but that means that old clients which lazily load this extension are looking in the wrong place\n// yuck,\n// so we also put it directly on the window\n// when 1.161.1 is the oldest version seen in production we can remove this\nassignableWindow.postHogTracingHeadersPatchFns = patchFns\n\nexport default patchFns\n"]}
1
+ {"version":3,"file":"tracing-headers.js","sourceRoot":"","sources":["../../../src/entrypoints/tracing-headers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,MAAM,0CAA0C,CAAA;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAE3D,IAAM,iBAAiB,GAAG,UAAC,cAA4C,EAAE,GAAY;IACjF,IAAI,cAAc,EAAE,CAAC;QACX,IAAA,KAA0B,cAAc,CAAC,6BAA6B,CAAC,IAAI,CAAC,EAA1E,SAAS,eAAA,EAAE,QAAQ,cAAuD,CAAA;QAClF,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAA;QAClD,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAA;IACpD,CAAC;AACL,CAAC,CAAA;AAED,IAAM,UAAU,GAAG,UAAC,cAAiC;IACjD,6DAA6D;IAC7D,aAAa;IACb,OAAO,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,UAAC,aAA2B;QACtD,OAAO,UAAgB,GAAsB,EAAE,IAA8B;;;;oBAGnE,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;oBAElC,iBAAiB,CAAC,cAAc,EAAE,GAAG,CAAC,CAAA;oBAEtC,sBAAO,aAAa,CAAC,GAAG,CAAC,EAAA;;;SAC5B,CAAA;IACL,CAAC,CAAC,CAAA;AACN,CAAC,CAAA;AAED,IAAM,QAAQ,GAAG,UAAC,cAAiC;IAC/C,OAAO,KAAK;IACR,iEAAiE;IACjE,MAAO,CAAC,cAAc,CAAC,SAAS,EAChC,MAAM;IACN,6DAA6D;IAC7D,aAAa;IACb,UAAC,YAAkD;QAC/C,OAAO,UACH,MAAc,EACd,GAAiB,EACjB,KAAY,EACZ,QAAwB,EACxB,QAAwB;YAFxB,sBAAA,EAAA,YAAY;YAIZ,wFAAwF;YACxF,6DAA6D;YAC7D,aAAa;YACb,IAAM,GAAG,GAAG,IAAsB,CAAA;YAElC,uEAAuE;YACvE,yCAAyC;YACzC,IAAM,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,CAAA;YAE5B,iBAAiB,CAAC,cAAc,EAAE,GAAG,CAAC,CAAA;YAEtC,OAAO,YAAY,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAA;QAC7E,CAAC,CAAA;IACL,CAAC,CACJ,CAAA;AACL,CAAC,CAAA;AAED,gBAAgB,CAAC,qBAAqB,GAAG,gBAAgB,CAAC,qBAAqB,IAAI,EAAE,CAAA;AACrF,IAAM,QAAQ,GAAG;IACb,WAAW,EAAE,UAAU;IACvB,SAAS,EAAE,QAAQ;CACtB,CAAA;AACD,gBAAgB,CAAC,qBAAqB,CAAC,sBAAsB,GAAG,QAAQ,CAAA;AAExE,8FAA8F;AAC9F,kGAAkG;AAClG,QAAQ;AACR,2CAA2C;AAC3C,2EAA2E;AAC3E,gBAAgB,CAAC,6BAA6B,GAAG,QAAQ,CAAA;AAEzD,eAAe,QAAQ,CAAA","sourcesContent":["import { SessionIdManager } from '../sessionid'\nimport { patch } from '../extensions/replay/rrweb-plugins/patch'\nimport { assignableWindow, window } from '../utils/globals'\n\nconst addTracingHeaders = (sessionManager: SessionIdManager | undefined, req: Request) => {\n if (sessionManager) {\n const { sessionId, windowId } = sessionManager.checkAndGetSessionAndWindowId(true)\n req.headers.set('X-POSTHOG-SESSION-ID', sessionId)\n req.headers.set('X-POSTHOG-WINDOW-ID', windowId)\n }\n}\n\nconst patchFetch = (sessionManager?: SessionIdManager): (() => void) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return patch(window, 'fetch', (originalFetch: typeof fetch) => {\n return async function (url: URL | RequestInfo, init?: RequestInit | undefined) {\n // check IE earlier than this, we only initialize if Request is present\n // eslint-disable-next-line compat/compat\n const req = new Request(url, init)\n\n addTracingHeaders(sessionManager, req)\n\n return originalFetch(req)\n }\n })\n}\n\nconst patchXHR = (sessionManager?: SessionIdManager): (() => void) => {\n return patch(\n // we can assert this is present because we've checked previously\n window!.XMLHttpRequest.prototype,\n 'open',\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n (originalOpen: typeof XMLHttpRequest.prototype.open) => {\n return function (\n method: string,\n url: string | URL,\n async = true,\n username?: string | null,\n password?: string | null\n ) {\n // because this function is returned in its actual context `this` _is_ an XMLHttpRequest\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const xhr = this as XMLHttpRequest\n\n // check IE earlier than this, we only initialize if Request is present\n // eslint-disable-next-line compat/compat\n const req = new Request(url)\n\n addTracingHeaders(sessionManager, req)\n\n return originalOpen.call(xhr, method, req.url, async, username, password)\n }\n }\n )\n}\n\nassignableWindow.__PosthogExtensions__ = assignableWindow.__PosthogExtensions__ || {}\nconst patchFns = {\n _patchFetch: patchFetch,\n _patchXHR: patchXHR,\n}\nassignableWindow.__PosthogExtensions__.tracingHeadersPatchFns = patchFns\n\n// we used to put tracingHeadersPatchFns on window, and now we put it on __PosthogExtensions__\n// but that means that old clients which lazily load this extension are looking in the wrong place\n// yuck,\n// so we also put it directly on the window\n// when 1.161.1 is the oldest version seen in production we can remove this\nassignableWindow.postHogTracingHeadersPatchFns = patchFns\n\nexport default patchFns\n"]}
@@ -175,6 +175,9 @@ var SessionRecording = /** @class */ (function () {
175
175
  logger.error('started without valid sessionManager');
176
176
  throw new Error(LOGGER_PREFIX + ' started without valid sessionManager. This is a bug.');
177
177
  }
178
+ if (this.instance.config.__preview_experimental_cookieless_mode) {
179
+ throw new Error(LOGGER_PREFIX + ' cannot be used with __preview_experimental_cookieless_mode.');
180
+ }
178
181
  // we know there's a sessionManager, so don't need to start without a session id
179
182
  var _a = this.sessionManager.checkAndGetSessionAndWindowId(), sessionId = _a.sessionId, windowId = _a.windowId;
180
183
  this.sessionId = sessionId;