autotel-subscribers 13.0.0 → 14.1.0

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.
@@ -3,6 +3,7 @@
3
3
  var path = require('path');
4
4
  var fs = require('fs');
5
5
  var readline = require('readline');
6
+ var async_hooks = require('async_hooks');
6
7
  var process2 = require('process');
7
8
  var os = require('os');
8
9
  var tty = require('tty');
@@ -114,11 +115,11 @@ function normalizeWindowsPath(path) {
114
115
  return path.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
115
116
  }
116
117
  var init_module_node = __esm({
117
- "../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs"() {
118
+ "../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs"() {
118
119
  }
119
120
  });
120
121
 
121
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/featureFlagUtils.mjs
122
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/featureFlagUtils.mjs
122
123
  function getFlagDetailFromFlagAndPayload(key, value, payload) {
123
124
  return {
124
125
  key,
@@ -135,7 +136,7 @@ function getFlagDetailFromFlagAndPayload(key, value, payload) {
135
136
  }
136
137
  var normalizeFlagsResponse, getFlagValuesFromFlags, getPayloadsFromFlags, getFeatureFlagValue, parsePayload;
137
138
  var init_featureFlagUtils = __esm({
138
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/featureFlagUtils.mjs"() {
139
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/featureFlagUtils.mjs"() {
139
140
  normalizeFlagsResponse = (flagsResponse) => {
140
141
  if ("flags" in flagsResponse) {
141
142
  const featureFlags = getFlagValuesFromFlags(flagsResponse.flags);
@@ -193,10 +194,10 @@ var init_featureFlagUtils = __esm({
193
194
  }
194
195
  });
195
196
 
196
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/vendor/uuidv7.mjs
197
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/vendor/uuidv7.mjs
197
198
  var DIGITS, UUID, V7Generator, getDefaultRandom, defaultGenerator, uuidv7, uuidv7obj;
198
199
  var init_uuidv7 = __esm({
199
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/vendor/uuidv7.mjs"() {
200
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/vendor/uuidv7.mjs"() {
200
201
  DIGITS = "0123456789abcdef";
201
202
  UUID = class _UUID {
202
203
  constructor(bytes) {
@@ -357,10 +358,10 @@ var init_uuidv7 = __esm({
357
358
  }
358
359
  });
359
360
 
360
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/utils/bot-detection.mjs
361
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/bot-detection.mjs
361
362
  var DEFAULT_BLOCKED_UA_STRS, isBlockedUA;
362
363
  var init_bot_detection = __esm({
363
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/utils/bot-detection.mjs"() {
364
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/bot-detection.mjs"() {
364
365
  DEFAULT_BLOCKED_UA_STRS = [
365
366
  "amazonbot",
366
367
  "amazonproductbot",
@@ -451,10 +452,10 @@ var init_bot_detection = __esm({
451
452
  }
452
453
  });
453
454
 
454
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/types.mjs
455
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/types.mjs
455
456
  var types_PostHogPersistedProperty;
456
457
  var init_types = __esm({
457
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/types.mjs"() {
458
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/types.mjs"() {
458
459
  types_PostHogPersistedProperty = /* @__PURE__ */ (function(PostHogPersistedProperty) {
459
460
  PostHogPersistedProperty["AnonymousId"] = "anonymous_id";
460
461
  PostHogPersistedProperty["DistinctId"] = "distinct_id";
@@ -486,13 +487,13 @@ var init_types = __esm({
486
487
  }
487
488
  });
488
489
 
489
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/utils/string-utils.mjs
490
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/string-utils.mjs
490
491
  var init_string_utils = __esm({
491
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/utils/string-utils.mjs"() {
492
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/string-utils.mjs"() {
492
493
  }
493
494
  });
494
495
 
495
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/utils/type-utils.mjs
496
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/type-utils.mjs
496
497
  function isInstanceOf(candidate, base) {
497
498
  try {
498
499
  return candidate instanceof base;
@@ -517,7 +518,7 @@ function isPlainObject(candidate) {
517
518
  }
518
519
  var nativeIsArray, ObjProto, type_utils_toString, isArray, isUndefined, isString, isEmptyString, isNumber, isPlainError;
519
520
  var init_type_utils = __esm({
520
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/utils/type-utils.mjs"() {
521
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/type-utils.mjs"() {
521
522
  init_types();
522
523
  init_string_utils();
523
524
  nativeIsArray = Array.isArray;
@@ -535,7 +536,7 @@ var init_type_utils = __esm({
535
536
  }
536
537
  });
537
538
 
538
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/utils/number-utils.mjs
539
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/number-utils.mjs
539
540
  function clampToRange(value, min, max, logger, fallbackValue) {
540
541
  if (min > max) {
541
542
  logger.warn("min cannot be greater than max.");
@@ -553,15 +554,15 @@ function clampToRange(value, min, max, logger, fallbackValue) {
553
554
  return clampToRange(max, min, max, logger);
554
555
  }
555
556
  var init_number_utils = __esm({
556
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/utils/number-utils.mjs"() {
557
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/number-utils.mjs"() {
557
558
  init_type_utils();
558
559
  }
559
560
  });
560
561
 
561
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs
562
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs
562
563
  var ONE_DAY_IN_MS, BucketedRateLimiter;
563
564
  var init_bucketed_rate_limiter = __esm({
564
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs"() {
565
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs"() {
565
566
  init_number_utils();
566
567
  ONE_DAY_IN_MS = 864e5;
567
568
  BucketedRateLimiter = class {
@@ -605,10 +606,10 @@ var init_bucketed_rate_limiter = __esm({
605
606
  }
606
607
  });
607
608
 
608
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/utils/promise-queue.mjs
609
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/promise-queue.mjs
609
610
  var PromiseQueue;
610
611
  var init_promise_queue = __esm({
611
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/utils/promise-queue.mjs"() {
612
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/promise-queue.mjs"() {
612
613
  init_uuidv7();
613
614
  PromiseQueue = class {
614
615
  add(promise) {
@@ -639,7 +640,7 @@ var init_promise_queue = __esm({
639
640
  }
640
641
  });
641
642
 
642
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/utils/logger.mjs
643
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/logger.mjs
643
644
  function createConsole(consoleLike = console) {
644
645
  const lockedMethods = {
645
646
  log: consoleLike.log.bind(consoleLike),
@@ -654,7 +655,7 @@ function createLogger(prefix, maybeCall = passThrough) {
654
655
  }
655
656
  var _createLogger, passThrough;
656
657
  var init_logger = __esm({
657
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/utils/logger.mjs"() {
658
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/logger.mjs"() {
658
659
  _createLogger = (prefix, maybeCall, consoleLike) => {
659
660
  function _log(level, ...args) {
660
661
  maybeCall(() => {
@@ -683,7 +684,21 @@ var init_logger = __esm({
683
684
  }
684
685
  });
685
686
 
686
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/utils/index.mjs
687
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs
688
+ var MOBILE, TABLET, GENERIC;
689
+ var init_user_agent_utils = __esm({
690
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs"() {
691
+ init_string_utils();
692
+ init_type_utils();
693
+ MOBILE = "Mobile";
694
+ TABLET = "Tablet";
695
+ GENERIC = "Generic";
696
+ GENERIC + " " + MOBILE.toLowerCase();
697
+ GENERIC + " " + TABLET.toLowerCase();
698
+ }
699
+ });
700
+
701
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/index.mjs
687
702
  function assert(truthyValue, message2) {
688
703
  if (!truthyValue || "string" != typeof truthyValue || isEmpty(truthyValue)) throw new Error(message2);
689
704
  }
@@ -727,7 +742,7 @@ function allSettled(promises) {
727
742
  }
728
743
  var STRING_FORMAT, isError;
729
744
  var init_utils = __esm({
730
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/utils/index.mjs"() {
745
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/index.mjs"() {
731
746
  init_bot_detection();
732
747
  init_bucketed_rate_limiter();
733
748
  init_number_utils();
@@ -735,15 +750,16 @@ var init_utils = __esm({
735
750
  init_type_utils();
736
751
  init_promise_queue();
737
752
  init_logger();
753
+ init_user_agent_utils();
738
754
  STRING_FORMAT = "utf8";
739
755
  isError = (x) => x instanceof Error;
740
756
  }
741
757
  });
742
758
 
743
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/eventemitter.mjs
759
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/eventemitter.mjs
744
760
  var SimpleEventEmitter;
745
761
  var init_eventemitter = __esm({
746
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/eventemitter.mjs"() {
762
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/eventemitter.mjs"() {
747
763
  SimpleEventEmitter = class {
748
764
  constructor() {
749
765
  this.events = {};
@@ -764,7 +780,7 @@ var init_eventemitter = __esm({
764
780
  }
765
781
  });
766
782
 
767
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/gzip.mjs
783
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/gzip.mjs
768
784
  function isGzipSupported() {
769
785
  return "CompressionStream" in globalThis;
770
786
  }
@@ -783,11 +799,11 @@ async function gzipCompress(input, isDebug = true) {
783
799
  }
784
800
  }
785
801
  var init_gzip = __esm({
786
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/gzip.mjs"() {
802
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/gzip.mjs"() {
787
803
  }
788
804
  });
789
805
 
790
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/posthog-core-stateless.mjs
806
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/posthog-core-stateless.mjs
791
807
  async function logFlushError(err) {
792
808
  if (err instanceof PostHogFetchHttpError) {
793
809
  let text = "";
@@ -807,7 +823,7 @@ function isPostHogFetchContentTooLargeError(err) {
807
823
  }
808
824
  var PostHogFetchHttpError, PostHogFetchNetworkError, PostHogCoreStateless;
809
825
  var init_posthog_core_stateless = __esm({
810
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/posthog-core-stateless.mjs"() {
826
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/posthog-core-stateless.mjs"() {
811
827
  init_eventemitter();
812
828
  init_featureFlagUtils();
813
829
  init_gzip();
@@ -1081,7 +1097,8 @@ var init_posthog_core_stateless = __esm({
1081
1097
  const flagDetail = featureFlags[key];
1082
1098
  return {
1083
1099
  response: flagDetail,
1084
- requestId: flagsResponse.requestId
1100
+ requestId: flagsResponse.requestId,
1101
+ evaluatedAt: flagsResponse.evaluatedAt
1085
1102
  };
1086
1103
  }
1087
1104
  async getFeatureFlagPayloadStateless(key, distinctId, groups = {}, personProperties = {}, groupProperties = {}, disableGeoip) {
@@ -1131,7 +1148,8 @@ var init_posthog_core_stateless = __esm({
1131
1148
  flags: {},
1132
1149
  featureFlags: {},
1133
1150
  featureFlagPayloads: {},
1134
- requestId: flagsResponse?.requestId
1151
+ requestId: flagsResponse?.requestId,
1152
+ quotaLimited: flagsResponse.quotaLimited
1135
1153
  };
1136
1154
  }
1137
1155
  return flagsResponse;
@@ -1423,9 +1441,9 @@ var init_posthog_core_stateless = __esm({
1423
1441
  }
1424
1442
  });
1425
1443
 
1426
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/posthog-core.mjs
1444
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/posthog-core.mjs
1427
1445
  var init_posthog_core = __esm({
1428
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/posthog-core.mjs"() {
1446
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/posthog-core.mjs"() {
1429
1447
  init_featureFlagUtils();
1430
1448
  init_types();
1431
1449
  init_posthog_core_stateless();
@@ -1434,7 +1452,7 @@ var init_posthog_core = __esm({
1434
1452
  }
1435
1453
  });
1436
1454
 
1437
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs
1455
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs
1438
1456
  function getFilenameToChunkIdMap(stackParser) {
1439
1457
  const chunkIdMap = globalThis._posthogChunkIds;
1440
1458
  if (!chunkIdMap) return;
@@ -1467,14 +1485,14 @@ function getFilenameToChunkIdMap(stackParser) {
1467
1485
  }
1468
1486
  var parsedStackResults, lastKeysCount, cachedFilenameChunkIds;
1469
1487
  var init_chunk_ids = __esm({
1470
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs"() {
1488
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs"() {
1471
1489
  }
1472
1490
  });
1473
1491
 
1474
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs
1492
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs
1475
1493
  var MAX_CAUSE_RECURSION, ErrorPropertiesBuilder;
1476
1494
  var init_error_properties_builder = __esm({
1477
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs"() {
1495
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs"() {
1478
1496
  init_utils();
1479
1497
  init_chunk_ids();
1480
1498
  MAX_CAUSE_RECURSION = 4;
@@ -1588,7 +1606,7 @@ var init_error_properties_builder = __esm({
1588
1606
  }
1589
1607
  });
1590
1608
 
1591
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs
1609
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs
1592
1610
  function createFrame(platform, filename, func, lineno, colno) {
1593
1611
  const frame = {
1594
1612
  platform,
@@ -1602,16 +1620,16 @@ function createFrame(platform, filename, func, lineno, colno) {
1602
1620
  }
1603
1621
  var UNKNOWN_FUNCTION;
1604
1622
  var init_base = __esm({
1605
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs"() {
1623
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs"() {
1606
1624
  init_utils();
1607
1625
  UNKNOWN_FUNCTION = "?";
1608
1626
  }
1609
1627
  });
1610
1628
 
1611
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs
1629
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs
1612
1630
  var extractSafariExtensionDetails;
1613
1631
  var init_safari = __esm({
1614
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs"() {
1632
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs"() {
1615
1633
  init_base();
1616
1634
  extractSafariExtensionDetails = (func, filename) => {
1617
1635
  const isSafariExtension = -1 !== func.indexOf("safari-extension");
@@ -1627,10 +1645,10 @@ var init_safari = __esm({
1627
1645
  }
1628
1646
  });
1629
1647
 
1630
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs
1648
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs
1631
1649
  var chromeRegexNoFnName, chromeRegex, chromeEvalRegex, chromeStackLineParser;
1632
1650
  var init_chrome = __esm({
1633
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs"() {
1651
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs"() {
1634
1652
  init_base();
1635
1653
  init_safari();
1636
1654
  chromeRegexNoFnName = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i;
@@ -1660,10 +1678,10 @@ var init_chrome = __esm({
1660
1678
  }
1661
1679
  });
1662
1680
 
1663
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs
1681
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs
1664
1682
  var winjsRegex, winjsStackLineParser;
1665
1683
  var init_winjs = __esm({
1666
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs"() {
1684
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs"() {
1667
1685
  init_base();
1668
1686
  winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
1669
1687
  winjsStackLineParser = (line, platform) => {
@@ -1673,10 +1691,10 @@ var init_winjs = __esm({
1673
1691
  }
1674
1692
  });
1675
1693
 
1676
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs
1694
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs
1677
1695
  var geckoREgex, geckoEvalRegex, geckoStackLineParser;
1678
1696
  var init_gecko = __esm({
1679
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs"() {
1697
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs"() {
1680
1698
  init_base();
1681
1699
  init_safari();
1682
1700
  geckoREgex = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i;
@@ -1703,10 +1721,10 @@ var init_gecko = __esm({
1703
1721
  }
1704
1722
  });
1705
1723
 
1706
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs
1724
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs
1707
1725
  var opera10Regex, opera10StackLineParser, opera11Regex, opera11StackLineParser;
1708
1726
  var init_opera = __esm({
1709
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs"() {
1727
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs"() {
1710
1728
  init_base();
1711
1729
  opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;
1712
1730
  opera10StackLineParser = (line, platform) => {
@@ -1721,7 +1739,7 @@ var init_opera = __esm({
1721
1739
  }
1722
1740
  });
1723
1741
 
1724
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs
1742
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs
1725
1743
  function filenameIsInApp(filename, isNative = false) {
1726
1744
  const isInternal = isNative || filename && !filename.startsWith("/") && !filename.match(/^[A-Z]:/) && !filename.startsWith(".") && !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//);
1727
1745
  return !isInternal && void 0 !== filename && !filename.includes("node_modules/");
@@ -1731,7 +1749,7 @@ function _parseIntOrUndefined(input) {
1731
1749
  }
1732
1750
  var FILENAME_MATCH, FULL_MATCH, nodeStackLineParser;
1733
1751
  var init_node = __esm({
1734
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs"() {
1752
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs"() {
1735
1753
  init_base();
1736
1754
  FILENAME_MATCH = /^\s*[-]{4,}$/;
1737
1755
  FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
@@ -1792,7 +1810,7 @@ var init_node = __esm({
1792
1810
  }
1793
1811
  });
1794
1812
 
1795
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs
1813
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs
1796
1814
  function reverseAndStripFrames(stack) {
1797
1815
  if (!stack.length) return [];
1798
1816
  const localStack = Array.from(stack);
@@ -1830,7 +1848,7 @@ function createStackParser(platform, ...parsers) {
1830
1848
  }
1831
1849
  var WEBPACK_ERROR_REGEXP, STACKTRACE_FRAME_LIMIT;
1832
1850
  var init_parsers = __esm({
1833
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs"() {
1851
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs"() {
1834
1852
  init_base();
1835
1853
  init_chrome();
1836
1854
  init_winjs();
@@ -1842,10 +1860,10 @@ var init_parsers = __esm({
1842
1860
  }
1843
1861
  });
1844
1862
 
1845
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs
1863
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs
1846
1864
  var DOMExceptionCoercer;
1847
1865
  var init_dom_exception_coercer = __esm({
1848
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs"() {
1866
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs"() {
1849
1867
  init_utils();
1850
1868
  DOMExceptionCoercer = class {
1851
1869
  match(err) {
@@ -1879,10 +1897,10 @@ var init_dom_exception_coercer = __esm({
1879
1897
  }
1880
1898
  });
1881
1899
 
1882
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs
1900
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs
1883
1901
  var ErrorCoercer;
1884
1902
  var init_error_coercer = __esm({
1885
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs"() {
1903
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs"() {
1886
1904
  init_utils();
1887
1905
  ErrorCoercer = class {
1888
1906
  match(err) {
@@ -1912,10 +1930,10 @@ var init_error_coercer = __esm({
1912
1930
  }
1913
1931
  });
1914
1932
 
1915
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs
1933
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs
1916
1934
  var ErrorEventCoercer;
1917
1935
  var init_error_event_coercer = __esm({
1918
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs"() {
1936
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs"() {
1919
1937
  init_utils();
1920
1938
  ErrorEventCoercer = class {
1921
1939
  constructor() {
@@ -1937,10 +1955,10 @@ var init_error_event_coercer = __esm({
1937
1955
  }
1938
1956
  });
1939
1957
 
1940
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs
1958
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs
1941
1959
  var ERROR_TYPES_PATTERN, StringCoercer;
1942
1960
  var init_string_coercer = __esm({
1943
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs"() {
1961
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs"() {
1944
1962
  ERROR_TYPES_PATTERN = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;
1945
1963
  StringCoercer = class {
1946
1964
  match(input) {
@@ -1972,10 +1990,10 @@ var init_string_coercer = __esm({
1972
1990
  }
1973
1991
  });
1974
1992
 
1975
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/types.mjs
1993
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/types.mjs
1976
1994
  var severityLevels;
1977
1995
  var init_types2 = __esm({
1978
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/types.mjs"() {
1996
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/types.mjs"() {
1979
1997
  severityLevels = [
1980
1998
  "fatal",
1981
1999
  "error",
@@ -1987,7 +2005,7 @@ var init_types2 = __esm({
1987
2005
  }
1988
2006
  });
1989
2007
 
1990
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs
2008
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs
1991
2009
  function extractExceptionKeysForMessage(err, maxLength = 40) {
1992
2010
  const keys = Object.keys(err);
1993
2011
  keys.sort();
@@ -2002,14 +2020,14 @@ function extractExceptionKeysForMessage(err, maxLength = 40) {
2002
2020
  return "";
2003
2021
  }
2004
2022
  var init_utils2 = __esm({
2005
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs"() {
2023
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs"() {
2006
2024
  }
2007
2025
  });
2008
2026
 
2009
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs
2027
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs
2010
2028
  var ObjectCoercer;
2011
2029
  var init_object_coercer = __esm({
2012
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs"() {
2030
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs"() {
2013
2031
  init_utils();
2014
2032
  init_types2();
2015
2033
  init_utils2();
@@ -2063,10 +2081,10 @@ var init_object_coercer = __esm({
2063
2081
  }
2064
2082
  });
2065
2083
 
2066
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs
2084
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs
2067
2085
  var EventCoercer;
2068
2086
  var init_event_coercer = __esm({
2069
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs"() {
2087
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs"() {
2070
2088
  init_utils();
2071
2089
  init_utils2();
2072
2090
  EventCoercer = class {
@@ -2086,10 +2104,10 @@ var init_event_coercer = __esm({
2086
2104
  }
2087
2105
  });
2088
2106
 
2089
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs
2107
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs
2090
2108
  var PrimitiveCoercer;
2091
2109
  var init_primitive_coercer = __esm({
2092
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs"() {
2110
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs"() {
2093
2111
  init_utils();
2094
2112
  PrimitiveCoercer = class {
2095
2113
  match(candidate) {
@@ -2107,10 +2125,10 @@ var init_primitive_coercer = __esm({
2107
2125
  }
2108
2126
  });
2109
2127
 
2110
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs
2128
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs
2111
2129
  var PromiseRejectionEventCoercer;
2112
2130
  var init_promise_rejection_event = __esm({
2113
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs"() {
2131
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs"() {
2114
2132
  init_utils();
2115
2133
  PromiseRejectionEventCoercer = class {
2116
2134
  match(err) {
@@ -2139,9 +2157,9 @@ var init_promise_rejection_event = __esm({
2139
2157
  }
2140
2158
  });
2141
2159
 
2142
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/coercers/index.mjs
2160
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/index.mjs
2143
2161
  var init_coercers = __esm({
2144
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/coercers/index.mjs"() {
2162
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/index.mjs"() {
2145
2163
  init_dom_exception_coercer();
2146
2164
  init_error_coercer();
2147
2165
  init_error_event_coercer();
@@ -2153,10 +2171,10 @@ var init_coercers = __esm({
2153
2171
  }
2154
2172
  });
2155
2173
 
2156
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/utils.mjs
2174
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/utils.mjs
2157
2175
  var ReduceableCache;
2158
2176
  var init_utils3 = __esm({
2159
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/utils.mjs"() {
2177
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/utils.mjs"() {
2160
2178
  ReduceableCache = class {
2161
2179
  constructor(_maxSize) {
2162
2180
  this._maxSize = _maxSize;
@@ -2182,7 +2200,7 @@ var init_utils3 = __esm({
2182
2200
  }
2183
2201
  });
2184
2202
 
2185
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/index.mjs
2203
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/index.mjs
2186
2204
  var error_tracking_exports = {};
2187
2205
  __export(error_tracking_exports, {
2188
2206
  DOMExceptionCoercer: () => DOMExceptionCoercer,
@@ -2205,7 +2223,7 @@ __export(error_tracking_exports, {
2205
2223
  winjsStackLineParser: () => winjsStackLineParser
2206
2224
  });
2207
2225
  var init_error_tracking = __esm({
2208
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/error-tracking/index.mjs"() {
2226
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/index.mjs"() {
2209
2227
  init_error_properties_builder();
2210
2228
  init_parsers();
2211
2229
  init_coercers();
@@ -2213,9 +2231,9 @@ var init_error_tracking = __esm({
2213
2231
  }
2214
2232
  });
2215
2233
 
2216
- // ../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/index.mjs
2234
+ // ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/index.mjs
2217
2235
  var init_dist = __esm({
2218
- "../../node_modules/.pnpm/@posthog+core@1.6.0/node_modules/@posthog/core/dist/index.mjs"() {
2236
+ "../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/index.mjs"() {
2219
2237
  init_featureFlagUtils();
2220
2238
  init_uuidv7();
2221
2239
  init_utils();
@@ -2406,7 +2424,7 @@ function snipLine(line, colno) {
2406
2424
  }
2407
2425
  var LRU_FILE_CONTENTS_CACHE, LRU_FILE_CONTENTS_FS_READ_FAILED, DEFAULT_LINES_OF_CONTEXT, MAX_CONTEXTLINES_COLNO, MAX_CONTEXTLINES_LINENO;
2408
2426
  var init_context_lines_node = __esm({
2409
- "../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/context-lines.node.mjs"() {
2427
+ "../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/context-lines.node.mjs"() {
2410
2428
  init_dist();
2411
2429
  LRU_FILE_CONTENTS_CACHE = new error_tracking_exports.ReduceableCache(25);
2412
2430
  LRU_FILE_CONTENTS_FS_READ_FAILED = new error_tracking_exports.ReduceableCache(20);
@@ -2416,7 +2434,7 @@ var init_context_lines_node = __esm({
2416
2434
  }
2417
2435
  });
2418
2436
 
2419
- // ../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs
2437
+ // ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs
2420
2438
  function makeUncaughtExceptionHandler(captureFn, onFatalFn) {
2421
2439
  let calledFatalError = false;
2422
2440
  return Object.assign((error) => {
@@ -2437,10 +2455,10 @@ function makeUncaughtExceptionHandler(captureFn, onFatalFn) {
2437
2455
  });
2438
2456
  }
2439
2457
  function addUncaughtExceptionListener(captureFn, onFatalFn) {
2440
- global.process.on("uncaughtException", makeUncaughtExceptionHandler(captureFn, onFatalFn));
2458
+ globalThis.process?.on("uncaughtException", makeUncaughtExceptionHandler(captureFn, onFatalFn));
2441
2459
  }
2442
2460
  function addUnhandledRejectionListener(captureFn) {
2443
- global.process.on("unhandledRejection", (reason) => captureFn(reason, {
2461
+ globalThis.process?.on("unhandledRejection", (reason) => captureFn(reason, {
2444
2462
  mechanism: {
2445
2463
  type: "onunhandledrejection",
2446
2464
  handled: false
@@ -2448,14 +2466,14 @@ function addUnhandledRejectionListener(captureFn) {
2448
2466
  }));
2449
2467
  }
2450
2468
  var init_autocapture = __esm({
2451
- "../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs"() {
2469
+ "../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs"() {
2452
2470
  }
2453
2471
  });
2454
2472
 
2455
- // ../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs
2473
+ // ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs
2456
2474
  var SHUTDOWN_TIMEOUT, ErrorTracking;
2457
2475
  var init_error_tracking2 = __esm({
2458
- "../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs"() {
2476
+ "../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs"() {
2459
2477
  init_autocapture();
2460
2478
  init_dist();
2461
2479
  SHUTDOWN_TIMEOUT = 2e3;
@@ -2521,15 +2539,28 @@ var init_error_tracking2 = __esm({
2521
2539
  }
2522
2540
  });
2523
2541
 
2524
- // ../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/version.mjs
2542
+ // ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/version.mjs
2525
2543
  var version;
2526
2544
  var init_version = __esm({
2527
- "../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/version.mjs"() {
2528
- version = "5.14.0";
2545
+ "../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/version.mjs"() {
2546
+ version = "5.18.1";
2529
2547
  }
2530
2548
  });
2531
2549
 
2532
- // ../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs
2550
+ // ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/types.mjs
2551
+ var FeatureFlagError;
2552
+ var init_types3 = __esm({
2553
+ "../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/types.mjs"() {
2554
+ FeatureFlagError = {
2555
+ ERRORS_WHILE_COMPUTING: "errors_while_computing_flags",
2556
+ FLAG_MISSING: "flag_missing",
2557
+ QUOTA_LIMITED: "quota_limited",
2558
+ UNKNOWN_ERROR: "unknown_error"
2559
+ };
2560
+ }
2561
+ });
2562
+
2563
+ // ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs
2533
2564
  async function hashSHA1(text) {
2534
2565
  const subtle = globalThis.crypto?.subtle;
2535
2566
  if (!subtle) throw new Error("SubtleCrypto API not available");
@@ -2538,11 +2569,11 @@ async function hashSHA1(text) {
2538
2569
  return hashArray.map((byte) => byte.toString(16).padStart(2, "0")).join("");
2539
2570
  }
2540
2571
  var init_crypto = __esm({
2541
- "../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs"() {
2572
+ "../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs"() {
2542
2573
  }
2543
2574
  });
2544
2575
 
2545
- // ../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs
2576
+ // ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs
2546
2577
  async function _hash(key, distinctId, salt = "") {
2547
2578
  const hashString = await hashSHA1(`${key}.${distinctId}${salt}`);
2548
2579
  return parseInt(hashString.slice(0, 15), 16) / LONG_SCALE;
@@ -2710,7 +2741,7 @@ function relativeDateParseForFeatureFlagMatching(value) {
2710
2741
  }
2711
2742
  var SIXTY_SECONDS, LONG_SCALE, NULL_VALUES_ALLOWED_OPERATORS, ClientError, InconclusiveMatchError, RequiresServerEvaluation, FeatureFlagsPoller;
2712
2743
  var init_feature_flags = __esm({
2713
- "../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs"() {
2744
+ "../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs"() {
2714
2745
  init_dist();
2715
2746
  init_crypto();
2716
2747
  SIXTY_SECONDS = 6e4;
@@ -2748,7 +2779,6 @@ var init_feature_flags = __esm({
2748
2779
  this.debugMode = false;
2749
2780
  this.shouldBeginExponentialBackoff = false;
2750
2781
  this.backOffCount = 0;
2751
- this.hasAttemptedCacheLoad = false;
2752
2782
  this.pollingInterval = pollingInterval;
2753
2783
  this.personalApiKey = personalApiKey;
2754
2784
  this.featureFlags = [];
@@ -2977,15 +3007,12 @@ var init_feature_flags = __esm({
2977
3007
  }
2978
3008
  }
2979
3009
  async loadFeatureFlags(forceReload = false) {
2980
- if (this.cacheProvider && !this.hasAttemptedCacheLoad) {
2981
- this.hasAttemptedCacheLoad = true;
2982
- await this.loadFromCache("Loaded flags from cache");
2983
- }
2984
- if (this.loadingPromise) return this.loadingPromise;
2985
- if (!this.loadedSuccessfullyOnce || forceReload) {
2986
- this.loadingPromise = this._loadFeatureFlags();
2987
- await this.loadingPromise;
2988
- }
3010
+ if (this.loadedSuccessfullyOnce && !forceReload) return;
3011
+ if (!forceReload && this.nextFetchAllowedAt && Date.now() < this.nextFetchAllowedAt) return void this.logMsgIfDebug(() => console.debug("[FEATURE FLAGS] Skipping fetch, in backoff period"));
3012
+ if (!this.loadingPromise) this.loadingPromise = this._loadFeatureFlags().catch((err) => this.logMsgIfDebug(() => console.debug(`[FEATURE FLAGS] Failed to load feature flags: ${err}`))).finally(() => {
3013
+ this.loadingPromise = void 0;
3014
+ });
3015
+ return this.loadingPromise;
2989
3016
  }
2990
3017
  isLocalEvaluationReady() {
2991
3018
  return (this.loadedSuccessfullyOnce ?? false) && (this.featureFlags?.length ?? 0) > 0;
@@ -2994,12 +3021,22 @@ var init_feature_flags = __esm({
2994
3021
  if (!this.shouldBeginExponentialBackoff) return this.pollingInterval;
2995
3022
  return Math.min(SIXTY_SECONDS, this.pollingInterval * 2 ** this.backOffCount);
2996
3023
  }
3024
+ beginBackoff() {
3025
+ this.shouldBeginExponentialBackoff = true;
3026
+ this.backOffCount += 1;
3027
+ this.nextFetchAllowedAt = Date.now() + this.getPollingInterval();
3028
+ }
3029
+ clearBackoff() {
3030
+ this.shouldBeginExponentialBackoff = false;
3031
+ this.backOffCount = 0;
3032
+ this.nextFetchAllowedAt = void 0;
3033
+ }
2997
3034
  async _loadFeatureFlags() {
2998
3035
  if (this.poller) {
2999
3036
  clearTimeout(this.poller);
3000
3037
  this.poller = void 0;
3001
3038
  }
3002
- this.poller = setTimeout(() => this._loadFeatureFlags(), this.getPollingInterval());
3039
+ this.poller = setTimeout(() => this.loadFeatureFlags(true), this.getPollingInterval());
3003
3040
  try {
3004
3041
  let shouldFetch = true;
3005
3042
  if (this.cacheProvider) try {
@@ -3015,9 +3052,14 @@ var init_feature_flags = __esm({
3015
3052
  const res = await this._requestFeatureFlagDefinitions();
3016
3053
  if (!res) return;
3017
3054
  switch (res.status) {
3055
+ case 304:
3056
+ this.logMsgIfDebug(() => console.debug("[FEATURE FLAGS] Flags not modified (304), using cached data"));
3057
+ this.flagsEtag = res.headers?.get("ETag") ?? this.flagsEtag;
3058
+ this.loadedSuccessfullyOnce = true;
3059
+ this.clearBackoff();
3060
+ return;
3018
3061
  case 401:
3019
- this.shouldBeginExponentialBackoff = true;
3020
- this.backOffCount += 1;
3062
+ this.beginBackoff();
3021
3063
  throw new ClientError(`Your project key or personal API key is invalid. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);
3022
3064
  case 402:
3023
3065
  console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - unsetting all local flags. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts");
@@ -3027,24 +3069,22 @@ var init_feature_flags = __esm({
3027
3069
  this.cohorts = {};
3028
3070
  return;
3029
3071
  case 403:
3030
- this.shouldBeginExponentialBackoff = true;
3031
- this.backOffCount += 1;
3072
+ this.beginBackoff();
3032
3073
  throw new ClientError(`Your personal API key does not have permission to fetch feature flag definitions for local evaluation. Setting next polling interval to ${this.getPollingInterval()}ms. Are you sure you're using the correct personal and Project API key pair? More information: https://posthog.com/docs/api/overview`);
3033
3074
  case 429:
3034
- this.shouldBeginExponentialBackoff = true;
3035
- this.backOffCount += 1;
3075
+ this.beginBackoff();
3036
3076
  throw new ClientError(`You are being rate limited. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);
3037
3077
  case 200: {
3038
3078
  const responseJson = await res.json() ?? {};
3039
3079
  if (!("flags" in responseJson)) return void this.onError?.(new Error(`Invalid response when getting feature flags: ${JSON.stringify(responseJson)}`));
3080
+ this.flagsEtag = res.headers?.get("ETag") ?? void 0;
3040
3081
  const flagData = {
3041
3082
  flags: responseJson.flags ?? [],
3042
3083
  groupTypeMapping: responseJson.group_type_mapping || {},
3043
3084
  cohorts: responseJson.cohorts || {}
3044
3085
  };
3045
3086
  this.updateFlagState(flagData);
3046
- this.shouldBeginExponentialBackoff = false;
3047
- this.backOffCount = 0;
3087
+ this.clearBackoff();
3048
3088
  if (this.cacheProvider && shouldFetch) try {
3049
3089
  await this.cacheProvider.onFlagDefinitionsReceived(flagData);
3050
3090
  } catch (err) {
@@ -3058,23 +3098,23 @@ var init_feature_flags = __esm({
3058
3098
  }
3059
3099
  } catch (err) {
3060
3100
  if (err instanceof ClientError) this.onError?.(err);
3061
- } finally {
3062
- this.loadingPromise = void 0;
3063
3101
  }
3064
3102
  }
3065
- getPersonalApiKeyRequestOptions(method = "GET") {
3103
+ getPersonalApiKeyRequestOptions(method = "GET", etag) {
3104
+ const headers = {
3105
+ ...this.customHeaders,
3106
+ "Content-Type": "application/json",
3107
+ Authorization: `Bearer ${this.personalApiKey}`
3108
+ };
3109
+ if (etag) headers["If-None-Match"] = etag;
3066
3110
  return {
3067
3111
  method,
3068
- headers: {
3069
- ...this.customHeaders,
3070
- "Content-Type": "application/json",
3071
- Authorization: `Bearer ${this.personalApiKey}`
3072
- }
3112
+ headers
3073
3113
  };
3074
3114
  }
3075
3115
  _requestFeatureFlagDefinitions() {
3076
3116
  const url = `${this.host}/api/feature_flag/local_evaluation?token=${this.projectApiKey}&send_cohorts`;
3077
- const options = this.getPersonalApiKeyRequestOptions();
3117
+ const options = this.getPersonalApiKeyRequestOptions("GET", this.flagsEtag);
3078
3118
  let abortTimeout = null;
3079
3119
  if (this.timeout && "number" == typeof this.timeout) {
3080
3120
  const controller = new AbortController();
@@ -3106,10 +3146,10 @@ var init_feature_flags = __esm({
3106
3146
  }
3107
3147
  });
3108
3148
 
3109
- // ../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/storage-memory.mjs
3149
+ // ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/storage-memory.mjs
3110
3150
  var PostHogMemoryStorage;
3111
3151
  var init_storage_memory = __esm({
3112
- "../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/storage-memory.mjs"() {
3152
+ "../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/storage-memory.mjs"() {
3113
3153
  PostHogMemoryStorage = class {
3114
3154
  getProperty(key) {
3115
3155
  return this._memoryStorage[key];
@@ -3124,12 +3164,13 @@ var init_storage_memory = __esm({
3124
3164
  }
3125
3165
  });
3126
3166
 
3127
- // ../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/client.mjs
3167
+ // ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/client.mjs
3128
3168
  var MINIMUM_POLLING_INTERVAL, THIRTY_SECONDS, MAX_CACHE_SIZE, PostHogBackendClient;
3129
3169
  var init_client = __esm({
3130
- "../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/client.mjs"() {
3170
+ "../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/client.mjs"() {
3131
3171
  init_version();
3132
3172
  init_dist();
3173
+ init_types3();
3133
3174
  init_feature_flags();
3134
3175
  init_error_tracking2();
3135
3176
  init_storage_memory();
@@ -3140,6 +3181,7 @@ var init_client = __esm({
3140
3181
  constructor(apiKey, options = {}) {
3141
3182
  super(apiKey, options), this._memoryStorage = new PostHogMemoryStorage();
3142
3183
  this.options = options;
3184
+ this.context = this.initializeContext();
3143
3185
  this.options.featureFlagsPollingInterval = "number" == typeof options.featureFlagsPollingInterval ? Math.max(options.featureFlagsPollingInterval, MINIMUM_POLLING_INTERVAL) : THIRTY_SECONDS;
3144
3186
  if (options.personalApiKey) {
3145
3187
  if (options.personalApiKey.includes("phc_")) throw new Error('Your Personal API key is invalid. These keys are prefixed with "phx_" and can be created in PostHog project settings.');
@@ -3210,25 +3252,29 @@ var init_client = __esm({
3210
3252
  if (err) console.error(err);
3211
3253
  }));
3212
3254
  }
3213
- identify({ distinctId, properties, disableGeoip }) {
3214
- const userPropsOnce = properties?.$set_once;
3215
- delete properties?.$set_once;
3216
- const userProps = properties?.$set || properties;
3217
- super.identifyStateless(distinctId, {
3218
- $set: userProps,
3219
- $set_once: userPropsOnce
3220
- }, {
3255
+ identify({ distinctId, properties = {}, disableGeoip }) {
3256
+ const { $set, $set_once, $anon_distinct_id, ...rest } = properties;
3257
+ const setProps = $set || rest;
3258
+ const setOnceProps = $set_once || {};
3259
+ const eventProperties = {
3260
+ $set: setProps,
3261
+ $set_once: setOnceProps,
3262
+ $anon_distinct_id: $anon_distinct_id ?? void 0
3263
+ };
3264
+ super.identifyStateless(distinctId, eventProperties, {
3221
3265
  disableGeoip
3222
3266
  });
3223
3267
  }
3224
- async identifyImmediate({ distinctId, properties, disableGeoip }) {
3225
- const userPropsOnce = properties?.$set_once;
3226
- delete properties?.$set_once;
3227
- const userProps = properties?.$set || properties;
3228
- await super.identifyStatelessImmediate(distinctId, {
3229
- $set: userProps,
3230
- $set_once: userPropsOnce
3231
- }, {
3268
+ async identifyImmediate({ distinctId, properties = {}, disableGeoip }) {
3269
+ const { $set, $set_once, $anon_distinct_id, ...rest } = properties;
3270
+ const setProps = $set || rest;
3271
+ const setOnceProps = $set_once || {};
3272
+ const eventProperties = {
3273
+ $set: setProps,
3274
+ $set_once: setOnceProps,
3275
+ $anon_distinct_id: $anon_distinct_id ?? void 0
3276
+ };
3277
+ super.identifyStatelessImmediate(distinctId, eventProperties, {
3232
3278
  disableGeoip
3233
3279
  });
3234
3280
  }
@@ -3271,13 +3317,25 @@ var init_client = __esm({
3271
3317
  let response = await this.featureFlagsPoller?.getFeatureFlag(key, distinctId, groups, personProperties, groupProperties);
3272
3318
  const flagWasLocallyEvaluated = void 0 !== response;
3273
3319
  let requestId;
3320
+ let evaluatedAt;
3274
3321
  let flagDetail;
3322
+ let featureFlagError;
3275
3323
  if (!flagWasLocallyEvaluated && !onlyEvaluateLocally) {
3276
- const remoteResponse = await super.getFeatureFlagDetailStateless(key, distinctId, groups, personProperties, groupProperties, disableGeoip);
3277
- if (void 0 === remoteResponse) return;
3278
- flagDetail = remoteResponse.response;
3279
- response = getFeatureFlagValue(flagDetail);
3280
- requestId = remoteResponse?.requestId;
3324
+ const flagsResponse = await super.getFeatureFlagDetailsStateless(distinctId, groups, personProperties, groupProperties, disableGeoip, [
3325
+ key
3326
+ ]);
3327
+ if (void 0 === flagsResponse) featureFlagError = FeatureFlagError.UNKNOWN_ERROR;
3328
+ else {
3329
+ requestId = flagsResponse.requestId;
3330
+ evaluatedAt = flagsResponse.evaluatedAt;
3331
+ const errors = [];
3332
+ if (flagsResponse.errorsWhileComputingFlags) errors.push(FeatureFlagError.ERRORS_WHILE_COMPUTING);
3333
+ if (flagsResponse.quotaLimited?.includes("feature_flags")) errors.push(FeatureFlagError.QUOTA_LIMITED);
3334
+ flagDetail = flagsResponse.flags[key];
3335
+ if (void 0 === flagDetail) errors.push(FeatureFlagError.FLAG_MISSING);
3336
+ if (errors.length > 0) featureFlagError = errors.join(",");
3337
+ response = getFeatureFlagValue(flagDetail);
3338
+ }
3281
3339
  }
3282
3340
  const featureFlagReportedKey = `${key}_${response}`;
3283
3341
  if (sendFeatureFlagEvents && (!(distinctId in this.distinctIdHasSentFlagCalls) || !this.distinctIdHasSentFlagCalls[distinctId].includes(featureFlagReportedKey))) {
@@ -3286,19 +3344,22 @@ var init_client = __esm({
3286
3344
  else this.distinctIdHasSentFlagCalls[distinctId] = [
3287
3345
  featureFlagReportedKey
3288
3346
  ];
3347
+ const properties = {
3348
+ $feature_flag: key,
3349
+ $feature_flag_response: response,
3350
+ $feature_flag_id: flagDetail?.metadata?.id,
3351
+ $feature_flag_version: flagDetail?.metadata?.version,
3352
+ $feature_flag_reason: flagDetail?.reason?.description ?? flagDetail?.reason?.code,
3353
+ locally_evaluated: flagWasLocallyEvaluated,
3354
+ [`$feature/${key}`]: response,
3355
+ $feature_flag_request_id: requestId,
3356
+ $feature_flag_evaluated_at: evaluatedAt
3357
+ };
3358
+ if (featureFlagError) properties.$feature_flag_error = featureFlagError;
3289
3359
  this.capture({
3290
3360
  distinctId,
3291
3361
  event: "$feature_flag_called",
3292
- properties: {
3293
- $feature_flag: key,
3294
- $feature_flag_response: response,
3295
- $feature_flag_id: flagDetail?.metadata?.id,
3296
- $feature_flag_version: flagDetail?.metadata?.version,
3297
- $feature_flag_reason: flagDetail?.reason?.description ?? flagDetail?.reason?.code,
3298
- locally_evaluated: flagWasLocallyEvaluated,
3299
- [`$feature/${key}`]: response,
3300
- $feature_flag_request_id: requestId
3301
- },
3362
+ properties,
3302
3363
  groups,
3303
3364
  disableGeoip
3304
3365
  });
@@ -3392,6 +3453,13 @@ var init_client = __esm({
3392
3453
  async reloadFeatureFlags() {
3393
3454
  await this.featureFlagsPoller?.loadFeatureFlags(true);
3394
3455
  }
3456
+ withContext(data, fn, options) {
3457
+ if (!this.context) return fn();
3458
+ return this.context.run(data, fn, options);
3459
+ }
3460
+ getContext() {
3461
+ return this.context?.get();
3462
+ }
3395
3463
  async _shutdown(shutdownTimeoutMs) {
3396
3464
  this.featureFlagsPoller?.stopPoller(shutdownTimeoutMs);
3397
3465
  this.errorTracking.shutdown();
@@ -3503,10 +3571,21 @@ var init_client = __esm({
3503
3571
  }
3504
3572
  async prepareEventMessage(props) {
3505
3573
  const { distinctId, event, properties, groups, sendFeatureFlags, timestamp, disableGeoip, uuid } = props;
3574
+ const contextData = this.context?.get();
3575
+ let mergedDistinctId = distinctId || contextData?.distinctId;
3576
+ const mergedProperties = {
3577
+ ...contextData?.properties || {},
3578
+ ...properties || {}
3579
+ };
3580
+ if (!mergedDistinctId) {
3581
+ mergedDistinctId = uuidv7();
3582
+ mergedProperties.$process_person_profile = false;
3583
+ }
3584
+ if (contextData?.sessionId && !mergedProperties.$session_id) mergedProperties.$session_id = contextData.sessionId;
3506
3585
  const eventMessage = this._runBeforeSend({
3507
- distinctId,
3586
+ distinctId: mergedDistinctId,
3508
3587
  event,
3509
- properties,
3588
+ properties: mergedProperties,
3510
3589
  groups,
3511
3590
  sendFeatureFlags,
3512
3591
  timestamp,
@@ -3517,8 +3596,9 @@ var init_client = __esm({
3517
3596
  const eventProperties = await Promise.resolve().then(async () => {
3518
3597
  if (sendFeatureFlags) {
3519
3598
  const sendFeatureFlagsOptions = "object" == typeof sendFeatureFlags ? sendFeatureFlags : void 0;
3520
- return await this.getFeatureFlagsForEvent(distinctId, groups, disableGeoip, sendFeatureFlagsOptions);
3599
+ return await this.getFeatureFlagsForEvent(eventMessage.distinctId, groups, disableGeoip, sendFeatureFlagsOptions);
3521
3600
  }
3601
+ eventMessage.event;
3522
3602
  return {};
3523
3603
  }).then((flags) => {
3524
3604
  const additionalProperties = {};
@@ -3574,8 +3654,37 @@ var init_client = __esm({
3574
3654
  };
3575
3655
  }
3576
3656
  });
3657
+ var PostHogContext;
3658
+ var init_context = __esm({
3659
+ "../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/context/context.mjs"() {
3660
+ PostHogContext = class {
3661
+ constructor() {
3662
+ this.storage = new async_hooks.AsyncLocalStorage();
3663
+ }
3664
+ get() {
3665
+ return this.storage.getStore();
3666
+ }
3667
+ run(context, fn, options) {
3668
+ const fresh = options?.fresh === true;
3669
+ if (fresh) return this.storage.run(context, fn);
3670
+ {
3671
+ const currentContext = this.get() || {};
3672
+ const mergedContext = {
3673
+ distinctId: context.distinctId ?? currentContext.distinctId,
3674
+ sessionId: context.sessionId ?? currentContext.sessionId,
3675
+ properties: {
3676
+ ...currentContext.properties || {},
3677
+ ...context.properties || {}
3678
+ }
3679
+ };
3680
+ return this.storage.run(mergedContext, fn);
3681
+ }
3682
+ }
3683
+ };
3684
+ }
3685
+ });
3577
3686
 
3578
- // ../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/extensions/sentry-integration.mjs
3687
+ // ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/sentry-integration.mjs
3579
3688
  function createEventProcessor(_posthog, { organization, projectId, prefix, severityAllowList = [
3580
3689
  "error"
3581
3690
  ], sendExceptionsToPostHog = true } = {}) {
@@ -3631,7 +3740,7 @@ function sentryIntegration(_posthog, options) {
3631
3740
  }
3632
3741
  var NAME, PostHogSentryIntegration;
3633
3742
  var init_sentry_integration = __esm({
3634
- "../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/extensions/sentry-integration.mjs"() {
3743
+ "../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/sentry-integration.mjs"() {
3635
3744
  NAME = "posthog-node";
3636
3745
  PostHogSentryIntegration = class {
3637
3746
  static #_ = this.POSTHOG_ID_TAG = "posthog_distinct_id";
@@ -3653,46 +3762,55 @@ var init_sentry_integration = __esm({
3653
3762
  }
3654
3763
  });
3655
3764
 
3656
- // ../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/extensions/express.mjs
3765
+ // ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/express.mjs
3657
3766
  function setupExpressErrorHandler(_posthog, app) {
3658
- app.use((error, _, __, next) => {
3767
+ app.use(posthogErrorHandler(_posthog));
3768
+ }
3769
+ function posthogErrorHandler(posthog) {
3770
+ return (error, req, res, next) => {
3771
+ const sessionId = req.headers["x-posthog-session-id"];
3772
+ const distinctId = req.headers["x-posthog-distinct-id"];
3773
+ const syntheticException = new Error("Synthetic exception");
3659
3774
  const hint = {
3660
3775
  mechanism: {
3661
3776
  type: "middleware",
3662
3777
  handled: false
3663
- }
3778
+ },
3779
+ syntheticException
3664
3780
  };
3665
- ErrorTracking.buildEventMessage(error, hint, uuidv7(), {
3666
- $process_person_profile: false
3667
- }).then((msg) => _posthog.capture(msg));
3781
+ posthog.addPendingPromise(ErrorTracking.buildEventMessage(error, hint, distinctId, {
3782
+ $session_id: sessionId,
3783
+ $current_url: req.url,
3784
+ $request_method: req.method,
3785
+ $request_path: req.path,
3786
+ $user_agent: req.headers["user-agent"],
3787
+ $response_status_code: res.statusCode,
3788
+ $ip: req.headers["x-forwarded-for"] || req?.socket?.remoteAddress
3789
+ }).then((msg) => {
3790
+ posthog.capture(msg);
3791
+ }));
3668
3792
  next(error);
3669
- });
3793
+ };
3670
3794
  }
3671
3795
  var init_express = __esm({
3672
- "../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/extensions/express.mjs"() {
3673
- init_dist();
3796
+ "../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/express.mjs"() {
3674
3797
  init_error_tracking2();
3675
3798
  }
3676
3799
  });
3677
3800
 
3678
- // ../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/types.mjs
3679
- var init_types3 = __esm({
3680
- "../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/types.mjs"() {
3681
- }
3682
- });
3683
-
3684
- // ../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/exports.mjs
3801
+ // ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/exports.mjs
3685
3802
  var init_exports = __esm({
3686
- "../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/exports.mjs"() {
3803
+ "../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/exports.mjs"() {
3687
3804
  init_sentry_integration();
3688
3805
  init_express();
3689
3806
  init_types3();
3690
3807
  }
3691
3808
  });
3692
3809
 
3693
- // ../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/entrypoints/index.node.mjs
3810
+ // ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/entrypoints/index.node.mjs
3694
3811
  var index_node_exports = {};
3695
3812
  __export(index_node_exports, {
3813
+ FeatureFlagError: () => FeatureFlagError,
3696
3814
  PostHog: () => PostHog,
3697
3815
  PostHogSentryIntegration: () => PostHogSentryIntegration,
3698
3816
  createEventProcessor: () => createEventProcessor,
@@ -3701,12 +3819,13 @@ __export(index_node_exports, {
3701
3819
  });
3702
3820
  var PostHog;
3703
3821
  var init_index_node = __esm({
3704
- "../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/entrypoints/index.node.mjs"() {
3822
+ "../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/entrypoints/index.node.mjs"() {
3705
3823
  init_module_node();
3706
3824
  init_context_lines_node();
3707
3825
  init_error_tracking2();
3708
3826
  init_client();
3709
3827
  init_dist();
3828
+ init_context();
3710
3829
  init_exports();
3711
3830
  ErrorTracking.errorPropertiesBuilder = new error_tracking_exports.ErrorPropertiesBuilder([
3712
3831
  new error_tracking_exports.EventCoercer(),
@@ -3722,6 +3841,9 @@ var init_index_node = __esm({
3722
3841
  getLibraryId() {
3723
3842
  return "posthog-node";
3724
3843
  }
3844
+ initializeContext() {
3845
+ return new PostHogContext();
3846
+ }
3725
3847
  };
3726
3848
  }
3727
3849
  });
@@ -6713,10 +6835,10 @@ var init_tslib_es6 = __esm({
6713
6835
  }
6714
6836
  });
6715
6837
 
6716
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/types/event/event.js
6838
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/types/event/event.js
6717
6839
  var IdentifyOperation, SpecialEventType;
6718
6840
  var init_event = __esm({
6719
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/types/event/event.js"() {
6841
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/types/event/event.js"() {
6720
6842
  (function(IdentifyOperation3) {
6721
6843
  IdentifyOperation3["SET"] = "$set";
6722
6844
  IdentifyOperation3["SET_ONCE"] = "$setOnce";
@@ -6737,10 +6859,10 @@ var init_event = __esm({
6737
6859
  }
6738
6860
  });
6739
6861
 
6740
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/types/constants.js
6862
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/types/constants.js
6741
6863
  var UNSET_VALUE, AMPLITUDE_PREFIX, STORAGE_PREFIX, DEFAULT_INSTANCE_NAME, AMPLITUDE_SERVER_URL, EU_AMPLITUDE_SERVER_URL, AMPLITUDE_BATCH_SERVER_URL, EU_AMPLITUDE_BATCH_SERVER_URL;
6742
6864
  var init_constants = __esm({
6743
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/types/constants.js"() {
6865
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/types/constants.js"() {
6744
6866
  UNSET_VALUE = "-";
6745
6867
  AMPLITUDE_PREFIX = "AMP";
6746
6868
  STORAGE_PREFIX = "".concat(AMPLITUDE_PREFIX, "_unsent");
@@ -6752,10 +6874,10 @@ var init_constants = __esm({
6752
6874
  }
6753
6875
  });
6754
6876
 
6755
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js
6877
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js
6756
6878
  var MAX_PROPERTY_KEYS, isValidObject, isValidProperties;
6757
6879
  var init_valid_properties = __esm({
6758
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js"() {
6880
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js"() {
6759
6881
  init_tslib_es6();
6760
6882
  MAX_PROPERTY_KEYS = 1e3;
6761
6883
  isValidObject = function(properties) {
@@ -6810,10 +6932,10 @@ var init_valid_properties = __esm({
6810
6932
  }
6811
6933
  });
6812
6934
 
6813
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/identify.js
6935
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/identify.js
6814
6936
  var Identify, IdentifyOperation2, OrderedIdentifyOperations;
6815
6937
  var init_identify = __esm({
6816
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/identify.js"() {
6938
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/identify.js"() {
6817
6939
  init_tslib_es6();
6818
6940
  init_constants();
6819
6941
  init_valid_properties();
@@ -6924,10 +7046,10 @@ var init_identify = __esm({
6924
7046
  }
6925
7047
  });
6926
7048
 
6927
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/types/messages.js
7049
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/types/messages.js
6928
7050
  var SUCCESS_MESSAGE, UNEXPECTED_ERROR_MESSAGE, MAX_RETRIES_EXCEEDED_MESSAGE, OPT_OUT_MESSAGE, MISSING_API_KEY_MESSAGE, INVALID_API_KEY, CLIENT_NOT_INITIALIZED;
6929
7051
  var init_messages = __esm({
6930
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/types/messages.js"() {
7052
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/types/messages.js"() {
6931
7053
  SUCCESS_MESSAGE = "Event tracked successfully";
6932
7054
  UNEXPECTED_ERROR_MESSAGE = "Unexpected error occurred";
6933
7055
  MAX_RETRIES_EXCEEDED_MESSAGE = "Event rejected due to exceeded retry count";
@@ -6938,10 +7060,10 @@ var init_messages = __esm({
6938
7060
  }
6939
7061
  });
6940
7062
 
6941
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/types/status.js
7063
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/types/status.js
6942
7064
  var Status;
6943
7065
  var init_status = __esm({
6944
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/types/status.js"() {
7066
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/types/status.js"() {
6945
7067
  (function(Status2) {
6946
7068
  Status2["Unknown"] = "unknown";
6947
7069
  Status2["Skipped"] = "skipped";
@@ -6956,10 +7078,10 @@ var init_status = __esm({
6956
7078
  }
6957
7079
  });
6958
7080
 
6959
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js
7081
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js
6960
7082
  var buildResult;
6961
7083
  var init_result_builder = __esm({
6962
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js"() {
7084
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js"() {
6963
7085
  init_status();
6964
7086
  buildResult = function(event, code, message2) {
6965
7087
  if (code === void 0) {
@@ -6973,10 +7095,10 @@ var init_result_builder = __esm({
6973
7095
  }
6974
7096
  });
6975
7097
 
6976
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js
7098
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js
6977
7099
  var getGlobalScope;
6978
7100
  var init_global_scope = __esm({
6979
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js"() {
7101
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js"() {
6980
7102
  getGlobalScope = function() {
6981
7103
  var ampIntegrationContextName = "ampIntegrationContext";
6982
7104
  if (typeof globalThis !== "undefined" && typeof globalThis[ampIntegrationContextName] !== "undefined") {
@@ -6999,10 +7121,10 @@ var init_global_scope = __esm({
6999
7121
  }
7000
7122
  });
7001
7123
 
7002
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js
7124
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js
7003
7125
  var legacyUUID, hex, UUID2;
7004
7126
  var init_uuid = __esm({
7005
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js"() {
7127
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js"() {
7006
7128
  init_tslib_es6();
7007
7129
  init_global_scope();
7008
7130
  legacyUUID = function(a) {
@@ -7046,10 +7168,10 @@ var init_uuid = __esm({
7046
7168
  }
7047
7169
  });
7048
7170
 
7049
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/timeline.js
7171
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/timeline.js
7050
7172
  var Timeline;
7051
7173
  var init_timeline = __esm({
7052
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/timeline.js"() {
7174
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/timeline.js"() {
7053
7175
  init_tslib_es6();
7054
7176
  init_result_builder();
7055
7177
  init_uuid();
@@ -7351,10 +7473,10 @@ var init_timeline = __esm({
7351
7473
  }
7352
7474
  });
7353
7475
 
7354
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js
7476
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js
7355
7477
  var createTrackEvent, createIdentifyEvent, createGroupIdentifyEvent, createGroupEvent, createRevenueEvent;
7356
7478
  var init_event_builder = __esm({
7357
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js"() {
7479
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js"() {
7358
7480
  init_tslib_es6();
7359
7481
  init_identify();
7360
7482
  init_event();
@@ -7384,10 +7506,10 @@ var init_event_builder = __esm({
7384
7506
  }
7385
7507
  });
7386
7508
 
7387
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js
7509
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js
7388
7510
  var returnWrapper;
7389
7511
  var init_return_wrapper = __esm({
7390
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js"() {
7512
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js"() {
7391
7513
  returnWrapper = function(awaitable) {
7392
7514
  return {
7393
7515
  promise: awaitable || Promise.resolve()
@@ -7396,10 +7518,10 @@ var init_return_wrapper = __esm({
7396
7518
  }
7397
7519
  });
7398
7520
 
7399
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/core-client.js
7521
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/core-client.js
7400
7522
  var AmplitudeCore;
7401
7523
  var init_core_client = __esm({
7402
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/core-client.js"() {
7524
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/core-client.js"() {
7403
7525
  init_tslib_es6();
7404
7526
  init_event();
7405
7527
  init_identify();
@@ -7667,10 +7789,10 @@ var init_core_client = __esm({
7667
7789
  }
7668
7790
  });
7669
7791
 
7670
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/revenue.js
7792
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/revenue.js
7671
7793
  var Revenue, RevenueProperty;
7672
7794
  var init_revenue = __esm({
7673
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/revenue.js"() {
7795
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/revenue.js"() {
7674
7796
  init_tslib_es6();
7675
7797
  init_valid_properties();
7676
7798
  Revenue = /** @class */
@@ -7747,10 +7869,10 @@ var init_revenue = __esm({
7747
7869
  }
7748
7870
  });
7749
7871
 
7750
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js
7872
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js
7751
7873
  var chunk;
7752
7874
  var init_chunk = __esm({
7753
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js"() {
7875
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js"() {
7754
7876
  chunk = function(arr, size) {
7755
7877
  var chunkSize = Math.max(size, 1);
7756
7878
  return arr.reduce(function(chunks, element, index) {
@@ -7765,10 +7887,10 @@ var init_chunk = __esm({
7765
7887
  }
7766
7888
  });
7767
7889
 
7768
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/types/loglevel.js
7890
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/types/loglevel.js
7769
7891
  var LogLevel;
7770
7892
  var init_loglevel = __esm({
7771
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/types/loglevel.js"() {
7893
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/types/loglevel.js"() {
7772
7894
  (function(LogLevel2) {
7773
7895
  LogLevel2[LogLevel2["None"] = 0] = "None";
7774
7896
  LogLevel2[LogLevel2["Error"] = 1] = "Error";
@@ -7779,10 +7901,10 @@ var init_loglevel = __esm({
7779
7901
  }
7780
7902
  });
7781
7903
 
7782
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/logger.js
7904
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/logger.js
7783
7905
  var PREFIX, Logger;
7784
7906
  var init_logger2 = __esm({
7785
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/logger.js"() {
7907
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/logger.js"() {
7786
7908
  init_loglevel();
7787
7909
  PREFIX = "Amplitude Logger ";
7788
7910
  Logger = /** @class */
@@ -7844,10 +7966,10 @@ var init_logger2 = __esm({
7844
7966
  }
7845
7967
  });
7846
7968
 
7847
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/config.js
7969
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/config.js
7848
7970
  var getDefaultConfig, Config, getServerUrl, createServerConfig, RequestMetadata;
7849
7971
  var init_config = __esm({
7850
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/config.js"() {
7972
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/config.js"() {
7851
7973
  init_constants();
7852
7974
  init_logger2();
7853
7975
  init_loglevel();
@@ -7948,19 +8070,19 @@ var init_config = __esm({
7948
8070
  }
7949
8071
  });
7950
8072
 
7951
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/utils/status-code.js
8073
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/utils/status-code.js
7952
8074
  function isSuccessStatusCode(code) {
7953
8075
  return code >= 200 && code < 300;
7954
8076
  }
7955
8077
  var init_status_code = __esm({
7956
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/utils/status-code.js"() {
8078
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/utils/status-code.js"() {
7957
8079
  }
7958
8080
  });
7959
8081
 
7960
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js
8082
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js
7961
8083
  var getStacktrace, getClientLogConfig, getValueByStringPath, getClientStates, debugWrapper;
7962
8084
  var init_debug = __esm({
7963
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js"() {
8085
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js"() {
7964
8086
  init_tslib_es6();
7965
8087
  init_loglevel();
7966
8088
  getStacktrace = function(ignoreDepth) {
@@ -8078,7 +8200,7 @@ var init_debug = __esm({
8078
8200
  }
8079
8201
  });
8080
8202
 
8081
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js
8203
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js
8082
8204
  function getErrorMessage(error) {
8083
8205
  if (error instanceof Error)
8084
8206
  return error.message;
@@ -8096,7 +8218,7 @@ function getResponseBodyString(res) {
8096
8218
  }
8097
8219
  var Destination;
8098
8220
  var init_destination = __esm({
8099
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js"() {
8221
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js"() {
8100
8222
  init_tslib_es6();
8101
8223
  init_status();
8102
8224
  init_messages();
@@ -8487,10 +8609,10 @@ var init_destination = __esm({
8487
8609
  }
8488
8610
  });
8489
8611
 
8490
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js
8612
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js
8491
8613
  var BaseTransport;
8492
8614
  var init_base2 = __esm({
8493
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js"() {
8615
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js"() {
8494
8616
  init_status();
8495
8617
  init_status_code();
8496
8618
  BaseTransport = /** @class */
@@ -8592,10 +8714,10 @@ var init_base2 = __esm({
8592
8714
  }
8593
8715
  });
8594
8716
 
8595
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/types/server-zone.js
8717
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/types/server-zone.js
8596
8718
  var ServerZone;
8597
8719
  var init_server_zone = __esm({
8598
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/types/server-zone.js"() {
8720
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/types/server-zone.js"() {
8599
8721
  (function(ServerZone2) {
8600
8722
  ServerZone2["US"] = "US";
8601
8723
  ServerZone2["EU"] = "EU";
@@ -8604,17 +8726,17 @@ var init_server_zone = __esm({
8604
8726
  }
8605
8727
  });
8606
8728
 
8607
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/types/offline.js
8729
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/types/offline.js
8608
8730
  var OfflineDisabled;
8609
8731
  var init_offline = __esm({
8610
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/types/offline.js"() {
8732
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/types/offline.js"() {
8611
8733
  OfflineDisabled = null;
8612
8734
  }
8613
8735
  });
8614
8736
 
8615
- // ../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/index.js
8737
+ // ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/index.js
8616
8738
  var init_esm = __esm({
8617
- "../../node_modules/.pnpm/@amplitude+analytics-core@2.33.0/node_modules/@amplitude/analytics-core/lib/esm/index.js"() {
8739
+ "../../node_modules/.pnpm/@amplitude+analytics-core@2.35.0/node_modules/@amplitude/analytics-core/lib/esm/index.js"() {
8618
8740
  init_core_client();
8619
8741
  init_identify();
8620
8742
  init_revenue();
@@ -8631,18 +8753,18 @@ var init_esm = __esm({
8631
8753
  }
8632
8754
  });
8633
8755
 
8634
- // ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.26/node_modules/@amplitude/analytics-node/lib/esm/version.js
8756
+ // ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.29/node_modules/@amplitude/analytics-node/lib/esm/version.js
8635
8757
  var VERSION;
8636
8758
  var init_version2 = __esm({
8637
- "../../node_modules/.pnpm/@amplitude+analytics-node@1.5.26/node_modules/@amplitude/analytics-node/lib/esm/version.js"() {
8638
- VERSION = "1.5.26";
8759
+ "../../node_modules/.pnpm/@amplitude+analytics-node@1.5.29/node_modules/@amplitude/analytics-node/lib/esm/version.js"() {
8760
+ VERSION = "1.5.29";
8639
8761
  }
8640
8762
  });
8641
8763
 
8642
- // ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.26/node_modules/@amplitude/analytics-node/lib/esm/plugins/context.js
8764
+ // ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.29/node_modules/@amplitude/analytics-node/lib/esm/plugins/context.js
8643
8765
  var Context;
8644
- var init_context = __esm({
8645
- "../../node_modules/.pnpm/@amplitude+analytics-node@1.5.26/node_modules/@amplitude/analytics-node/lib/esm/plugins/context.js"() {
8766
+ var init_context2 = __esm({
8767
+ "../../node_modules/.pnpm/@amplitude+analytics-node@1.5.29/node_modules/@amplitude/analytics-node/lib/esm/plugins/context.js"() {
8646
8768
  init_tslib_es6();
8647
8769
  init_esm();
8648
8770
  init_version2();
@@ -8677,7 +8799,7 @@ var init_context = __esm({
8677
8799
  });
8678
8800
  var Http;
8679
8801
  var init_http = __esm({
8680
- "../../node_modules/.pnpm/@amplitude+analytics-node@1.5.26/node_modules/@amplitude/analytics-node/lib/esm/transports/http.js"() {
8802
+ "../../node_modules/.pnpm/@amplitude+analytics-node@1.5.29/node_modules/@amplitude/analytics-node/lib/esm/transports/http.js"() {
8681
8803
  init_tslib_es6();
8682
8804
  init_esm();
8683
8805
  Http = /** @class */
@@ -8739,10 +8861,10 @@ var init_http = __esm({
8739
8861
  }
8740
8862
  });
8741
8863
 
8742
- // ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.26/node_modules/@amplitude/analytics-node/lib/esm/config.js
8864
+ // ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.29/node_modules/@amplitude/analytics-node/lib/esm/config.js
8743
8865
  var NodeConfig, useNodeConfig;
8744
8866
  var init_config2 = __esm({
8745
- "../../node_modules/.pnpm/@amplitude+analytics-node@1.5.26/node_modules/@amplitude/analytics-node/lib/esm/config.js"() {
8867
+ "../../node_modules/.pnpm/@amplitude+analytics-node@1.5.29/node_modules/@amplitude/analytics-node/lib/esm/config.js"() {
8746
8868
  init_tslib_es6();
8747
8869
  init_esm();
8748
8870
  init_http();
@@ -8760,13 +8882,13 @@ var init_config2 = __esm({
8760
8882
  }
8761
8883
  });
8762
8884
 
8763
- // ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.26/node_modules/@amplitude/analytics-node/lib/esm/node-client.js
8885
+ // ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.29/node_modules/@amplitude/analytics-node/lib/esm/node-client.js
8764
8886
  var AmplitudeNode, createInstance, node_client_default;
8765
8887
  var init_node_client = __esm({
8766
- "../../node_modules/.pnpm/@amplitude+analytics-node@1.5.26/node_modules/@amplitude/analytics-node/lib/esm/node-client.js"() {
8888
+ "../../node_modules/.pnpm/@amplitude+analytics-node@1.5.29/node_modules/@amplitude/analytics-node/lib/esm/node-client.js"() {
8767
8889
  init_tslib_es6();
8768
8890
  init_esm();
8769
- init_context();
8891
+ init_context2();
8770
8892
  init_config2();
8771
8893
  AmplitudeNode = /** @class */
8772
8894
  (function(_super) {
@@ -8837,7 +8959,7 @@ var init_node_client = __esm({
8837
8959
  }
8838
8960
  });
8839
8961
 
8840
- // ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.26/node_modules/@amplitude/analytics-node/lib/esm/types.js
8962
+ // ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.29/node_modules/@amplitude/analytics-node/lib/esm/types.js
8841
8963
  var types_exports = {};
8842
8964
  __export(types_exports, {
8843
8965
  IdentifyOperation: () => IdentifyOperation,
@@ -8848,12 +8970,12 @@ __export(types_exports, {
8848
8970
  SpecialEventType: () => SpecialEventType
8849
8971
  });
8850
8972
  var init_types4 = __esm({
8851
- "../../node_modules/.pnpm/@amplitude+analytics-node@1.5.26/node_modules/@amplitude/analytics-node/lib/esm/types.js"() {
8973
+ "../../node_modules/.pnpm/@amplitude+analytics-node@1.5.29/node_modules/@amplitude/analytics-node/lib/esm/types.js"() {
8852
8974
  init_esm();
8853
8975
  }
8854
8976
  });
8855
8977
 
8856
- // ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.26/node_modules/@amplitude/analytics-node/lib/esm/index.js
8978
+ // ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.29/node_modules/@amplitude/analytics-node/lib/esm/index.js
8857
8979
  var esm_exports = {};
8858
8980
  __export(esm_exports, {
8859
8981
  Identify: () => Identify,
@@ -8874,7 +8996,7 @@ __export(esm_exports, {
8874
8996
  });
8875
8997
  var add, groupIdentify, identify, init, logEvent, remove, revenue, setGroup, setOptOut, track, flush;
8876
8998
  var init_esm2 = __esm({
8877
- "../../node_modules/.pnpm/@amplitude+analytics-node@1.5.26/node_modules/@amplitude/analytics-node/lib/esm/index.js"() {
8999
+ "../../node_modules/.pnpm/@amplitude+analytics-node@1.5.29/node_modules/@amplitude/analytics-node/lib/esm/index.js"() {
8878
9000
  init_node_client();
8879
9001
  init_node_client();
8880
9002
  init_esm();
@@ -9646,7 +9768,7 @@ var init_stats = __esm({
9646
9768
 
9647
9769
  // ../../node_modules/.pnpm/@segment+analytics-core@1.8.2/node_modules/@segment/analytics-core/dist/esm/context/index.js
9648
9770
  var ContextCancelation, CoreContext;
9649
- var init_context2 = __esm({
9771
+ var init_context3 = __esm({
9650
9772
  "../../node_modules/.pnpm/@segment+analytics-core@1.8.2/node_modules/@segment/analytics-core/dist/esm/context/index.js"() {
9651
9773
  init_dist3();
9652
9774
  init_dist2();
@@ -9872,7 +9994,7 @@ function ensure(ctx, plugin) {
9872
9994
  var init_delivery = __esm({
9873
9995
  "../../node_modules/.pnpm/@segment+analytics-core@1.8.2/node_modules/@segment/analytics-core/dist/esm/queue/delivery.js"() {
9874
9996
  init_tslib_es6();
9875
- init_context2();
9997
+ init_context3();
9876
9998
  }
9877
9999
  });
9878
10000
 
@@ -9883,7 +10005,7 @@ var init_event_queue = __esm({
9883
10005
  init_tslib_es6();
9884
10006
  init_group_by();
9885
10007
  init_priority_queue();
9886
- init_context2();
10008
+ init_context3();
9887
10009
  init_esm3();
9888
10010
  init_task_group();
9889
10011
  init_delivery();
@@ -10315,7 +10437,7 @@ var init_esm4 = __esm({
10315
10437
  init_callback();
10316
10438
  init_priority_queue();
10317
10439
  init_backoff();
10318
- init_context2();
10440
+ init_context3();
10319
10441
  init_event_queue();
10320
10442
  init_analytics();
10321
10443
  init_dispatch();
@@ -11983,7 +12105,7 @@ var init_event_factory = __esm({
11983
12105
 
11984
12106
  // ../../node_modules/.pnpm/@segment+analytics-node@2.3.0/node_modules/@segment/analytics-node/dist/esm/app/context.js
11985
12107
  var Context2;
11986
- var init_context3 = __esm({
12108
+ var init_context4 = __esm({
11987
12109
  "../../node_modules/.pnpm/@segment+analytics-node@2.3.0/node_modules/@segment/analytics-node/dist/esm/app/context.js"() {
11988
12110
  init_esm4();
11989
12111
  Context2 = class extends CoreContext {
@@ -11999,7 +12121,7 @@ var normalizeDispatchCb, dispatchAndEmit;
11999
12121
  var init_dispatch_emit = __esm({
12000
12122
  "../../node_modules/.pnpm/@segment+analytics-node@2.3.0/node_modules/@segment/analytics-node/dist/esm/app/dispatch-emit.js"() {
12001
12123
  init_esm4();
12002
- init_context3();
12124
+ init_context4();
12003
12125
  normalizeDispatchCb = (cb) => (ctx) => {
12004
12126
  const failedDelivery = ctx.failedDelivery();
12005
12127
  return failedDelivery ? cb(failedDelivery.reason, ctx) : cb(void 0, ctx);
@@ -15171,7 +15293,7 @@ var init_analytics_node = __esm({
15171
15293
  init_event_factory();
15172
15294
  init_dispatch_emit();
15173
15295
  init_emitter3();
15174
- init_context3();
15296
+ init_context4();
15175
15297
  init_event_queue2();
15176
15298
  init_http_client();
15177
15299
  Analytics = class extends NodeEmitter {
@@ -15373,7 +15495,7 @@ var init_analytics_node = __esm({
15373
15495
  var init_index_common = __esm({
15374
15496
  "../../node_modules/.pnpm/@segment+analytics-node@2.3.0/node_modules/@segment/analytics-node/dist/esm/index.common.js"() {
15375
15497
  init_analytics_node();
15376
- init_context3();
15498
+ init_context4();
15377
15499
  init_http_client();
15378
15500
  }
15379
15501
  });
@@ -16022,7 +16144,8 @@ var MixpanelSubscriber = class {
16022
16144
  var AmplitudeSubscriber = class {
16023
16145
  name = "AmplitudeSubscriber";
16024
16146
  version = "1.0.0";
16025
- amplitude;
16147
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16148
+ amplitudeModule = null;
16026
16149
  enabled;
16027
16150
  config;
16028
16151
  initPromise = null;
@@ -16035,11 +16158,12 @@ var AmplitudeSubscriber = class {
16035
16158
  }
16036
16159
  async initialize() {
16037
16160
  try {
16038
- const { init: init2 } = await Promise.resolve().then(() => (init_esm2(), esm_exports));
16039
- this.amplitude = init2(this.config.apiKey);
16161
+ const amplitude = await Promise.resolve().then(() => (init_esm2(), esm_exports));
16162
+ amplitude.init(this.config.apiKey);
16163
+ this.amplitudeModule = amplitude;
16040
16164
  } catch (error) {
16041
16165
  console.error(
16042
- "Amplitude subscriber failed to initialize. Install @amplitude/events-node: pnpm add @amplitude/events-node",
16166
+ "Amplitude subscriber failed to initialize. Install @amplitude/analytics-node: pnpm add @amplitude/analytics-node",
16043
16167
  error
16044
16168
  );
16045
16169
  this.enabled = false;
@@ -16054,7 +16178,7 @@ var AmplitudeSubscriber = class {
16054
16178
  async trackEvent(name, attributes) {
16055
16179
  if (!this.enabled) return;
16056
16180
  await this.ensureInitialized();
16057
- this.amplitude?.track({
16181
+ this.amplitudeModule?.track({
16058
16182
  event_type: name,
16059
16183
  user_id: attributes?.userId || attributes?.user_id || "anonymous",
16060
16184
  event_properties: attributes
@@ -16063,7 +16187,7 @@ var AmplitudeSubscriber = class {
16063
16187
  async trackFunnelStep(funnelName, step, attributes) {
16064
16188
  if (!this.enabled) return;
16065
16189
  await this.ensureInitialized();
16066
- this.amplitude?.trackEvent({
16190
+ this.amplitudeModule?.track({
16067
16191
  event_type: `${funnelName}.${step}`,
16068
16192
  user_id: attributes?.userId || attributes?.user_id || "anonymous",
16069
16193
  event_properties: {
@@ -16076,7 +16200,7 @@ var AmplitudeSubscriber = class {
16076
16200
  async trackOutcome(operationName, outcome, attributes) {
16077
16201
  if (!this.enabled) return;
16078
16202
  await this.ensureInitialized();
16079
- this.amplitude?.trackEvent({
16203
+ this.amplitudeModule?.track({
16080
16204
  event_type: `${operationName}.${outcome}`,
16081
16205
  user_id: attributes?.userId || attributes?.user_id || "anonymous",
16082
16206
  event_properties: {
@@ -16089,7 +16213,7 @@ var AmplitudeSubscriber = class {
16089
16213
  async trackValue(name, value, attributes) {
16090
16214
  if (!this.enabled) return;
16091
16215
  await this.ensureInitialized();
16092
- this.amplitude?.trackEvent({
16216
+ this.amplitudeModule?.track({
16093
16217
  event_type: name,
16094
16218
  user_id: attributes?.userId || attributes?.user_id || "anonymous",
16095
16219
  event_properties: {
@@ -16101,8 +16225,8 @@ var AmplitudeSubscriber = class {
16101
16225
  /** Flush pending events before shutdown */
16102
16226
  async shutdown() {
16103
16227
  await this.ensureInitialized();
16104
- if (this.amplitude) {
16105
- await this.amplitude.flush();
16228
+ if (this.amplitudeModule) {
16229
+ await this.amplitudeModule.flush();
16106
16230
  }
16107
16231
  }
16108
16232
  };