autotel-subscribers 15.0.0 → 16.0.1
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.
- package/dist/amplitude.cjs +64 -64
- package/dist/amplitude.cjs.map +1 -1
- package/dist/amplitude.js +64 -64
- package/dist/amplitude.js.map +1 -1
- package/dist/factories.cjs +987 -347
- package/dist/factories.cjs.map +1 -1
- package/dist/factories.js +987 -347
- package/dist/factories.js.map +1 -1
- package/dist/index.cjs +987 -347
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +987 -347
- package/dist/index.js.map +1 -1
- package/dist/mixpanel.cjs +686 -130
- package/dist/mixpanel.cjs.map +1 -1
- package/dist/mixpanel.js +686 -130
- package/dist/mixpanel.js.map +1 -1
- package/dist/posthog.cjs +234 -150
- package/dist/posthog.cjs.map +1 -1
- package/dist/posthog.js +234 -150
- package/dist/posthog.js.map +1 -1
- package/package.json +13 -13
package/dist/factories.js
CHANGED
|
@@ -86,11 +86,11 @@ function normalizeWindowsPath(path) {
|
|
|
86
86
|
return path.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
|
|
87
87
|
}
|
|
88
88
|
var init_module_node = __esm({
|
|
89
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
89
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs"() {
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
93
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/featureFlagUtils.mjs
|
|
94
94
|
function getFlagDetailFromFlagAndPayload(key, value, payload) {
|
|
95
95
|
return {
|
|
96
96
|
key,
|
|
@@ -107,7 +107,7 @@ function getFlagDetailFromFlagAndPayload(key, value, payload) {
|
|
|
107
107
|
}
|
|
108
108
|
var normalizeFlagsResponse, getFlagValuesFromFlags, getPayloadsFromFlags, getFeatureFlagValue, parsePayload;
|
|
109
109
|
var init_featureFlagUtils = __esm({
|
|
110
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
110
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/featureFlagUtils.mjs"() {
|
|
111
111
|
normalizeFlagsResponse = (flagsResponse) => {
|
|
112
112
|
if ("flags" in flagsResponse) {
|
|
113
113
|
const featureFlags = getFlagValuesFromFlags(flagsResponse.flags);
|
|
@@ -165,10 +165,10 @@ var init_featureFlagUtils = __esm({
|
|
|
165
165
|
}
|
|
166
166
|
});
|
|
167
167
|
|
|
168
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
168
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/vendor/uuidv7.mjs
|
|
169
169
|
var DIGITS, UUID, V7Generator, getDefaultRandom, defaultGenerator, uuidv7, uuidv7obj;
|
|
170
170
|
var init_uuidv7 = __esm({
|
|
171
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
171
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/vendor/uuidv7.mjs"() {
|
|
172
172
|
DIGITS = "0123456789abcdef";
|
|
173
173
|
UUID = class _UUID {
|
|
174
174
|
constructor(bytes) {
|
|
@@ -329,10 +329,10 @@ var init_uuidv7 = __esm({
|
|
|
329
329
|
}
|
|
330
330
|
});
|
|
331
331
|
|
|
332
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
332
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/bot-detection.mjs
|
|
333
333
|
var DEFAULT_BLOCKED_UA_STRS, isBlockedUA;
|
|
334
334
|
var init_bot_detection = __esm({
|
|
335
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
335
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/bot-detection.mjs"() {
|
|
336
336
|
DEFAULT_BLOCKED_UA_STRS = [
|
|
337
337
|
"amazonbot",
|
|
338
338
|
"amazonproductbot",
|
|
@@ -423,10 +423,10 @@ var init_bot_detection = __esm({
|
|
|
423
423
|
}
|
|
424
424
|
});
|
|
425
425
|
|
|
426
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
426
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/types.mjs
|
|
427
427
|
var types_PostHogPersistedProperty;
|
|
428
428
|
var init_types = __esm({
|
|
429
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
429
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/types.mjs"() {
|
|
430
430
|
types_PostHogPersistedProperty = /* @__PURE__ */ (function(PostHogPersistedProperty) {
|
|
431
431
|
PostHogPersistedProperty["AnonymousId"] = "anonymous_id";
|
|
432
432
|
PostHogPersistedProperty["DistinctId"] = "distinct_id";
|
|
@@ -458,20 +458,13 @@ var init_types = __esm({
|
|
|
458
458
|
}
|
|
459
459
|
});
|
|
460
460
|
|
|
461
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
461
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/string-utils.mjs
|
|
462
462
|
var init_string_utils = __esm({
|
|
463
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
463
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/string-utils.mjs"() {
|
|
464
464
|
}
|
|
465
465
|
});
|
|
466
466
|
|
|
467
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
468
|
-
function isInstanceOf(candidate, base) {
|
|
469
|
-
try {
|
|
470
|
-
return candidate instanceof base;
|
|
471
|
-
} catch {
|
|
472
|
-
return false;
|
|
473
|
-
}
|
|
474
|
-
}
|
|
467
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/type-utils.mjs
|
|
475
468
|
function isPrimitive(value) {
|
|
476
469
|
return null === value || "object" != typeof value;
|
|
477
470
|
}
|
|
@@ -487,9 +480,16 @@ function isEvent(candidate) {
|
|
|
487
480
|
function isPlainObject(candidate) {
|
|
488
481
|
return isBuiltin(candidate, "Object");
|
|
489
482
|
}
|
|
490
|
-
|
|
483
|
+
function isInstanceOf(candidate, base) {
|
|
484
|
+
try {
|
|
485
|
+
return candidate instanceof base;
|
|
486
|
+
} catch {
|
|
487
|
+
return false;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
var nativeIsArray, ObjProto, type_utils_toString, isArray, isObject, isUndefined, isString, isEmptyString, isNumber, isPlainError;
|
|
491
491
|
var init_type_utils = __esm({
|
|
492
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
492
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/type-utils.mjs"() {
|
|
493
493
|
init_types();
|
|
494
494
|
init_string_utils();
|
|
495
495
|
nativeIsArray = Array.isArray;
|
|
@@ -499,6 +499,7 @@ var init_type_utils = __esm({
|
|
|
499
499
|
isArray = nativeIsArray || function(obj) {
|
|
500
500
|
return "[object Array]" === type_utils_toString.call(obj);
|
|
501
501
|
};
|
|
502
|
+
isObject = (x) => x === Object(x) && !isArray(x);
|
|
502
503
|
isUndefined = (x) => void 0 === x;
|
|
503
504
|
isString = (x) => "[object String]" == type_utils_toString.call(x);
|
|
504
505
|
isEmptyString = (x) => isString(x) && 0 === x.trim().length;
|
|
@@ -507,7 +508,7 @@ var init_type_utils = __esm({
|
|
|
507
508
|
}
|
|
508
509
|
});
|
|
509
510
|
|
|
510
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
511
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/number-utils.mjs
|
|
511
512
|
function clampToRange(value, min, max, logger, fallbackValue) {
|
|
512
513
|
if (min > max) {
|
|
513
514
|
logger.warn("min cannot be greater than max.");
|
|
@@ -525,15 +526,15 @@ function clampToRange(value, min, max, logger, fallbackValue) {
|
|
|
525
526
|
return clampToRange(max, min, max, logger);
|
|
526
527
|
}
|
|
527
528
|
var init_number_utils = __esm({
|
|
528
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
529
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/number-utils.mjs"() {
|
|
529
530
|
init_type_utils();
|
|
530
531
|
}
|
|
531
532
|
});
|
|
532
533
|
|
|
533
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
534
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs
|
|
534
535
|
var ONE_DAY_IN_MS, BucketedRateLimiter;
|
|
535
536
|
var init_bucketed_rate_limiter = __esm({
|
|
536
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
537
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs"() {
|
|
537
538
|
init_number_utils();
|
|
538
539
|
ONE_DAY_IN_MS = 864e5;
|
|
539
540
|
BucketedRateLimiter = class {
|
|
@@ -577,10 +578,10 @@ var init_bucketed_rate_limiter = __esm({
|
|
|
577
578
|
}
|
|
578
579
|
});
|
|
579
580
|
|
|
580
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
581
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/promise-queue.mjs
|
|
581
582
|
var PromiseQueue;
|
|
582
583
|
var init_promise_queue = __esm({
|
|
583
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
584
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/promise-queue.mjs"() {
|
|
584
585
|
init_uuidv7();
|
|
585
586
|
PromiseQueue = class {
|
|
586
587
|
add(promise) {
|
|
@@ -611,7 +612,7 @@ var init_promise_queue = __esm({
|
|
|
611
612
|
}
|
|
612
613
|
});
|
|
613
614
|
|
|
614
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
615
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/logger.mjs
|
|
615
616
|
function createConsole(consoleLike = console) {
|
|
616
617
|
const lockedMethods = {
|
|
617
618
|
log: consoleLike.log.bind(consoleLike),
|
|
@@ -626,7 +627,7 @@ function createLogger(prefix, maybeCall = passThrough) {
|
|
|
626
627
|
}
|
|
627
628
|
var _createLogger, passThrough;
|
|
628
629
|
var init_logger = __esm({
|
|
629
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
630
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/logger.mjs"() {
|
|
630
631
|
_createLogger = (prefix, maybeCall, consoleLike) => {
|
|
631
632
|
function _log(level, ...args) {
|
|
632
633
|
maybeCall(() => {
|
|
@@ -655,10 +656,10 @@ var init_logger = __esm({
|
|
|
655
656
|
}
|
|
656
657
|
});
|
|
657
658
|
|
|
658
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
659
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs
|
|
659
660
|
var MOBILE, TABLET, GENERIC;
|
|
660
661
|
var init_user_agent_utils = __esm({
|
|
661
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
662
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs"() {
|
|
662
663
|
init_string_utils();
|
|
663
664
|
init_type_utils();
|
|
664
665
|
MOBILE = "Mobile";
|
|
@@ -669,7 +670,7 @@ var init_user_agent_utils = __esm({
|
|
|
669
670
|
}
|
|
670
671
|
});
|
|
671
672
|
|
|
672
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
673
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/index.mjs
|
|
673
674
|
function assert(truthyValue, message2) {
|
|
674
675
|
if (!truthyValue || "string" != typeof truthyValue || isEmpty(truthyValue)) throw new Error(message2);
|
|
675
676
|
}
|
|
@@ -713,7 +714,7 @@ function allSettled(promises) {
|
|
|
713
714
|
}
|
|
714
715
|
var STRING_FORMAT, isError;
|
|
715
716
|
var init_utils = __esm({
|
|
716
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
717
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/index.mjs"() {
|
|
717
718
|
init_bot_detection();
|
|
718
719
|
init_bucketed_rate_limiter();
|
|
719
720
|
init_number_utils();
|
|
@@ -727,10 +728,10 @@ var init_utils = __esm({
|
|
|
727
728
|
}
|
|
728
729
|
});
|
|
729
730
|
|
|
730
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
731
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/eventemitter.mjs
|
|
731
732
|
var SimpleEventEmitter;
|
|
732
733
|
var init_eventemitter = __esm({
|
|
733
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
734
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/eventemitter.mjs"() {
|
|
734
735
|
SimpleEventEmitter = class {
|
|
735
736
|
constructor() {
|
|
736
737
|
this.events = {};
|
|
@@ -751,7 +752,7 @@ var init_eventemitter = __esm({
|
|
|
751
752
|
}
|
|
752
753
|
});
|
|
753
754
|
|
|
754
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
755
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/gzip.mjs
|
|
755
756
|
function isGzipSupported() {
|
|
756
757
|
return "CompressionStream" in globalThis;
|
|
757
758
|
}
|
|
@@ -770,11 +771,11 @@ async function gzipCompress(input, isDebug = true) {
|
|
|
770
771
|
}
|
|
771
772
|
}
|
|
772
773
|
var init_gzip = __esm({
|
|
773
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
774
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/gzip.mjs"() {
|
|
774
775
|
}
|
|
775
776
|
});
|
|
776
777
|
|
|
777
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
778
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/posthog-core-stateless.mjs
|
|
778
779
|
async function logFlushError(err) {
|
|
779
780
|
if (err instanceof PostHogFetchHttpError) {
|
|
780
781
|
let text = "";
|
|
@@ -794,7 +795,7 @@ function isPostHogFetchContentTooLargeError(err) {
|
|
|
794
795
|
}
|
|
795
796
|
var PostHogFetchHttpError, PostHogFetchNetworkError, PostHogCoreStateless;
|
|
796
797
|
var init_posthog_core_stateless = __esm({
|
|
797
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
798
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/posthog-core-stateless.mjs"() {
|
|
798
799
|
init_eventemitter();
|
|
799
800
|
init_featureFlagUtils();
|
|
800
801
|
init_gzip();
|
|
@@ -1412,9 +1413,9 @@ var init_posthog_core_stateless = __esm({
|
|
|
1412
1413
|
}
|
|
1413
1414
|
});
|
|
1414
1415
|
|
|
1415
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1416
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/posthog-core.mjs
|
|
1416
1417
|
var init_posthog_core = __esm({
|
|
1417
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1418
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/posthog-core.mjs"() {
|
|
1418
1419
|
init_featureFlagUtils();
|
|
1419
1420
|
init_types();
|
|
1420
1421
|
init_posthog_core_stateless();
|
|
@@ -1423,7 +1424,7 @@ var init_posthog_core = __esm({
|
|
|
1423
1424
|
}
|
|
1424
1425
|
});
|
|
1425
1426
|
|
|
1426
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1427
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs
|
|
1427
1428
|
function getFilenameToChunkIdMap(stackParser) {
|
|
1428
1429
|
const chunkIdMap = globalThis._posthogChunkIds;
|
|
1429
1430
|
if (!chunkIdMap) return;
|
|
@@ -1456,14 +1457,14 @@ function getFilenameToChunkIdMap(stackParser) {
|
|
|
1456
1457
|
}
|
|
1457
1458
|
var parsedStackResults, lastKeysCount, cachedFilenameChunkIds;
|
|
1458
1459
|
var init_chunk_ids = __esm({
|
|
1459
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1460
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs"() {
|
|
1460
1461
|
}
|
|
1461
1462
|
});
|
|
1462
1463
|
|
|
1463
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1464
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs
|
|
1464
1465
|
var MAX_CAUSE_RECURSION, ErrorPropertiesBuilder;
|
|
1465
1466
|
var init_error_properties_builder = __esm({
|
|
1466
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1467
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs"() {
|
|
1467
1468
|
init_utils();
|
|
1468
1469
|
init_chunk_ids();
|
|
1469
1470
|
MAX_CAUSE_RECURSION = 4;
|
|
@@ -1577,7 +1578,7 @@ var init_error_properties_builder = __esm({
|
|
|
1577
1578
|
}
|
|
1578
1579
|
});
|
|
1579
1580
|
|
|
1580
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1581
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs
|
|
1581
1582
|
function createFrame(platform, filename, func, lineno, colno) {
|
|
1582
1583
|
const frame = {
|
|
1583
1584
|
platform,
|
|
@@ -1591,16 +1592,16 @@ function createFrame(platform, filename, func, lineno, colno) {
|
|
|
1591
1592
|
}
|
|
1592
1593
|
var UNKNOWN_FUNCTION;
|
|
1593
1594
|
var init_base = __esm({
|
|
1594
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1595
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs"() {
|
|
1595
1596
|
init_utils();
|
|
1596
1597
|
UNKNOWN_FUNCTION = "?";
|
|
1597
1598
|
}
|
|
1598
1599
|
});
|
|
1599
1600
|
|
|
1600
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1601
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs
|
|
1601
1602
|
var extractSafariExtensionDetails;
|
|
1602
1603
|
var init_safari = __esm({
|
|
1603
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1604
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs"() {
|
|
1604
1605
|
init_base();
|
|
1605
1606
|
extractSafariExtensionDetails = (func, filename) => {
|
|
1606
1607
|
const isSafariExtension = -1 !== func.indexOf("safari-extension");
|
|
@@ -1616,10 +1617,10 @@ var init_safari = __esm({
|
|
|
1616
1617
|
}
|
|
1617
1618
|
});
|
|
1618
1619
|
|
|
1619
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1620
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs
|
|
1620
1621
|
var chromeRegexNoFnName, chromeRegex, chromeEvalRegex, chromeStackLineParser;
|
|
1621
1622
|
var init_chrome = __esm({
|
|
1622
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1623
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs"() {
|
|
1623
1624
|
init_base();
|
|
1624
1625
|
init_safari();
|
|
1625
1626
|
chromeRegexNoFnName = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i;
|
|
@@ -1649,23 +1650,10 @@ var init_chrome = __esm({
|
|
|
1649
1650
|
}
|
|
1650
1651
|
});
|
|
1651
1652
|
|
|
1652
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1653
|
-
var winjsRegex, winjsStackLineParser;
|
|
1654
|
-
var init_winjs = __esm({
|
|
1655
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs"() {
|
|
1656
|
-
init_base();
|
|
1657
|
-
winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
|
|
1658
|
-
winjsStackLineParser = (line, platform) => {
|
|
1659
|
-
const parts = winjsRegex.exec(line);
|
|
1660
|
-
return parts ? createFrame(platform, parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : void 0) : void 0;
|
|
1661
|
-
};
|
|
1662
|
-
}
|
|
1663
|
-
});
|
|
1664
|
-
|
|
1665
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs
|
|
1653
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs
|
|
1666
1654
|
var geckoREgex, geckoEvalRegex, geckoStackLineParser;
|
|
1667
1655
|
var init_gecko = __esm({
|
|
1668
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1656
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs"() {
|
|
1669
1657
|
init_base();
|
|
1670
1658
|
init_safari();
|
|
1671
1659
|
geckoREgex = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i;
|
|
@@ -1692,10 +1680,23 @@ var init_gecko = __esm({
|
|
|
1692
1680
|
}
|
|
1693
1681
|
});
|
|
1694
1682
|
|
|
1695
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1683
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs
|
|
1684
|
+
var winjsRegex, winjsStackLineParser;
|
|
1685
|
+
var init_winjs = __esm({
|
|
1686
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs"() {
|
|
1687
|
+
init_base();
|
|
1688
|
+
winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
|
|
1689
|
+
winjsStackLineParser = (line, platform) => {
|
|
1690
|
+
const parts = winjsRegex.exec(line);
|
|
1691
|
+
return parts ? createFrame(platform, parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : void 0) : void 0;
|
|
1692
|
+
};
|
|
1693
|
+
}
|
|
1694
|
+
});
|
|
1695
|
+
|
|
1696
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs
|
|
1696
1697
|
var opera10Regex, opera10StackLineParser, opera11Regex, opera11StackLineParser;
|
|
1697
1698
|
var init_opera = __esm({
|
|
1698
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1699
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs"() {
|
|
1699
1700
|
init_base();
|
|
1700
1701
|
opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;
|
|
1701
1702
|
opera10StackLineParser = (line, platform) => {
|
|
@@ -1710,7 +1711,7 @@ var init_opera = __esm({
|
|
|
1710
1711
|
}
|
|
1711
1712
|
});
|
|
1712
1713
|
|
|
1713
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1714
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs
|
|
1714
1715
|
function filenameIsInApp(filename, isNative = false) {
|
|
1715
1716
|
const isInternal = isNative || filename && !filename.startsWith("/") && !filename.match(/^[A-Z]:/) && !filename.startsWith(".") && !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//);
|
|
1716
1717
|
return !isInternal && void 0 !== filename && !filename.includes("node_modules/");
|
|
@@ -1720,7 +1721,7 @@ function _parseIntOrUndefined(input) {
|
|
|
1720
1721
|
}
|
|
1721
1722
|
var FILENAME_MATCH, FULL_MATCH, nodeStackLineParser;
|
|
1722
1723
|
var init_node = __esm({
|
|
1723
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1724
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs"() {
|
|
1724
1725
|
init_base();
|
|
1725
1726
|
FILENAME_MATCH = /^\s*[-]{4,}$/;
|
|
1726
1727
|
FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
|
|
@@ -1781,7 +1782,7 @@ var init_node = __esm({
|
|
|
1781
1782
|
}
|
|
1782
1783
|
});
|
|
1783
1784
|
|
|
1784
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1785
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs
|
|
1785
1786
|
function reverseAndStripFrames(stack) {
|
|
1786
1787
|
if (!stack.length) return [];
|
|
1787
1788
|
const localStack = Array.from(stack);
|
|
@@ -1795,6 +1796,9 @@ function reverseAndStripFrames(stack) {
|
|
|
1795
1796
|
function getLastStackFrame(arr) {
|
|
1796
1797
|
return arr[arr.length - 1] || {};
|
|
1797
1798
|
}
|
|
1799
|
+
function createDefaultStackParser() {
|
|
1800
|
+
return createStackParser("web:javascript", chromeStackLineParser, geckoStackLineParser);
|
|
1801
|
+
}
|
|
1798
1802
|
function createStackParser(platform, ...parsers) {
|
|
1799
1803
|
return (stack, skipFirstLines = 0) => {
|
|
1800
1804
|
const frames = [];
|
|
@@ -1819,11 +1823,11 @@ function createStackParser(platform, ...parsers) {
|
|
|
1819
1823
|
}
|
|
1820
1824
|
var WEBPACK_ERROR_REGEXP, STACKTRACE_FRAME_LIMIT;
|
|
1821
1825
|
var init_parsers = __esm({
|
|
1822
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1826
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs"() {
|
|
1823
1827
|
init_base();
|
|
1824
1828
|
init_chrome();
|
|
1825
|
-
init_winjs();
|
|
1826
1829
|
init_gecko();
|
|
1830
|
+
init_winjs();
|
|
1827
1831
|
init_opera();
|
|
1828
1832
|
init_node();
|
|
1829
1833
|
WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/;
|
|
@@ -1831,10 +1835,10 @@ var init_parsers = __esm({
|
|
|
1831
1835
|
}
|
|
1832
1836
|
});
|
|
1833
1837
|
|
|
1834
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1838
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs
|
|
1835
1839
|
var DOMExceptionCoercer;
|
|
1836
1840
|
var init_dom_exception_coercer = __esm({
|
|
1837
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1841
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs"() {
|
|
1838
1842
|
init_utils();
|
|
1839
1843
|
DOMExceptionCoercer = class {
|
|
1840
1844
|
match(err) {
|
|
@@ -1868,10 +1872,10 @@ var init_dom_exception_coercer = __esm({
|
|
|
1868
1872
|
}
|
|
1869
1873
|
});
|
|
1870
1874
|
|
|
1871
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1875
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs
|
|
1872
1876
|
var ErrorCoercer;
|
|
1873
1877
|
var init_error_coercer = __esm({
|
|
1874
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1878
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs"() {
|
|
1875
1879
|
init_utils();
|
|
1876
1880
|
ErrorCoercer = class {
|
|
1877
1881
|
match(err) {
|
|
@@ -1901,10 +1905,10 @@ var init_error_coercer = __esm({
|
|
|
1901
1905
|
}
|
|
1902
1906
|
});
|
|
1903
1907
|
|
|
1904
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1908
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs
|
|
1905
1909
|
var ErrorEventCoercer;
|
|
1906
1910
|
var init_error_event_coercer = __esm({
|
|
1907
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1911
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs"() {
|
|
1908
1912
|
init_utils();
|
|
1909
1913
|
ErrorEventCoercer = class {
|
|
1910
1914
|
constructor() {
|
|
@@ -1926,10 +1930,10 @@ var init_error_event_coercer = __esm({
|
|
|
1926
1930
|
}
|
|
1927
1931
|
});
|
|
1928
1932
|
|
|
1929
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1933
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs
|
|
1930
1934
|
var ERROR_TYPES_PATTERN, StringCoercer;
|
|
1931
1935
|
var init_string_coercer = __esm({
|
|
1932
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1936
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs"() {
|
|
1933
1937
|
ERROR_TYPES_PATTERN = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;
|
|
1934
1938
|
StringCoercer = class {
|
|
1935
1939
|
match(input) {
|
|
@@ -1961,10 +1965,10 @@ var init_string_coercer = __esm({
|
|
|
1961
1965
|
}
|
|
1962
1966
|
});
|
|
1963
1967
|
|
|
1964
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1968
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/types.mjs
|
|
1965
1969
|
var severityLevels;
|
|
1966
1970
|
var init_types2 = __esm({
|
|
1967
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1971
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/types.mjs"() {
|
|
1968
1972
|
severityLevels = [
|
|
1969
1973
|
"fatal",
|
|
1970
1974
|
"error",
|
|
@@ -1976,7 +1980,7 @@ var init_types2 = __esm({
|
|
|
1976
1980
|
}
|
|
1977
1981
|
});
|
|
1978
1982
|
|
|
1979
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1983
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs
|
|
1980
1984
|
function extractExceptionKeysForMessage(err, maxLength = 40) {
|
|
1981
1985
|
const keys = Object.keys(err);
|
|
1982
1986
|
keys.sort();
|
|
@@ -1991,14 +1995,14 @@ function extractExceptionKeysForMessage(err, maxLength = 40) {
|
|
|
1991
1995
|
return "";
|
|
1992
1996
|
}
|
|
1993
1997
|
var init_utils2 = __esm({
|
|
1994
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1998
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs"() {
|
|
1995
1999
|
}
|
|
1996
2000
|
});
|
|
1997
2001
|
|
|
1998
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2002
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs
|
|
1999
2003
|
var ObjectCoercer;
|
|
2000
2004
|
var init_object_coercer = __esm({
|
|
2001
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2005
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs"() {
|
|
2002
2006
|
init_utils();
|
|
2003
2007
|
init_types2();
|
|
2004
2008
|
init_utils2();
|
|
@@ -2052,10 +2056,10 @@ var init_object_coercer = __esm({
|
|
|
2052
2056
|
}
|
|
2053
2057
|
});
|
|
2054
2058
|
|
|
2055
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2059
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs
|
|
2056
2060
|
var EventCoercer;
|
|
2057
2061
|
var init_event_coercer = __esm({
|
|
2058
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2062
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs"() {
|
|
2059
2063
|
init_utils();
|
|
2060
2064
|
init_utils2();
|
|
2061
2065
|
EventCoercer = class {
|
|
@@ -2075,10 +2079,10 @@ var init_event_coercer = __esm({
|
|
|
2075
2079
|
}
|
|
2076
2080
|
});
|
|
2077
2081
|
|
|
2078
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2082
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs
|
|
2079
2083
|
var PrimitiveCoercer;
|
|
2080
2084
|
var init_primitive_coercer = __esm({
|
|
2081
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2085
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs"() {
|
|
2082
2086
|
init_utils();
|
|
2083
2087
|
PrimitiveCoercer = class {
|
|
2084
2088
|
match(candidate) {
|
|
@@ -2096,10 +2100,10 @@ var init_primitive_coercer = __esm({
|
|
|
2096
2100
|
}
|
|
2097
2101
|
});
|
|
2098
2102
|
|
|
2099
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2103
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs
|
|
2100
2104
|
var PromiseRejectionEventCoercer;
|
|
2101
2105
|
var init_promise_rejection_event = __esm({
|
|
2102
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2106
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs"() {
|
|
2103
2107
|
init_utils();
|
|
2104
2108
|
PromiseRejectionEventCoercer = class {
|
|
2105
2109
|
match(err) {
|
|
@@ -2128,9 +2132,9 @@ var init_promise_rejection_event = __esm({
|
|
|
2128
2132
|
}
|
|
2129
2133
|
});
|
|
2130
2134
|
|
|
2131
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2135
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/index.mjs
|
|
2132
2136
|
var init_coercers = __esm({
|
|
2133
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2137
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/index.mjs"() {
|
|
2134
2138
|
init_dom_exception_coercer();
|
|
2135
2139
|
init_error_coercer();
|
|
2136
2140
|
init_error_event_coercer();
|
|
@@ -2142,10 +2146,10 @@ var init_coercers = __esm({
|
|
|
2142
2146
|
}
|
|
2143
2147
|
});
|
|
2144
2148
|
|
|
2145
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2149
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/utils.mjs
|
|
2146
2150
|
var ReduceableCache;
|
|
2147
2151
|
var init_utils3 = __esm({
|
|
2148
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2152
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/utils.mjs"() {
|
|
2149
2153
|
ReduceableCache = class {
|
|
2150
2154
|
constructor(_maxSize) {
|
|
2151
2155
|
this._maxSize = _maxSize;
|
|
@@ -2171,7 +2175,7 @@ var init_utils3 = __esm({
|
|
|
2171
2175
|
}
|
|
2172
2176
|
});
|
|
2173
2177
|
|
|
2174
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2178
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/index.mjs
|
|
2175
2179
|
var error_tracking_exports = {};
|
|
2176
2180
|
__export(error_tracking_exports, {
|
|
2177
2181
|
DOMExceptionCoercer: () => DOMExceptionCoercer,
|
|
@@ -2185,6 +2189,7 @@ __export(error_tracking_exports, {
|
|
|
2185
2189
|
ReduceableCache: () => ReduceableCache,
|
|
2186
2190
|
StringCoercer: () => StringCoercer,
|
|
2187
2191
|
chromeStackLineParser: () => chromeStackLineParser,
|
|
2192
|
+
createDefaultStackParser: () => createDefaultStackParser,
|
|
2188
2193
|
createStackParser: () => createStackParser,
|
|
2189
2194
|
geckoStackLineParser: () => geckoStackLineParser,
|
|
2190
2195
|
nodeStackLineParser: () => nodeStackLineParser,
|
|
@@ -2194,7 +2199,7 @@ __export(error_tracking_exports, {
|
|
|
2194
2199
|
winjsStackLineParser: () => winjsStackLineParser
|
|
2195
2200
|
});
|
|
2196
2201
|
var init_error_tracking = __esm({
|
|
2197
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2202
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/index.mjs"() {
|
|
2198
2203
|
init_error_properties_builder();
|
|
2199
2204
|
init_parsers();
|
|
2200
2205
|
init_coercers();
|
|
@@ -2202,9 +2207,9 @@ var init_error_tracking = __esm({
|
|
|
2202
2207
|
}
|
|
2203
2208
|
});
|
|
2204
2209
|
|
|
2205
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2210
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/index.mjs
|
|
2206
2211
|
var init_dist = __esm({
|
|
2207
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2212
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/index.mjs"() {
|
|
2208
2213
|
init_featureFlagUtils();
|
|
2209
2214
|
init_uuidv7();
|
|
2210
2215
|
init_utils();
|
|
@@ -2395,7 +2400,7 @@ function snipLine(line, colno) {
|
|
|
2395
2400
|
}
|
|
2396
2401
|
var LRU_FILE_CONTENTS_CACHE, LRU_FILE_CONTENTS_FS_READ_FAILED, DEFAULT_LINES_OF_CONTEXT, MAX_CONTEXTLINES_COLNO, MAX_CONTEXTLINES_LINENO;
|
|
2397
2402
|
var init_context_lines_node = __esm({
|
|
2398
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2403
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/context-lines.node.mjs"() {
|
|
2399
2404
|
init_dist();
|
|
2400
2405
|
LRU_FILE_CONTENTS_CACHE = new error_tracking_exports.ReduceableCache(25);
|
|
2401
2406
|
LRU_FILE_CONTENTS_FS_READ_FAILED = new error_tracking_exports.ReduceableCache(20);
|
|
@@ -2405,7 +2410,7 @@ var init_context_lines_node = __esm({
|
|
|
2405
2410
|
}
|
|
2406
2411
|
});
|
|
2407
2412
|
|
|
2408
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2413
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs
|
|
2409
2414
|
function makeUncaughtExceptionHandler(captureFn, onFatalFn) {
|
|
2410
2415
|
let calledFatalError = false;
|
|
2411
2416
|
return Object.assign((error) => {
|
|
@@ -2437,14 +2442,14 @@ function addUnhandledRejectionListener(captureFn) {
|
|
|
2437
2442
|
}));
|
|
2438
2443
|
}
|
|
2439
2444
|
var init_autocapture = __esm({
|
|
2440
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2445
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs"() {
|
|
2441
2446
|
}
|
|
2442
2447
|
});
|
|
2443
2448
|
|
|
2444
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2449
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs
|
|
2445
2450
|
var SHUTDOWN_TIMEOUT, ErrorTracking;
|
|
2446
2451
|
var init_error_tracking2 = __esm({
|
|
2447
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2452
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs"() {
|
|
2448
2453
|
init_autocapture();
|
|
2449
2454
|
init_dist();
|
|
2450
2455
|
SHUTDOWN_TIMEOUT = 2e3;
|
|
@@ -2461,6 +2466,9 @@ var init_error_tracking2 = __esm({
|
|
|
2461
2466
|
});
|
|
2462
2467
|
this.startAutocaptureIfEnabled();
|
|
2463
2468
|
}
|
|
2469
|
+
static isPreviouslyCapturedError(x) {
|
|
2470
|
+
return isObject(x) && "__posthog_previously_captured_error" in x && true === x.__posthog_previously_captured_error;
|
|
2471
|
+
}
|
|
2464
2472
|
static async buildEventMessage(error, hint, distinctId, additionalProperties) {
|
|
2465
2473
|
const properties = {
|
|
2466
2474
|
...additionalProperties
|
|
@@ -2485,14 +2493,16 @@ var init_error_tracking2 = __esm({
|
|
|
2485
2493
|
}
|
|
2486
2494
|
onException(exception, hint) {
|
|
2487
2495
|
this.client.addPendingPromise((async () => {
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
exception
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
+
if (!_ErrorTracking.isPreviouslyCapturedError(exception)) {
|
|
2497
|
+
const eventMessage = await _ErrorTracking.buildEventMessage(exception, hint);
|
|
2498
|
+
const exceptionProperties = eventMessage.properties;
|
|
2499
|
+
const exceptionType = exceptionProperties?.$exception_list[0]?.type ?? "Exception";
|
|
2500
|
+
const isRateLimited = this._rateLimiter.consumeRateLimit(exceptionType);
|
|
2501
|
+
if (isRateLimited) return void this._logger.info("Skipping exception capture because of client rate limiting.", {
|
|
2502
|
+
exception: exceptionType
|
|
2503
|
+
});
|
|
2504
|
+
return this.client.capture(eventMessage);
|
|
2505
|
+
}
|
|
2496
2506
|
})());
|
|
2497
2507
|
}
|
|
2498
2508
|
async onFatalError(exception) {
|
|
@@ -2510,18 +2520,18 @@ var init_error_tracking2 = __esm({
|
|
|
2510
2520
|
}
|
|
2511
2521
|
});
|
|
2512
2522
|
|
|
2513
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2523
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/version.mjs
|
|
2514
2524
|
var version;
|
|
2515
2525
|
var init_version = __esm({
|
|
2516
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2517
|
-
version = "5.
|
|
2526
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/version.mjs"() {
|
|
2527
|
+
version = "5.21.0";
|
|
2518
2528
|
}
|
|
2519
2529
|
});
|
|
2520
2530
|
|
|
2521
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2531
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/types.mjs
|
|
2522
2532
|
var FeatureFlagError;
|
|
2523
2533
|
var init_types3 = __esm({
|
|
2524
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2534
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/types.mjs"() {
|
|
2525
2535
|
FeatureFlagError = {
|
|
2526
2536
|
ERRORS_WHILE_COMPUTING: "errors_while_computing_flags",
|
|
2527
2537
|
FLAG_MISSING: "flag_missing",
|
|
@@ -2531,7 +2541,7 @@ var init_types3 = __esm({
|
|
|
2531
2541
|
}
|
|
2532
2542
|
});
|
|
2533
2543
|
|
|
2534
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2544
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs
|
|
2535
2545
|
async function hashSHA1(text) {
|
|
2536
2546
|
const subtle = globalThis.crypto?.subtle;
|
|
2537
2547
|
if (!subtle) throw new Error("SubtleCrypto API not available");
|
|
@@ -2540,11 +2550,11 @@ async function hashSHA1(text) {
|
|
|
2540
2550
|
return hashArray.map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
2541
2551
|
}
|
|
2542
2552
|
var init_crypto = __esm({
|
|
2543
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2553
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs"() {
|
|
2544
2554
|
}
|
|
2545
2555
|
});
|
|
2546
2556
|
|
|
2547
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2557
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs
|
|
2548
2558
|
async function _hash(key, distinctId, salt = "") {
|
|
2549
2559
|
const hashString = await hashSHA1(`${key}.${distinctId}${salt}`);
|
|
2550
2560
|
return parseInt(hashString.slice(0, 15), 16) / LONG_SCALE;
|
|
@@ -2712,7 +2722,7 @@ function relativeDateParseForFeatureFlagMatching(value) {
|
|
|
2712
2722
|
}
|
|
2713
2723
|
var SIXTY_SECONDS, LONG_SCALE, NULL_VALUES_ALLOWED_OPERATORS, ClientError, InconclusiveMatchError, RequiresServerEvaluation, FeatureFlagsPoller;
|
|
2714
2724
|
var init_feature_flags = __esm({
|
|
2715
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2725
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs"() {
|
|
2716
2726
|
init_dist();
|
|
2717
2727
|
init_crypto();
|
|
2718
2728
|
SIXTY_SECONDS = 6e4;
|
|
@@ -2766,6 +2776,7 @@ var init_feature_flags = __esm({
|
|
|
2766
2776
|
this.customHeaders = customHeaders;
|
|
2767
2777
|
this.onLoad = options.onLoad;
|
|
2768
2778
|
this.cacheProvider = options.cacheProvider;
|
|
2779
|
+
this.strictLocalEvaluation = options.strictLocalEvaluation ?? false;
|
|
2769
2780
|
this.loadFeatureFlags();
|
|
2770
2781
|
}
|
|
2771
2782
|
debug(enabled = true) {
|
|
@@ -2961,6 +2972,11 @@ var init_feature_flags = __esm({
|
|
|
2961
2972
|
this.cohorts = flagData.cohorts;
|
|
2962
2973
|
this.loadedSuccessfullyOnce = true;
|
|
2963
2974
|
}
|
|
2975
|
+
warnAboutExperienceContinuityFlags(flags) {
|
|
2976
|
+
if (this.strictLocalEvaluation) return;
|
|
2977
|
+
const experienceContinuityFlags = flags.filter((f) => f.ensure_experience_continuity);
|
|
2978
|
+
if (experienceContinuityFlags.length > 0) console.warn(`[PostHog] You are using local evaluation but ${experienceContinuityFlags.length} flag(s) have experience continuity enabled: ${experienceContinuityFlags.map((f) => f.key).join(", ")}. Experience continuity is incompatible with local evaluation and will cause a server request on every flag evaluation, negating local evaluation cost savings. To avoid server requests and unexpected costs, either disable experience continuity on these flags in PostHog, use strictLocalEvaluation: true in client init, or pass onlyEvaluateLocally: true per flag call (flags that cannot be evaluated locally will return undefined).`);
|
|
2979
|
+
}
|
|
2964
2980
|
async loadFromCache(debugMessage) {
|
|
2965
2981
|
if (!this.cacheProvider) return false;
|
|
2966
2982
|
try {
|
|
@@ -2969,6 +2985,7 @@ var init_feature_flags = __esm({
|
|
|
2969
2985
|
this.updateFlagState(cached);
|
|
2970
2986
|
this.logMsgIfDebug(() => console.debug(`[FEATURE FLAGS] ${debugMessage} (${cached.flags.length} flags)`));
|
|
2971
2987
|
this.onLoad?.(this.featureFlags.length);
|
|
2988
|
+
this.warnAboutExperienceContinuityFlags(cached.flags);
|
|
2972
2989
|
return true;
|
|
2973
2990
|
}
|
|
2974
2991
|
return false;
|
|
@@ -3062,6 +3079,7 @@ var init_feature_flags = __esm({
|
|
|
3062
3079
|
this.onError?.(new Error(`Failed to store in cache: ${err}`));
|
|
3063
3080
|
}
|
|
3064
3081
|
this.onLoad?.(this.featureFlags.length);
|
|
3082
|
+
this.warnAboutExperienceContinuityFlags(flagData.flags);
|
|
3065
3083
|
break;
|
|
3066
3084
|
}
|
|
3067
3085
|
default:
|
|
@@ -3117,10 +3135,10 @@ var init_feature_flags = __esm({
|
|
|
3117
3135
|
}
|
|
3118
3136
|
});
|
|
3119
3137
|
|
|
3120
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3138
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/storage-memory.mjs
|
|
3121
3139
|
var PostHogMemoryStorage;
|
|
3122
3140
|
var init_storage_memory = __esm({
|
|
3123
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3141
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/storage-memory.mjs"() {
|
|
3124
3142
|
PostHogMemoryStorage = class {
|
|
3125
3143
|
getProperty(key) {
|
|
3126
3144
|
return this._memoryStorage[key];
|
|
@@ -3135,10 +3153,10 @@ var init_storage_memory = __esm({
|
|
|
3135
3153
|
}
|
|
3136
3154
|
});
|
|
3137
3155
|
|
|
3138
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3156
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/client.mjs
|
|
3139
3157
|
var MINIMUM_POLLING_INTERVAL, THIRTY_SECONDS, MAX_CACHE_SIZE, PostHogBackendClient;
|
|
3140
3158
|
var init_client = __esm({
|
|
3141
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3159
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/client.mjs"() {
|
|
3142
3160
|
init_version();
|
|
3143
3161
|
init_dist();
|
|
3144
3162
|
init_types3();
|
|
@@ -3171,7 +3189,8 @@ var init_client = __esm({
|
|
|
3171
3189
|
this._events.emit("localEvaluationFlagsLoaded", count);
|
|
3172
3190
|
},
|
|
3173
3191
|
customHeaders: this.getCustomHeaders(),
|
|
3174
|
-
cacheProvider: options.flagDefinitionCacheProvider
|
|
3192
|
+
cacheProvider: options.flagDefinitionCacheProvider,
|
|
3193
|
+
strictLocalEvaluation: options.strictLocalEvaluation
|
|
3175
3194
|
});
|
|
3176
3195
|
}
|
|
3177
3196
|
this.errorTracking = new ErrorTracking(this, options, this._logger);
|
|
@@ -3278,12 +3297,13 @@ var init_client = __esm({
|
|
|
3278
3297
|
});
|
|
3279
3298
|
}
|
|
3280
3299
|
async getFeatureFlag(key, distinctId, options) {
|
|
3300
|
+
if (void 0 !== this._flagOverrides && key in this._flagOverrides) return this._flagOverrides[key];
|
|
3281
3301
|
const { groups, disableGeoip } = options || {};
|
|
3282
3302
|
let { onlyEvaluateLocally, sendFeatureFlagEvents, personProperties, groupProperties } = options || {};
|
|
3283
3303
|
const adjustedProperties = this.addLocalPersonAndGroupProperties(distinctId, groups, personProperties, groupProperties);
|
|
3284
3304
|
personProperties = adjustedProperties.allPersonProperties;
|
|
3285
3305
|
groupProperties = adjustedProperties.allGroupProperties;
|
|
3286
|
-
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = false;
|
|
3306
|
+
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;
|
|
3287
3307
|
if (void 0 == sendFeatureFlagEvents) sendFeatureFlagEvents = this.options.sendFeatureFlagEvent ?? true;
|
|
3288
3308
|
let response = await this.featureFlagsPoller?.getFeatureFlag(key, distinctId, groups, personProperties, groupProperties);
|
|
3289
3309
|
const flagWasLocallyEvaluated = void 0 !== response;
|
|
@@ -3338,6 +3358,7 @@ var init_client = __esm({
|
|
|
3338
3358
|
return response;
|
|
3339
3359
|
}
|
|
3340
3360
|
async getFeatureFlagPayload(key, distinctId, matchValue, options) {
|
|
3361
|
+
if (void 0 !== this._payloadOverrides && key in this._payloadOverrides) return this._payloadOverrides[key];
|
|
3341
3362
|
const { groups, disableGeoip } = options || {};
|
|
3342
3363
|
let { onlyEvaluateLocally, personProperties, groupProperties } = options || {};
|
|
3343
3364
|
const adjustedProperties = this.addLocalPersonAndGroupProperties(distinctId, groups, personProperties, groupProperties);
|
|
@@ -3359,7 +3380,7 @@ var init_client = __esm({
|
|
|
3359
3380
|
else throw e;
|
|
3360
3381
|
}
|
|
3361
3382
|
}
|
|
3362
|
-
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = false;
|
|
3383
|
+
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;
|
|
3363
3384
|
const payloadWasLocallyEvaluated = void 0 !== response;
|
|
3364
3385
|
if (!payloadWasLocallyEvaluated && !onlyEvaluateLocally) response = await super.getFeatureFlagPayloadStateless(key, distinctId, groups, personProperties, groupProperties, disableGeoip);
|
|
3365
3386
|
return response;
|
|
@@ -3390,7 +3411,7 @@ var init_client = __esm({
|
|
|
3390
3411
|
const adjustedProperties = this.addLocalPersonAndGroupProperties(distinctId, groups, personProperties, groupProperties);
|
|
3391
3412
|
personProperties = adjustedProperties.allPersonProperties;
|
|
3392
3413
|
groupProperties = adjustedProperties.allGroupProperties;
|
|
3393
|
-
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = false;
|
|
3414
|
+
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;
|
|
3394
3415
|
const localEvaluationResult = await this.featureFlagsPoller?.getAllFlagsAndPayloads(distinctId, groups, personProperties, groupProperties, flagKeys);
|
|
3395
3416
|
let featureFlags = {};
|
|
3396
3417
|
let featureFlagPayloads = {};
|
|
@@ -3411,6 +3432,14 @@ var init_client = __esm({
|
|
|
3411
3432
|
...remoteEvaluationResult.payloads || {}
|
|
3412
3433
|
};
|
|
3413
3434
|
}
|
|
3435
|
+
if (void 0 !== this._flagOverrides) featureFlags = {
|
|
3436
|
+
...featureFlags,
|
|
3437
|
+
...this._flagOverrides
|
|
3438
|
+
};
|
|
3439
|
+
if (void 0 !== this._payloadOverrides) featureFlagPayloads = {
|
|
3440
|
+
...featureFlagPayloads,
|
|
3441
|
+
...this._payloadOverrides
|
|
3442
|
+
};
|
|
3414
3443
|
return {
|
|
3415
3444
|
featureFlags,
|
|
3416
3445
|
featureFlagPayloads
|
|
@@ -3424,6 +3453,53 @@ var init_client = __esm({
|
|
|
3424
3453
|
async reloadFeatureFlags() {
|
|
3425
3454
|
await this.featureFlagsPoller?.loadFeatureFlags(true);
|
|
3426
3455
|
}
|
|
3456
|
+
overrideFeatureFlags(overrides) {
|
|
3457
|
+
const flagArrayToRecord = (flags) => Object.fromEntries(flags.map((f) => [
|
|
3458
|
+
f,
|
|
3459
|
+
true
|
|
3460
|
+
]));
|
|
3461
|
+
if (false === overrides) {
|
|
3462
|
+
this._flagOverrides = void 0;
|
|
3463
|
+
this._payloadOverrides = void 0;
|
|
3464
|
+
return;
|
|
3465
|
+
}
|
|
3466
|
+
if (Array.isArray(overrides)) {
|
|
3467
|
+
this._flagOverrides = flagArrayToRecord(overrides);
|
|
3468
|
+
return;
|
|
3469
|
+
}
|
|
3470
|
+
if (this._isFeatureFlagOverrideOptions(overrides)) {
|
|
3471
|
+
if ("flags" in overrides) {
|
|
3472
|
+
if (false === overrides.flags) this._flagOverrides = void 0;
|
|
3473
|
+
else if (Array.isArray(overrides.flags)) this._flagOverrides = flagArrayToRecord(overrides.flags);
|
|
3474
|
+
else if (void 0 !== overrides.flags) this._flagOverrides = {
|
|
3475
|
+
...overrides.flags
|
|
3476
|
+
};
|
|
3477
|
+
}
|
|
3478
|
+
if ("payloads" in overrides) {
|
|
3479
|
+
if (false === overrides.payloads) this._payloadOverrides = void 0;
|
|
3480
|
+
else if (void 0 !== overrides.payloads) this._payloadOverrides = {
|
|
3481
|
+
...overrides.payloads
|
|
3482
|
+
};
|
|
3483
|
+
}
|
|
3484
|
+
return;
|
|
3485
|
+
}
|
|
3486
|
+
this._flagOverrides = {
|
|
3487
|
+
...overrides
|
|
3488
|
+
};
|
|
3489
|
+
}
|
|
3490
|
+
_isFeatureFlagOverrideOptions(overrides) {
|
|
3491
|
+
if ("object" != typeof overrides || null === overrides || Array.isArray(overrides)) return false;
|
|
3492
|
+
const obj = overrides;
|
|
3493
|
+
if ("flags" in obj) {
|
|
3494
|
+
const flagsValue = obj["flags"];
|
|
3495
|
+
if (false === flagsValue || Array.isArray(flagsValue) || "object" == typeof flagsValue && null !== flagsValue) return true;
|
|
3496
|
+
}
|
|
3497
|
+
if ("payloads" in obj) {
|
|
3498
|
+
const payloadsValue = obj["payloads"];
|
|
3499
|
+
if (false === payloadsValue || "object" == typeof payloadsValue && null !== payloadsValue) return true;
|
|
3500
|
+
}
|
|
3501
|
+
return false;
|
|
3502
|
+
}
|
|
3427
3503
|
withContext(data, fn, options) {
|
|
3428
3504
|
if (!this.context) return fn();
|
|
3429
3505
|
return this.context.run(data, fn, options);
|
|
@@ -3485,7 +3561,7 @@ var init_client = __esm({
|
|
|
3485
3561
|
const finalPersonProperties = sendFeatureFlagsOptions?.personProperties || {};
|
|
3486
3562
|
const finalGroupProperties = sendFeatureFlagsOptions?.groupProperties || {};
|
|
3487
3563
|
const flagKeys = sendFeatureFlagsOptions?.flagKeys;
|
|
3488
|
-
const onlyEvaluateLocally = sendFeatureFlagsOptions?.onlyEvaluateLocally ?? false;
|
|
3564
|
+
const onlyEvaluateLocally = sendFeatureFlagsOptions?.onlyEvaluateLocally ?? this.options.strictLocalEvaluation ?? false;
|
|
3489
3565
|
if (onlyEvaluateLocally) if (!((this.featureFlagsPoller?.featureFlags?.length || 0) > 0)) return {};
|
|
3490
3566
|
else {
|
|
3491
3567
|
const groupsWithStringValues = {};
|
|
@@ -3528,17 +3604,24 @@ var init_client = __esm({
|
|
|
3528
3604
|
allGroupProperties
|
|
3529
3605
|
};
|
|
3530
3606
|
}
|
|
3531
|
-
captureException(error, distinctId, additionalProperties) {
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3607
|
+
captureException(error, distinctId, additionalProperties, uuid) {
|
|
3608
|
+
if (!ErrorTracking.isPreviouslyCapturedError(error)) {
|
|
3609
|
+
const syntheticException = new Error("PostHog syntheticException");
|
|
3610
|
+
this.addPendingPromise(ErrorTracking.buildEventMessage(error, {
|
|
3611
|
+
syntheticException
|
|
3612
|
+
}, distinctId, additionalProperties).then((msg) => this.capture({
|
|
3613
|
+
...msg,
|
|
3614
|
+
uuid
|
|
3615
|
+
})));
|
|
3616
|
+
}
|
|
3536
3617
|
}
|
|
3537
3618
|
async captureExceptionImmediate(error, distinctId, additionalProperties) {
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3619
|
+
if (!ErrorTracking.isPreviouslyCapturedError(error)) {
|
|
3620
|
+
const syntheticException = new Error("PostHog syntheticException");
|
|
3621
|
+
this.addPendingPromise(ErrorTracking.buildEventMessage(error, {
|
|
3622
|
+
syntheticException
|
|
3623
|
+
}, distinctId, additionalProperties).then((msg) => this.captureImmediate(msg)));
|
|
3624
|
+
}
|
|
3542
3625
|
}
|
|
3543
3626
|
async prepareEventMessage(props) {
|
|
3544
3627
|
const { distinctId, event, properties, groups, sendFeatureFlags, timestamp, disableGeoip, uuid } = props;
|
|
@@ -3627,7 +3710,7 @@ var init_client = __esm({
|
|
|
3627
3710
|
});
|
|
3628
3711
|
var PostHogContext;
|
|
3629
3712
|
var init_context = __esm({
|
|
3630
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3713
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/context/context.mjs"() {
|
|
3631
3714
|
PostHogContext = class {
|
|
3632
3715
|
constructor() {
|
|
3633
3716
|
this.storage = new AsyncLocalStorage();
|
|
@@ -3655,7 +3738,7 @@ var init_context = __esm({
|
|
|
3655
3738
|
}
|
|
3656
3739
|
});
|
|
3657
3740
|
|
|
3658
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3741
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/sentry-integration.mjs
|
|
3659
3742
|
function createEventProcessor(_posthog, { organization, projectId, prefix, severityAllowList = [
|
|
3660
3743
|
"error"
|
|
3661
3744
|
], sendExceptionsToPostHog = true } = {}) {
|
|
@@ -3711,7 +3794,7 @@ function sentryIntegration(_posthog, options) {
|
|
|
3711
3794
|
}
|
|
3712
3795
|
var NAME, PostHogSentryIntegration;
|
|
3713
3796
|
var init_sentry_integration = __esm({
|
|
3714
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3797
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/sentry-integration.mjs"() {
|
|
3715
3798
|
NAME = "posthog-node";
|
|
3716
3799
|
PostHogSentryIntegration = class {
|
|
3717
3800
|
static #_ = this.POSTHOG_ID_TAG = "posthog_distinct_id";
|
|
@@ -3733,12 +3816,13 @@ var init_sentry_integration = __esm({
|
|
|
3733
3816
|
}
|
|
3734
3817
|
});
|
|
3735
3818
|
|
|
3736
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3819
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/express.mjs
|
|
3737
3820
|
function setupExpressErrorHandler(_posthog, app) {
|
|
3738
3821
|
app.use(posthogErrorHandler(_posthog));
|
|
3739
3822
|
}
|
|
3740
3823
|
function posthogErrorHandler(posthog) {
|
|
3741
3824
|
return (error, req, res, next) => {
|
|
3825
|
+
if (ErrorTracking.isPreviouslyCapturedError(error)) return void next(error);
|
|
3742
3826
|
const sessionId = req.headers["x-posthog-session-id"];
|
|
3743
3827
|
const distinctId = req.headers["x-posthog-distinct-id"];
|
|
3744
3828
|
const syntheticException = new Error("Synthetic exception");
|
|
@@ -3764,21 +3848,21 @@ function posthogErrorHandler(posthog) {
|
|
|
3764
3848
|
};
|
|
3765
3849
|
}
|
|
3766
3850
|
var init_express = __esm({
|
|
3767
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3851
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/express.mjs"() {
|
|
3768
3852
|
init_error_tracking2();
|
|
3769
3853
|
}
|
|
3770
3854
|
});
|
|
3771
3855
|
|
|
3772
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3856
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/exports.mjs
|
|
3773
3857
|
var init_exports = __esm({
|
|
3774
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3858
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/exports.mjs"() {
|
|
3775
3859
|
init_sentry_integration();
|
|
3776
3860
|
init_express();
|
|
3777
3861
|
init_types3();
|
|
3778
3862
|
}
|
|
3779
3863
|
});
|
|
3780
3864
|
|
|
3781
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3865
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/entrypoints/index.node.mjs
|
|
3782
3866
|
var index_node_exports = {};
|
|
3783
3867
|
__export(index_node_exports, {
|
|
3784
3868
|
FeatureFlagError: () => FeatureFlagError,
|
|
@@ -3790,7 +3874,7 @@ __export(index_node_exports, {
|
|
|
3790
3874
|
});
|
|
3791
3875
|
var PostHog;
|
|
3792
3876
|
var init_index_node = __esm({
|
|
3793
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3877
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/entrypoints/index.node.mjs"() {
|
|
3794
3878
|
init_module_node();
|
|
3795
3879
|
init_context_lines_node();
|
|
3796
3880
|
init_error_tracking2();
|
|
@@ -5081,9 +5165,9 @@ var require_dist2 = __commonJS({
|
|
|
5081
5165
|
}
|
|
5082
5166
|
});
|
|
5083
5167
|
|
|
5084
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5168
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/package.json
|
|
5085
5169
|
var require_package = __commonJS({
|
|
5086
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5170
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/package.json"(exports$1, module) {
|
|
5087
5171
|
module.exports = {
|
|
5088
5172
|
name: "mixpanel",
|
|
5089
5173
|
description: "A simple server-side API for mixpanel",
|
|
@@ -5093,7 +5177,7 @@ var require_package = __commonJS({
|
|
|
5093
5177
|
"api",
|
|
5094
5178
|
"stats"
|
|
5095
5179
|
],
|
|
5096
|
-
version: "0.
|
|
5180
|
+
version: "0.20.0",
|
|
5097
5181
|
homepage: "https://github.com/mixpanel/mixpanel-node",
|
|
5098
5182
|
author: "Carl Sverre",
|
|
5099
5183
|
license: "MIT",
|
|
@@ -5109,29 +5193,35 @@ var require_package = __commonJS({
|
|
|
5109
5193
|
node: ">=10.0"
|
|
5110
5194
|
},
|
|
5111
5195
|
scripts: {
|
|
5112
|
-
test: "vitest"
|
|
5196
|
+
test: "vitest",
|
|
5197
|
+
format: "prettier --write .",
|
|
5198
|
+
"check-format": "prettier --check .",
|
|
5199
|
+
lint: "oxlint ."
|
|
5113
5200
|
},
|
|
5114
5201
|
types: "./lib/mixpanel-node.d.ts",
|
|
5115
5202
|
devDependencies: {
|
|
5116
5203
|
"@types/node": "^24.10.1",
|
|
5117
5204
|
"@vitest/coverage-v8": "^4.0.8",
|
|
5118
5205
|
nock: "^14.0.10",
|
|
5206
|
+
oxlint: "^1.16.0",
|
|
5207
|
+
prettier: "^3.6.2",
|
|
5119
5208
|
proxyquire: "^2.1.3",
|
|
5120
5209
|
typescript: "^5.9.3",
|
|
5121
5210
|
vitest: "^4.0.8"
|
|
5122
5211
|
},
|
|
5123
5212
|
dependencies: {
|
|
5124
|
-
"https-proxy-agent": "7.0.6"
|
|
5213
|
+
"https-proxy-agent": "7.0.6",
|
|
5214
|
+
"json-logic-js": "2.0.5"
|
|
5125
5215
|
}
|
|
5126
5216
|
};
|
|
5127
5217
|
}
|
|
5128
5218
|
});
|
|
5129
5219
|
|
|
5130
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5220
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/utils.js
|
|
5131
5221
|
var require_utils = __commonJS({
|
|
5132
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5222
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/utils.js"(exports$1) {
|
|
5133
5223
|
exports$1.async_all = function(requests, handler, callback) {
|
|
5134
|
-
|
|
5224
|
+
let total = requests.length, errors = null, results = [], done = function(err, result) {
|
|
5135
5225
|
if (err) {
|
|
5136
5226
|
errors = errors || [];
|
|
5137
5227
|
errors.push(err);
|
|
@@ -5144,14 +5234,16 @@ var require_utils = __commonJS({
|
|
|
5144
5234
|
if (total === 0) {
|
|
5145
5235
|
callback(errors, results);
|
|
5146
5236
|
} else {
|
|
5147
|
-
for (
|
|
5237
|
+
for (let i = 0, l = requests.length; i < l; i++) {
|
|
5148
5238
|
handler(requests[i], done);
|
|
5149
5239
|
}
|
|
5150
5240
|
}
|
|
5151
5241
|
};
|
|
5152
5242
|
exports$1.ensure_timestamp = function(time) {
|
|
5153
5243
|
if (!(time instanceof Date || typeof time === "number")) {
|
|
5154
|
-
throw new Error(
|
|
5244
|
+
throw new Error(
|
|
5245
|
+
"`time` property must be a Date or Unix timestamp and is only required for `import` endpoint"
|
|
5246
|
+
);
|
|
5155
5247
|
}
|
|
5156
5248
|
return time instanceof Date ? time.getTime() : time;
|
|
5157
5249
|
};
|
|
@@ -5168,9 +5260,9 @@ var require_utils = __commonJS({
|
|
|
5168
5260
|
}
|
|
5169
5261
|
});
|
|
5170
5262
|
|
|
5171
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5263
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/profile_helpers.js
|
|
5172
5264
|
var require_profile_helpers = __commonJS({
|
|
5173
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5265
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/profile_helpers.js"(exports$1) {
|
|
5174
5266
|
var { ensure_timestamp } = require_utils();
|
|
5175
5267
|
function merge_modifiers(data, modifiers) {
|
|
5176
5268
|
if (modifiers) {
|
|
@@ -5218,7 +5310,7 @@ var require_profile_helpers = __commonJS({
|
|
|
5218
5310
|
}
|
|
5219
5311
|
}
|
|
5220
5312
|
let data = {
|
|
5221
|
-
|
|
5313
|
+
$token: this.token,
|
|
5222
5314
|
...identifiers
|
|
5223
5315
|
};
|
|
5224
5316
|
const set_key = set_once ? "$set_once" : "$set";
|
|
@@ -5233,14 +5325,20 @@ var require_profile_helpers = __commonJS({
|
|
|
5233
5325
|
}
|
|
5234
5326
|
data = merge_modifiers(data, modifiers);
|
|
5235
5327
|
if (this.config.debug) {
|
|
5236
|
-
this.mixpanel.config.logger.debug(
|
|
5328
|
+
this.mixpanel.config.logger.debug(
|
|
5329
|
+
`Sending the following data to Mixpanel (${this.endpoint})`,
|
|
5330
|
+
{ data }
|
|
5331
|
+
);
|
|
5237
5332
|
}
|
|
5238
|
-
this.mixpanel.send_request(
|
|
5333
|
+
this.mixpanel.send_request(
|
|
5334
|
+
{ method: "GET", endpoint: this.endpoint, data },
|
|
5335
|
+
callback
|
|
5336
|
+
);
|
|
5239
5337
|
}
|
|
5240
5338
|
_delete_profile({ identifiers, modifiers, callback }) {
|
|
5241
5339
|
let data = {
|
|
5242
|
-
|
|
5243
|
-
|
|
5340
|
+
$delete: "",
|
|
5341
|
+
$token: this.token,
|
|
5244
5342
|
...identifiers
|
|
5245
5343
|
};
|
|
5246
5344
|
if (typeof modifiers === "function") {
|
|
@@ -5250,13 +5348,18 @@ var require_profile_helpers = __commonJS({
|
|
|
5250
5348
|
if (this.config.debug) {
|
|
5251
5349
|
this.mixpanel.config.logger.debug("Deleting profile", { identifiers });
|
|
5252
5350
|
}
|
|
5253
|
-
this.mixpanel.send_request(
|
|
5351
|
+
this.mixpanel.send_request(
|
|
5352
|
+
{ method: "GET", endpoint: this.endpoint, data },
|
|
5353
|
+
callback
|
|
5354
|
+
);
|
|
5254
5355
|
}
|
|
5255
5356
|
_remove({ identifiers, data, modifiers, callback }) {
|
|
5256
5357
|
let $remove = {};
|
|
5257
5358
|
if (typeof data !== "object" || Array.isArray(data)) {
|
|
5258
5359
|
if (this.config.debug) {
|
|
5259
|
-
this.mixpanel.config.logger.error(
|
|
5360
|
+
this.mixpanel.config.logger.error(
|
|
5361
|
+
"Invalid value passed to #remove - data must be an object with scalar values"
|
|
5362
|
+
);
|
|
5260
5363
|
}
|
|
5261
5364
|
return;
|
|
5262
5365
|
}
|
|
@@ -5277,8 +5380,8 @@ var require_profile_helpers = __commonJS({
|
|
|
5277
5380
|
return;
|
|
5278
5381
|
}
|
|
5279
5382
|
data = {
|
|
5280
|
-
|
|
5281
|
-
|
|
5383
|
+
$remove,
|
|
5384
|
+
$token: this.token,
|
|
5282
5385
|
...identifiers
|
|
5283
5386
|
};
|
|
5284
5387
|
if (typeof modifiers === "function") {
|
|
@@ -5291,19 +5394,24 @@ var require_profile_helpers = __commonJS({
|
|
|
5291
5394
|
{ data }
|
|
5292
5395
|
);
|
|
5293
5396
|
}
|
|
5294
|
-
this.mixpanel.send_request(
|
|
5397
|
+
this.mixpanel.send_request(
|
|
5398
|
+
{ method: "GET", endpoint: this.endpoint, data },
|
|
5399
|
+
callback
|
|
5400
|
+
);
|
|
5295
5401
|
}
|
|
5296
5402
|
_union({ identifiers, data, modifiers, callback }) {
|
|
5297
5403
|
let $union = {};
|
|
5298
5404
|
if (typeof data !== "object" || Array.isArray(data)) {
|
|
5299
5405
|
if (this.config.debug) {
|
|
5300
|
-
this.mixpanel.config.logger.error(
|
|
5406
|
+
this.mixpanel.config.logger.error(
|
|
5407
|
+
"Invalid value passed to #union - data must be an object with scalar or array values"
|
|
5408
|
+
);
|
|
5301
5409
|
}
|
|
5302
5410
|
return;
|
|
5303
5411
|
}
|
|
5304
5412
|
for (const [key, val] of Object.entries(data)) {
|
|
5305
5413
|
if (Array.isArray(val)) {
|
|
5306
|
-
|
|
5414
|
+
const merge_values = val.filter(function(v) {
|
|
5307
5415
|
return typeof v === "string" || typeof v === "number";
|
|
5308
5416
|
});
|
|
5309
5417
|
if (merge_values.length > 0) {
|
|
@@ -5324,8 +5432,8 @@ var require_profile_helpers = __commonJS({
|
|
|
5324
5432
|
return;
|
|
5325
5433
|
}
|
|
5326
5434
|
data = {
|
|
5327
|
-
|
|
5328
|
-
|
|
5435
|
+
$union,
|
|
5436
|
+
$token: this.token,
|
|
5329
5437
|
...identifiers
|
|
5330
5438
|
};
|
|
5331
5439
|
if (typeof modifiers === "function") {
|
|
@@ -5338,7 +5446,10 @@ var require_profile_helpers = __commonJS({
|
|
|
5338
5446
|
{ data }
|
|
5339
5447
|
);
|
|
5340
5448
|
}
|
|
5341
|
-
this.mixpanel.send_request(
|
|
5449
|
+
this.mixpanel.send_request(
|
|
5450
|
+
{ method: "GET", endpoint: this.endpoint, data },
|
|
5451
|
+
callback
|
|
5452
|
+
);
|
|
5342
5453
|
}
|
|
5343
5454
|
_unset({ identifiers, prop, modifiers, callback }) {
|
|
5344
5455
|
let $unset = [];
|
|
@@ -5356,8 +5467,8 @@ var require_profile_helpers = __commonJS({
|
|
|
5356
5467
|
return;
|
|
5357
5468
|
}
|
|
5358
5469
|
let data = {
|
|
5359
|
-
|
|
5360
|
-
|
|
5470
|
+
$unset,
|
|
5471
|
+
$token: this.token,
|
|
5361
5472
|
...identifiers
|
|
5362
5473
|
};
|
|
5363
5474
|
if (typeof modifiers === "function") {
|
|
@@ -5370,15 +5481,18 @@ var require_profile_helpers = __commonJS({
|
|
|
5370
5481
|
{ data }
|
|
5371
5482
|
);
|
|
5372
5483
|
}
|
|
5373
|
-
this.mixpanel.send_request(
|
|
5484
|
+
this.mixpanel.send_request(
|
|
5485
|
+
{ method: "GET", endpoint: this.endpoint, data },
|
|
5486
|
+
callback
|
|
5487
|
+
);
|
|
5374
5488
|
}
|
|
5375
5489
|
};
|
|
5376
5490
|
}
|
|
5377
5491
|
});
|
|
5378
5492
|
|
|
5379
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5493
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/groups.js
|
|
5380
5494
|
var require_groups = __commonJS({
|
|
5381
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5495
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/groups.js"(exports$1) {
|
|
5382
5496
|
var { ProfileHelpers } = require_profile_helpers();
|
|
5383
5497
|
var MixpanelGroups = class extends ProfileHelpers() {
|
|
5384
5498
|
constructor(mp_instance) {
|
|
@@ -5387,9 +5501,9 @@ var require_groups = __commonJS({
|
|
|
5387
5501
|
this.endpoint = "/groups";
|
|
5388
5502
|
}
|
|
5389
5503
|
/** groups.set_once(group_key, group_id, prop, to, modifiers, callback)
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5504
|
+
---
|
|
5505
|
+
The same as groups.set, but adds a property value to a group only if it has not been set before.
|
|
5506
|
+
*/
|
|
5393
5507
|
set_once(group_key, group_id, prop, to, modifiers, callback) {
|
|
5394
5508
|
const identifiers = { $group_key: group_key, $group_id: group_id };
|
|
5395
5509
|
this._set(prop, to, modifiers, callback, { identifiers, set_once: true });
|
|
@@ -5478,9 +5592,9 @@ var require_groups = __commonJS({
|
|
|
5478
5592
|
}
|
|
5479
5593
|
});
|
|
5480
5594
|
|
|
5481
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5595
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/people.js
|
|
5482
5596
|
var require_people = __commonJS({
|
|
5483
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5597
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/people.js"(exports$1) {
|
|
5484
5598
|
var { merge_modifiers, ProfileHelpers } = require_profile_helpers();
|
|
5485
5599
|
var MixpanelPeople = class extends ProfileHelpers() {
|
|
5486
5600
|
constructor(mp_instance) {
|
|
@@ -5546,7 +5660,7 @@ var require_people = __commonJS({
|
|
|
5546
5660
|
});
|
|
5547
5661
|
*/
|
|
5548
5662
|
increment(distinct_id, prop, by, modifiers, callback) {
|
|
5549
|
-
|
|
5663
|
+
const $add = {};
|
|
5550
5664
|
if (typeof prop === "object") {
|
|
5551
5665
|
if (typeof by === "object") {
|
|
5552
5666
|
callback = modifiers;
|
|
@@ -5582,16 +5696,22 @@ var require_people = __commonJS({
|
|
|
5582
5696
|
$add[prop] = 1;
|
|
5583
5697
|
}
|
|
5584
5698
|
}
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5699
|
+
let data = {
|
|
5700
|
+
$add,
|
|
5701
|
+
$token: this.mixpanel.token,
|
|
5702
|
+
$distinct_id: distinct_id
|
|
5589
5703
|
};
|
|
5590
5704
|
data = merge_modifiers(data, modifiers);
|
|
5591
5705
|
if (this.mixpanel.config.debug) {
|
|
5592
|
-
this.mixpanel.config.logger.debug(
|
|
5706
|
+
this.mixpanel.config.logger.debug(
|
|
5707
|
+
"Sending the following data to Mixpanel (Engage)",
|
|
5708
|
+
{ data }
|
|
5709
|
+
);
|
|
5593
5710
|
}
|
|
5594
|
-
this.mixpanel.send_request(
|
|
5711
|
+
this.mixpanel.send_request(
|
|
5712
|
+
{ method: "GET", endpoint: "/engage", data },
|
|
5713
|
+
callback
|
|
5714
|
+
);
|
|
5595
5715
|
}
|
|
5596
5716
|
/**
|
|
5597
5717
|
people.append(distinct_id, prop, value, modifiers, callback)
|
|
@@ -5610,7 +5730,7 @@ var require_people = __commonJS({
|
|
|
5610
5730
|
});
|
|
5611
5731
|
*/
|
|
5612
5732
|
append(distinct_id, prop, value, modifiers, callback) {
|
|
5613
|
-
|
|
5733
|
+
const $append = {};
|
|
5614
5734
|
if (typeof prop === "object") {
|
|
5615
5735
|
if (typeof value === "object") {
|
|
5616
5736
|
callback = modifiers;
|
|
@@ -5627,16 +5747,22 @@ var require_people = __commonJS({
|
|
|
5627
5747
|
callback = modifiers;
|
|
5628
5748
|
}
|
|
5629
5749
|
}
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5750
|
+
let data = {
|
|
5751
|
+
$append,
|
|
5752
|
+
$token: this.mixpanel.token,
|
|
5753
|
+
$distinct_id: distinct_id
|
|
5634
5754
|
};
|
|
5635
5755
|
data = merge_modifiers(data, modifiers);
|
|
5636
5756
|
if (this.mixpanel.config.debug) {
|
|
5637
|
-
this.mixpanel.config.logger.debug(
|
|
5757
|
+
this.mixpanel.config.logger.debug(
|
|
5758
|
+
"Sending the following data to Mixpanel (Engage)",
|
|
5759
|
+
{ data }
|
|
5760
|
+
);
|
|
5638
5761
|
}
|
|
5639
|
-
this.mixpanel.send_request(
|
|
5762
|
+
this.mixpanel.send_request(
|
|
5763
|
+
{ method: "GET", endpoint: "/engage", data },
|
|
5764
|
+
callback
|
|
5765
|
+
);
|
|
5640
5766
|
}
|
|
5641
5767
|
/**
|
|
5642
5768
|
people.track_charge(distinct_id, amount, properties, modifiers, callback)
|
|
@@ -5671,27 +5797,35 @@ var require_people = __commonJS({
|
|
|
5671
5797
|
if (typeof amount !== "number") {
|
|
5672
5798
|
amount = parseFloat(amount);
|
|
5673
5799
|
if (isNaN(amount)) {
|
|
5674
|
-
this.mixpanel.config.logger.error(
|
|
5800
|
+
this.mixpanel.config.logger.error(
|
|
5801
|
+
"Invalid value passed to mixpanel.people.track_charge - must be a number"
|
|
5802
|
+
);
|
|
5675
5803
|
return;
|
|
5676
5804
|
}
|
|
5677
5805
|
}
|
|
5678
5806
|
properties.$amount = amount;
|
|
5679
5807
|
if (properties.hasOwnProperty("$time")) {
|
|
5680
|
-
|
|
5808
|
+
const time = properties.$time;
|
|
5681
5809
|
if (Object.prototype.toString.call(time) === "[object Date]") {
|
|
5682
5810
|
properties.$time = time.toISOString();
|
|
5683
5811
|
}
|
|
5684
5812
|
}
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5813
|
+
let data = {
|
|
5814
|
+
$append: { $transactions: properties },
|
|
5815
|
+
$token: this.mixpanel.token,
|
|
5816
|
+
$distinct_id: distinct_id
|
|
5689
5817
|
};
|
|
5690
5818
|
data = merge_modifiers(data, modifiers);
|
|
5691
5819
|
if (this.mixpanel.config.debug) {
|
|
5692
|
-
this.mixpanel.config.logger.debug(
|
|
5820
|
+
this.mixpanel.config.logger.debug(
|
|
5821
|
+
"Sending the following data to Mixpanel (Engage)",
|
|
5822
|
+
{ data }
|
|
5823
|
+
);
|
|
5693
5824
|
}
|
|
5694
|
-
this.mixpanel.send_request(
|
|
5825
|
+
this.mixpanel.send_request(
|
|
5826
|
+
{ method: "GET", endpoint: "/engage", data },
|
|
5827
|
+
callback
|
|
5828
|
+
);
|
|
5695
5829
|
}
|
|
5696
5830
|
/**
|
|
5697
5831
|
people.clear_charges(distinct_id, modifiers, callback)
|
|
@@ -5703,19 +5837,24 @@ var require_people = __commonJS({
|
|
|
5703
5837
|
mixpanel.people.clear_charges('bob');
|
|
5704
5838
|
*/
|
|
5705
5839
|
clear_charges(distinct_id, modifiers, callback) {
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5840
|
+
let data = {
|
|
5841
|
+
$set: { $transactions: [] },
|
|
5842
|
+
$token: this.mixpanel.token,
|
|
5843
|
+
$distinct_id: distinct_id
|
|
5710
5844
|
};
|
|
5711
5845
|
if (typeof modifiers === "function") {
|
|
5712
5846
|
callback = modifiers;
|
|
5713
5847
|
}
|
|
5714
5848
|
data = merge_modifiers(data, modifiers);
|
|
5715
5849
|
if (this.mixpanel.config.debug) {
|
|
5716
|
-
this.mixpanel.config.logger.debug("Clearing this user's charges", {
|
|
5850
|
+
this.mixpanel.config.logger.debug("Clearing this user's charges", {
|
|
5851
|
+
$distinct_id: distinct_id
|
|
5852
|
+
});
|
|
5717
5853
|
}
|
|
5718
|
-
this.mixpanel.send_request(
|
|
5854
|
+
this.mixpanel.send_request(
|
|
5855
|
+
{ method: "GET", endpoint: "/engage", data },
|
|
5856
|
+
callback
|
|
5857
|
+
);
|
|
5719
5858
|
}
|
|
5720
5859
|
/**
|
|
5721
5860
|
people.delete_user(distinct_id, modifiers, callback)
|
|
@@ -5742,7 +5881,7 @@ var require_people = __commonJS({
|
|
|
5742
5881
|
mixpanel.people.remove('bob', {'browsers': 'chrome', 'os': 'linux'});
|
|
5743
5882
|
*/
|
|
5744
5883
|
remove(distinct_id, data, modifiers, callback) {
|
|
5745
|
-
const identifiers = {
|
|
5884
|
+
const identifiers = { $distinct_id: distinct_id };
|
|
5746
5885
|
this._remove({ identifiers, data, modifiers, callback });
|
|
5747
5886
|
}
|
|
5748
5887
|
/**
|
|
@@ -5780,9 +5919,9 @@ var require_people = __commonJS({
|
|
|
5780
5919
|
}
|
|
5781
5920
|
});
|
|
5782
5921
|
|
|
5783
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5922
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/utils.js
|
|
5784
5923
|
var require_utils2 = __commonJS({
|
|
5785
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5924
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/utils.js"(exports$1, module) {
|
|
5786
5925
|
var crypto3 = __require("crypto");
|
|
5787
5926
|
var EXPOSURE_EVENT = "$experiment_started";
|
|
5788
5927
|
var REQUEST_HEADERS = {
|
|
@@ -5817,22 +5956,55 @@ var require_utils2 = __commonJS({
|
|
|
5817
5956
|
const traceFlags = "01";
|
|
5818
5957
|
return `${version3}-${traceId}-${parentId}-${traceFlags}`;
|
|
5819
5958
|
}
|
|
5959
|
+
function lowercaseJson(obj, lowercaseKeys) {
|
|
5960
|
+
if (obj === null || obj === void 0) {
|
|
5961
|
+
return obj;
|
|
5962
|
+
} else if (typeof obj === "string") {
|
|
5963
|
+
return obj.toLowerCase();
|
|
5964
|
+
} else if (typeof obj === "object") {
|
|
5965
|
+
if (Array.isArray(obj)) {
|
|
5966
|
+
return obj.map((item) => lowercaseJson(item, lowercaseKeys));
|
|
5967
|
+
} else {
|
|
5968
|
+
return Object.fromEntries(
|
|
5969
|
+
Object.entries(obj).map(([k, v]) => [
|
|
5970
|
+
lowercaseKeys ? k.toLowerCase() : k,
|
|
5971
|
+
lowercaseJson(v, lowercaseKeys)
|
|
5972
|
+
])
|
|
5973
|
+
);
|
|
5974
|
+
}
|
|
5975
|
+
} else {
|
|
5976
|
+
return obj;
|
|
5977
|
+
}
|
|
5978
|
+
}
|
|
5979
|
+
function lowercaseAllKeysAndValues(obj) {
|
|
5980
|
+
return lowercaseJson(obj, true);
|
|
5981
|
+
}
|
|
5982
|
+
function lowercaseLeafNodes(obj) {
|
|
5983
|
+
return lowercaseJson(obj, false);
|
|
5984
|
+
}
|
|
5820
5985
|
module.exports = {
|
|
5821
5986
|
EXPOSURE_EVENT,
|
|
5822
5987
|
REQUEST_HEADERS,
|
|
5823
5988
|
normalizedHash,
|
|
5824
5989
|
prepareCommonQueryParams,
|
|
5825
|
-
generateTraceparent
|
|
5990
|
+
generateTraceparent,
|
|
5991
|
+
lowercaseAllKeysAndValues,
|
|
5992
|
+
lowercaseLeafNodes
|
|
5826
5993
|
};
|
|
5827
5994
|
}
|
|
5828
5995
|
});
|
|
5829
5996
|
|
|
5830
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5997
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/flags.js
|
|
5831
5998
|
var require_flags = __commonJS({
|
|
5832
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5999
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/flags.js"(exports$1, module) {
|
|
5833
6000
|
var https3 = __require("https");
|
|
5834
6001
|
var packageInfo = require_package();
|
|
5835
|
-
var {
|
|
6002
|
+
var {
|
|
6003
|
+
prepareCommonQueryParams,
|
|
6004
|
+
generateTraceparent,
|
|
6005
|
+
EXPOSURE_EVENT,
|
|
6006
|
+
REQUEST_HEADERS
|
|
6007
|
+
} = require_utils2();
|
|
5836
6008
|
var FeatureFlagsProvider = class {
|
|
5837
6009
|
/**
|
|
5838
6010
|
* @param {Object} providerConfig - Configuration object with token, api_host, request_timeout_in_seconds
|
|
@@ -5855,7 +6027,10 @@ var require_flags = __commonJS({
|
|
|
5855
6027
|
*/
|
|
5856
6028
|
async callFlagsEndpoint(additionalParams = null) {
|
|
5857
6029
|
return new Promise((resolve, reject) => {
|
|
5858
|
-
const commonParams = prepareCommonQueryParams(
|
|
6030
|
+
const commonParams = prepareCommonQueryParams(
|
|
6031
|
+
this.providerConfig.token,
|
|
6032
|
+
packageInfo.version
|
|
6033
|
+
);
|
|
5859
6034
|
const params = new URLSearchParams(commonParams);
|
|
5860
6035
|
if (additionalParams) {
|
|
5861
6036
|
for (const [key, value] of Object.entries(additionalParams)) {
|
|
@@ -5870,8 +6045,8 @@ var require_flags = __commonJS({
|
|
|
5870
6045
|
method: "GET",
|
|
5871
6046
|
headers: {
|
|
5872
6047
|
...REQUEST_HEADERS,
|
|
5873
|
-
|
|
5874
|
-
|
|
6048
|
+
Authorization: "Basic " + Buffer.from(this.providerConfig.token + ":").toString("base64"),
|
|
6049
|
+
traceparent: generateTraceparent()
|
|
5875
6050
|
},
|
|
5876
6051
|
timeout: this.providerConfig.request_timeout_in_seconds * 1e3
|
|
5877
6052
|
};
|
|
@@ -5882,20 +6057,26 @@ var require_flags = __commonJS({
|
|
|
5882
6057
|
});
|
|
5883
6058
|
res.on("end", () => {
|
|
5884
6059
|
if (res.statusCode !== 200) {
|
|
5885
|
-
this.logger?.error(
|
|
6060
|
+
this.logger?.error(
|
|
6061
|
+
`HTTP ${res.statusCode} error calling flags endpoint: ${data}`
|
|
6062
|
+
);
|
|
5886
6063
|
return reject(new Error(`HTTP ${res.statusCode}: ${data}`));
|
|
5887
6064
|
}
|
|
5888
6065
|
try {
|
|
5889
6066
|
const result = JSON.parse(data);
|
|
5890
6067
|
resolve(result);
|
|
5891
6068
|
} catch (parseErr) {
|
|
5892
|
-
this.logger?.error(
|
|
6069
|
+
this.logger?.error(
|
|
6070
|
+
`Failed to parse JSON response: ${parseErr.message}`
|
|
6071
|
+
);
|
|
5893
6072
|
reject(parseErr);
|
|
5894
6073
|
}
|
|
5895
6074
|
});
|
|
5896
6075
|
});
|
|
5897
6076
|
request.on("error", (err) => {
|
|
5898
|
-
this.logger?.error(
|
|
6077
|
+
this.logger?.error(
|
|
6078
|
+
`Network error calling flags endpoint: ${err.message}`
|
|
6079
|
+
);
|
|
5899
6080
|
reject(err);
|
|
5900
6081
|
});
|
|
5901
6082
|
request.on("timeout", () => {
|
|
@@ -5917,14 +6098,16 @@ var require_flags = __commonJS({
|
|
|
5917
6098
|
*/
|
|
5918
6099
|
trackExposureEvent(flagKey, selectedVariant, context, latencyMs = null) {
|
|
5919
6100
|
if (!context.distinct_id) {
|
|
5920
|
-
this.logger?.error(
|
|
6101
|
+
this.logger?.error(
|
|
6102
|
+
"Cannot track exposure event without a distinct_id in the context"
|
|
6103
|
+
);
|
|
5921
6104
|
return;
|
|
5922
6105
|
}
|
|
5923
6106
|
const properties = {
|
|
5924
|
-
|
|
6107
|
+
distinct_id: context.distinct_id,
|
|
5925
6108
|
"Experiment name": flagKey,
|
|
5926
6109
|
"Variant name": selectedVariant.variant_key,
|
|
5927
|
-
|
|
6110
|
+
$experiment_type: "feature_flag",
|
|
5928
6111
|
"Flag evaluation mode": this.evaluationMode
|
|
5929
6112
|
};
|
|
5930
6113
|
if (latencyMs !== null && latencyMs !== void 0) {
|
|
@@ -5941,7 +6124,9 @@ var require_flags = __commonJS({
|
|
|
5941
6124
|
}
|
|
5942
6125
|
this.tracker(EXPOSURE_EVENT, properties, (err) => {
|
|
5943
6126
|
if (err) {
|
|
5944
|
-
this.logger?.error(
|
|
6127
|
+
this.logger?.error(
|
|
6128
|
+
`[flags]Failed to track exposure event for flag '${flagKey}': ${err.message}`
|
|
6129
|
+
);
|
|
5945
6130
|
}
|
|
5946
6131
|
});
|
|
5947
6132
|
}
|
|
@@ -5950,11 +6135,392 @@ var require_flags = __commonJS({
|
|
|
5950
6135
|
}
|
|
5951
6136
|
});
|
|
5952
6137
|
|
|
5953
|
-
// ../../node_modules/.pnpm/
|
|
6138
|
+
// ../../node_modules/.pnpm/json-logic-js@2.0.5/node_modules/json-logic-js/logic.js
|
|
6139
|
+
var require_logic = __commonJS({
|
|
6140
|
+
"../../node_modules/.pnpm/json-logic-js@2.0.5/node_modules/json-logic-js/logic.js"(exports$1, module) {
|
|
6141
|
+
(function(root, factory) {
|
|
6142
|
+
if (typeof define === "function" && define.amd) {
|
|
6143
|
+
define(factory);
|
|
6144
|
+
} else if (typeof exports$1 === "object") {
|
|
6145
|
+
module.exports = factory();
|
|
6146
|
+
} else {
|
|
6147
|
+
root.jsonLogic = factory();
|
|
6148
|
+
}
|
|
6149
|
+
})(exports$1, function() {
|
|
6150
|
+
if (!Array.isArray) {
|
|
6151
|
+
Array.isArray = function(arg) {
|
|
6152
|
+
return Object.prototype.toString.call(arg) === "[object Array]";
|
|
6153
|
+
};
|
|
6154
|
+
}
|
|
6155
|
+
function arrayUnique(array) {
|
|
6156
|
+
var a = [];
|
|
6157
|
+
for (var i = 0, l = array.length; i < l; i++) {
|
|
6158
|
+
if (a.indexOf(array[i]) === -1) {
|
|
6159
|
+
a.push(array[i]);
|
|
6160
|
+
}
|
|
6161
|
+
}
|
|
6162
|
+
return a;
|
|
6163
|
+
}
|
|
6164
|
+
var jsonLogic = {};
|
|
6165
|
+
var operations = {
|
|
6166
|
+
"==": function(a, b) {
|
|
6167
|
+
return a == b;
|
|
6168
|
+
},
|
|
6169
|
+
"===": function(a, b) {
|
|
6170
|
+
return a === b;
|
|
6171
|
+
},
|
|
6172
|
+
"!=": function(a, b) {
|
|
6173
|
+
return a != b;
|
|
6174
|
+
},
|
|
6175
|
+
"!==": function(a, b) {
|
|
6176
|
+
return a !== b;
|
|
6177
|
+
},
|
|
6178
|
+
">": function(a, b) {
|
|
6179
|
+
return a > b;
|
|
6180
|
+
},
|
|
6181
|
+
">=": function(a, b) {
|
|
6182
|
+
return a >= b;
|
|
6183
|
+
},
|
|
6184
|
+
"<": function(a, b, c) {
|
|
6185
|
+
return c === void 0 ? a < b : a < b && b < c;
|
|
6186
|
+
},
|
|
6187
|
+
"<=": function(a, b, c) {
|
|
6188
|
+
return c === void 0 ? a <= b : a <= b && b <= c;
|
|
6189
|
+
},
|
|
6190
|
+
"!!": function(a) {
|
|
6191
|
+
return jsonLogic.truthy(a);
|
|
6192
|
+
},
|
|
6193
|
+
"!": function(a) {
|
|
6194
|
+
return !jsonLogic.truthy(a);
|
|
6195
|
+
},
|
|
6196
|
+
"%": function(a, b) {
|
|
6197
|
+
return a % b;
|
|
6198
|
+
},
|
|
6199
|
+
"log": function(a) {
|
|
6200
|
+
console.log(a);
|
|
6201
|
+
return a;
|
|
6202
|
+
},
|
|
6203
|
+
"in": function(a, b) {
|
|
6204
|
+
if (!b || typeof b.indexOf === "undefined") return false;
|
|
6205
|
+
return b.indexOf(a) !== -1;
|
|
6206
|
+
},
|
|
6207
|
+
"cat": function() {
|
|
6208
|
+
return Array.prototype.join.call(arguments, "");
|
|
6209
|
+
},
|
|
6210
|
+
"substr": function(source, start, end) {
|
|
6211
|
+
if (end < 0) {
|
|
6212
|
+
var temp = String(source).substr(start);
|
|
6213
|
+
return temp.substr(0, temp.length + end);
|
|
6214
|
+
}
|
|
6215
|
+
return String(source).substr(start, end);
|
|
6216
|
+
},
|
|
6217
|
+
"+": function() {
|
|
6218
|
+
return Array.prototype.reduce.call(arguments, function(a, b) {
|
|
6219
|
+
return parseFloat(a, 10) + parseFloat(b, 10);
|
|
6220
|
+
}, 0);
|
|
6221
|
+
},
|
|
6222
|
+
"*": function() {
|
|
6223
|
+
return Array.prototype.reduce.call(arguments, function(a, b) {
|
|
6224
|
+
return parseFloat(a, 10) * parseFloat(b, 10);
|
|
6225
|
+
});
|
|
6226
|
+
},
|
|
6227
|
+
"-": function(a, b) {
|
|
6228
|
+
if (b === void 0) {
|
|
6229
|
+
return -a;
|
|
6230
|
+
} else {
|
|
6231
|
+
return a - b;
|
|
6232
|
+
}
|
|
6233
|
+
},
|
|
6234
|
+
"/": function(a, b) {
|
|
6235
|
+
return a / b;
|
|
6236
|
+
},
|
|
6237
|
+
"min": function() {
|
|
6238
|
+
return Math.min.apply(this, arguments);
|
|
6239
|
+
},
|
|
6240
|
+
"max": function() {
|
|
6241
|
+
return Math.max.apply(this, arguments);
|
|
6242
|
+
},
|
|
6243
|
+
"merge": function() {
|
|
6244
|
+
return Array.prototype.reduce.call(arguments, function(a, b) {
|
|
6245
|
+
return a.concat(b);
|
|
6246
|
+
}, []);
|
|
6247
|
+
},
|
|
6248
|
+
"var": function(a, b) {
|
|
6249
|
+
var not_found = b === void 0 ? null : b;
|
|
6250
|
+
var data = this;
|
|
6251
|
+
if (typeof a === "undefined" || a === "" || a === null) {
|
|
6252
|
+
return data;
|
|
6253
|
+
}
|
|
6254
|
+
var sub_props = String(a).split(".");
|
|
6255
|
+
for (var i = 0; i < sub_props.length; i++) {
|
|
6256
|
+
if (data === null || data === void 0) {
|
|
6257
|
+
return not_found;
|
|
6258
|
+
}
|
|
6259
|
+
data = data[sub_props[i]];
|
|
6260
|
+
if (data === void 0) {
|
|
6261
|
+
return not_found;
|
|
6262
|
+
}
|
|
6263
|
+
}
|
|
6264
|
+
return data;
|
|
6265
|
+
},
|
|
6266
|
+
"missing": function() {
|
|
6267
|
+
var missing = [];
|
|
6268
|
+
var keys = Array.isArray(arguments[0]) ? arguments[0] : arguments;
|
|
6269
|
+
for (var i = 0; i < keys.length; i++) {
|
|
6270
|
+
var key = keys[i];
|
|
6271
|
+
var value = jsonLogic.apply({ "var": key }, this);
|
|
6272
|
+
if (value === null || value === "") {
|
|
6273
|
+
missing.push(key);
|
|
6274
|
+
}
|
|
6275
|
+
}
|
|
6276
|
+
return missing;
|
|
6277
|
+
},
|
|
6278
|
+
"missing_some": function(need_count, options) {
|
|
6279
|
+
var are_missing = jsonLogic.apply({ "missing": options }, this);
|
|
6280
|
+
if (options.length - are_missing.length >= need_count) {
|
|
6281
|
+
return [];
|
|
6282
|
+
} else {
|
|
6283
|
+
return are_missing;
|
|
6284
|
+
}
|
|
6285
|
+
}
|
|
6286
|
+
};
|
|
6287
|
+
jsonLogic.is_logic = function(logic) {
|
|
6288
|
+
return typeof logic === "object" && // An object
|
|
6289
|
+
logic !== null && // but not null
|
|
6290
|
+
!Array.isArray(logic) && // and not an array
|
|
6291
|
+
Object.keys(logic).length === 1;
|
|
6292
|
+
};
|
|
6293
|
+
jsonLogic.truthy = function(value) {
|
|
6294
|
+
if (Array.isArray(value) && value.length === 0) {
|
|
6295
|
+
return false;
|
|
6296
|
+
}
|
|
6297
|
+
return !!value;
|
|
6298
|
+
};
|
|
6299
|
+
jsonLogic.get_operator = function(logic) {
|
|
6300
|
+
return Object.keys(logic)[0];
|
|
6301
|
+
};
|
|
6302
|
+
jsonLogic.get_values = function(logic) {
|
|
6303
|
+
return logic[jsonLogic.get_operator(logic)];
|
|
6304
|
+
};
|
|
6305
|
+
jsonLogic.apply = function(logic, data) {
|
|
6306
|
+
if (Array.isArray(logic)) {
|
|
6307
|
+
return logic.map(function(l) {
|
|
6308
|
+
return jsonLogic.apply(l, data);
|
|
6309
|
+
});
|
|
6310
|
+
}
|
|
6311
|
+
if (!jsonLogic.is_logic(logic)) {
|
|
6312
|
+
return logic;
|
|
6313
|
+
}
|
|
6314
|
+
var op = jsonLogic.get_operator(logic);
|
|
6315
|
+
var values = logic[op];
|
|
6316
|
+
var i;
|
|
6317
|
+
var current;
|
|
6318
|
+
var scopedLogic;
|
|
6319
|
+
var scopedData;
|
|
6320
|
+
var initial;
|
|
6321
|
+
if (!Array.isArray(values)) {
|
|
6322
|
+
values = [values];
|
|
6323
|
+
}
|
|
6324
|
+
if (op === "if" || op == "?:") {
|
|
6325
|
+
for (i = 0; i < values.length - 1; i += 2) {
|
|
6326
|
+
if (jsonLogic.truthy(jsonLogic.apply(values[i], data))) {
|
|
6327
|
+
return jsonLogic.apply(values[i + 1], data);
|
|
6328
|
+
}
|
|
6329
|
+
}
|
|
6330
|
+
if (values.length === i + 1) {
|
|
6331
|
+
return jsonLogic.apply(values[i], data);
|
|
6332
|
+
}
|
|
6333
|
+
return null;
|
|
6334
|
+
} else if (op === "and") {
|
|
6335
|
+
for (i = 0; i < values.length; i += 1) {
|
|
6336
|
+
current = jsonLogic.apply(values[i], data);
|
|
6337
|
+
if (!jsonLogic.truthy(current)) {
|
|
6338
|
+
return current;
|
|
6339
|
+
}
|
|
6340
|
+
}
|
|
6341
|
+
return current;
|
|
6342
|
+
} else if (op === "or") {
|
|
6343
|
+
for (i = 0; i < values.length; i += 1) {
|
|
6344
|
+
current = jsonLogic.apply(values[i], data);
|
|
6345
|
+
if (jsonLogic.truthy(current)) {
|
|
6346
|
+
return current;
|
|
6347
|
+
}
|
|
6348
|
+
}
|
|
6349
|
+
return current;
|
|
6350
|
+
} else if (op === "filter") {
|
|
6351
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6352
|
+
scopedLogic = values[1];
|
|
6353
|
+
if (!Array.isArray(scopedData)) {
|
|
6354
|
+
return [];
|
|
6355
|
+
}
|
|
6356
|
+
return scopedData.filter(function(datum) {
|
|
6357
|
+
return jsonLogic.truthy(jsonLogic.apply(scopedLogic, datum));
|
|
6358
|
+
});
|
|
6359
|
+
} else if (op === "map") {
|
|
6360
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6361
|
+
scopedLogic = values[1];
|
|
6362
|
+
if (!Array.isArray(scopedData)) {
|
|
6363
|
+
return [];
|
|
6364
|
+
}
|
|
6365
|
+
return scopedData.map(function(datum) {
|
|
6366
|
+
return jsonLogic.apply(scopedLogic, datum);
|
|
6367
|
+
});
|
|
6368
|
+
} else if (op === "reduce") {
|
|
6369
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6370
|
+
scopedLogic = values[1];
|
|
6371
|
+
initial = typeof values[2] !== "undefined" ? jsonLogic.apply(values[2], data) : null;
|
|
6372
|
+
if (!Array.isArray(scopedData)) {
|
|
6373
|
+
return initial;
|
|
6374
|
+
}
|
|
6375
|
+
return scopedData.reduce(
|
|
6376
|
+
function(accumulator, current2) {
|
|
6377
|
+
return jsonLogic.apply(
|
|
6378
|
+
scopedLogic,
|
|
6379
|
+
{ current: current2, accumulator }
|
|
6380
|
+
);
|
|
6381
|
+
},
|
|
6382
|
+
initial
|
|
6383
|
+
);
|
|
6384
|
+
} else if (op === "all") {
|
|
6385
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6386
|
+
scopedLogic = values[1];
|
|
6387
|
+
if (!Array.isArray(scopedData) || !scopedData.length) {
|
|
6388
|
+
return false;
|
|
6389
|
+
}
|
|
6390
|
+
for (i = 0; i < scopedData.length; i += 1) {
|
|
6391
|
+
if (!jsonLogic.truthy(jsonLogic.apply(scopedLogic, scopedData[i]))) {
|
|
6392
|
+
return false;
|
|
6393
|
+
}
|
|
6394
|
+
}
|
|
6395
|
+
return true;
|
|
6396
|
+
} else if (op === "none") {
|
|
6397
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6398
|
+
scopedLogic = values[1];
|
|
6399
|
+
if (!Array.isArray(scopedData) || !scopedData.length) {
|
|
6400
|
+
return true;
|
|
6401
|
+
}
|
|
6402
|
+
for (i = 0; i < scopedData.length; i += 1) {
|
|
6403
|
+
if (jsonLogic.truthy(jsonLogic.apply(scopedLogic, scopedData[i]))) {
|
|
6404
|
+
return false;
|
|
6405
|
+
}
|
|
6406
|
+
}
|
|
6407
|
+
return true;
|
|
6408
|
+
} else if (op === "some") {
|
|
6409
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6410
|
+
scopedLogic = values[1];
|
|
6411
|
+
if (!Array.isArray(scopedData) || !scopedData.length) {
|
|
6412
|
+
return false;
|
|
6413
|
+
}
|
|
6414
|
+
for (i = 0; i < scopedData.length; i += 1) {
|
|
6415
|
+
if (jsonLogic.truthy(jsonLogic.apply(scopedLogic, scopedData[i]))) {
|
|
6416
|
+
return true;
|
|
6417
|
+
}
|
|
6418
|
+
}
|
|
6419
|
+
return false;
|
|
6420
|
+
}
|
|
6421
|
+
values = values.map(function(val) {
|
|
6422
|
+
return jsonLogic.apply(val, data);
|
|
6423
|
+
});
|
|
6424
|
+
if (operations.hasOwnProperty(op) && typeof operations[op] === "function") {
|
|
6425
|
+
return operations[op].apply(data, values);
|
|
6426
|
+
} else if (op.indexOf(".") > 0) {
|
|
6427
|
+
var sub_ops = String(op).split(".");
|
|
6428
|
+
var operation = operations;
|
|
6429
|
+
for (i = 0; i < sub_ops.length; i++) {
|
|
6430
|
+
if (!operation.hasOwnProperty(sub_ops[i])) {
|
|
6431
|
+
throw new Error("Unrecognized operation " + op + " (failed at " + sub_ops.slice(0, i + 1).join(".") + ")");
|
|
6432
|
+
}
|
|
6433
|
+
operation = operation[sub_ops[i]];
|
|
6434
|
+
}
|
|
6435
|
+
return operation.apply(data, values);
|
|
6436
|
+
}
|
|
6437
|
+
throw new Error("Unrecognized operation " + op);
|
|
6438
|
+
};
|
|
6439
|
+
jsonLogic.uses_data = function(logic) {
|
|
6440
|
+
var collection = [];
|
|
6441
|
+
if (jsonLogic.is_logic(logic)) {
|
|
6442
|
+
var op = jsonLogic.get_operator(logic);
|
|
6443
|
+
var values = logic[op];
|
|
6444
|
+
if (!Array.isArray(values)) {
|
|
6445
|
+
values = [values];
|
|
6446
|
+
}
|
|
6447
|
+
if (op === "var") {
|
|
6448
|
+
collection.push(values[0]);
|
|
6449
|
+
} else {
|
|
6450
|
+
values.forEach(function(val) {
|
|
6451
|
+
collection.push.apply(collection, jsonLogic.uses_data(val));
|
|
6452
|
+
});
|
|
6453
|
+
}
|
|
6454
|
+
}
|
|
6455
|
+
return arrayUnique(collection);
|
|
6456
|
+
};
|
|
6457
|
+
jsonLogic.add_operation = function(name, code) {
|
|
6458
|
+
operations[name] = code;
|
|
6459
|
+
};
|
|
6460
|
+
jsonLogic.rm_operation = function(name) {
|
|
6461
|
+
delete operations[name];
|
|
6462
|
+
};
|
|
6463
|
+
jsonLogic.rule_like = function(rule, pattern) {
|
|
6464
|
+
if (pattern === rule) {
|
|
6465
|
+
return true;
|
|
6466
|
+
}
|
|
6467
|
+
if (pattern === "@") {
|
|
6468
|
+
return true;
|
|
6469
|
+
}
|
|
6470
|
+
if (pattern === "number") {
|
|
6471
|
+
return typeof rule === "number";
|
|
6472
|
+
}
|
|
6473
|
+
if (pattern === "string") {
|
|
6474
|
+
return typeof rule === "string";
|
|
6475
|
+
}
|
|
6476
|
+
if (pattern === "array") {
|
|
6477
|
+
return Array.isArray(rule) && !jsonLogic.is_logic(rule);
|
|
6478
|
+
}
|
|
6479
|
+
if (jsonLogic.is_logic(pattern)) {
|
|
6480
|
+
if (jsonLogic.is_logic(rule)) {
|
|
6481
|
+
var pattern_op = jsonLogic.get_operator(pattern);
|
|
6482
|
+
var rule_op = jsonLogic.get_operator(rule);
|
|
6483
|
+
if (pattern_op === "@" || pattern_op === rule_op) {
|
|
6484
|
+
return jsonLogic.rule_like(
|
|
6485
|
+
jsonLogic.get_values(rule, false),
|
|
6486
|
+
jsonLogic.get_values(pattern, false)
|
|
6487
|
+
);
|
|
6488
|
+
}
|
|
6489
|
+
}
|
|
6490
|
+
return false;
|
|
6491
|
+
}
|
|
6492
|
+
if (Array.isArray(pattern)) {
|
|
6493
|
+
if (Array.isArray(rule)) {
|
|
6494
|
+
if (pattern.length !== rule.length) {
|
|
6495
|
+
return false;
|
|
6496
|
+
}
|
|
6497
|
+
for (var i = 0; i < pattern.length; i += 1) {
|
|
6498
|
+
if (!jsonLogic.rule_like(rule[i], pattern[i])) {
|
|
6499
|
+
return false;
|
|
6500
|
+
}
|
|
6501
|
+
}
|
|
6502
|
+
return true;
|
|
6503
|
+
} else {
|
|
6504
|
+
return false;
|
|
6505
|
+
}
|
|
6506
|
+
}
|
|
6507
|
+
return false;
|
|
6508
|
+
};
|
|
6509
|
+
return jsonLogic;
|
|
6510
|
+
});
|
|
6511
|
+
}
|
|
6512
|
+
});
|
|
6513
|
+
|
|
6514
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/local_flags.js
|
|
5954
6515
|
var require_local_flags = __commonJS({
|
|
5955
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
6516
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/local_flags.js"(exports$1, module) {
|
|
5956
6517
|
var FeatureFlagsProvider = require_flags();
|
|
5957
|
-
var {
|
|
6518
|
+
var {
|
|
6519
|
+
normalizedHash,
|
|
6520
|
+
lowercaseAllKeysAndValues,
|
|
6521
|
+
lowercaseLeafNodes
|
|
6522
|
+
} = require_utils2();
|
|
6523
|
+
var { apply } = require_logic();
|
|
5958
6524
|
var LocalFeatureFlagsProvider = class extends FeatureFlagsProvider {
|
|
5959
6525
|
/**
|
|
5960
6526
|
* @param {string} token - Mixpanel project token
|
|
@@ -5993,12 +6559,16 @@ var require_local_flags = __commonJS({
|
|
|
5993
6559
|
try {
|
|
5994
6560
|
await this._fetchFlagDefinitions();
|
|
5995
6561
|
} catch (err) {
|
|
5996
|
-
this.logger?.error(
|
|
6562
|
+
this.logger?.error(
|
|
6563
|
+
`Error polling for flag definition: ${err.message}`
|
|
6564
|
+
);
|
|
5997
6565
|
}
|
|
5998
6566
|
}, this.config.polling_interval_in_seconds * 1e3);
|
|
5999
6567
|
}
|
|
6000
6568
|
} catch (err) {
|
|
6001
|
-
this.logger?.error(
|
|
6569
|
+
this.logger?.error(
|
|
6570
|
+
`Initial flag definitions fetch failed: ${err.message}`
|
|
6571
|
+
);
|
|
6002
6572
|
}
|
|
6003
6573
|
}
|
|
6004
6574
|
/**
|
|
@@ -6009,7 +6579,9 @@ var require_local_flags = __commonJS({
|
|
|
6009
6579
|
clearInterval(this.pollingInterval);
|
|
6010
6580
|
this.pollingInterval = null;
|
|
6011
6581
|
} else {
|
|
6012
|
-
this.logger?.warn(
|
|
6582
|
+
this.logger?.warn(
|
|
6583
|
+
"stopPollingForDefinitions called but polling was not active"
|
|
6584
|
+
);
|
|
6013
6585
|
}
|
|
6014
6586
|
}
|
|
6015
6587
|
/**
|
|
@@ -6034,7 +6606,12 @@ var require_local_flags = __commonJS({
|
|
|
6034
6606
|
* @returns {*} The variant value
|
|
6035
6607
|
*/
|
|
6036
6608
|
getVariantValue(flagKey, fallbackValue, context, reportExposure = true) {
|
|
6037
|
-
const result = this.getVariant(
|
|
6609
|
+
const result = this.getVariant(
|
|
6610
|
+
flagKey,
|
|
6611
|
+
{ variant_value: fallbackValue },
|
|
6612
|
+
context,
|
|
6613
|
+
reportExposure
|
|
6614
|
+
);
|
|
6038
6615
|
return result.variant_value;
|
|
6039
6616
|
}
|
|
6040
6617
|
/**
|
|
@@ -6065,7 +6642,12 @@ var require_local_flags = __commonJS({
|
|
|
6065
6642
|
} else {
|
|
6066
6643
|
const rollout = this._getAssignedRollout(flag, contextValue, context);
|
|
6067
6644
|
if (rollout) {
|
|
6068
|
-
selectedVariant = this._getAssignedVariant(
|
|
6645
|
+
selectedVariant = this._getAssignedVariant(
|
|
6646
|
+
flag,
|
|
6647
|
+
contextValue,
|
|
6648
|
+
flagKey,
|
|
6649
|
+
rollout
|
|
6650
|
+
);
|
|
6069
6651
|
}
|
|
6070
6652
|
}
|
|
6071
6653
|
if (selectedVariant) {
|
|
@@ -6160,7 +6742,10 @@ var require_local_flags = __commonJS({
|
|
|
6160
6742
|
}
|
|
6161
6743
|
_getAssignedVariant(flag, contextValue, flagKey, rollout) {
|
|
6162
6744
|
if (rollout.variant_override) {
|
|
6163
|
-
const variant = this._getMatchingVariant(
|
|
6745
|
+
const variant = this._getMatchingVariant(
|
|
6746
|
+
rollout.variant_override.key,
|
|
6747
|
+
flag
|
|
6748
|
+
);
|
|
6164
6749
|
if (variant) {
|
|
6165
6750
|
return { ...variant, is_qa_tester: false };
|
|
6166
6751
|
}
|
|
@@ -6193,15 +6778,41 @@ var require_local_flags = __commonJS({
|
|
|
6193
6778
|
is_qa_tester: false
|
|
6194
6779
|
};
|
|
6195
6780
|
}
|
|
6781
|
+
_extractRuntimeParameters(context) {
|
|
6782
|
+
const customProperties = context.custom_properties;
|
|
6783
|
+
if (!customProperties || typeof customProperties !== "object") {
|
|
6784
|
+
return null;
|
|
6785
|
+
}
|
|
6786
|
+
return lowercaseAllKeysAndValues(customProperties);
|
|
6787
|
+
}
|
|
6788
|
+
_isRuntimeRuleSatisfied(rollout, context) {
|
|
6789
|
+
try {
|
|
6790
|
+
return apply(
|
|
6791
|
+
lowercaseLeafNodes(rollout.runtime_evaluation_rule),
|
|
6792
|
+
this._extractRuntimeParameters(context)
|
|
6793
|
+
);
|
|
6794
|
+
} catch (error) {
|
|
6795
|
+
this.logger?.error(`Error evaluating runtime rule: ${error.message}`);
|
|
6796
|
+
return false;
|
|
6797
|
+
}
|
|
6798
|
+
}
|
|
6196
6799
|
_isRuntimeEvaluationSatisfied(rollout, context) {
|
|
6197
|
-
if (
|
|
6800
|
+
if (rollout.runtime_evaluation_rule) {
|
|
6801
|
+
return this._isRuntimeRuleSatisfied(rollout, context);
|
|
6802
|
+
} else if (rollout.runtime_evaluation_definition) {
|
|
6803
|
+
return this._isLegacyRuntimeEvaluationSatisfied(rollout, context);
|
|
6804
|
+
} else {
|
|
6198
6805
|
return true;
|
|
6199
6806
|
}
|
|
6200
|
-
|
|
6201
|
-
|
|
6807
|
+
}
|
|
6808
|
+
_isLegacyRuntimeEvaluationSatisfied(rollout, context) {
|
|
6809
|
+
const customProperties = this._extractRuntimeParameters(context);
|
|
6810
|
+
if (!customProperties) {
|
|
6202
6811
|
return false;
|
|
6203
6812
|
}
|
|
6204
|
-
for (const [key, expectedValue] of Object.entries(
|
|
6813
|
+
for (const [key, expectedValue] of Object.entries(
|
|
6814
|
+
rollout.runtime_evaluation_definition
|
|
6815
|
+
)) {
|
|
6205
6816
|
if (!(key in customProperties)) {
|
|
6206
6817
|
return false;
|
|
6207
6818
|
}
|
|
@@ -6217,9 +6828,9 @@ var require_local_flags = __commonJS({
|
|
|
6217
6828
|
}
|
|
6218
6829
|
});
|
|
6219
6830
|
|
|
6220
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
6831
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/remote_flags.js
|
|
6221
6832
|
var require_remote_flags = __commonJS({
|
|
6222
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
6833
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/remote_flags.js"(exports$1, module) {
|
|
6223
6834
|
var FeatureFlagsProvider = require_flags();
|
|
6224
6835
|
var RemoteFeatureFlagsProvider = class extends FeatureFlagsProvider {
|
|
6225
6836
|
/**
|
|
@@ -6253,10 +6864,17 @@ var require_remote_flags = __commonJS({
|
|
|
6253
6864
|
*/
|
|
6254
6865
|
async getVariantValue(flagKey, fallbackValue, context, reportExposure = true) {
|
|
6255
6866
|
try {
|
|
6256
|
-
const selectedVariant = await this.getVariant(
|
|
6867
|
+
const selectedVariant = await this.getVariant(
|
|
6868
|
+
flagKey,
|
|
6869
|
+
{ variant_value: fallbackValue },
|
|
6870
|
+
context,
|
|
6871
|
+
reportExposure
|
|
6872
|
+
);
|
|
6257
6873
|
return selectedVariant.variant_value;
|
|
6258
6874
|
} catch (err) {
|
|
6259
|
-
this.logger?.error(
|
|
6875
|
+
this.logger?.error(
|
|
6876
|
+
`Failed to get variant value for flag '${flagKey}': ${err.message}`
|
|
6877
|
+
);
|
|
6260
6878
|
return fallbackValue;
|
|
6261
6879
|
}
|
|
6262
6880
|
}
|
|
@@ -6285,7 +6903,9 @@ var require_remote_flags = __commonJS({
|
|
|
6285
6903
|
}
|
|
6286
6904
|
return selectedVariant;
|
|
6287
6905
|
} catch (err) {
|
|
6288
|
-
this.logger?.error(
|
|
6906
|
+
this.logger?.error(
|
|
6907
|
+
`Failed to get variant for flag '${flagKey}': ${err.message}`
|
|
6908
|
+
);
|
|
6289
6909
|
return fallbackVariant;
|
|
6290
6910
|
}
|
|
6291
6911
|
}
|
|
@@ -6302,7 +6922,9 @@ var require_remote_flags = __commonJS({
|
|
|
6302
6922
|
const value = await this.getVariantValue(flagKey, false, context);
|
|
6303
6923
|
return value === true;
|
|
6304
6924
|
} catch (err) {
|
|
6305
|
-
this.logger?.error(
|
|
6925
|
+
this.logger?.error(
|
|
6926
|
+
`Failed to check if flag '${flagKey}' is enabled: ${err.message}`
|
|
6927
|
+
);
|
|
6306
6928
|
return false;
|
|
6307
6929
|
}
|
|
6308
6930
|
}
|
|
@@ -6341,9 +6963,9 @@ var require_remote_flags = __commonJS({
|
|
|
6341
6963
|
}
|
|
6342
6964
|
});
|
|
6343
6965
|
|
|
6344
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
6966
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/index.js
|
|
6345
6967
|
var require_flags2 = __commonJS({
|
|
6346
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
6968
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/index.js"(exports$1, module) {
|
|
6347
6969
|
var LocalFeatureFlagsProvider = require_local_flags();
|
|
6348
6970
|
var RemoteFeatureFlagsProvider = require_remote_flags();
|
|
6349
6971
|
module.exports = {
|
|
@@ -6353,9 +6975,9 @@ var require_flags2 = __commonJS({
|
|
|
6353
6975
|
}
|
|
6354
6976
|
});
|
|
6355
6977
|
|
|
6356
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
6978
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/mixpanel-node.js
|
|
6357
6979
|
var require_mixpanel_node = __commonJS({
|
|
6358
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
6980
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/mixpanel-node.js"(exports$1, module) {
|
|
6359
6981
|
var querystring = __require("querystring");
|
|
6360
6982
|
var Buffer4 = __require("buffer").Buffer;
|
|
6361
6983
|
var http3 = __require("http");
|
|
@@ -6366,7 +6988,10 @@ var require_mixpanel_node = __commonJS({
|
|
|
6366
6988
|
var { async_all, ensure_timestamp, assert_logger } = require_utils();
|
|
6367
6989
|
var { MixpanelGroups } = require_groups();
|
|
6368
6990
|
var { MixpanelPeople } = require_people();
|
|
6369
|
-
var {
|
|
6991
|
+
var {
|
|
6992
|
+
LocalFeatureFlagsProvider,
|
|
6993
|
+
RemoteFeatureFlagsProvider
|
|
6994
|
+
} = require_flags2();
|
|
6370
6995
|
var DEFAULT_CONFIG = {
|
|
6371
6996
|
test: false,
|
|
6372
6997
|
debug: false,
|
|
@@ -6382,7 +7007,9 @@ var require_mixpanel_node = __commonJS({
|
|
|
6382
7007
|
};
|
|
6383
7008
|
var create_client = function(token, config) {
|
|
6384
7009
|
if (!token) {
|
|
6385
|
-
throw new Error(
|
|
7010
|
+
throw new Error(
|
|
7011
|
+
"The Mixpanel Client needs a Mixpanel token: `init(token)`"
|
|
7012
|
+
);
|
|
6386
7013
|
}
|
|
6387
7014
|
const metrics = {
|
|
6388
7015
|
token,
|
|
@@ -6396,9 +7023,11 @@ var require_mixpanel_node = __commonJS({
|
|
|
6396
7023
|
https: new https3.Agent({ keepAlive })
|
|
6397
7024
|
};
|
|
6398
7025
|
const proxyPath = process.env.HTTPS_PROXY || process.env.HTTP_PROXY;
|
|
6399
|
-
const proxyAgent = proxyPath ? new HttpsProxyAgent(
|
|
6400
|
-
|
|
6401
|
-
|
|
7026
|
+
const proxyAgent = proxyPath ? new HttpsProxyAgent(
|
|
7027
|
+
Object.assign(url.parse(proxyPath), {
|
|
7028
|
+
keepAlive
|
|
7029
|
+
})
|
|
7030
|
+
) : null;
|
|
6402
7031
|
metrics.send_request = function(options, callback) {
|
|
6403
7032
|
callback = callback || function() {
|
|
6404
7033
|
};
|
|
@@ -6406,8 +7035,8 @@ var require_mixpanel_node = __commonJS({
|
|
|
6406
7035
|
const endpoint = options.endpoint;
|
|
6407
7036
|
const method = (options.method || "GET").toUpperCase();
|
|
6408
7037
|
let query_params = {
|
|
6409
|
-
|
|
6410
|
-
|
|
7038
|
+
ip: metrics.config.geolocate ? 1 : 0,
|
|
7039
|
+
verbose: metrics.config.verbose ? 1 : 0
|
|
6411
7040
|
};
|
|
6412
7041
|
const key = metrics.config.key;
|
|
6413
7042
|
const secret = metrics.config.secret;
|
|
@@ -6440,7 +7069,9 @@ var require_mixpanel_node = __commonJS({
|
|
|
6440
7069
|
} else if (key) {
|
|
6441
7070
|
query_params.api_key = key;
|
|
6442
7071
|
} else if (endpoint === "/import") {
|
|
6443
|
-
throw new Error(
|
|
7072
|
+
throw new Error(
|
|
7073
|
+
"The Mixpanel Client needs a Mixpanel API Secret when importing old events: `init(token, { secret: ... })`"
|
|
7074
|
+
);
|
|
6444
7075
|
}
|
|
6445
7076
|
request_options.agent = proxyAgent || REQUEST_AGENTS[metrics.config.protocol];
|
|
6446
7077
|
if (metrics.config.test) {
|
|
@@ -6448,20 +7079,22 @@ var require_mixpanel_node = __commonJS({
|
|
|
6448
7079
|
}
|
|
6449
7080
|
request_options.path = metrics.config.path + endpoint + "?" + querystring.stringify(query_params);
|
|
6450
7081
|
request = request_lib.request(request_options, function(res) {
|
|
6451
|
-
|
|
7082
|
+
let data = "";
|
|
6452
7083
|
res.on("data", function(chunk3) {
|
|
6453
7084
|
data += chunk3;
|
|
6454
7085
|
});
|
|
6455
7086
|
res.on("end", function() {
|
|
6456
|
-
|
|
7087
|
+
let e;
|
|
6457
7088
|
if (metrics.config.verbose) {
|
|
6458
7089
|
try {
|
|
6459
|
-
|
|
7090
|
+
const result = JSON.parse(data);
|
|
6460
7091
|
if (result.status != 1) {
|
|
6461
7092
|
e = new Error("Mixpanel Server Error: " + result.error);
|
|
6462
7093
|
}
|
|
6463
7094
|
} catch (ex) {
|
|
6464
|
-
e = new Error(
|
|
7095
|
+
e = new Error(
|
|
7096
|
+
"Could not parse response from Mixpanel " + ex.message
|
|
7097
|
+
);
|
|
6465
7098
|
}
|
|
6466
7099
|
} else {
|
|
6467
7100
|
e = data !== "1" ? new Error("Mixpanel Server Error: " + data) : void 0;
|
|
@@ -6484,39 +7117,46 @@ var require_mixpanel_node = __commonJS({
|
|
|
6484
7117
|
properties.token = metrics.token;
|
|
6485
7118
|
properties.mp_lib = "node";
|
|
6486
7119
|
properties.$lib_version = packageInfo.version;
|
|
6487
|
-
|
|
7120
|
+
const data = {
|
|
6488
7121
|
event,
|
|
6489
7122
|
properties
|
|
6490
7123
|
};
|
|
6491
7124
|
if (metrics.config.debug) {
|
|
6492
|
-
metrics.config.logger.debug("Sending the following event to Mixpanel", {
|
|
7125
|
+
metrics.config.logger.debug("Sending the following event to Mixpanel", {
|
|
7126
|
+
data
|
|
7127
|
+
});
|
|
6493
7128
|
}
|
|
6494
|
-
metrics.send_request(
|
|
7129
|
+
metrics.send_request(
|
|
7130
|
+
{ method: "GET", endpoint, data },
|
|
7131
|
+
callback
|
|
7132
|
+
);
|
|
6495
7133
|
};
|
|
6496
|
-
|
|
6497
|
-
|
|
7134
|
+
const chunk2 = function(arr, size) {
|
|
7135
|
+
let chunks = [], i = 0, total = arr.length;
|
|
6498
7136
|
while (i < total) {
|
|
6499
7137
|
chunks.push(arr.slice(i, i += size));
|
|
6500
7138
|
}
|
|
6501
7139
|
return chunks;
|
|
6502
7140
|
};
|
|
6503
|
-
|
|
6504
|
-
|
|
7141
|
+
const send_batch_requests = function(options, callback) {
|
|
7142
|
+
const event_list = options.event_list, endpoint = options.endpoint, max_batch_size = options.max_batch_size ? Math.min(MAX_BATCH_SIZE, options.max_batch_size) : MAX_BATCH_SIZE, max_concurrent_requests = options.max_concurrent_requests || options.max_batch_size > MAX_BATCH_SIZE && Math.ceil(options.max_batch_size / MAX_BATCH_SIZE), event_batches = chunk2(event_list, max_batch_size), request_batches = max_concurrent_requests ? chunk2(event_batches, max_concurrent_requests) : [event_batches], total_event_batches = event_batches.length, total_request_batches = request_batches.length;
|
|
6505
7143
|
function send_event_batch(batch, cb) {
|
|
6506
7144
|
if (batch.length > 0) {
|
|
6507
7145
|
batch = batch.map(function(event) {
|
|
6508
|
-
event.properties;
|
|
6509
7146
|
if (endpoint === "/import" || event.properties.time) {
|
|
6510
7147
|
event.properties.time = ensure_timestamp(event.properties.time);
|
|
6511
7148
|
}
|
|
6512
7149
|
event.properties.token = event.properties.token || metrics.token;
|
|
6513
7150
|
return event;
|
|
6514
7151
|
});
|
|
6515
|
-
metrics.send_request(
|
|
7152
|
+
metrics.send_request(
|
|
7153
|
+
{ method: "POST", endpoint, data: batch },
|
|
7154
|
+
cb
|
|
7155
|
+
);
|
|
6516
7156
|
}
|
|
6517
7157
|
}
|
|
6518
7158
|
function send_next_request_batch(index) {
|
|
6519
|
-
|
|
7159
|
+
const request_batch = request_batches[index], cb = function(errors, results) {
|
|
6520
7160
|
index += 1;
|
|
6521
7161
|
if (index === total_request_batches) {
|
|
6522
7162
|
callback && callback(errors, results);
|
|
@@ -6549,7 +7189,7 @@ var require_mixpanel_node = __commonJS({
|
|
|
6549
7189
|
callback = options;
|
|
6550
7190
|
options = {};
|
|
6551
7191
|
}
|
|
6552
|
-
|
|
7192
|
+
const batch_options = {
|
|
6553
7193
|
event_list,
|
|
6554
7194
|
endpoint: "/track",
|
|
6555
7195
|
max_concurrent_requests: options.max_concurrent_requests,
|
|
@@ -6566,7 +7206,7 @@ var require_mixpanel_node = __commonJS({
|
|
|
6566
7206
|
metrics.send_event_request("/import", event, properties, callback);
|
|
6567
7207
|
};
|
|
6568
7208
|
metrics.import_batch = function(event_list, options, callback) {
|
|
6569
|
-
|
|
7209
|
+
let batch_options;
|
|
6570
7210
|
if (typeof options === "function" || !options) {
|
|
6571
7211
|
callback = options;
|
|
6572
7212
|
options = {};
|
|
@@ -6580,7 +7220,7 @@ var require_mixpanel_node = __commonJS({
|
|
|
6580
7220
|
send_batch_requests(batch_options, callback);
|
|
6581
7221
|
};
|
|
6582
7222
|
metrics.alias = function(distinct_id, alias, callback) {
|
|
6583
|
-
|
|
7223
|
+
const properties = {
|
|
6584
7224
|
distinct_id,
|
|
6585
7225
|
alias
|
|
6586
7226
|
};
|
|
@@ -6806,10 +7446,10 @@ var init_tslib_es6 = __esm({
|
|
|
6806
7446
|
}
|
|
6807
7447
|
});
|
|
6808
7448
|
|
|
6809
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
7449
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/event/event.js
|
|
6810
7450
|
var IdentifyOperation, SpecialEventType;
|
|
6811
7451
|
var init_event = __esm({
|
|
6812
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
7452
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/event/event.js"() {
|
|
6813
7453
|
(function(IdentifyOperation3) {
|
|
6814
7454
|
IdentifyOperation3["SET"] = "$set";
|
|
6815
7455
|
IdentifyOperation3["SET_ONCE"] = "$setOnce";
|
|
@@ -6830,10 +7470,10 @@ var init_event = __esm({
|
|
|
6830
7470
|
}
|
|
6831
7471
|
});
|
|
6832
7472
|
|
|
6833
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
7473
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/constants.js
|
|
6834
7474
|
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;
|
|
6835
7475
|
var init_constants = __esm({
|
|
6836
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
7476
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/constants.js"() {
|
|
6837
7477
|
UNSET_VALUE = "-";
|
|
6838
7478
|
AMPLITUDE_PREFIX = "AMP";
|
|
6839
7479
|
STORAGE_PREFIX = "".concat(AMPLITUDE_PREFIX, "_unsent");
|
|
@@ -6845,10 +7485,10 @@ var init_constants = __esm({
|
|
|
6845
7485
|
}
|
|
6846
7486
|
});
|
|
6847
7487
|
|
|
6848
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
7488
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js
|
|
6849
7489
|
var MAX_PROPERTY_KEYS, isValidObject, isValidProperties;
|
|
6850
7490
|
var init_valid_properties = __esm({
|
|
6851
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
7491
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js"() {
|
|
6852
7492
|
init_tslib_es6();
|
|
6853
7493
|
MAX_PROPERTY_KEYS = 1e3;
|
|
6854
7494
|
isValidObject = function(properties) {
|
|
@@ -6903,10 +7543,10 @@ var init_valid_properties = __esm({
|
|
|
6903
7543
|
}
|
|
6904
7544
|
});
|
|
6905
7545
|
|
|
6906
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
7546
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/identify.js
|
|
6907
7547
|
var Identify, IdentifyOperation2, OrderedIdentifyOperations;
|
|
6908
7548
|
var init_identify = __esm({
|
|
6909
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
7549
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/identify.js"() {
|
|
6910
7550
|
init_tslib_es6();
|
|
6911
7551
|
init_constants();
|
|
6912
7552
|
init_valid_properties();
|
|
@@ -7017,10 +7657,10 @@ var init_identify = __esm({
|
|
|
7017
7657
|
}
|
|
7018
7658
|
});
|
|
7019
7659
|
|
|
7020
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
7660
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/messages.js
|
|
7021
7661
|
var SUCCESS_MESSAGE, UNEXPECTED_ERROR_MESSAGE, MAX_RETRIES_EXCEEDED_MESSAGE, OPT_OUT_MESSAGE, MISSING_API_KEY_MESSAGE, INVALID_API_KEY, CLIENT_NOT_INITIALIZED;
|
|
7022
7662
|
var init_messages = __esm({
|
|
7023
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
7663
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/messages.js"() {
|
|
7024
7664
|
SUCCESS_MESSAGE = "Event tracked successfully";
|
|
7025
7665
|
UNEXPECTED_ERROR_MESSAGE = "Unexpected error occurred";
|
|
7026
7666
|
MAX_RETRIES_EXCEEDED_MESSAGE = "Event rejected due to exceeded retry count";
|
|
@@ -7031,10 +7671,10 @@ var init_messages = __esm({
|
|
|
7031
7671
|
}
|
|
7032
7672
|
});
|
|
7033
7673
|
|
|
7034
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
7674
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/status.js
|
|
7035
7675
|
var Status;
|
|
7036
7676
|
var init_status = __esm({
|
|
7037
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
7677
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/status.js"() {
|
|
7038
7678
|
(function(Status2) {
|
|
7039
7679
|
Status2["Unknown"] = "unknown";
|
|
7040
7680
|
Status2["Skipped"] = "skipped";
|
|
@@ -7049,10 +7689,10 @@ var init_status = __esm({
|
|
|
7049
7689
|
}
|
|
7050
7690
|
});
|
|
7051
7691
|
|
|
7052
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
7692
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js
|
|
7053
7693
|
var buildResult;
|
|
7054
7694
|
var init_result_builder = __esm({
|
|
7055
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
7695
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js"() {
|
|
7056
7696
|
init_status();
|
|
7057
7697
|
buildResult = function(event, code, message2) {
|
|
7058
7698
|
if (code === void 0) {
|
|
@@ -7066,10 +7706,10 @@ var init_result_builder = __esm({
|
|
|
7066
7706
|
}
|
|
7067
7707
|
});
|
|
7068
7708
|
|
|
7069
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
7709
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js
|
|
7070
7710
|
var getGlobalScope;
|
|
7071
7711
|
var init_global_scope = __esm({
|
|
7072
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
7712
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js"() {
|
|
7073
7713
|
getGlobalScope = function() {
|
|
7074
7714
|
var ampIntegrationContextName = "ampIntegrationContext";
|
|
7075
7715
|
if (typeof globalThis !== "undefined" && typeof globalThis[ampIntegrationContextName] !== "undefined") {
|
|
@@ -7092,10 +7732,10 @@ var init_global_scope = __esm({
|
|
|
7092
7732
|
}
|
|
7093
7733
|
});
|
|
7094
7734
|
|
|
7095
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
7735
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js
|
|
7096
7736
|
var legacyUUID, hex, UUID2;
|
|
7097
7737
|
var init_uuid = __esm({
|
|
7098
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
7738
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js"() {
|
|
7099
7739
|
init_tslib_es6();
|
|
7100
7740
|
init_global_scope();
|
|
7101
7741
|
legacyUUID = function(a) {
|
|
@@ -7139,10 +7779,10 @@ var init_uuid = __esm({
|
|
|
7139
7779
|
}
|
|
7140
7780
|
});
|
|
7141
7781
|
|
|
7142
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
7782
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/timeline.js
|
|
7143
7783
|
var Timeline;
|
|
7144
7784
|
var init_timeline = __esm({
|
|
7145
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
7785
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/timeline.js"() {
|
|
7146
7786
|
init_tslib_es6();
|
|
7147
7787
|
init_result_builder();
|
|
7148
7788
|
init_uuid();
|
|
@@ -7444,10 +8084,10 @@ var init_timeline = __esm({
|
|
|
7444
8084
|
}
|
|
7445
8085
|
});
|
|
7446
8086
|
|
|
7447
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8087
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js
|
|
7448
8088
|
var createTrackEvent, createIdentifyEvent, createGroupIdentifyEvent, createGroupEvent, createRevenueEvent;
|
|
7449
8089
|
var init_event_builder = __esm({
|
|
7450
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8090
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js"() {
|
|
7451
8091
|
init_tslib_es6();
|
|
7452
8092
|
init_identify();
|
|
7453
8093
|
init_event();
|
|
@@ -7477,10 +8117,10 @@ var init_event_builder = __esm({
|
|
|
7477
8117
|
}
|
|
7478
8118
|
});
|
|
7479
8119
|
|
|
7480
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8120
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js
|
|
7481
8121
|
var returnWrapper;
|
|
7482
8122
|
var init_return_wrapper = __esm({
|
|
7483
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8123
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js"() {
|
|
7484
8124
|
returnWrapper = function(awaitable) {
|
|
7485
8125
|
return {
|
|
7486
8126
|
promise: awaitable || Promise.resolve()
|
|
@@ -7489,10 +8129,10 @@ var init_return_wrapper = __esm({
|
|
|
7489
8129
|
}
|
|
7490
8130
|
});
|
|
7491
8131
|
|
|
7492
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8132
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/core-client.js
|
|
7493
8133
|
var AmplitudeCore;
|
|
7494
8134
|
var init_core_client = __esm({
|
|
7495
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8135
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/core-client.js"() {
|
|
7496
8136
|
init_tslib_es6();
|
|
7497
8137
|
init_event();
|
|
7498
8138
|
init_identify();
|
|
@@ -7760,10 +8400,10 @@ var init_core_client = __esm({
|
|
|
7760
8400
|
}
|
|
7761
8401
|
});
|
|
7762
8402
|
|
|
7763
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8403
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/revenue.js
|
|
7764
8404
|
var Revenue, RevenueProperty;
|
|
7765
8405
|
var init_revenue = __esm({
|
|
7766
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8406
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/revenue.js"() {
|
|
7767
8407
|
init_tslib_es6();
|
|
7768
8408
|
init_valid_properties();
|
|
7769
8409
|
Revenue = /** @class */
|
|
@@ -7840,10 +8480,10 @@ var init_revenue = __esm({
|
|
|
7840
8480
|
}
|
|
7841
8481
|
});
|
|
7842
8482
|
|
|
7843
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8483
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js
|
|
7844
8484
|
var chunk;
|
|
7845
8485
|
var init_chunk = __esm({
|
|
7846
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8486
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js"() {
|
|
7847
8487
|
chunk = function(arr, size) {
|
|
7848
8488
|
var chunkSize = Math.max(size, 1);
|
|
7849
8489
|
return arr.reduce(function(chunks, element, index) {
|
|
@@ -7858,10 +8498,10 @@ var init_chunk = __esm({
|
|
|
7858
8498
|
}
|
|
7859
8499
|
});
|
|
7860
8500
|
|
|
7861
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8501
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/loglevel.js
|
|
7862
8502
|
var LogLevel;
|
|
7863
8503
|
var init_loglevel = __esm({
|
|
7864
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8504
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/loglevel.js"() {
|
|
7865
8505
|
(function(LogLevel2) {
|
|
7866
8506
|
LogLevel2[LogLevel2["None"] = 0] = "None";
|
|
7867
8507
|
LogLevel2[LogLevel2["Error"] = 1] = "Error";
|
|
@@ -7872,10 +8512,10 @@ var init_loglevel = __esm({
|
|
|
7872
8512
|
}
|
|
7873
8513
|
});
|
|
7874
8514
|
|
|
7875
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8515
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/logger.js
|
|
7876
8516
|
var PREFIX, Logger;
|
|
7877
8517
|
var init_logger2 = __esm({
|
|
7878
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8518
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/logger.js"() {
|
|
7879
8519
|
init_loglevel();
|
|
7880
8520
|
PREFIX = "Amplitude Logger ";
|
|
7881
8521
|
Logger = /** @class */
|
|
@@ -7937,10 +8577,10 @@ var init_logger2 = __esm({
|
|
|
7937
8577
|
}
|
|
7938
8578
|
});
|
|
7939
8579
|
|
|
7940
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8580
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/config.js
|
|
7941
8581
|
var getDefaultConfig, Config, getServerUrl, createServerConfig, RequestMetadata;
|
|
7942
8582
|
var init_config = __esm({
|
|
7943
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8583
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/config.js"() {
|
|
7944
8584
|
init_constants();
|
|
7945
8585
|
init_logger2();
|
|
7946
8586
|
init_loglevel();
|
|
@@ -8041,19 +8681,19 @@ var init_config = __esm({
|
|
|
8041
8681
|
}
|
|
8042
8682
|
});
|
|
8043
8683
|
|
|
8044
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8684
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/status-code.js
|
|
8045
8685
|
function isSuccessStatusCode(code) {
|
|
8046
8686
|
return code >= 200 && code < 300;
|
|
8047
8687
|
}
|
|
8048
8688
|
var init_status_code = __esm({
|
|
8049
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8689
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/status-code.js"() {
|
|
8050
8690
|
}
|
|
8051
8691
|
});
|
|
8052
8692
|
|
|
8053
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8693
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js
|
|
8054
8694
|
var getStacktrace, getClientLogConfig, getValueByStringPath, getClientStates, debugWrapper;
|
|
8055
8695
|
var init_debug = __esm({
|
|
8056
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8696
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js"() {
|
|
8057
8697
|
init_tslib_es6();
|
|
8058
8698
|
init_loglevel();
|
|
8059
8699
|
getStacktrace = function(ignoreDepth) {
|
|
@@ -8171,7 +8811,7 @@ var init_debug = __esm({
|
|
|
8171
8811
|
}
|
|
8172
8812
|
});
|
|
8173
8813
|
|
|
8174
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8814
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js
|
|
8175
8815
|
function getErrorMessage(error) {
|
|
8176
8816
|
if (error instanceof Error)
|
|
8177
8817
|
return error.message;
|
|
@@ -8189,7 +8829,7 @@ function getResponseBodyString(res) {
|
|
|
8189
8829
|
}
|
|
8190
8830
|
var Destination;
|
|
8191
8831
|
var init_destination = __esm({
|
|
8192
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
8832
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js"() {
|
|
8193
8833
|
init_tslib_es6();
|
|
8194
8834
|
init_status();
|
|
8195
8835
|
init_messages();
|
|
@@ -8580,10 +9220,10 @@ var init_destination = __esm({
|
|
|
8580
9220
|
}
|
|
8581
9221
|
});
|
|
8582
9222
|
|
|
8583
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
9223
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js
|
|
8584
9224
|
var BaseTransport;
|
|
8585
9225
|
var init_base2 = __esm({
|
|
8586
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
9226
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js"() {
|
|
8587
9227
|
init_status();
|
|
8588
9228
|
init_status_code();
|
|
8589
9229
|
BaseTransport = /** @class */
|
|
@@ -8685,10 +9325,10 @@ var init_base2 = __esm({
|
|
|
8685
9325
|
}
|
|
8686
9326
|
});
|
|
8687
9327
|
|
|
8688
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
9328
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/server-zone.js
|
|
8689
9329
|
var ServerZone;
|
|
8690
9330
|
var init_server_zone = __esm({
|
|
8691
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
9331
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/server-zone.js"() {
|
|
8692
9332
|
(function(ServerZone2) {
|
|
8693
9333
|
ServerZone2["US"] = "US";
|
|
8694
9334
|
ServerZone2["EU"] = "EU";
|
|
@@ -8697,17 +9337,17 @@ var init_server_zone = __esm({
|
|
|
8697
9337
|
}
|
|
8698
9338
|
});
|
|
8699
9339
|
|
|
8700
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
9340
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/offline.js
|
|
8701
9341
|
var OfflineDisabled;
|
|
8702
9342
|
var init_offline = __esm({
|
|
8703
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
9343
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/offline.js"() {
|
|
8704
9344
|
OfflineDisabled = null;
|
|
8705
9345
|
}
|
|
8706
9346
|
});
|
|
8707
9347
|
|
|
8708
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
9348
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/index.js
|
|
8709
9349
|
var init_esm = __esm({
|
|
8710
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
9350
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/index.js"() {
|
|
8711
9351
|
init_core_client();
|
|
8712
9352
|
init_identify();
|
|
8713
9353
|
init_revenue();
|
|
@@ -8724,18 +9364,18 @@ var init_esm = __esm({
|
|
|
8724
9364
|
}
|
|
8725
9365
|
});
|
|
8726
9366
|
|
|
8727
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
9367
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/version.js
|
|
8728
9368
|
var VERSION;
|
|
8729
9369
|
var init_version2 = __esm({
|
|
8730
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
8731
|
-
VERSION = "1.5.
|
|
9370
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/version.js"() {
|
|
9371
|
+
VERSION = "1.5.31";
|
|
8732
9372
|
}
|
|
8733
9373
|
});
|
|
8734
9374
|
|
|
8735
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
9375
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/plugins/context.js
|
|
8736
9376
|
var Context;
|
|
8737
9377
|
var init_context2 = __esm({
|
|
8738
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
9378
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/plugins/context.js"() {
|
|
8739
9379
|
init_tslib_es6();
|
|
8740
9380
|
init_esm();
|
|
8741
9381
|
init_version2();
|
|
@@ -8770,7 +9410,7 @@ var init_context2 = __esm({
|
|
|
8770
9410
|
});
|
|
8771
9411
|
var Http;
|
|
8772
9412
|
var init_http = __esm({
|
|
8773
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
9413
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/transports/http.js"() {
|
|
8774
9414
|
init_tslib_es6();
|
|
8775
9415
|
init_esm();
|
|
8776
9416
|
Http = /** @class */
|
|
@@ -8832,10 +9472,10 @@ var init_http = __esm({
|
|
|
8832
9472
|
}
|
|
8833
9473
|
});
|
|
8834
9474
|
|
|
8835
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
9475
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/config.js
|
|
8836
9476
|
var NodeConfig, useNodeConfig;
|
|
8837
9477
|
var init_config2 = __esm({
|
|
8838
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
9478
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/config.js"() {
|
|
8839
9479
|
init_tslib_es6();
|
|
8840
9480
|
init_esm();
|
|
8841
9481
|
init_http();
|
|
@@ -8853,10 +9493,10 @@ var init_config2 = __esm({
|
|
|
8853
9493
|
}
|
|
8854
9494
|
});
|
|
8855
9495
|
|
|
8856
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
9496
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/node-client.js
|
|
8857
9497
|
var AmplitudeNode, createInstance, node_client_default;
|
|
8858
9498
|
var init_node_client = __esm({
|
|
8859
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
9499
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/node-client.js"() {
|
|
8860
9500
|
init_tslib_es6();
|
|
8861
9501
|
init_esm();
|
|
8862
9502
|
init_context2();
|
|
@@ -8930,7 +9570,7 @@ var init_node_client = __esm({
|
|
|
8930
9570
|
}
|
|
8931
9571
|
});
|
|
8932
9572
|
|
|
8933
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
9573
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/types.js
|
|
8934
9574
|
var types_exports = {};
|
|
8935
9575
|
__export(types_exports, {
|
|
8936
9576
|
IdentifyOperation: () => IdentifyOperation,
|
|
@@ -8941,12 +9581,12 @@ __export(types_exports, {
|
|
|
8941
9581
|
SpecialEventType: () => SpecialEventType
|
|
8942
9582
|
});
|
|
8943
9583
|
var init_types4 = __esm({
|
|
8944
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
9584
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/types.js"() {
|
|
8945
9585
|
init_esm();
|
|
8946
9586
|
}
|
|
8947
9587
|
});
|
|
8948
9588
|
|
|
8949
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
9589
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/index.js
|
|
8950
9590
|
var esm_exports = {};
|
|
8951
9591
|
__export(esm_exports, {
|
|
8952
9592
|
Identify: () => Identify,
|
|
@@ -8967,7 +9607,7 @@ __export(esm_exports, {
|
|
|
8967
9607
|
});
|
|
8968
9608
|
var add, groupIdentify, identify, init, logEvent, remove, revenue, setGroup, setOptOut, track, flush;
|
|
8969
9609
|
var init_esm2 = __esm({
|
|
8970
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
9610
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/index.js"() {
|
|
8971
9611
|
init_node_client();
|
|
8972
9612
|
init_node_client();
|
|
8973
9613
|
init_esm();
|
|
@@ -10769,7 +11409,7 @@ var init_is_disjoint = __esm({
|
|
|
10769
11409
|
function isObjectLike(value) {
|
|
10770
11410
|
return typeof value === "object" && value !== null;
|
|
10771
11411
|
}
|
|
10772
|
-
function
|
|
11412
|
+
function isObject2(input) {
|
|
10773
11413
|
if (!isObjectLike(input) || Object.prototype.toString.call(input) !== "[object Object]") {
|
|
10774
11414
|
return false;
|
|
10775
11415
|
}
|
|
@@ -10789,7 +11429,7 @@ var init_is_object = __esm({
|
|
|
10789
11429
|
|
|
10790
11430
|
// ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_jwk.js
|
|
10791
11431
|
function isJWK(key) {
|
|
10792
|
-
return
|
|
11432
|
+
return isObject2(key) && typeof key.kty === "string";
|
|
10793
11433
|
}
|
|
10794
11434
|
function isPrivateJWK(key) {
|
|
10795
11435
|
return key.kty !== "oct" && typeof key.d === "string";
|
|
@@ -11433,7 +12073,7 @@ var init_produce = __esm({
|
|
|
11433
12073
|
ProduceJWT = class {
|
|
11434
12074
|
_payload;
|
|
11435
12075
|
constructor(payload = {}) {
|
|
11436
|
-
if (!
|
|
12076
|
+
if (!isObject2(payload)) {
|
|
11437
12077
|
throw new TypeError("JWT Claims Set MUST be an object");
|
|
11438
12078
|
}
|
|
11439
12079
|
this._payload = payload;
|