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/index.cjs
CHANGED
|
@@ -115,11 +115,11 @@ function normalizeWindowsPath(path) {
|
|
|
115
115
|
return path.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
|
|
116
116
|
}
|
|
117
117
|
var init_module_node = __esm({
|
|
118
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
118
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs"() {
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
121
|
|
|
122
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
122
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/featureFlagUtils.mjs
|
|
123
123
|
function getFlagDetailFromFlagAndPayload(key, value, payload) {
|
|
124
124
|
return {
|
|
125
125
|
key,
|
|
@@ -136,7 +136,7 @@ function getFlagDetailFromFlagAndPayload(key, value, payload) {
|
|
|
136
136
|
}
|
|
137
137
|
var normalizeFlagsResponse, getFlagValuesFromFlags, getPayloadsFromFlags, getFeatureFlagValue, parsePayload;
|
|
138
138
|
var init_featureFlagUtils = __esm({
|
|
139
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
139
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/featureFlagUtils.mjs"() {
|
|
140
140
|
normalizeFlagsResponse = (flagsResponse) => {
|
|
141
141
|
if ("flags" in flagsResponse) {
|
|
142
142
|
const featureFlags = getFlagValuesFromFlags(flagsResponse.flags);
|
|
@@ -194,10 +194,10 @@ var init_featureFlagUtils = __esm({
|
|
|
194
194
|
}
|
|
195
195
|
});
|
|
196
196
|
|
|
197
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
197
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/vendor/uuidv7.mjs
|
|
198
198
|
var DIGITS, UUID, V7Generator, getDefaultRandom, defaultGenerator, uuidv7, uuidv7obj;
|
|
199
199
|
var init_uuidv7 = __esm({
|
|
200
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
200
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/vendor/uuidv7.mjs"() {
|
|
201
201
|
DIGITS = "0123456789abcdef";
|
|
202
202
|
UUID = class _UUID {
|
|
203
203
|
constructor(bytes) {
|
|
@@ -358,10 +358,10 @@ var init_uuidv7 = __esm({
|
|
|
358
358
|
}
|
|
359
359
|
});
|
|
360
360
|
|
|
361
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
361
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/bot-detection.mjs
|
|
362
362
|
var DEFAULT_BLOCKED_UA_STRS, isBlockedUA;
|
|
363
363
|
var init_bot_detection = __esm({
|
|
364
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
364
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/bot-detection.mjs"() {
|
|
365
365
|
DEFAULT_BLOCKED_UA_STRS = [
|
|
366
366
|
"amazonbot",
|
|
367
367
|
"amazonproductbot",
|
|
@@ -452,10 +452,10 @@ var init_bot_detection = __esm({
|
|
|
452
452
|
}
|
|
453
453
|
});
|
|
454
454
|
|
|
455
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
455
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/types.mjs
|
|
456
456
|
var types_PostHogPersistedProperty;
|
|
457
457
|
var init_types = __esm({
|
|
458
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
458
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/types.mjs"() {
|
|
459
459
|
types_PostHogPersistedProperty = /* @__PURE__ */ (function(PostHogPersistedProperty) {
|
|
460
460
|
PostHogPersistedProperty["AnonymousId"] = "anonymous_id";
|
|
461
461
|
PostHogPersistedProperty["DistinctId"] = "distinct_id";
|
|
@@ -487,20 +487,13 @@ var init_types = __esm({
|
|
|
487
487
|
}
|
|
488
488
|
});
|
|
489
489
|
|
|
490
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
490
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/string-utils.mjs
|
|
491
491
|
var init_string_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/string-utils.mjs"() {
|
|
493
493
|
}
|
|
494
494
|
});
|
|
495
495
|
|
|
496
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
497
|
-
function isInstanceOf(candidate, base) {
|
|
498
|
-
try {
|
|
499
|
-
return candidate instanceof base;
|
|
500
|
-
} catch {
|
|
501
|
-
return false;
|
|
502
|
-
}
|
|
503
|
-
}
|
|
496
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/type-utils.mjs
|
|
504
497
|
function isPrimitive(value) {
|
|
505
498
|
return null === value || "object" != typeof value;
|
|
506
499
|
}
|
|
@@ -516,9 +509,16 @@ function isEvent(candidate) {
|
|
|
516
509
|
function isPlainObject(candidate) {
|
|
517
510
|
return isBuiltin(candidate, "Object");
|
|
518
511
|
}
|
|
519
|
-
|
|
512
|
+
function isInstanceOf(candidate, base) {
|
|
513
|
+
try {
|
|
514
|
+
return candidate instanceof base;
|
|
515
|
+
} catch {
|
|
516
|
+
return false;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
var nativeIsArray, ObjProto, type_utils_toString, isArray, isObject, isUndefined, isString, isEmptyString, isNumber, isPlainError;
|
|
520
520
|
var init_type_utils = __esm({
|
|
521
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
521
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/type-utils.mjs"() {
|
|
522
522
|
init_types();
|
|
523
523
|
init_string_utils();
|
|
524
524
|
nativeIsArray = Array.isArray;
|
|
@@ -528,6 +528,7 @@ var init_type_utils = __esm({
|
|
|
528
528
|
isArray = nativeIsArray || function(obj) {
|
|
529
529
|
return "[object Array]" === type_utils_toString.call(obj);
|
|
530
530
|
};
|
|
531
|
+
isObject = (x) => x === Object(x) && !isArray(x);
|
|
531
532
|
isUndefined = (x) => void 0 === x;
|
|
532
533
|
isString = (x) => "[object String]" == type_utils_toString.call(x);
|
|
533
534
|
isEmptyString = (x) => isString(x) && 0 === x.trim().length;
|
|
@@ -536,7 +537,7 @@ var init_type_utils = __esm({
|
|
|
536
537
|
}
|
|
537
538
|
});
|
|
538
539
|
|
|
539
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
540
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/number-utils.mjs
|
|
540
541
|
function clampToRange(value, min, max, logger, fallbackValue) {
|
|
541
542
|
if (min > max) {
|
|
542
543
|
logger.warn("min cannot be greater than max.");
|
|
@@ -554,15 +555,15 @@ function clampToRange(value, min, max, logger, fallbackValue) {
|
|
|
554
555
|
return clampToRange(max, min, max, logger);
|
|
555
556
|
}
|
|
556
557
|
var init_number_utils = __esm({
|
|
557
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
558
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/number-utils.mjs"() {
|
|
558
559
|
init_type_utils();
|
|
559
560
|
}
|
|
560
561
|
});
|
|
561
562
|
|
|
562
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
563
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs
|
|
563
564
|
var ONE_DAY_IN_MS, BucketedRateLimiter;
|
|
564
565
|
var init_bucketed_rate_limiter = __esm({
|
|
565
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
566
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs"() {
|
|
566
567
|
init_number_utils();
|
|
567
568
|
ONE_DAY_IN_MS = 864e5;
|
|
568
569
|
BucketedRateLimiter = class {
|
|
@@ -606,10 +607,10 @@ var init_bucketed_rate_limiter = __esm({
|
|
|
606
607
|
}
|
|
607
608
|
});
|
|
608
609
|
|
|
609
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
610
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/promise-queue.mjs
|
|
610
611
|
var PromiseQueue;
|
|
611
612
|
var init_promise_queue = __esm({
|
|
612
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
613
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/promise-queue.mjs"() {
|
|
613
614
|
init_uuidv7();
|
|
614
615
|
PromiseQueue = class {
|
|
615
616
|
add(promise) {
|
|
@@ -640,7 +641,7 @@ var init_promise_queue = __esm({
|
|
|
640
641
|
}
|
|
641
642
|
});
|
|
642
643
|
|
|
643
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
644
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/logger.mjs
|
|
644
645
|
function createConsole(consoleLike = console) {
|
|
645
646
|
const lockedMethods = {
|
|
646
647
|
log: consoleLike.log.bind(consoleLike),
|
|
@@ -655,7 +656,7 @@ function createLogger(prefix, maybeCall = passThrough) {
|
|
|
655
656
|
}
|
|
656
657
|
var _createLogger, passThrough;
|
|
657
658
|
var init_logger = __esm({
|
|
658
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
659
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/logger.mjs"() {
|
|
659
660
|
_createLogger = (prefix, maybeCall, consoleLike) => {
|
|
660
661
|
function _log(level, ...args) {
|
|
661
662
|
maybeCall(() => {
|
|
@@ -684,10 +685,10 @@ var init_logger = __esm({
|
|
|
684
685
|
}
|
|
685
686
|
});
|
|
686
687
|
|
|
687
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
688
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs
|
|
688
689
|
var MOBILE, TABLET, GENERIC;
|
|
689
690
|
var init_user_agent_utils = __esm({
|
|
690
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
691
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs"() {
|
|
691
692
|
init_string_utils();
|
|
692
693
|
init_type_utils();
|
|
693
694
|
MOBILE = "Mobile";
|
|
@@ -698,7 +699,7 @@ var init_user_agent_utils = __esm({
|
|
|
698
699
|
}
|
|
699
700
|
});
|
|
700
701
|
|
|
701
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
702
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/index.mjs
|
|
702
703
|
function assert(truthyValue, message2) {
|
|
703
704
|
if (!truthyValue || "string" != typeof truthyValue || isEmpty(truthyValue)) throw new Error(message2);
|
|
704
705
|
}
|
|
@@ -742,7 +743,7 @@ function allSettled(promises) {
|
|
|
742
743
|
}
|
|
743
744
|
var STRING_FORMAT, isError;
|
|
744
745
|
var init_utils = __esm({
|
|
745
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
746
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/utils/index.mjs"() {
|
|
746
747
|
init_bot_detection();
|
|
747
748
|
init_bucketed_rate_limiter();
|
|
748
749
|
init_number_utils();
|
|
@@ -756,10 +757,10 @@ var init_utils = __esm({
|
|
|
756
757
|
}
|
|
757
758
|
});
|
|
758
759
|
|
|
759
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
760
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/eventemitter.mjs
|
|
760
761
|
var SimpleEventEmitter;
|
|
761
762
|
var init_eventemitter = __esm({
|
|
762
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
763
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/eventemitter.mjs"() {
|
|
763
764
|
SimpleEventEmitter = class {
|
|
764
765
|
constructor() {
|
|
765
766
|
this.events = {};
|
|
@@ -780,7 +781,7 @@ var init_eventemitter = __esm({
|
|
|
780
781
|
}
|
|
781
782
|
});
|
|
782
783
|
|
|
783
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
784
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/gzip.mjs
|
|
784
785
|
function isGzipSupported() {
|
|
785
786
|
return "CompressionStream" in globalThis;
|
|
786
787
|
}
|
|
@@ -799,11 +800,11 @@ async function gzipCompress(input, isDebug = true) {
|
|
|
799
800
|
}
|
|
800
801
|
}
|
|
801
802
|
var init_gzip = __esm({
|
|
802
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
803
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/gzip.mjs"() {
|
|
803
804
|
}
|
|
804
805
|
});
|
|
805
806
|
|
|
806
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
807
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/posthog-core-stateless.mjs
|
|
807
808
|
async function logFlushError(err) {
|
|
808
809
|
if (err instanceof PostHogFetchHttpError) {
|
|
809
810
|
let text = "";
|
|
@@ -823,7 +824,7 @@ function isPostHogFetchContentTooLargeError(err) {
|
|
|
823
824
|
}
|
|
824
825
|
var PostHogFetchHttpError, PostHogFetchNetworkError, PostHogCoreStateless;
|
|
825
826
|
var init_posthog_core_stateless = __esm({
|
|
826
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
827
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/posthog-core-stateless.mjs"() {
|
|
827
828
|
init_eventemitter();
|
|
828
829
|
init_featureFlagUtils();
|
|
829
830
|
init_gzip();
|
|
@@ -1441,9 +1442,9 @@ var init_posthog_core_stateless = __esm({
|
|
|
1441
1442
|
}
|
|
1442
1443
|
});
|
|
1443
1444
|
|
|
1444
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1445
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/posthog-core.mjs
|
|
1445
1446
|
var init_posthog_core = __esm({
|
|
1446
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1447
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/posthog-core.mjs"() {
|
|
1447
1448
|
init_featureFlagUtils();
|
|
1448
1449
|
init_types();
|
|
1449
1450
|
init_posthog_core_stateless();
|
|
@@ -1452,7 +1453,7 @@ var init_posthog_core = __esm({
|
|
|
1452
1453
|
}
|
|
1453
1454
|
});
|
|
1454
1455
|
|
|
1455
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1456
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs
|
|
1456
1457
|
function getFilenameToChunkIdMap(stackParser) {
|
|
1457
1458
|
const chunkIdMap = globalThis._posthogChunkIds;
|
|
1458
1459
|
if (!chunkIdMap) return;
|
|
@@ -1485,14 +1486,14 @@ function getFilenameToChunkIdMap(stackParser) {
|
|
|
1485
1486
|
}
|
|
1486
1487
|
var parsedStackResults, lastKeysCount, cachedFilenameChunkIds;
|
|
1487
1488
|
var init_chunk_ids = __esm({
|
|
1488
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1489
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs"() {
|
|
1489
1490
|
}
|
|
1490
1491
|
});
|
|
1491
1492
|
|
|
1492
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1493
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs
|
|
1493
1494
|
var MAX_CAUSE_RECURSION, ErrorPropertiesBuilder;
|
|
1494
1495
|
var init_error_properties_builder = __esm({
|
|
1495
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1496
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs"() {
|
|
1496
1497
|
init_utils();
|
|
1497
1498
|
init_chunk_ids();
|
|
1498
1499
|
MAX_CAUSE_RECURSION = 4;
|
|
@@ -1606,7 +1607,7 @@ var init_error_properties_builder = __esm({
|
|
|
1606
1607
|
}
|
|
1607
1608
|
});
|
|
1608
1609
|
|
|
1609
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1610
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs
|
|
1610
1611
|
function createFrame(platform, filename, func, lineno, colno) {
|
|
1611
1612
|
const frame = {
|
|
1612
1613
|
platform,
|
|
@@ -1620,16 +1621,16 @@ function createFrame(platform, filename, func, lineno, colno) {
|
|
|
1620
1621
|
}
|
|
1621
1622
|
var UNKNOWN_FUNCTION;
|
|
1622
1623
|
var init_base = __esm({
|
|
1623
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1624
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs"() {
|
|
1624
1625
|
init_utils();
|
|
1625
1626
|
UNKNOWN_FUNCTION = "?";
|
|
1626
1627
|
}
|
|
1627
1628
|
});
|
|
1628
1629
|
|
|
1629
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1630
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs
|
|
1630
1631
|
var extractSafariExtensionDetails;
|
|
1631
1632
|
var init_safari = __esm({
|
|
1632
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1633
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs"() {
|
|
1633
1634
|
init_base();
|
|
1634
1635
|
extractSafariExtensionDetails = (func, filename) => {
|
|
1635
1636
|
const isSafariExtension = -1 !== func.indexOf("safari-extension");
|
|
@@ -1645,10 +1646,10 @@ var init_safari = __esm({
|
|
|
1645
1646
|
}
|
|
1646
1647
|
});
|
|
1647
1648
|
|
|
1648
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1649
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs
|
|
1649
1650
|
var chromeRegexNoFnName, chromeRegex, chromeEvalRegex, chromeStackLineParser;
|
|
1650
1651
|
var init_chrome = __esm({
|
|
1651
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1652
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs"() {
|
|
1652
1653
|
init_base();
|
|
1653
1654
|
init_safari();
|
|
1654
1655
|
chromeRegexNoFnName = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i;
|
|
@@ -1678,23 +1679,10 @@ var init_chrome = __esm({
|
|
|
1678
1679
|
}
|
|
1679
1680
|
});
|
|
1680
1681
|
|
|
1681
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1682
|
-
var winjsRegex, winjsStackLineParser;
|
|
1683
|
-
var init_winjs = __esm({
|
|
1684
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs"() {
|
|
1685
|
-
init_base();
|
|
1686
|
-
winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
|
|
1687
|
-
winjsStackLineParser = (line, platform) => {
|
|
1688
|
-
const parts = winjsRegex.exec(line);
|
|
1689
|
-
return parts ? createFrame(platform, parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : void 0) : void 0;
|
|
1690
|
-
};
|
|
1691
|
-
}
|
|
1692
|
-
});
|
|
1693
|
-
|
|
1694
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs
|
|
1682
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs
|
|
1695
1683
|
var geckoREgex, geckoEvalRegex, geckoStackLineParser;
|
|
1696
1684
|
var init_gecko = __esm({
|
|
1697
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1685
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs"() {
|
|
1698
1686
|
init_base();
|
|
1699
1687
|
init_safari();
|
|
1700
1688
|
geckoREgex = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i;
|
|
@@ -1721,10 +1709,23 @@ var init_gecko = __esm({
|
|
|
1721
1709
|
}
|
|
1722
1710
|
});
|
|
1723
1711
|
|
|
1724
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1712
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs
|
|
1713
|
+
var winjsRegex, winjsStackLineParser;
|
|
1714
|
+
var init_winjs = __esm({
|
|
1715
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs"() {
|
|
1716
|
+
init_base();
|
|
1717
|
+
winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
|
|
1718
|
+
winjsStackLineParser = (line, platform) => {
|
|
1719
|
+
const parts = winjsRegex.exec(line);
|
|
1720
|
+
return parts ? createFrame(platform, parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : void 0) : void 0;
|
|
1721
|
+
};
|
|
1722
|
+
}
|
|
1723
|
+
});
|
|
1724
|
+
|
|
1725
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs
|
|
1725
1726
|
var opera10Regex, opera10StackLineParser, opera11Regex, opera11StackLineParser;
|
|
1726
1727
|
var init_opera = __esm({
|
|
1727
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1728
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs"() {
|
|
1728
1729
|
init_base();
|
|
1729
1730
|
opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;
|
|
1730
1731
|
opera10StackLineParser = (line, platform) => {
|
|
@@ -1739,7 +1740,7 @@ var init_opera = __esm({
|
|
|
1739
1740
|
}
|
|
1740
1741
|
});
|
|
1741
1742
|
|
|
1742
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1743
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs
|
|
1743
1744
|
function filenameIsInApp(filename, isNative = false) {
|
|
1744
1745
|
const isInternal = isNative || filename && !filename.startsWith("/") && !filename.match(/^[A-Z]:/) && !filename.startsWith(".") && !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//);
|
|
1745
1746
|
return !isInternal && void 0 !== filename && !filename.includes("node_modules/");
|
|
@@ -1749,7 +1750,7 @@ function _parseIntOrUndefined(input) {
|
|
|
1749
1750
|
}
|
|
1750
1751
|
var FILENAME_MATCH, FULL_MATCH, nodeStackLineParser;
|
|
1751
1752
|
var init_node = __esm({
|
|
1752
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1753
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs"() {
|
|
1753
1754
|
init_base();
|
|
1754
1755
|
FILENAME_MATCH = /^\s*[-]{4,}$/;
|
|
1755
1756
|
FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
|
|
@@ -1810,7 +1811,7 @@ var init_node = __esm({
|
|
|
1810
1811
|
}
|
|
1811
1812
|
});
|
|
1812
1813
|
|
|
1813
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1814
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs
|
|
1814
1815
|
function reverseAndStripFrames(stack) {
|
|
1815
1816
|
if (!stack.length) return [];
|
|
1816
1817
|
const localStack = Array.from(stack);
|
|
@@ -1824,6 +1825,9 @@ function reverseAndStripFrames(stack) {
|
|
|
1824
1825
|
function getLastStackFrame(arr) {
|
|
1825
1826
|
return arr[arr.length - 1] || {};
|
|
1826
1827
|
}
|
|
1828
|
+
function createDefaultStackParser() {
|
|
1829
|
+
return createStackParser("web:javascript", chromeStackLineParser, geckoStackLineParser);
|
|
1830
|
+
}
|
|
1827
1831
|
function createStackParser(platform, ...parsers) {
|
|
1828
1832
|
return (stack, skipFirstLines = 0) => {
|
|
1829
1833
|
const frames = [];
|
|
@@ -1848,11 +1852,11 @@ function createStackParser(platform, ...parsers) {
|
|
|
1848
1852
|
}
|
|
1849
1853
|
var WEBPACK_ERROR_REGEXP, STACKTRACE_FRAME_LIMIT;
|
|
1850
1854
|
var init_parsers = __esm({
|
|
1851
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1855
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs"() {
|
|
1852
1856
|
init_base();
|
|
1853
1857
|
init_chrome();
|
|
1854
|
-
init_winjs();
|
|
1855
1858
|
init_gecko();
|
|
1859
|
+
init_winjs();
|
|
1856
1860
|
init_opera();
|
|
1857
1861
|
init_node();
|
|
1858
1862
|
WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/;
|
|
@@ -1860,10 +1864,10 @@ var init_parsers = __esm({
|
|
|
1860
1864
|
}
|
|
1861
1865
|
});
|
|
1862
1866
|
|
|
1863
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1867
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs
|
|
1864
1868
|
var DOMExceptionCoercer;
|
|
1865
1869
|
var init_dom_exception_coercer = __esm({
|
|
1866
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1870
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs"() {
|
|
1867
1871
|
init_utils();
|
|
1868
1872
|
DOMExceptionCoercer = class {
|
|
1869
1873
|
match(err) {
|
|
@@ -1897,10 +1901,10 @@ var init_dom_exception_coercer = __esm({
|
|
|
1897
1901
|
}
|
|
1898
1902
|
});
|
|
1899
1903
|
|
|
1900
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1904
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs
|
|
1901
1905
|
var ErrorCoercer;
|
|
1902
1906
|
var init_error_coercer = __esm({
|
|
1903
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1907
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs"() {
|
|
1904
1908
|
init_utils();
|
|
1905
1909
|
ErrorCoercer = class {
|
|
1906
1910
|
match(err) {
|
|
@@ -1930,10 +1934,10 @@ var init_error_coercer = __esm({
|
|
|
1930
1934
|
}
|
|
1931
1935
|
});
|
|
1932
1936
|
|
|
1933
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1937
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs
|
|
1934
1938
|
var ErrorEventCoercer;
|
|
1935
1939
|
var init_error_event_coercer = __esm({
|
|
1936
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1940
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs"() {
|
|
1937
1941
|
init_utils();
|
|
1938
1942
|
ErrorEventCoercer = class {
|
|
1939
1943
|
constructor() {
|
|
@@ -1955,10 +1959,10 @@ var init_error_event_coercer = __esm({
|
|
|
1955
1959
|
}
|
|
1956
1960
|
});
|
|
1957
1961
|
|
|
1958
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1962
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs
|
|
1959
1963
|
var ERROR_TYPES_PATTERN, StringCoercer;
|
|
1960
1964
|
var init_string_coercer = __esm({
|
|
1961
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1965
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs"() {
|
|
1962
1966
|
ERROR_TYPES_PATTERN = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;
|
|
1963
1967
|
StringCoercer = class {
|
|
1964
1968
|
match(input) {
|
|
@@ -1990,10 +1994,10 @@ var init_string_coercer = __esm({
|
|
|
1990
1994
|
}
|
|
1991
1995
|
});
|
|
1992
1996
|
|
|
1993
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
1997
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/types.mjs
|
|
1994
1998
|
var severityLevels;
|
|
1995
1999
|
var init_types2 = __esm({
|
|
1996
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2000
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/types.mjs"() {
|
|
1997
2001
|
severityLevels = [
|
|
1998
2002
|
"fatal",
|
|
1999
2003
|
"error",
|
|
@@ -2005,7 +2009,7 @@ var init_types2 = __esm({
|
|
|
2005
2009
|
}
|
|
2006
2010
|
});
|
|
2007
2011
|
|
|
2008
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2012
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs
|
|
2009
2013
|
function extractExceptionKeysForMessage(err, maxLength = 40) {
|
|
2010
2014
|
const keys = Object.keys(err);
|
|
2011
2015
|
keys.sort();
|
|
@@ -2020,14 +2024,14 @@ function extractExceptionKeysForMessage(err, maxLength = 40) {
|
|
|
2020
2024
|
return "";
|
|
2021
2025
|
}
|
|
2022
2026
|
var init_utils2 = __esm({
|
|
2023
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2027
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs"() {
|
|
2024
2028
|
}
|
|
2025
2029
|
});
|
|
2026
2030
|
|
|
2027
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2031
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs
|
|
2028
2032
|
var ObjectCoercer;
|
|
2029
2033
|
var init_object_coercer = __esm({
|
|
2030
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2034
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs"() {
|
|
2031
2035
|
init_utils();
|
|
2032
2036
|
init_types2();
|
|
2033
2037
|
init_utils2();
|
|
@@ -2081,10 +2085,10 @@ var init_object_coercer = __esm({
|
|
|
2081
2085
|
}
|
|
2082
2086
|
});
|
|
2083
2087
|
|
|
2084
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2088
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs
|
|
2085
2089
|
var EventCoercer;
|
|
2086
2090
|
var init_event_coercer = __esm({
|
|
2087
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2091
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs"() {
|
|
2088
2092
|
init_utils();
|
|
2089
2093
|
init_utils2();
|
|
2090
2094
|
EventCoercer = class {
|
|
@@ -2104,10 +2108,10 @@ var init_event_coercer = __esm({
|
|
|
2104
2108
|
}
|
|
2105
2109
|
});
|
|
2106
2110
|
|
|
2107
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2111
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs
|
|
2108
2112
|
var PrimitiveCoercer;
|
|
2109
2113
|
var init_primitive_coercer = __esm({
|
|
2110
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2114
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs"() {
|
|
2111
2115
|
init_utils();
|
|
2112
2116
|
PrimitiveCoercer = class {
|
|
2113
2117
|
match(candidate) {
|
|
@@ -2125,10 +2129,10 @@ var init_primitive_coercer = __esm({
|
|
|
2125
2129
|
}
|
|
2126
2130
|
});
|
|
2127
2131
|
|
|
2128
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2132
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs
|
|
2129
2133
|
var PromiseRejectionEventCoercer;
|
|
2130
2134
|
var init_promise_rejection_event = __esm({
|
|
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/promise-rejection-event.mjs"() {
|
|
2132
2136
|
init_utils();
|
|
2133
2137
|
PromiseRejectionEventCoercer = class {
|
|
2134
2138
|
match(err) {
|
|
@@ -2157,9 +2161,9 @@ var init_promise_rejection_event = __esm({
|
|
|
2157
2161
|
}
|
|
2158
2162
|
});
|
|
2159
2163
|
|
|
2160
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2164
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/index.mjs
|
|
2161
2165
|
var init_coercers = __esm({
|
|
2162
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2166
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/coercers/index.mjs"() {
|
|
2163
2167
|
init_dom_exception_coercer();
|
|
2164
2168
|
init_error_coercer();
|
|
2165
2169
|
init_error_event_coercer();
|
|
@@ -2171,10 +2175,10 @@ var init_coercers = __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/utils.mjs
|
|
2175
2179
|
var ReduceableCache;
|
|
2176
2180
|
var init_utils3 = __esm({
|
|
2177
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2181
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/utils.mjs"() {
|
|
2178
2182
|
ReduceableCache = class {
|
|
2179
2183
|
constructor(_maxSize) {
|
|
2180
2184
|
this._maxSize = _maxSize;
|
|
@@ -2200,7 +2204,7 @@ var init_utils3 = __esm({
|
|
|
2200
2204
|
}
|
|
2201
2205
|
});
|
|
2202
2206
|
|
|
2203
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2207
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/index.mjs
|
|
2204
2208
|
var error_tracking_exports = {};
|
|
2205
2209
|
__export(error_tracking_exports, {
|
|
2206
2210
|
DOMExceptionCoercer: () => DOMExceptionCoercer,
|
|
@@ -2214,6 +2218,7 @@ __export(error_tracking_exports, {
|
|
|
2214
2218
|
ReduceableCache: () => ReduceableCache,
|
|
2215
2219
|
StringCoercer: () => StringCoercer,
|
|
2216
2220
|
chromeStackLineParser: () => chromeStackLineParser,
|
|
2221
|
+
createDefaultStackParser: () => createDefaultStackParser,
|
|
2217
2222
|
createStackParser: () => createStackParser,
|
|
2218
2223
|
geckoStackLineParser: () => geckoStackLineParser,
|
|
2219
2224
|
nodeStackLineParser: () => nodeStackLineParser,
|
|
@@ -2223,7 +2228,7 @@ __export(error_tracking_exports, {
|
|
|
2223
2228
|
winjsStackLineParser: () => winjsStackLineParser
|
|
2224
2229
|
});
|
|
2225
2230
|
var init_error_tracking = __esm({
|
|
2226
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2231
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/error-tracking/index.mjs"() {
|
|
2227
2232
|
init_error_properties_builder();
|
|
2228
2233
|
init_parsers();
|
|
2229
2234
|
init_coercers();
|
|
@@ -2231,9 +2236,9 @@ var init_error_tracking = __esm({
|
|
|
2231
2236
|
}
|
|
2232
2237
|
});
|
|
2233
2238
|
|
|
2234
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2239
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/index.mjs
|
|
2235
2240
|
var init_dist = __esm({
|
|
2236
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.
|
|
2241
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.1/node_modules/@posthog/core/dist/index.mjs"() {
|
|
2237
2242
|
init_featureFlagUtils();
|
|
2238
2243
|
init_uuidv7();
|
|
2239
2244
|
init_utils();
|
|
@@ -2424,7 +2429,7 @@ function snipLine(line, colno) {
|
|
|
2424
2429
|
}
|
|
2425
2430
|
var LRU_FILE_CONTENTS_CACHE, LRU_FILE_CONTENTS_FS_READ_FAILED, DEFAULT_LINES_OF_CONTEXT, MAX_CONTEXTLINES_COLNO, MAX_CONTEXTLINES_LINENO;
|
|
2426
2431
|
var init_context_lines_node = __esm({
|
|
2427
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2432
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/context-lines.node.mjs"() {
|
|
2428
2433
|
init_dist();
|
|
2429
2434
|
LRU_FILE_CONTENTS_CACHE = new error_tracking_exports.ReduceableCache(25);
|
|
2430
2435
|
LRU_FILE_CONTENTS_FS_READ_FAILED = new error_tracking_exports.ReduceableCache(20);
|
|
@@ -2434,7 +2439,7 @@ var init_context_lines_node = __esm({
|
|
|
2434
2439
|
}
|
|
2435
2440
|
});
|
|
2436
2441
|
|
|
2437
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2442
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs
|
|
2438
2443
|
function makeUncaughtExceptionHandler(captureFn, onFatalFn) {
|
|
2439
2444
|
let calledFatalError = false;
|
|
2440
2445
|
return Object.assign((error) => {
|
|
@@ -2466,14 +2471,14 @@ function addUnhandledRejectionListener(captureFn) {
|
|
|
2466
2471
|
}));
|
|
2467
2472
|
}
|
|
2468
2473
|
var init_autocapture = __esm({
|
|
2469
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2474
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs"() {
|
|
2470
2475
|
}
|
|
2471
2476
|
});
|
|
2472
2477
|
|
|
2473
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2478
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs
|
|
2474
2479
|
var SHUTDOWN_TIMEOUT, ErrorTracking;
|
|
2475
2480
|
var init_error_tracking2 = __esm({
|
|
2476
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2481
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs"() {
|
|
2477
2482
|
init_autocapture();
|
|
2478
2483
|
init_dist();
|
|
2479
2484
|
SHUTDOWN_TIMEOUT = 2e3;
|
|
@@ -2490,6 +2495,9 @@ var init_error_tracking2 = __esm({
|
|
|
2490
2495
|
});
|
|
2491
2496
|
this.startAutocaptureIfEnabled();
|
|
2492
2497
|
}
|
|
2498
|
+
static isPreviouslyCapturedError(x) {
|
|
2499
|
+
return isObject(x) && "__posthog_previously_captured_error" in x && true === x.__posthog_previously_captured_error;
|
|
2500
|
+
}
|
|
2493
2501
|
static async buildEventMessage(error, hint, distinctId, additionalProperties) {
|
|
2494
2502
|
const properties = {
|
|
2495
2503
|
...additionalProperties
|
|
@@ -2514,14 +2522,16 @@ var init_error_tracking2 = __esm({
|
|
|
2514
2522
|
}
|
|
2515
2523
|
onException(exception, hint) {
|
|
2516
2524
|
this.client.addPendingPromise((async () => {
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
exception
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
+
if (!_ErrorTracking.isPreviouslyCapturedError(exception)) {
|
|
2526
|
+
const eventMessage = await _ErrorTracking.buildEventMessage(exception, hint);
|
|
2527
|
+
const exceptionProperties = eventMessage.properties;
|
|
2528
|
+
const exceptionType = exceptionProperties?.$exception_list[0]?.type ?? "Exception";
|
|
2529
|
+
const isRateLimited = this._rateLimiter.consumeRateLimit(exceptionType);
|
|
2530
|
+
if (isRateLimited) return void this._logger.info("Skipping exception capture because of client rate limiting.", {
|
|
2531
|
+
exception: exceptionType
|
|
2532
|
+
});
|
|
2533
|
+
return this.client.capture(eventMessage);
|
|
2534
|
+
}
|
|
2525
2535
|
})());
|
|
2526
2536
|
}
|
|
2527
2537
|
async onFatalError(exception) {
|
|
@@ -2539,18 +2549,18 @@ var init_error_tracking2 = __esm({
|
|
|
2539
2549
|
}
|
|
2540
2550
|
});
|
|
2541
2551
|
|
|
2542
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2552
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/version.mjs
|
|
2543
2553
|
var version;
|
|
2544
2554
|
var init_version = __esm({
|
|
2545
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2546
|
-
version = "5.
|
|
2555
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/version.mjs"() {
|
|
2556
|
+
version = "5.21.0";
|
|
2547
2557
|
}
|
|
2548
2558
|
});
|
|
2549
2559
|
|
|
2550
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2560
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/types.mjs
|
|
2551
2561
|
var FeatureFlagError;
|
|
2552
2562
|
var init_types3 = __esm({
|
|
2553
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2563
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/types.mjs"() {
|
|
2554
2564
|
FeatureFlagError = {
|
|
2555
2565
|
ERRORS_WHILE_COMPUTING: "errors_while_computing_flags",
|
|
2556
2566
|
FLAG_MISSING: "flag_missing",
|
|
@@ -2560,7 +2570,7 @@ var init_types3 = __esm({
|
|
|
2560
2570
|
}
|
|
2561
2571
|
});
|
|
2562
2572
|
|
|
2563
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2573
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs
|
|
2564
2574
|
async function hashSHA1(text) {
|
|
2565
2575
|
const subtle = globalThis.crypto?.subtle;
|
|
2566
2576
|
if (!subtle) throw new Error("SubtleCrypto API not available");
|
|
@@ -2569,11 +2579,11 @@ async function hashSHA1(text) {
|
|
|
2569
2579
|
return hashArray.map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
2570
2580
|
}
|
|
2571
2581
|
var init_crypto = __esm({
|
|
2572
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2582
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs"() {
|
|
2573
2583
|
}
|
|
2574
2584
|
});
|
|
2575
2585
|
|
|
2576
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2586
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs
|
|
2577
2587
|
async function _hash(key, distinctId, salt = "") {
|
|
2578
2588
|
const hashString = await hashSHA1(`${key}.${distinctId}${salt}`);
|
|
2579
2589
|
return parseInt(hashString.slice(0, 15), 16) / LONG_SCALE;
|
|
@@ -2741,7 +2751,7 @@ function relativeDateParseForFeatureFlagMatching(value) {
|
|
|
2741
2751
|
}
|
|
2742
2752
|
var SIXTY_SECONDS, LONG_SCALE, NULL_VALUES_ALLOWED_OPERATORS, ClientError, InconclusiveMatchError, RequiresServerEvaluation, FeatureFlagsPoller;
|
|
2743
2753
|
var init_feature_flags = __esm({
|
|
2744
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2754
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs"() {
|
|
2745
2755
|
init_dist();
|
|
2746
2756
|
init_crypto();
|
|
2747
2757
|
SIXTY_SECONDS = 6e4;
|
|
@@ -2795,6 +2805,7 @@ var init_feature_flags = __esm({
|
|
|
2795
2805
|
this.customHeaders = customHeaders;
|
|
2796
2806
|
this.onLoad = options.onLoad;
|
|
2797
2807
|
this.cacheProvider = options.cacheProvider;
|
|
2808
|
+
this.strictLocalEvaluation = options.strictLocalEvaluation ?? false;
|
|
2798
2809
|
this.loadFeatureFlags();
|
|
2799
2810
|
}
|
|
2800
2811
|
debug(enabled = true) {
|
|
@@ -2990,6 +3001,11 @@ var init_feature_flags = __esm({
|
|
|
2990
3001
|
this.cohorts = flagData.cohorts;
|
|
2991
3002
|
this.loadedSuccessfullyOnce = true;
|
|
2992
3003
|
}
|
|
3004
|
+
warnAboutExperienceContinuityFlags(flags) {
|
|
3005
|
+
if (this.strictLocalEvaluation) return;
|
|
3006
|
+
const experienceContinuityFlags = flags.filter((f) => f.ensure_experience_continuity);
|
|
3007
|
+
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).`);
|
|
3008
|
+
}
|
|
2993
3009
|
async loadFromCache(debugMessage) {
|
|
2994
3010
|
if (!this.cacheProvider) return false;
|
|
2995
3011
|
try {
|
|
@@ -2998,6 +3014,7 @@ var init_feature_flags = __esm({
|
|
|
2998
3014
|
this.updateFlagState(cached);
|
|
2999
3015
|
this.logMsgIfDebug(() => console.debug(`[FEATURE FLAGS] ${debugMessage} (${cached.flags.length} flags)`));
|
|
3000
3016
|
this.onLoad?.(this.featureFlags.length);
|
|
3017
|
+
this.warnAboutExperienceContinuityFlags(cached.flags);
|
|
3001
3018
|
return true;
|
|
3002
3019
|
}
|
|
3003
3020
|
return false;
|
|
@@ -3091,6 +3108,7 @@ var init_feature_flags = __esm({
|
|
|
3091
3108
|
this.onError?.(new Error(`Failed to store in cache: ${err}`));
|
|
3092
3109
|
}
|
|
3093
3110
|
this.onLoad?.(this.featureFlags.length);
|
|
3111
|
+
this.warnAboutExperienceContinuityFlags(flagData.flags);
|
|
3094
3112
|
break;
|
|
3095
3113
|
}
|
|
3096
3114
|
default:
|
|
@@ -3146,10 +3164,10 @@ var init_feature_flags = __esm({
|
|
|
3146
3164
|
}
|
|
3147
3165
|
});
|
|
3148
3166
|
|
|
3149
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3167
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/storage-memory.mjs
|
|
3150
3168
|
var PostHogMemoryStorage;
|
|
3151
3169
|
var init_storage_memory = __esm({
|
|
3152
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3170
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/storage-memory.mjs"() {
|
|
3153
3171
|
PostHogMemoryStorage = class {
|
|
3154
3172
|
getProperty(key) {
|
|
3155
3173
|
return this._memoryStorage[key];
|
|
@@ -3164,10 +3182,10 @@ var init_storage_memory = __esm({
|
|
|
3164
3182
|
}
|
|
3165
3183
|
});
|
|
3166
3184
|
|
|
3167
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3185
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/client.mjs
|
|
3168
3186
|
var MINIMUM_POLLING_INTERVAL, THIRTY_SECONDS, MAX_CACHE_SIZE, PostHogBackendClient;
|
|
3169
3187
|
var init_client = __esm({
|
|
3170
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3188
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/client.mjs"() {
|
|
3171
3189
|
init_version();
|
|
3172
3190
|
init_dist();
|
|
3173
3191
|
init_types3();
|
|
@@ -3200,7 +3218,8 @@ var init_client = __esm({
|
|
|
3200
3218
|
this._events.emit("localEvaluationFlagsLoaded", count);
|
|
3201
3219
|
},
|
|
3202
3220
|
customHeaders: this.getCustomHeaders(),
|
|
3203
|
-
cacheProvider: options.flagDefinitionCacheProvider
|
|
3221
|
+
cacheProvider: options.flagDefinitionCacheProvider,
|
|
3222
|
+
strictLocalEvaluation: options.strictLocalEvaluation
|
|
3204
3223
|
});
|
|
3205
3224
|
}
|
|
3206
3225
|
this.errorTracking = new ErrorTracking(this, options, this._logger);
|
|
@@ -3307,12 +3326,13 @@ var init_client = __esm({
|
|
|
3307
3326
|
});
|
|
3308
3327
|
}
|
|
3309
3328
|
async getFeatureFlag(key, distinctId, options) {
|
|
3329
|
+
if (void 0 !== this._flagOverrides && key in this._flagOverrides) return this._flagOverrides[key];
|
|
3310
3330
|
const { groups, disableGeoip } = options || {};
|
|
3311
3331
|
let { onlyEvaluateLocally, sendFeatureFlagEvents, personProperties, groupProperties } = options || {};
|
|
3312
3332
|
const adjustedProperties = this.addLocalPersonAndGroupProperties(distinctId, groups, personProperties, groupProperties);
|
|
3313
3333
|
personProperties = adjustedProperties.allPersonProperties;
|
|
3314
3334
|
groupProperties = adjustedProperties.allGroupProperties;
|
|
3315
|
-
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = false;
|
|
3335
|
+
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;
|
|
3316
3336
|
if (void 0 == sendFeatureFlagEvents) sendFeatureFlagEvents = this.options.sendFeatureFlagEvent ?? true;
|
|
3317
3337
|
let response = await this.featureFlagsPoller?.getFeatureFlag(key, distinctId, groups, personProperties, groupProperties);
|
|
3318
3338
|
const flagWasLocallyEvaluated = void 0 !== response;
|
|
@@ -3367,6 +3387,7 @@ var init_client = __esm({
|
|
|
3367
3387
|
return response;
|
|
3368
3388
|
}
|
|
3369
3389
|
async getFeatureFlagPayload(key, distinctId, matchValue, options) {
|
|
3390
|
+
if (void 0 !== this._payloadOverrides && key in this._payloadOverrides) return this._payloadOverrides[key];
|
|
3370
3391
|
const { groups, disableGeoip } = options || {};
|
|
3371
3392
|
let { onlyEvaluateLocally, personProperties, groupProperties } = options || {};
|
|
3372
3393
|
const adjustedProperties = this.addLocalPersonAndGroupProperties(distinctId, groups, personProperties, groupProperties);
|
|
@@ -3388,7 +3409,7 @@ var init_client = __esm({
|
|
|
3388
3409
|
else throw e;
|
|
3389
3410
|
}
|
|
3390
3411
|
}
|
|
3391
|
-
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = false;
|
|
3412
|
+
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;
|
|
3392
3413
|
const payloadWasLocallyEvaluated = void 0 !== response;
|
|
3393
3414
|
if (!payloadWasLocallyEvaluated && !onlyEvaluateLocally) response = await super.getFeatureFlagPayloadStateless(key, distinctId, groups, personProperties, groupProperties, disableGeoip);
|
|
3394
3415
|
return response;
|
|
@@ -3419,7 +3440,7 @@ var init_client = __esm({
|
|
|
3419
3440
|
const adjustedProperties = this.addLocalPersonAndGroupProperties(distinctId, groups, personProperties, groupProperties);
|
|
3420
3441
|
personProperties = adjustedProperties.allPersonProperties;
|
|
3421
3442
|
groupProperties = adjustedProperties.allGroupProperties;
|
|
3422
|
-
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = false;
|
|
3443
|
+
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;
|
|
3423
3444
|
const localEvaluationResult = await this.featureFlagsPoller?.getAllFlagsAndPayloads(distinctId, groups, personProperties, groupProperties, flagKeys);
|
|
3424
3445
|
let featureFlags = {};
|
|
3425
3446
|
let featureFlagPayloads = {};
|
|
@@ -3440,6 +3461,14 @@ var init_client = __esm({
|
|
|
3440
3461
|
...remoteEvaluationResult.payloads || {}
|
|
3441
3462
|
};
|
|
3442
3463
|
}
|
|
3464
|
+
if (void 0 !== this._flagOverrides) featureFlags = {
|
|
3465
|
+
...featureFlags,
|
|
3466
|
+
...this._flagOverrides
|
|
3467
|
+
};
|
|
3468
|
+
if (void 0 !== this._payloadOverrides) featureFlagPayloads = {
|
|
3469
|
+
...featureFlagPayloads,
|
|
3470
|
+
...this._payloadOverrides
|
|
3471
|
+
};
|
|
3443
3472
|
return {
|
|
3444
3473
|
featureFlags,
|
|
3445
3474
|
featureFlagPayloads
|
|
@@ -3453,6 +3482,53 @@ var init_client = __esm({
|
|
|
3453
3482
|
async reloadFeatureFlags() {
|
|
3454
3483
|
await this.featureFlagsPoller?.loadFeatureFlags(true);
|
|
3455
3484
|
}
|
|
3485
|
+
overrideFeatureFlags(overrides) {
|
|
3486
|
+
const flagArrayToRecord = (flags) => Object.fromEntries(flags.map((f) => [
|
|
3487
|
+
f,
|
|
3488
|
+
true
|
|
3489
|
+
]));
|
|
3490
|
+
if (false === overrides) {
|
|
3491
|
+
this._flagOverrides = void 0;
|
|
3492
|
+
this._payloadOverrides = void 0;
|
|
3493
|
+
return;
|
|
3494
|
+
}
|
|
3495
|
+
if (Array.isArray(overrides)) {
|
|
3496
|
+
this._flagOverrides = flagArrayToRecord(overrides);
|
|
3497
|
+
return;
|
|
3498
|
+
}
|
|
3499
|
+
if (this._isFeatureFlagOverrideOptions(overrides)) {
|
|
3500
|
+
if ("flags" in overrides) {
|
|
3501
|
+
if (false === overrides.flags) this._flagOverrides = void 0;
|
|
3502
|
+
else if (Array.isArray(overrides.flags)) this._flagOverrides = flagArrayToRecord(overrides.flags);
|
|
3503
|
+
else if (void 0 !== overrides.flags) this._flagOverrides = {
|
|
3504
|
+
...overrides.flags
|
|
3505
|
+
};
|
|
3506
|
+
}
|
|
3507
|
+
if ("payloads" in overrides) {
|
|
3508
|
+
if (false === overrides.payloads) this._payloadOverrides = void 0;
|
|
3509
|
+
else if (void 0 !== overrides.payloads) this._payloadOverrides = {
|
|
3510
|
+
...overrides.payloads
|
|
3511
|
+
};
|
|
3512
|
+
}
|
|
3513
|
+
return;
|
|
3514
|
+
}
|
|
3515
|
+
this._flagOverrides = {
|
|
3516
|
+
...overrides
|
|
3517
|
+
};
|
|
3518
|
+
}
|
|
3519
|
+
_isFeatureFlagOverrideOptions(overrides) {
|
|
3520
|
+
if ("object" != typeof overrides || null === overrides || Array.isArray(overrides)) return false;
|
|
3521
|
+
const obj = overrides;
|
|
3522
|
+
if ("flags" in obj) {
|
|
3523
|
+
const flagsValue = obj["flags"];
|
|
3524
|
+
if (false === flagsValue || Array.isArray(flagsValue) || "object" == typeof flagsValue && null !== flagsValue) return true;
|
|
3525
|
+
}
|
|
3526
|
+
if ("payloads" in obj) {
|
|
3527
|
+
const payloadsValue = obj["payloads"];
|
|
3528
|
+
if (false === payloadsValue || "object" == typeof payloadsValue && null !== payloadsValue) return true;
|
|
3529
|
+
}
|
|
3530
|
+
return false;
|
|
3531
|
+
}
|
|
3456
3532
|
withContext(data, fn, options) {
|
|
3457
3533
|
if (!this.context) return fn();
|
|
3458
3534
|
return this.context.run(data, fn, options);
|
|
@@ -3514,7 +3590,7 @@ var init_client = __esm({
|
|
|
3514
3590
|
const finalPersonProperties = sendFeatureFlagsOptions?.personProperties || {};
|
|
3515
3591
|
const finalGroupProperties = sendFeatureFlagsOptions?.groupProperties || {};
|
|
3516
3592
|
const flagKeys = sendFeatureFlagsOptions?.flagKeys;
|
|
3517
|
-
const onlyEvaluateLocally = sendFeatureFlagsOptions?.onlyEvaluateLocally ?? false;
|
|
3593
|
+
const onlyEvaluateLocally = sendFeatureFlagsOptions?.onlyEvaluateLocally ?? this.options.strictLocalEvaluation ?? false;
|
|
3518
3594
|
if (onlyEvaluateLocally) if (!((this.featureFlagsPoller?.featureFlags?.length || 0) > 0)) return {};
|
|
3519
3595
|
else {
|
|
3520
3596
|
const groupsWithStringValues = {};
|
|
@@ -3557,17 +3633,24 @@ var init_client = __esm({
|
|
|
3557
3633
|
allGroupProperties
|
|
3558
3634
|
};
|
|
3559
3635
|
}
|
|
3560
|
-
captureException(error, distinctId, additionalProperties) {
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3636
|
+
captureException(error, distinctId, additionalProperties, uuid) {
|
|
3637
|
+
if (!ErrorTracking.isPreviouslyCapturedError(error)) {
|
|
3638
|
+
const syntheticException = new Error("PostHog syntheticException");
|
|
3639
|
+
this.addPendingPromise(ErrorTracking.buildEventMessage(error, {
|
|
3640
|
+
syntheticException
|
|
3641
|
+
}, distinctId, additionalProperties).then((msg) => this.capture({
|
|
3642
|
+
...msg,
|
|
3643
|
+
uuid
|
|
3644
|
+
})));
|
|
3645
|
+
}
|
|
3565
3646
|
}
|
|
3566
3647
|
async captureExceptionImmediate(error, distinctId, additionalProperties) {
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3648
|
+
if (!ErrorTracking.isPreviouslyCapturedError(error)) {
|
|
3649
|
+
const syntheticException = new Error("PostHog syntheticException");
|
|
3650
|
+
this.addPendingPromise(ErrorTracking.buildEventMessage(error, {
|
|
3651
|
+
syntheticException
|
|
3652
|
+
}, distinctId, additionalProperties).then((msg) => this.captureImmediate(msg)));
|
|
3653
|
+
}
|
|
3571
3654
|
}
|
|
3572
3655
|
async prepareEventMessage(props) {
|
|
3573
3656
|
const { distinctId, event, properties, groups, sendFeatureFlags, timestamp, disableGeoip, uuid } = props;
|
|
@@ -3656,7 +3739,7 @@ var init_client = __esm({
|
|
|
3656
3739
|
});
|
|
3657
3740
|
var PostHogContext;
|
|
3658
3741
|
var init_context = __esm({
|
|
3659
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3742
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/context/context.mjs"() {
|
|
3660
3743
|
PostHogContext = class {
|
|
3661
3744
|
constructor() {
|
|
3662
3745
|
this.storage = new async_hooks.AsyncLocalStorage();
|
|
@@ -3684,7 +3767,7 @@ var init_context = __esm({
|
|
|
3684
3767
|
}
|
|
3685
3768
|
});
|
|
3686
3769
|
|
|
3687
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3770
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/sentry-integration.mjs
|
|
3688
3771
|
function createEventProcessor(_posthog, { organization, projectId, prefix, severityAllowList = [
|
|
3689
3772
|
"error"
|
|
3690
3773
|
], sendExceptionsToPostHog = true } = {}) {
|
|
@@ -3740,7 +3823,7 @@ function sentryIntegration(_posthog, options) {
|
|
|
3740
3823
|
}
|
|
3741
3824
|
var NAME, PostHogSentryIntegration;
|
|
3742
3825
|
var init_sentry_integration = __esm({
|
|
3743
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3826
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/sentry-integration.mjs"() {
|
|
3744
3827
|
NAME = "posthog-node";
|
|
3745
3828
|
PostHogSentryIntegration = class {
|
|
3746
3829
|
static #_ = this.POSTHOG_ID_TAG = "posthog_distinct_id";
|
|
@@ -3762,12 +3845,13 @@ var init_sentry_integration = __esm({
|
|
|
3762
3845
|
}
|
|
3763
3846
|
});
|
|
3764
3847
|
|
|
3765
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3848
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/express.mjs
|
|
3766
3849
|
function setupExpressErrorHandler(_posthog, app) {
|
|
3767
3850
|
app.use(posthogErrorHandler(_posthog));
|
|
3768
3851
|
}
|
|
3769
3852
|
function posthogErrorHandler(posthog) {
|
|
3770
3853
|
return (error, req, res, next) => {
|
|
3854
|
+
if (ErrorTracking.isPreviouslyCapturedError(error)) return void next(error);
|
|
3771
3855
|
const sessionId = req.headers["x-posthog-session-id"];
|
|
3772
3856
|
const distinctId = req.headers["x-posthog-distinct-id"];
|
|
3773
3857
|
const syntheticException = new Error("Synthetic exception");
|
|
@@ -3793,21 +3877,21 @@ function posthogErrorHandler(posthog) {
|
|
|
3793
3877
|
};
|
|
3794
3878
|
}
|
|
3795
3879
|
var init_express = __esm({
|
|
3796
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3880
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/extensions/express.mjs"() {
|
|
3797
3881
|
init_error_tracking2();
|
|
3798
3882
|
}
|
|
3799
3883
|
});
|
|
3800
3884
|
|
|
3801
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3885
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/exports.mjs
|
|
3802
3886
|
var init_exports = __esm({
|
|
3803
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3887
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/exports.mjs"() {
|
|
3804
3888
|
init_sentry_integration();
|
|
3805
3889
|
init_express();
|
|
3806
3890
|
init_types3();
|
|
3807
3891
|
}
|
|
3808
3892
|
});
|
|
3809
3893
|
|
|
3810
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3894
|
+
// ../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/entrypoints/index.node.mjs
|
|
3811
3895
|
var index_node_exports = {};
|
|
3812
3896
|
__export(index_node_exports, {
|
|
3813
3897
|
FeatureFlagError: () => FeatureFlagError,
|
|
@@ -3819,7 +3903,7 @@ __export(index_node_exports, {
|
|
|
3819
3903
|
});
|
|
3820
3904
|
var PostHog;
|
|
3821
3905
|
var init_index_node = __esm({
|
|
3822
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3906
|
+
"../../node_modules/.pnpm/posthog-node@5.21.0/node_modules/posthog-node/dist/entrypoints/index.node.mjs"() {
|
|
3823
3907
|
init_module_node();
|
|
3824
3908
|
init_context_lines_node();
|
|
3825
3909
|
init_error_tracking2();
|
|
@@ -5110,9 +5194,9 @@ var require_dist2 = __commonJS({
|
|
|
5110
5194
|
}
|
|
5111
5195
|
});
|
|
5112
5196
|
|
|
5113
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5197
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/package.json
|
|
5114
5198
|
var require_package = __commonJS({
|
|
5115
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5199
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/package.json"(exports$1, module) {
|
|
5116
5200
|
module.exports = {
|
|
5117
5201
|
name: "mixpanel",
|
|
5118
5202
|
description: "A simple server-side API for mixpanel",
|
|
@@ -5122,7 +5206,7 @@ var require_package = __commonJS({
|
|
|
5122
5206
|
"api",
|
|
5123
5207
|
"stats"
|
|
5124
5208
|
],
|
|
5125
|
-
version: "0.
|
|
5209
|
+
version: "0.20.0",
|
|
5126
5210
|
homepage: "https://github.com/mixpanel/mixpanel-node",
|
|
5127
5211
|
author: "Carl Sverre",
|
|
5128
5212
|
license: "MIT",
|
|
@@ -5138,29 +5222,35 @@ var require_package = __commonJS({
|
|
|
5138
5222
|
node: ">=10.0"
|
|
5139
5223
|
},
|
|
5140
5224
|
scripts: {
|
|
5141
|
-
test: "vitest"
|
|
5225
|
+
test: "vitest",
|
|
5226
|
+
format: "prettier --write .",
|
|
5227
|
+
"check-format": "prettier --check .",
|
|
5228
|
+
lint: "oxlint ."
|
|
5142
5229
|
},
|
|
5143
5230
|
types: "./lib/mixpanel-node.d.ts",
|
|
5144
5231
|
devDependencies: {
|
|
5145
5232
|
"@types/node": "^24.10.1",
|
|
5146
5233
|
"@vitest/coverage-v8": "^4.0.8",
|
|
5147
5234
|
nock: "^14.0.10",
|
|
5235
|
+
oxlint: "^1.16.0",
|
|
5236
|
+
prettier: "^3.6.2",
|
|
5148
5237
|
proxyquire: "^2.1.3",
|
|
5149
5238
|
typescript: "^5.9.3",
|
|
5150
5239
|
vitest: "^4.0.8"
|
|
5151
5240
|
},
|
|
5152
5241
|
dependencies: {
|
|
5153
|
-
"https-proxy-agent": "7.0.6"
|
|
5242
|
+
"https-proxy-agent": "7.0.6",
|
|
5243
|
+
"json-logic-js": "2.0.5"
|
|
5154
5244
|
}
|
|
5155
5245
|
};
|
|
5156
5246
|
}
|
|
5157
5247
|
});
|
|
5158
5248
|
|
|
5159
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5249
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/utils.js
|
|
5160
5250
|
var require_utils = __commonJS({
|
|
5161
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5251
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/utils.js"(exports$1) {
|
|
5162
5252
|
exports$1.async_all = function(requests, handler, callback) {
|
|
5163
|
-
|
|
5253
|
+
let total = requests.length, errors = null, results = [], done = function(err, result) {
|
|
5164
5254
|
if (err) {
|
|
5165
5255
|
errors = errors || [];
|
|
5166
5256
|
errors.push(err);
|
|
@@ -5173,14 +5263,16 @@ var require_utils = __commonJS({
|
|
|
5173
5263
|
if (total === 0) {
|
|
5174
5264
|
callback(errors, results);
|
|
5175
5265
|
} else {
|
|
5176
|
-
for (
|
|
5266
|
+
for (let i = 0, l = requests.length; i < l; i++) {
|
|
5177
5267
|
handler(requests[i], done);
|
|
5178
5268
|
}
|
|
5179
5269
|
}
|
|
5180
5270
|
};
|
|
5181
5271
|
exports$1.ensure_timestamp = function(time) {
|
|
5182
5272
|
if (!(time instanceof Date || typeof time === "number")) {
|
|
5183
|
-
throw new Error(
|
|
5273
|
+
throw new Error(
|
|
5274
|
+
"`time` property must be a Date or Unix timestamp and is only required for `import` endpoint"
|
|
5275
|
+
);
|
|
5184
5276
|
}
|
|
5185
5277
|
return time instanceof Date ? time.getTime() : time;
|
|
5186
5278
|
};
|
|
@@ -5197,9 +5289,9 @@ var require_utils = __commonJS({
|
|
|
5197
5289
|
}
|
|
5198
5290
|
});
|
|
5199
5291
|
|
|
5200
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5292
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/profile_helpers.js
|
|
5201
5293
|
var require_profile_helpers = __commonJS({
|
|
5202
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5294
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/profile_helpers.js"(exports$1) {
|
|
5203
5295
|
var { ensure_timestamp } = require_utils();
|
|
5204
5296
|
function merge_modifiers(data, modifiers) {
|
|
5205
5297
|
if (modifiers) {
|
|
@@ -5247,7 +5339,7 @@ var require_profile_helpers = __commonJS({
|
|
|
5247
5339
|
}
|
|
5248
5340
|
}
|
|
5249
5341
|
let data = {
|
|
5250
|
-
|
|
5342
|
+
$token: this.token,
|
|
5251
5343
|
...identifiers
|
|
5252
5344
|
};
|
|
5253
5345
|
const set_key = set_once ? "$set_once" : "$set";
|
|
@@ -5262,14 +5354,20 @@ var require_profile_helpers = __commonJS({
|
|
|
5262
5354
|
}
|
|
5263
5355
|
data = merge_modifiers(data, modifiers);
|
|
5264
5356
|
if (this.config.debug) {
|
|
5265
|
-
this.mixpanel.config.logger.debug(
|
|
5357
|
+
this.mixpanel.config.logger.debug(
|
|
5358
|
+
`Sending the following data to Mixpanel (${this.endpoint})`,
|
|
5359
|
+
{ data }
|
|
5360
|
+
);
|
|
5266
5361
|
}
|
|
5267
|
-
this.mixpanel.send_request(
|
|
5362
|
+
this.mixpanel.send_request(
|
|
5363
|
+
{ method: "GET", endpoint: this.endpoint, data },
|
|
5364
|
+
callback
|
|
5365
|
+
);
|
|
5268
5366
|
}
|
|
5269
5367
|
_delete_profile({ identifiers, modifiers, callback }) {
|
|
5270
5368
|
let data = {
|
|
5271
|
-
|
|
5272
|
-
|
|
5369
|
+
$delete: "",
|
|
5370
|
+
$token: this.token,
|
|
5273
5371
|
...identifiers
|
|
5274
5372
|
};
|
|
5275
5373
|
if (typeof modifiers === "function") {
|
|
@@ -5279,13 +5377,18 @@ var require_profile_helpers = __commonJS({
|
|
|
5279
5377
|
if (this.config.debug) {
|
|
5280
5378
|
this.mixpanel.config.logger.debug("Deleting profile", { identifiers });
|
|
5281
5379
|
}
|
|
5282
|
-
this.mixpanel.send_request(
|
|
5380
|
+
this.mixpanel.send_request(
|
|
5381
|
+
{ method: "GET", endpoint: this.endpoint, data },
|
|
5382
|
+
callback
|
|
5383
|
+
);
|
|
5283
5384
|
}
|
|
5284
5385
|
_remove({ identifiers, data, modifiers, callback }) {
|
|
5285
5386
|
let $remove = {};
|
|
5286
5387
|
if (typeof data !== "object" || Array.isArray(data)) {
|
|
5287
5388
|
if (this.config.debug) {
|
|
5288
|
-
this.mixpanel.config.logger.error(
|
|
5389
|
+
this.mixpanel.config.logger.error(
|
|
5390
|
+
"Invalid value passed to #remove - data must be an object with scalar values"
|
|
5391
|
+
);
|
|
5289
5392
|
}
|
|
5290
5393
|
return;
|
|
5291
5394
|
}
|
|
@@ -5306,8 +5409,8 @@ var require_profile_helpers = __commonJS({
|
|
|
5306
5409
|
return;
|
|
5307
5410
|
}
|
|
5308
5411
|
data = {
|
|
5309
|
-
|
|
5310
|
-
|
|
5412
|
+
$remove,
|
|
5413
|
+
$token: this.token,
|
|
5311
5414
|
...identifiers
|
|
5312
5415
|
};
|
|
5313
5416
|
if (typeof modifiers === "function") {
|
|
@@ -5320,19 +5423,24 @@ var require_profile_helpers = __commonJS({
|
|
|
5320
5423
|
{ data }
|
|
5321
5424
|
);
|
|
5322
5425
|
}
|
|
5323
|
-
this.mixpanel.send_request(
|
|
5426
|
+
this.mixpanel.send_request(
|
|
5427
|
+
{ method: "GET", endpoint: this.endpoint, data },
|
|
5428
|
+
callback
|
|
5429
|
+
);
|
|
5324
5430
|
}
|
|
5325
5431
|
_union({ identifiers, data, modifiers, callback }) {
|
|
5326
5432
|
let $union = {};
|
|
5327
5433
|
if (typeof data !== "object" || Array.isArray(data)) {
|
|
5328
5434
|
if (this.config.debug) {
|
|
5329
|
-
this.mixpanel.config.logger.error(
|
|
5435
|
+
this.mixpanel.config.logger.error(
|
|
5436
|
+
"Invalid value passed to #union - data must be an object with scalar or array values"
|
|
5437
|
+
);
|
|
5330
5438
|
}
|
|
5331
5439
|
return;
|
|
5332
5440
|
}
|
|
5333
5441
|
for (const [key, val] of Object.entries(data)) {
|
|
5334
5442
|
if (Array.isArray(val)) {
|
|
5335
|
-
|
|
5443
|
+
const merge_values = val.filter(function(v) {
|
|
5336
5444
|
return typeof v === "string" || typeof v === "number";
|
|
5337
5445
|
});
|
|
5338
5446
|
if (merge_values.length > 0) {
|
|
@@ -5353,8 +5461,8 @@ var require_profile_helpers = __commonJS({
|
|
|
5353
5461
|
return;
|
|
5354
5462
|
}
|
|
5355
5463
|
data = {
|
|
5356
|
-
|
|
5357
|
-
|
|
5464
|
+
$union,
|
|
5465
|
+
$token: this.token,
|
|
5358
5466
|
...identifiers
|
|
5359
5467
|
};
|
|
5360
5468
|
if (typeof modifiers === "function") {
|
|
@@ -5367,7 +5475,10 @@ var require_profile_helpers = __commonJS({
|
|
|
5367
5475
|
{ data }
|
|
5368
5476
|
);
|
|
5369
5477
|
}
|
|
5370
|
-
this.mixpanel.send_request(
|
|
5478
|
+
this.mixpanel.send_request(
|
|
5479
|
+
{ method: "GET", endpoint: this.endpoint, data },
|
|
5480
|
+
callback
|
|
5481
|
+
);
|
|
5371
5482
|
}
|
|
5372
5483
|
_unset({ identifiers, prop, modifiers, callback }) {
|
|
5373
5484
|
let $unset = [];
|
|
@@ -5385,8 +5496,8 @@ var require_profile_helpers = __commonJS({
|
|
|
5385
5496
|
return;
|
|
5386
5497
|
}
|
|
5387
5498
|
let data = {
|
|
5388
|
-
|
|
5389
|
-
|
|
5499
|
+
$unset,
|
|
5500
|
+
$token: this.token,
|
|
5390
5501
|
...identifiers
|
|
5391
5502
|
};
|
|
5392
5503
|
if (typeof modifiers === "function") {
|
|
@@ -5399,15 +5510,18 @@ var require_profile_helpers = __commonJS({
|
|
|
5399
5510
|
{ data }
|
|
5400
5511
|
);
|
|
5401
5512
|
}
|
|
5402
|
-
this.mixpanel.send_request(
|
|
5513
|
+
this.mixpanel.send_request(
|
|
5514
|
+
{ method: "GET", endpoint: this.endpoint, data },
|
|
5515
|
+
callback
|
|
5516
|
+
);
|
|
5403
5517
|
}
|
|
5404
5518
|
};
|
|
5405
5519
|
}
|
|
5406
5520
|
});
|
|
5407
5521
|
|
|
5408
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5522
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/groups.js
|
|
5409
5523
|
var require_groups = __commonJS({
|
|
5410
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5524
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/groups.js"(exports$1) {
|
|
5411
5525
|
var { ProfileHelpers } = require_profile_helpers();
|
|
5412
5526
|
var MixpanelGroups = class extends ProfileHelpers() {
|
|
5413
5527
|
constructor(mp_instance) {
|
|
@@ -5416,9 +5530,9 @@ var require_groups = __commonJS({
|
|
|
5416
5530
|
this.endpoint = "/groups";
|
|
5417
5531
|
}
|
|
5418
5532
|
/** groups.set_once(group_key, group_id, prop, to, modifiers, callback)
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5533
|
+
---
|
|
5534
|
+
The same as groups.set, but adds a property value to a group only if it has not been set before.
|
|
5535
|
+
*/
|
|
5422
5536
|
set_once(group_key, group_id, prop, to, modifiers, callback) {
|
|
5423
5537
|
const identifiers = { $group_key: group_key, $group_id: group_id };
|
|
5424
5538
|
this._set(prop, to, modifiers, callback, { identifiers, set_once: true });
|
|
@@ -5507,9 +5621,9 @@ var require_groups = __commonJS({
|
|
|
5507
5621
|
}
|
|
5508
5622
|
});
|
|
5509
5623
|
|
|
5510
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5624
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/people.js
|
|
5511
5625
|
var require_people = __commonJS({
|
|
5512
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5626
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/people.js"(exports$1) {
|
|
5513
5627
|
var { merge_modifiers, ProfileHelpers } = require_profile_helpers();
|
|
5514
5628
|
var MixpanelPeople = class extends ProfileHelpers() {
|
|
5515
5629
|
constructor(mp_instance) {
|
|
@@ -5575,7 +5689,7 @@ var require_people = __commonJS({
|
|
|
5575
5689
|
});
|
|
5576
5690
|
*/
|
|
5577
5691
|
increment(distinct_id, prop, by, modifiers, callback) {
|
|
5578
|
-
|
|
5692
|
+
const $add = {};
|
|
5579
5693
|
if (typeof prop === "object") {
|
|
5580
5694
|
if (typeof by === "object") {
|
|
5581
5695
|
callback = modifiers;
|
|
@@ -5611,16 +5725,22 @@ var require_people = __commonJS({
|
|
|
5611
5725
|
$add[prop] = 1;
|
|
5612
5726
|
}
|
|
5613
5727
|
}
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5728
|
+
let data = {
|
|
5729
|
+
$add,
|
|
5730
|
+
$token: this.mixpanel.token,
|
|
5731
|
+
$distinct_id: distinct_id
|
|
5618
5732
|
};
|
|
5619
5733
|
data = merge_modifiers(data, modifiers);
|
|
5620
5734
|
if (this.mixpanel.config.debug) {
|
|
5621
|
-
this.mixpanel.config.logger.debug(
|
|
5735
|
+
this.mixpanel.config.logger.debug(
|
|
5736
|
+
"Sending the following data to Mixpanel (Engage)",
|
|
5737
|
+
{ data }
|
|
5738
|
+
);
|
|
5622
5739
|
}
|
|
5623
|
-
this.mixpanel.send_request(
|
|
5740
|
+
this.mixpanel.send_request(
|
|
5741
|
+
{ method: "GET", endpoint: "/engage", data },
|
|
5742
|
+
callback
|
|
5743
|
+
);
|
|
5624
5744
|
}
|
|
5625
5745
|
/**
|
|
5626
5746
|
people.append(distinct_id, prop, value, modifiers, callback)
|
|
@@ -5639,7 +5759,7 @@ var require_people = __commonJS({
|
|
|
5639
5759
|
});
|
|
5640
5760
|
*/
|
|
5641
5761
|
append(distinct_id, prop, value, modifiers, callback) {
|
|
5642
|
-
|
|
5762
|
+
const $append = {};
|
|
5643
5763
|
if (typeof prop === "object") {
|
|
5644
5764
|
if (typeof value === "object") {
|
|
5645
5765
|
callback = modifiers;
|
|
@@ -5656,16 +5776,22 @@ var require_people = __commonJS({
|
|
|
5656
5776
|
callback = modifiers;
|
|
5657
5777
|
}
|
|
5658
5778
|
}
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5779
|
+
let data = {
|
|
5780
|
+
$append,
|
|
5781
|
+
$token: this.mixpanel.token,
|
|
5782
|
+
$distinct_id: distinct_id
|
|
5663
5783
|
};
|
|
5664
5784
|
data = merge_modifiers(data, modifiers);
|
|
5665
5785
|
if (this.mixpanel.config.debug) {
|
|
5666
|
-
this.mixpanel.config.logger.debug(
|
|
5786
|
+
this.mixpanel.config.logger.debug(
|
|
5787
|
+
"Sending the following data to Mixpanel (Engage)",
|
|
5788
|
+
{ data }
|
|
5789
|
+
);
|
|
5667
5790
|
}
|
|
5668
|
-
this.mixpanel.send_request(
|
|
5791
|
+
this.mixpanel.send_request(
|
|
5792
|
+
{ method: "GET", endpoint: "/engage", data },
|
|
5793
|
+
callback
|
|
5794
|
+
);
|
|
5669
5795
|
}
|
|
5670
5796
|
/**
|
|
5671
5797
|
people.track_charge(distinct_id, amount, properties, modifiers, callback)
|
|
@@ -5700,27 +5826,35 @@ var require_people = __commonJS({
|
|
|
5700
5826
|
if (typeof amount !== "number") {
|
|
5701
5827
|
amount = parseFloat(amount);
|
|
5702
5828
|
if (isNaN(amount)) {
|
|
5703
|
-
this.mixpanel.config.logger.error(
|
|
5829
|
+
this.mixpanel.config.logger.error(
|
|
5830
|
+
"Invalid value passed to mixpanel.people.track_charge - must be a number"
|
|
5831
|
+
);
|
|
5704
5832
|
return;
|
|
5705
5833
|
}
|
|
5706
5834
|
}
|
|
5707
5835
|
properties.$amount = amount;
|
|
5708
5836
|
if (properties.hasOwnProperty("$time")) {
|
|
5709
|
-
|
|
5837
|
+
const time = properties.$time;
|
|
5710
5838
|
if (Object.prototype.toString.call(time) === "[object Date]") {
|
|
5711
5839
|
properties.$time = time.toISOString();
|
|
5712
5840
|
}
|
|
5713
5841
|
}
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5842
|
+
let data = {
|
|
5843
|
+
$append: { $transactions: properties },
|
|
5844
|
+
$token: this.mixpanel.token,
|
|
5845
|
+
$distinct_id: distinct_id
|
|
5718
5846
|
};
|
|
5719
5847
|
data = merge_modifiers(data, modifiers);
|
|
5720
5848
|
if (this.mixpanel.config.debug) {
|
|
5721
|
-
this.mixpanel.config.logger.debug(
|
|
5849
|
+
this.mixpanel.config.logger.debug(
|
|
5850
|
+
"Sending the following data to Mixpanel (Engage)",
|
|
5851
|
+
{ data }
|
|
5852
|
+
);
|
|
5722
5853
|
}
|
|
5723
|
-
this.mixpanel.send_request(
|
|
5854
|
+
this.mixpanel.send_request(
|
|
5855
|
+
{ method: "GET", endpoint: "/engage", data },
|
|
5856
|
+
callback
|
|
5857
|
+
);
|
|
5724
5858
|
}
|
|
5725
5859
|
/**
|
|
5726
5860
|
people.clear_charges(distinct_id, modifiers, callback)
|
|
@@ -5732,19 +5866,24 @@ var require_people = __commonJS({
|
|
|
5732
5866
|
mixpanel.people.clear_charges('bob');
|
|
5733
5867
|
*/
|
|
5734
5868
|
clear_charges(distinct_id, modifiers, callback) {
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5869
|
+
let data = {
|
|
5870
|
+
$set: { $transactions: [] },
|
|
5871
|
+
$token: this.mixpanel.token,
|
|
5872
|
+
$distinct_id: distinct_id
|
|
5739
5873
|
};
|
|
5740
5874
|
if (typeof modifiers === "function") {
|
|
5741
5875
|
callback = modifiers;
|
|
5742
5876
|
}
|
|
5743
5877
|
data = merge_modifiers(data, modifiers);
|
|
5744
5878
|
if (this.mixpanel.config.debug) {
|
|
5745
|
-
this.mixpanel.config.logger.debug("Clearing this user's charges", {
|
|
5879
|
+
this.mixpanel.config.logger.debug("Clearing this user's charges", {
|
|
5880
|
+
$distinct_id: distinct_id
|
|
5881
|
+
});
|
|
5746
5882
|
}
|
|
5747
|
-
this.mixpanel.send_request(
|
|
5883
|
+
this.mixpanel.send_request(
|
|
5884
|
+
{ method: "GET", endpoint: "/engage", data },
|
|
5885
|
+
callback
|
|
5886
|
+
);
|
|
5748
5887
|
}
|
|
5749
5888
|
/**
|
|
5750
5889
|
people.delete_user(distinct_id, modifiers, callback)
|
|
@@ -5771,7 +5910,7 @@ var require_people = __commonJS({
|
|
|
5771
5910
|
mixpanel.people.remove('bob', {'browsers': 'chrome', 'os': 'linux'});
|
|
5772
5911
|
*/
|
|
5773
5912
|
remove(distinct_id, data, modifiers, callback) {
|
|
5774
|
-
const identifiers = {
|
|
5913
|
+
const identifiers = { $distinct_id: distinct_id };
|
|
5775
5914
|
this._remove({ identifiers, data, modifiers, callback });
|
|
5776
5915
|
}
|
|
5777
5916
|
/**
|
|
@@ -5809,9 +5948,9 @@ var require_people = __commonJS({
|
|
|
5809
5948
|
}
|
|
5810
5949
|
});
|
|
5811
5950
|
|
|
5812
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5951
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/utils.js
|
|
5813
5952
|
var require_utils2 = __commonJS({
|
|
5814
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5953
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/utils.js"(exports$1, module) {
|
|
5815
5954
|
var crypto3 = __require("crypto");
|
|
5816
5955
|
var EXPOSURE_EVENT = "$experiment_started";
|
|
5817
5956
|
var REQUEST_HEADERS = {
|
|
@@ -5846,22 +5985,55 @@ var require_utils2 = __commonJS({
|
|
|
5846
5985
|
const traceFlags = "01";
|
|
5847
5986
|
return `${version3}-${traceId}-${parentId}-${traceFlags}`;
|
|
5848
5987
|
}
|
|
5988
|
+
function lowercaseJson(obj, lowercaseKeys) {
|
|
5989
|
+
if (obj === null || obj === void 0) {
|
|
5990
|
+
return obj;
|
|
5991
|
+
} else if (typeof obj === "string") {
|
|
5992
|
+
return obj.toLowerCase();
|
|
5993
|
+
} else if (typeof obj === "object") {
|
|
5994
|
+
if (Array.isArray(obj)) {
|
|
5995
|
+
return obj.map((item) => lowercaseJson(item, lowercaseKeys));
|
|
5996
|
+
} else {
|
|
5997
|
+
return Object.fromEntries(
|
|
5998
|
+
Object.entries(obj).map(([k, v]) => [
|
|
5999
|
+
lowercaseKeys ? k.toLowerCase() : k,
|
|
6000
|
+
lowercaseJson(v, lowercaseKeys)
|
|
6001
|
+
])
|
|
6002
|
+
);
|
|
6003
|
+
}
|
|
6004
|
+
} else {
|
|
6005
|
+
return obj;
|
|
6006
|
+
}
|
|
6007
|
+
}
|
|
6008
|
+
function lowercaseAllKeysAndValues(obj) {
|
|
6009
|
+
return lowercaseJson(obj, true);
|
|
6010
|
+
}
|
|
6011
|
+
function lowercaseLeafNodes(obj) {
|
|
6012
|
+
return lowercaseJson(obj, false);
|
|
6013
|
+
}
|
|
5849
6014
|
module.exports = {
|
|
5850
6015
|
EXPOSURE_EVENT,
|
|
5851
6016
|
REQUEST_HEADERS,
|
|
5852
6017
|
normalizedHash,
|
|
5853
6018
|
prepareCommonQueryParams,
|
|
5854
|
-
generateTraceparent
|
|
6019
|
+
generateTraceparent,
|
|
6020
|
+
lowercaseAllKeysAndValues,
|
|
6021
|
+
lowercaseLeafNodes
|
|
5855
6022
|
};
|
|
5856
6023
|
}
|
|
5857
6024
|
});
|
|
5858
6025
|
|
|
5859
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
6026
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/flags.js
|
|
5860
6027
|
var require_flags = __commonJS({
|
|
5861
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
6028
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/flags.js"(exports$1, module) {
|
|
5862
6029
|
var https3 = __require("https");
|
|
5863
6030
|
var packageInfo = require_package();
|
|
5864
|
-
var {
|
|
6031
|
+
var {
|
|
6032
|
+
prepareCommonQueryParams,
|
|
6033
|
+
generateTraceparent,
|
|
6034
|
+
EXPOSURE_EVENT,
|
|
6035
|
+
REQUEST_HEADERS
|
|
6036
|
+
} = require_utils2();
|
|
5865
6037
|
var FeatureFlagsProvider = class {
|
|
5866
6038
|
/**
|
|
5867
6039
|
* @param {Object} providerConfig - Configuration object with token, api_host, request_timeout_in_seconds
|
|
@@ -5884,7 +6056,10 @@ var require_flags = __commonJS({
|
|
|
5884
6056
|
*/
|
|
5885
6057
|
async callFlagsEndpoint(additionalParams = null) {
|
|
5886
6058
|
return new Promise((resolve, reject) => {
|
|
5887
|
-
const commonParams = prepareCommonQueryParams(
|
|
6059
|
+
const commonParams = prepareCommonQueryParams(
|
|
6060
|
+
this.providerConfig.token,
|
|
6061
|
+
packageInfo.version
|
|
6062
|
+
);
|
|
5888
6063
|
const params = new URLSearchParams(commonParams);
|
|
5889
6064
|
if (additionalParams) {
|
|
5890
6065
|
for (const [key, value] of Object.entries(additionalParams)) {
|
|
@@ -5899,8 +6074,8 @@ var require_flags = __commonJS({
|
|
|
5899
6074
|
method: "GET",
|
|
5900
6075
|
headers: {
|
|
5901
6076
|
...REQUEST_HEADERS,
|
|
5902
|
-
|
|
5903
|
-
|
|
6077
|
+
Authorization: "Basic " + Buffer.from(this.providerConfig.token + ":").toString("base64"),
|
|
6078
|
+
traceparent: generateTraceparent()
|
|
5904
6079
|
},
|
|
5905
6080
|
timeout: this.providerConfig.request_timeout_in_seconds * 1e3
|
|
5906
6081
|
};
|
|
@@ -5911,20 +6086,26 @@ var require_flags = __commonJS({
|
|
|
5911
6086
|
});
|
|
5912
6087
|
res.on("end", () => {
|
|
5913
6088
|
if (res.statusCode !== 200) {
|
|
5914
|
-
this.logger?.error(
|
|
6089
|
+
this.logger?.error(
|
|
6090
|
+
`HTTP ${res.statusCode} error calling flags endpoint: ${data}`
|
|
6091
|
+
);
|
|
5915
6092
|
return reject(new Error(`HTTP ${res.statusCode}: ${data}`));
|
|
5916
6093
|
}
|
|
5917
6094
|
try {
|
|
5918
6095
|
const result = JSON.parse(data);
|
|
5919
6096
|
resolve(result);
|
|
5920
6097
|
} catch (parseErr) {
|
|
5921
|
-
this.logger?.error(
|
|
6098
|
+
this.logger?.error(
|
|
6099
|
+
`Failed to parse JSON response: ${parseErr.message}`
|
|
6100
|
+
);
|
|
5922
6101
|
reject(parseErr);
|
|
5923
6102
|
}
|
|
5924
6103
|
});
|
|
5925
6104
|
});
|
|
5926
6105
|
request.on("error", (err) => {
|
|
5927
|
-
this.logger?.error(
|
|
6106
|
+
this.logger?.error(
|
|
6107
|
+
`Network error calling flags endpoint: ${err.message}`
|
|
6108
|
+
);
|
|
5928
6109
|
reject(err);
|
|
5929
6110
|
});
|
|
5930
6111
|
request.on("timeout", () => {
|
|
@@ -5946,14 +6127,16 @@ var require_flags = __commonJS({
|
|
|
5946
6127
|
*/
|
|
5947
6128
|
trackExposureEvent(flagKey, selectedVariant, context, latencyMs = null) {
|
|
5948
6129
|
if (!context.distinct_id) {
|
|
5949
|
-
this.logger?.error(
|
|
6130
|
+
this.logger?.error(
|
|
6131
|
+
"Cannot track exposure event without a distinct_id in the context"
|
|
6132
|
+
);
|
|
5950
6133
|
return;
|
|
5951
6134
|
}
|
|
5952
6135
|
const properties = {
|
|
5953
|
-
|
|
6136
|
+
distinct_id: context.distinct_id,
|
|
5954
6137
|
"Experiment name": flagKey,
|
|
5955
6138
|
"Variant name": selectedVariant.variant_key,
|
|
5956
|
-
|
|
6139
|
+
$experiment_type: "feature_flag",
|
|
5957
6140
|
"Flag evaluation mode": this.evaluationMode
|
|
5958
6141
|
};
|
|
5959
6142
|
if (latencyMs !== null && latencyMs !== void 0) {
|
|
@@ -5970,7 +6153,9 @@ var require_flags = __commonJS({
|
|
|
5970
6153
|
}
|
|
5971
6154
|
this.tracker(EXPOSURE_EVENT, properties, (err) => {
|
|
5972
6155
|
if (err) {
|
|
5973
|
-
this.logger?.error(
|
|
6156
|
+
this.logger?.error(
|
|
6157
|
+
`[flags]Failed to track exposure event for flag '${flagKey}': ${err.message}`
|
|
6158
|
+
);
|
|
5974
6159
|
}
|
|
5975
6160
|
});
|
|
5976
6161
|
}
|
|
@@ -5979,11 +6164,392 @@ var require_flags = __commonJS({
|
|
|
5979
6164
|
}
|
|
5980
6165
|
});
|
|
5981
6166
|
|
|
5982
|
-
// ../../node_modules/.pnpm/
|
|
6167
|
+
// ../../node_modules/.pnpm/json-logic-js@2.0.5/node_modules/json-logic-js/logic.js
|
|
6168
|
+
var require_logic = __commonJS({
|
|
6169
|
+
"../../node_modules/.pnpm/json-logic-js@2.0.5/node_modules/json-logic-js/logic.js"(exports$1, module) {
|
|
6170
|
+
(function(root, factory) {
|
|
6171
|
+
if (typeof define === "function" && define.amd) {
|
|
6172
|
+
define(factory);
|
|
6173
|
+
} else if (typeof exports$1 === "object") {
|
|
6174
|
+
module.exports = factory();
|
|
6175
|
+
} else {
|
|
6176
|
+
root.jsonLogic = factory();
|
|
6177
|
+
}
|
|
6178
|
+
})(exports$1, function() {
|
|
6179
|
+
if (!Array.isArray) {
|
|
6180
|
+
Array.isArray = function(arg) {
|
|
6181
|
+
return Object.prototype.toString.call(arg) === "[object Array]";
|
|
6182
|
+
};
|
|
6183
|
+
}
|
|
6184
|
+
function arrayUnique(array) {
|
|
6185
|
+
var a = [];
|
|
6186
|
+
for (var i = 0, l = array.length; i < l; i++) {
|
|
6187
|
+
if (a.indexOf(array[i]) === -1) {
|
|
6188
|
+
a.push(array[i]);
|
|
6189
|
+
}
|
|
6190
|
+
}
|
|
6191
|
+
return a;
|
|
6192
|
+
}
|
|
6193
|
+
var jsonLogic = {};
|
|
6194
|
+
var operations = {
|
|
6195
|
+
"==": function(a, b) {
|
|
6196
|
+
return a == b;
|
|
6197
|
+
},
|
|
6198
|
+
"===": function(a, b) {
|
|
6199
|
+
return a === b;
|
|
6200
|
+
},
|
|
6201
|
+
"!=": function(a, b) {
|
|
6202
|
+
return a != b;
|
|
6203
|
+
},
|
|
6204
|
+
"!==": function(a, b) {
|
|
6205
|
+
return a !== b;
|
|
6206
|
+
},
|
|
6207
|
+
">": function(a, b) {
|
|
6208
|
+
return a > b;
|
|
6209
|
+
},
|
|
6210
|
+
">=": function(a, b) {
|
|
6211
|
+
return a >= b;
|
|
6212
|
+
},
|
|
6213
|
+
"<": function(a, b, c) {
|
|
6214
|
+
return c === void 0 ? a < b : a < b && b < c;
|
|
6215
|
+
},
|
|
6216
|
+
"<=": function(a, b, c) {
|
|
6217
|
+
return c === void 0 ? a <= b : a <= b && b <= c;
|
|
6218
|
+
},
|
|
6219
|
+
"!!": function(a) {
|
|
6220
|
+
return jsonLogic.truthy(a);
|
|
6221
|
+
},
|
|
6222
|
+
"!": function(a) {
|
|
6223
|
+
return !jsonLogic.truthy(a);
|
|
6224
|
+
},
|
|
6225
|
+
"%": function(a, b) {
|
|
6226
|
+
return a % b;
|
|
6227
|
+
},
|
|
6228
|
+
"log": function(a) {
|
|
6229
|
+
console.log(a);
|
|
6230
|
+
return a;
|
|
6231
|
+
},
|
|
6232
|
+
"in": function(a, b) {
|
|
6233
|
+
if (!b || typeof b.indexOf === "undefined") return false;
|
|
6234
|
+
return b.indexOf(a) !== -1;
|
|
6235
|
+
},
|
|
6236
|
+
"cat": function() {
|
|
6237
|
+
return Array.prototype.join.call(arguments, "");
|
|
6238
|
+
},
|
|
6239
|
+
"substr": function(source, start, end) {
|
|
6240
|
+
if (end < 0) {
|
|
6241
|
+
var temp = String(source).substr(start);
|
|
6242
|
+
return temp.substr(0, temp.length + end);
|
|
6243
|
+
}
|
|
6244
|
+
return String(source).substr(start, end);
|
|
6245
|
+
},
|
|
6246
|
+
"+": function() {
|
|
6247
|
+
return Array.prototype.reduce.call(arguments, function(a, b) {
|
|
6248
|
+
return parseFloat(a, 10) + parseFloat(b, 10);
|
|
6249
|
+
}, 0);
|
|
6250
|
+
},
|
|
6251
|
+
"*": function() {
|
|
6252
|
+
return Array.prototype.reduce.call(arguments, function(a, b) {
|
|
6253
|
+
return parseFloat(a, 10) * parseFloat(b, 10);
|
|
6254
|
+
});
|
|
6255
|
+
},
|
|
6256
|
+
"-": function(a, b) {
|
|
6257
|
+
if (b === void 0) {
|
|
6258
|
+
return -a;
|
|
6259
|
+
} else {
|
|
6260
|
+
return a - b;
|
|
6261
|
+
}
|
|
6262
|
+
},
|
|
6263
|
+
"/": function(a, b) {
|
|
6264
|
+
return a / b;
|
|
6265
|
+
},
|
|
6266
|
+
"min": function() {
|
|
6267
|
+
return Math.min.apply(this, arguments);
|
|
6268
|
+
},
|
|
6269
|
+
"max": function() {
|
|
6270
|
+
return Math.max.apply(this, arguments);
|
|
6271
|
+
},
|
|
6272
|
+
"merge": function() {
|
|
6273
|
+
return Array.prototype.reduce.call(arguments, function(a, b) {
|
|
6274
|
+
return a.concat(b);
|
|
6275
|
+
}, []);
|
|
6276
|
+
},
|
|
6277
|
+
"var": function(a, b) {
|
|
6278
|
+
var not_found = b === void 0 ? null : b;
|
|
6279
|
+
var data = this;
|
|
6280
|
+
if (typeof a === "undefined" || a === "" || a === null) {
|
|
6281
|
+
return data;
|
|
6282
|
+
}
|
|
6283
|
+
var sub_props = String(a).split(".");
|
|
6284
|
+
for (var i = 0; i < sub_props.length; i++) {
|
|
6285
|
+
if (data === null || data === void 0) {
|
|
6286
|
+
return not_found;
|
|
6287
|
+
}
|
|
6288
|
+
data = data[sub_props[i]];
|
|
6289
|
+
if (data === void 0) {
|
|
6290
|
+
return not_found;
|
|
6291
|
+
}
|
|
6292
|
+
}
|
|
6293
|
+
return data;
|
|
6294
|
+
},
|
|
6295
|
+
"missing": function() {
|
|
6296
|
+
var missing = [];
|
|
6297
|
+
var keys = Array.isArray(arguments[0]) ? arguments[0] : arguments;
|
|
6298
|
+
for (var i = 0; i < keys.length; i++) {
|
|
6299
|
+
var key = keys[i];
|
|
6300
|
+
var value = jsonLogic.apply({ "var": key }, this);
|
|
6301
|
+
if (value === null || value === "") {
|
|
6302
|
+
missing.push(key);
|
|
6303
|
+
}
|
|
6304
|
+
}
|
|
6305
|
+
return missing;
|
|
6306
|
+
},
|
|
6307
|
+
"missing_some": function(need_count, options) {
|
|
6308
|
+
var are_missing = jsonLogic.apply({ "missing": options }, this);
|
|
6309
|
+
if (options.length - are_missing.length >= need_count) {
|
|
6310
|
+
return [];
|
|
6311
|
+
} else {
|
|
6312
|
+
return are_missing;
|
|
6313
|
+
}
|
|
6314
|
+
}
|
|
6315
|
+
};
|
|
6316
|
+
jsonLogic.is_logic = function(logic) {
|
|
6317
|
+
return typeof logic === "object" && // An object
|
|
6318
|
+
logic !== null && // but not null
|
|
6319
|
+
!Array.isArray(logic) && // and not an array
|
|
6320
|
+
Object.keys(logic).length === 1;
|
|
6321
|
+
};
|
|
6322
|
+
jsonLogic.truthy = function(value) {
|
|
6323
|
+
if (Array.isArray(value) && value.length === 0) {
|
|
6324
|
+
return false;
|
|
6325
|
+
}
|
|
6326
|
+
return !!value;
|
|
6327
|
+
};
|
|
6328
|
+
jsonLogic.get_operator = function(logic) {
|
|
6329
|
+
return Object.keys(logic)[0];
|
|
6330
|
+
};
|
|
6331
|
+
jsonLogic.get_values = function(logic) {
|
|
6332
|
+
return logic[jsonLogic.get_operator(logic)];
|
|
6333
|
+
};
|
|
6334
|
+
jsonLogic.apply = function(logic, data) {
|
|
6335
|
+
if (Array.isArray(logic)) {
|
|
6336
|
+
return logic.map(function(l) {
|
|
6337
|
+
return jsonLogic.apply(l, data);
|
|
6338
|
+
});
|
|
6339
|
+
}
|
|
6340
|
+
if (!jsonLogic.is_logic(logic)) {
|
|
6341
|
+
return logic;
|
|
6342
|
+
}
|
|
6343
|
+
var op = jsonLogic.get_operator(logic);
|
|
6344
|
+
var values = logic[op];
|
|
6345
|
+
var i;
|
|
6346
|
+
var current;
|
|
6347
|
+
var scopedLogic;
|
|
6348
|
+
var scopedData;
|
|
6349
|
+
var initial;
|
|
6350
|
+
if (!Array.isArray(values)) {
|
|
6351
|
+
values = [values];
|
|
6352
|
+
}
|
|
6353
|
+
if (op === "if" || op == "?:") {
|
|
6354
|
+
for (i = 0; i < values.length - 1; i += 2) {
|
|
6355
|
+
if (jsonLogic.truthy(jsonLogic.apply(values[i], data))) {
|
|
6356
|
+
return jsonLogic.apply(values[i + 1], data);
|
|
6357
|
+
}
|
|
6358
|
+
}
|
|
6359
|
+
if (values.length === i + 1) {
|
|
6360
|
+
return jsonLogic.apply(values[i], data);
|
|
6361
|
+
}
|
|
6362
|
+
return null;
|
|
6363
|
+
} else if (op === "and") {
|
|
6364
|
+
for (i = 0; i < values.length; i += 1) {
|
|
6365
|
+
current = jsonLogic.apply(values[i], data);
|
|
6366
|
+
if (!jsonLogic.truthy(current)) {
|
|
6367
|
+
return current;
|
|
6368
|
+
}
|
|
6369
|
+
}
|
|
6370
|
+
return current;
|
|
6371
|
+
} else if (op === "or") {
|
|
6372
|
+
for (i = 0; i < values.length; i += 1) {
|
|
6373
|
+
current = jsonLogic.apply(values[i], data);
|
|
6374
|
+
if (jsonLogic.truthy(current)) {
|
|
6375
|
+
return current;
|
|
6376
|
+
}
|
|
6377
|
+
}
|
|
6378
|
+
return current;
|
|
6379
|
+
} else if (op === "filter") {
|
|
6380
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6381
|
+
scopedLogic = values[1];
|
|
6382
|
+
if (!Array.isArray(scopedData)) {
|
|
6383
|
+
return [];
|
|
6384
|
+
}
|
|
6385
|
+
return scopedData.filter(function(datum) {
|
|
6386
|
+
return jsonLogic.truthy(jsonLogic.apply(scopedLogic, datum));
|
|
6387
|
+
});
|
|
6388
|
+
} else if (op === "map") {
|
|
6389
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6390
|
+
scopedLogic = values[1];
|
|
6391
|
+
if (!Array.isArray(scopedData)) {
|
|
6392
|
+
return [];
|
|
6393
|
+
}
|
|
6394
|
+
return scopedData.map(function(datum) {
|
|
6395
|
+
return jsonLogic.apply(scopedLogic, datum);
|
|
6396
|
+
});
|
|
6397
|
+
} else if (op === "reduce") {
|
|
6398
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6399
|
+
scopedLogic = values[1];
|
|
6400
|
+
initial = typeof values[2] !== "undefined" ? jsonLogic.apply(values[2], data) : null;
|
|
6401
|
+
if (!Array.isArray(scopedData)) {
|
|
6402
|
+
return initial;
|
|
6403
|
+
}
|
|
6404
|
+
return scopedData.reduce(
|
|
6405
|
+
function(accumulator, current2) {
|
|
6406
|
+
return jsonLogic.apply(
|
|
6407
|
+
scopedLogic,
|
|
6408
|
+
{ current: current2, accumulator }
|
|
6409
|
+
);
|
|
6410
|
+
},
|
|
6411
|
+
initial
|
|
6412
|
+
);
|
|
6413
|
+
} else if (op === "all") {
|
|
6414
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6415
|
+
scopedLogic = values[1];
|
|
6416
|
+
if (!Array.isArray(scopedData) || !scopedData.length) {
|
|
6417
|
+
return false;
|
|
6418
|
+
}
|
|
6419
|
+
for (i = 0; i < scopedData.length; i += 1) {
|
|
6420
|
+
if (!jsonLogic.truthy(jsonLogic.apply(scopedLogic, scopedData[i]))) {
|
|
6421
|
+
return false;
|
|
6422
|
+
}
|
|
6423
|
+
}
|
|
6424
|
+
return true;
|
|
6425
|
+
} else if (op === "none") {
|
|
6426
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6427
|
+
scopedLogic = values[1];
|
|
6428
|
+
if (!Array.isArray(scopedData) || !scopedData.length) {
|
|
6429
|
+
return true;
|
|
6430
|
+
}
|
|
6431
|
+
for (i = 0; i < scopedData.length; i += 1) {
|
|
6432
|
+
if (jsonLogic.truthy(jsonLogic.apply(scopedLogic, scopedData[i]))) {
|
|
6433
|
+
return false;
|
|
6434
|
+
}
|
|
6435
|
+
}
|
|
6436
|
+
return true;
|
|
6437
|
+
} else if (op === "some") {
|
|
6438
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6439
|
+
scopedLogic = values[1];
|
|
6440
|
+
if (!Array.isArray(scopedData) || !scopedData.length) {
|
|
6441
|
+
return false;
|
|
6442
|
+
}
|
|
6443
|
+
for (i = 0; i < scopedData.length; i += 1) {
|
|
6444
|
+
if (jsonLogic.truthy(jsonLogic.apply(scopedLogic, scopedData[i]))) {
|
|
6445
|
+
return true;
|
|
6446
|
+
}
|
|
6447
|
+
}
|
|
6448
|
+
return false;
|
|
6449
|
+
}
|
|
6450
|
+
values = values.map(function(val) {
|
|
6451
|
+
return jsonLogic.apply(val, data);
|
|
6452
|
+
});
|
|
6453
|
+
if (operations.hasOwnProperty(op) && typeof operations[op] === "function") {
|
|
6454
|
+
return operations[op].apply(data, values);
|
|
6455
|
+
} else if (op.indexOf(".") > 0) {
|
|
6456
|
+
var sub_ops = String(op).split(".");
|
|
6457
|
+
var operation = operations;
|
|
6458
|
+
for (i = 0; i < sub_ops.length; i++) {
|
|
6459
|
+
if (!operation.hasOwnProperty(sub_ops[i])) {
|
|
6460
|
+
throw new Error("Unrecognized operation " + op + " (failed at " + sub_ops.slice(0, i + 1).join(".") + ")");
|
|
6461
|
+
}
|
|
6462
|
+
operation = operation[sub_ops[i]];
|
|
6463
|
+
}
|
|
6464
|
+
return operation.apply(data, values);
|
|
6465
|
+
}
|
|
6466
|
+
throw new Error("Unrecognized operation " + op);
|
|
6467
|
+
};
|
|
6468
|
+
jsonLogic.uses_data = function(logic) {
|
|
6469
|
+
var collection = [];
|
|
6470
|
+
if (jsonLogic.is_logic(logic)) {
|
|
6471
|
+
var op = jsonLogic.get_operator(logic);
|
|
6472
|
+
var values = logic[op];
|
|
6473
|
+
if (!Array.isArray(values)) {
|
|
6474
|
+
values = [values];
|
|
6475
|
+
}
|
|
6476
|
+
if (op === "var") {
|
|
6477
|
+
collection.push(values[0]);
|
|
6478
|
+
} else {
|
|
6479
|
+
values.forEach(function(val) {
|
|
6480
|
+
collection.push.apply(collection, jsonLogic.uses_data(val));
|
|
6481
|
+
});
|
|
6482
|
+
}
|
|
6483
|
+
}
|
|
6484
|
+
return arrayUnique(collection);
|
|
6485
|
+
};
|
|
6486
|
+
jsonLogic.add_operation = function(name, code) {
|
|
6487
|
+
operations[name] = code;
|
|
6488
|
+
};
|
|
6489
|
+
jsonLogic.rm_operation = function(name) {
|
|
6490
|
+
delete operations[name];
|
|
6491
|
+
};
|
|
6492
|
+
jsonLogic.rule_like = function(rule, pattern) {
|
|
6493
|
+
if (pattern === rule) {
|
|
6494
|
+
return true;
|
|
6495
|
+
}
|
|
6496
|
+
if (pattern === "@") {
|
|
6497
|
+
return true;
|
|
6498
|
+
}
|
|
6499
|
+
if (pattern === "number") {
|
|
6500
|
+
return typeof rule === "number";
|
|
6501
|
+
}
|
|
6502
|
+
if (pattern === "string") {
|
|
6503
|
+
return typeof rule === "string";
|
|
6504
|
+
}
|
|
6505
|
+
if (pattern === "array") {
|
|
6506
|
+
return Array.isArray(rule) && !jsonLogic.is_logic(rule);
|
|
6507
|
+
}
|
|
6508
|
+
if (jsonLogic.is_logic(pattern)) {
|
|
6509
|
+
if (jsonLogic.is_logic(rule)) {
|
|
6510
|
+
var pattern_op = jsonLogic.get_operator(pattern);
|
|
6511
|
+
var rule_op = jsonLogic.get_operator(rule);
|
|
6512
|
+
if (pattern_op === "@" || pattern_op === rule_op) {
|
|
6513
|
+
return jsonLogic.rule_like(
|
|
6514
|
+
jsonLogic.get_values(rule, false),
|
|
6515
|
+
jsonLogic.get_values(pattern, false)
|
|
6516
|
+
);
|
|
6517
|
+
}
|
|
6518
|
+
}
|
|
6519
|
+
return false;
|
|
6520
|
+
}
|
|
6521
|
+
if (Array.isArray(pattern)) {
|
|
6522
|
+
if (Array.isArray(rule)) {
|
|
6523
|
+
if (pattern.length !== rule.length) {
|
|
6524
|
+
return false;
|
|
6525
|
+
}
|
|
6526
|
+
for (var i = 0; i < pattern.length; i += 1) {
|
|
6527
|
+
if (!jsonLogic.rule_like(rule[i], pattern[i])) {
|
|
6528
|
+
return false;
|
|
6529
|
+
}
|
|
6530
|
+
}
|
|
6531
|
+
return true;
|
|
6532
|
+
} else {
|
|
6533
|
+
return false;
|
|
6534
|
+
}
|
|
6535
|
+
}
|
|
6536
|
+
return false;
|
|
6537
|
+
};
|
|
6538
|
+
return jsonLogic;
|
|
6539
|
+
});
|
|
6540
|
+
}
|
|
6541
|
+
});
|
|
6542
|
+
|
|
6543
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/local_flags.js
|
|
5983
6544
|
var require_local_flags = __commonJS({
|
|
5984
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
6545
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/local_flags.js"(exports$1, module) {
|
|
5985
6546
|
var FeatureFlagsProvider = require_flags();
|
|
5986
|
-
var {
|
|
6547
|
+
var {
|
|
6548
|
+
normalizedHash,
|
|
6549
|
+
lowercaseAllKeysAndValues,
|
|
6550
|
+
lowercaseLeafNodes
|
|
6551
|
+
} = require_utils2();
|
|
6552
|
+
var { apply } = require_logic();
|
|
5987
6553
|
var LocalFeatureFlagsProvider = class extends FeatureFlagsProvider {
|
|
5988
6554
|
/**
|
|
5989
6555
|
* @param {string} token - Mixpanel project token
|
|
@@ -6022,12 +6588,16 @@ var require_local_flags = __commonJS({
|
|
|
6022
6588
|
try {
|
|
6023
6589
|
await this._fetchFlagDefinitions();
|
|
6024
6590
|
} catch (err) {
|
|
6025
|
-
this.logger?.error(
|
|
6591
|
+
this.logger?.error(
|
|
6592
|
+
`Error polling for flag definition: ${err.message}`
|
|
6593
|
+
);
|
|
6026
6594
|
}
|
|
6027
6595
|
}, this.config.polling_interval_in_seconds * 1e3);
|
|
6028
6596
|
}
|
|
6029
6597
|
} catch (err) {
|
|
6030
|
-
this.logger?.error(
|
|
6598
|
+
this.logger?.error(
|
|
6599
|
+
`Initial flag definitions fetch failed: ${err.message}`
|
|
6600
|
+
);
|
|
6031
6601
|
}
|
|
6032
6602
|
}
|
|
6033
6603
|
/**
|
|
@@ -6038,7 +6608,9 @@ var require_local_flags = __commonJS({
|
|
|
6038
6608
|
clearInterval(this.pollingInterval);
|
|
6039
6609
|
this.pollingInterval = null;
|
|
6040
6610
|
} else {
|
|
6041
|
-
this.logger?.warn(
|
|
6611
|
+
this.logger?.warn(
|
|
6612
|
+
"stopPollingForDefinitions called but polling was not active"
|
|
6613
|
+
);
|
|
6042
6614
|
}
|
|
6043
6615
|
}
|
|
6044
6616
|
/**
|
|
@@ -6063,7 +6635,12 @@ var require_local_flags = __commonJS({
|
|
|
6063
6635
|
* @returns {*} The variant value
|
|
6064
6636
|
*/
|
|
6065
6637
|
getVariantValue(flagKey, fallbackValue, context, reportExposure = true) {
|
|
6066
|
-
const result = this.getVariant(
|
|
6638
|
+
const result = this.getVariant(
|
|
6639
|
+
flagKey,
|
|
6640
|
+
{ variant_value: fallbackValue },
|
|
6641
|
+
context,
|
|
6642
|
+
reportExposure
|
|
6643
|
+
);
|
|
6067
6644
|
return result.variant_value;
|
|
6068
6645
|
}
|
|
6069
6646
|
/**
|
|
@@ -6094,7 +6671,12 @@ var require_local_flags = __commonJS({
|
|
|
6094
6671
|
} else {
|
|
6095
6672
|
const rollout = this._getAssignedRollout(flag, contextValue, context);
|
|
6096
6673
|
if (rollout) {
|
|
6097
|
-
selectedVariant = this._getAssignedVariant(
|
|
6674
|
+
selectedVariant = this._getAssignedVariant(
|
|
6675
|
+
flag,
|
|
6676
|
+
contextValue,
|
|
6677
|
+
flagKey,
|
|
6678
|
+
rollout
|
|
6679
|
+
);
|
|
6098
6680
|
}
|
|
6099
6681
|
}
|
|
6100
6682
|
if (selectedVariant) {
|
|
@@ -6189,7 +6771,10 @@ var require_local_flags = __commonJS({
|
|
|
6189
6771
|
}
|
|
6190
6772
|
_getAssignedVariant(flag, contextValue, flagKey, rollout) {
|
|
6191
6773
|
if (rollout.variant_override) {
|
|
6192
|
-
const variant = this._getMatchingVariant(
|
|
6774
|
+
const variant = this._getMatchingVariant(
|
|
6775
|
+
rollout.variant_override.key,
|
|
6776
|
+
flag
|
|
6777
|
+
);
|
|
6193
6778
|
if (variant) {
|
|
6194
6779
|
return { ...variant, is_qa_tester: false };
|
|
6195
6780
|
}
|
|
@@ -6222,15 +6807,41 @@ var require_local_flags = __commonJS({
|
|
|
6222
6807
|
is_qa_tester: false
|
|
6223
6808
|
};
|
|
6224
6809
|
}
|
|
6810
|
+
_extractRuntimeParameters(context) {
|
|
6811
|
+
const customProperties = context.custom_properties;
|
|
6812
|
+
if (!customProperties || typeof customProperties !== "object") {
|
|
6813
|
+
return null;
|
|
6814
|
+
}
|
|
6815
|
+
return lowercaseAllKeysAndValues(customProperties);
|
|
6816
|
+
}
|
|
6817
|
+
_isRuntimeRuleSatisfied(rollout, context) {
|
|
6818
|
+
try {
|
|
6819
|
+
return apply(
|
|
6820
|
+
lowercaseLeafNodes(rollout.runtime_evaluation_rule),
|
|
6821
|
+
this._extractRuntimeParameters(context)
|
|
6822
|
+
);
|
|
6823
|
+
} catch (error) {
|
|
6824
|
+
this.logger?.error(`Error evaluating runtime rule: ${error.message}`);
|
|
6825
|
+
return false;
|
|
6826
|
+
}
|
|
6827
|
+
}
|
|
6225
6828
|
_isRuntimeEvaluationSatisfied(rollout, context) {
|
|
6226
|
-
if (
|
|
6829
|
+
if (rollout.runtime_evaluation_rule) {
|
|
6830
|
+
return this._isRuntimeRuleSatisfied(rollout, context);
|
|
6831
|
+
} else if (rollout.runtime_evaluation_definition) {
|
|
6832
|
+
return this._isLegacyRuntimeEvaluationSatisfied(rollout, context);
|
|
6833
|
+
} else {
|
|
6227
6834
|
return true;
|
|
6228
6835
|
}
|
|
6229
|
-
|
|
6230
|
-
|
|
6836
|
+
}
|
|
6837
|
+
_isLegacyRuntimeEvaluationSatisfied(rollout, context) {
|
|
6838
|
+
const customProperties = this._extractRuntimeParameters(context);
|
|
6839
|
+
if (!customProperties) {
|
|
6231
6840
|
return false;
|
|
6232
6841
|
}
|
|
6233
|
-
for (const [key, expectedValue] of Object.entries(
|
|
6842
|
+
for (const [key, expectedValue] of Object.entries(
|
|
6843
|
+
rollout.runtime_evaluation_definition
|
|
6844
|
+
)) {
|
|
6234
6845
|
if (!(key in customProperties)) {
|
|
6235
6846
|
return false;
|
|
6236
6847
|
}
|
|
@@ -6246,9 +6857,9 @@ var require_local_flags = __commonJS({
|
|
|
6246
6857
|
}
|
|
6247
6858
|
});
|
|
6248
6859
|
|
|
6249
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
6860
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/remote_flags.js
|
|
6250
6861
|
var require_remote_flags = __commonJS({
|
|
6251
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
6862
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/remote_flags.js"(exports$1, module) {
|
|
6252
6863
|
var FeatureFlagsProvider = require_flags();
|
|
6253
6864
|
var RemoteFeatureFlagsProvider = class extends FeatureFlagsProvider {
|
|
6254
6865
|
/**
|
|
@@ -6282,10 +6893,17 @@ var require_remote_flags = __commonJS({
|
|
|
6282
6893
|
*/
|
|
6283
6894
|
async getVariantValue(flagKey, fallbackValue, context, reportExposure = true) {
|
|
6284
6895
|
try {
|
|
6285
|
-
const selectedVariant = await this.getVariant(
|
|
6896
|
+
const selectedVariant = await this.getVariant(
|
|
6897
|
+
flagKey,
|
|
6898
|
+
{ variant_value: fallbackValue },
|
|
6899
|
+
context,
|
|
6900
|
+
reportExposure
|
|
6901
|
+
);
|
|
6286
6902
|
return selectedVariant.variant_value;
|
|
6287
6903
|
} catch (err) {
|
|
6288
|
-
this.logger?.error(
|
|
6904
|
+
this.logger?.error(
|
|
6905
|
+
`Failed to get variant value for flag '${flagKey}': ${err.message}`
|
|
6906
|
+
);
|
|
6289
6907
|
return fallbackValue;
|
|
6290
6908
|
}
|
|
6291
6909
|
}
|
|
@@ -6314,7 +6932,9 @@ var require_remote_flags = __commonJS({
|
|
|
6314
6932
|
}
|
|
6315
6933
|
return selectedVariant;
|
|
6316
6934
|
} catch (err) {
|
|
6317
|
-
this.logger?.error(
|
|
6935
|
+
this.logger?.error(
|
|
6936
|
+
`Failed to get variant for flag '${flagKey}': ${err.message}`
|
|
6937
|
+
);
|
|
6318
6938
|
return fallbackVariant;
|
|
6319
6939
|
}
|
|
6320
6940
|
}
|
|
@@ -6331,7 +6951,9 @@ var require_remote_flags = __commonJS({
|
|
|
6331
6951
|
const value = await this.getVariantValue(flagKey, false, context);
|
|
6332
6952
|
return value === true;
|
|
6333
6953
|
} catch (err) {
|
|
6334
|
-
this.logger?.error(
|
|
6954
|
+
this.logger?.error(
|
|
6955
|
+
`Failed to check if flag '${flagKey}' is enabled: ${err.message}`
|
|
6956
|
+
);
|
|
6335
6957
|
return false;
|
|
6336
6958
|
}
|
|
6337
6959
|
}
|
|
@@ -6370,9 +6992,9 @@ var require_remote_flags = __commonJS({
|
|
|
6370
6992
|
}
|
|
6371
6993
|
});
|
|
6372
6994
|
|
|
6373
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
6995
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/index.js
|
|
6374
6996
|
var require_flags2 = __commonJS({
|
|
6375
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
6997
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/index.js"(exports$1, module) {
|
|
6376
6998
|
var LocalFeatureFlagsProvider = require_local_flags();
|
|
6377
6999
|
var RemoteFeatureFlagsProvider = require_remote_flags();
|
|
6378
7000
|
module.exports = {
|
|
@@ -6382,9 +7004,9 @@ var require_flags2 = __commonJS({
|
|
|
6382
7004
|
}
|
|
6383
7005
|
});
|
|
6384
7006
|
|
|
6385
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
7007
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/mixpanel-node.js
|
|
6386
7008
|
var require_mixpanel_node = __commonJS({
|
|
6387
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
7009
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/mixpanel-node.js"(exports$1, module) {
|
|
6388
7010
|
var querystring = __require("querystring");
|
|
6389
7011
|
var Buffer4 = __require("buffer").Buffer;
|
|
6390
7012
|
var http3 = __require("http");
|
|
@@ -6395,7 +7017,10 @@ var require_mixpanel_node = __commonJS({
|
|
|
6395
7017
|
var { async_all, ensure_timestamp, assert_logger } = require_utils();
|
|
6396
7018
|
var { MixpanelGroups } = require_groups();
|
|
6397
7019
|
var { MixpanelPeople } = require_people();
|
|
6398
|
-
var {
|
|
7020
|
+
var {
|
|
7021
|
+
LocalFeatureFlagsProvider,
|
|
7022
|
+
RemoteFeatureFlagsProvider
|
|
7023
|
+
} = require_flags2();
|
|
6399
7024
|
var DEFAULT_CONFIG = {
|
|
6400
7025
|
test: false,
|
|
6401
7026
|
debug: false,
|
|
@@ -6411,7 +7036,9 @@ var require_mixpanel_node = __commonJS({
|
|
|
6411
7036
|
};
|
|
6412
7037
|
var create_client = function(token, config) {
|
|
6413
7038
|
if (!token) {
|
|
6414
|
-
throw new Error(
|
|
7039
|
+
throw new Error(
|
|
7040
|
+
"The Mixpanel Client needs a Mixpanel token: `init(token)`"
|
|
7041
|
+
);
|
|
6415
7042
|
}
|
|
6416
7043
|
const metrics = {
|
|
6417
7044
|
token,
|
|
@@ -6425,9 +7052,11 @@ var require_mixpanel_node = __commonJS({
|
|
|
6425
7052
|
https: new https3.Agent({ keepAlive })
|
|
6426
7053
|
};
|
|
6427
7054
|
const proxyPath = process.env.HTTPS_PROXY || process.env.HTTP_PROXY;
|
|
6428
|
-
const proxyAgent = proxyPath ? new HttpsProxyAgent(
|
|
6429
|
-
|
|
6430
|
-
|
|
7055
|
+
const proxyAgent = proxyPath ? new HttpsProxyAgent(
|
|
7056
|
+
Object.assign(url.parse(proxyPath), {
|
|
7057
|
+
keepAlive
|
|
7058
|
+
})
|
|
7059
|
+
) : null;
|
|
6431
7060
|
metrics.send_request = function(options, callback) {
|
|
6432
7061
|
callback = callback || function() {
|
|
6433
7062
|
};
|
|
@@ -6435,8 +7064,8 @@ var require_mixpanel_node = __commonJS({
|
|
|
6435
7064
|
const endpoint = options.endpoint;
|
|
6436
7065
|
const method = (options.method || "GET").toUpperCase();
|
|
6437
7066
|
let query_params = {
|
|
6438
|
-
|
|
6439
|
-
|
|
7067
|
+
ip: metrics.config.geolocate ? 1 : 0,
|
|
7068
|
+
verbose: metrics.config.verbose ? 1 : 0
|
|
6440
7069
|
};
|
|
6441
7070
|
const key = metrics.config.key;
|
|
6442
7071
|
const secret = metrics.config.secret;
|
|
@@ -6469,7 +7098,9 @@ var require_mixpanel_node = __commonJS({
|
|
|
6469
7098
|
} else if (key) {
|
|
6470
7099
|
query_params.api_key = key;
|
|
6471
7100
|
} else if (endpoint === "/import") {
|
|
6472
|
-
throw new Error(
|
|
7101
|
+
throw new Error(
|
|
7102
|
+
"The Mixpanel Client needs a Mixpanel API Secret when importing old events: `init(token, { secret: ... })`"
|
|
7103
|
+
);
|
|
6473
7104
|
}
|
|
6474
7105
|
request_options.agent = proxyAgent || REQUEST_AGENTS[metrics.config.protocol];
|
|
6475
7106
|
if (metrics.config.test) {
|
|
@@ -6477,20 +7108,22 @@ var require_mixpanel_node = __commonJS({
|
|
|
6477
7108
|
}
|
|
6478
7109
|
request_options.path = metrics.config.path + endpoint + "?" + querystring.stringify(query_params);
|
|
6479
7110
|
request = request_lib.request(request_options, function(res) {
|
|
6480
|
-
|
|
7111
|
+
let data = "";
|
|
6481
7112
|
res.on("data", function(chunk3) {
|
|
6482
7113
|
data += chunk3;
|
|
6483
7114
|
});
|
|
6484
7115
|
res.on("end", function() {
|
|
6485
|
-
|
|
7116
|
+
let e;
|
|
6486
7117
|
if (metrics.config.verbose) {
|
|
6487
7118
|
try {
|
|
6488
|
-
|
|
7119
|
+
const result = JSON.parse(data);
|
|
6489
7120
|
if (result.status != 1) {
|
|
6490
7121
|
e = new Error("Mixpanel Server Error: " + result.error);
|
|
6491
7122
|
}
|
|
6492
7123
|
} catch (ex) {
|
|
6493
|
-
e = new Error(
|
|
7124
|
+
e = new Error(
|
|
7125
|
+
"Could not parse response from Mixpanel " + ex.message
|
|
7126
|
+
);
|
|
6494
7127
|
}
|
|
6495
7128
|
} else {
|
|
6496
7129
|
e = data !== "1" ? new Error("Mixpanel Server Error: " + data) : void 0;
|
|
@@ -6513,39 +7146,46 @@ var require_mixpanel_node = __commonJS({
|
|
|
6513
7146
|
properties.token = metrics.token;
|
|
6514
7147
|
properties.mp_lib = "node";
|
|
6515
7148
|
properties.$lib_version = packageInfo.version;
|
|
6516
|
-
|
|
7149
|
+
const data = {
|
|
6517
7150
|
event,
|
|
6518
7151
|
properties
|
|
6519
7152
|
};
|
|
6520
7153
|
if (metrics.config.debug) {
|
|
6521
|
-
metrics.config.logger.debug("Sending the following event to Mixpanel", {
|
|
7154
|
+
metrics.config.logger.debug("Sending the following event to Mixpanel", {
|
|
7155
|
+
data
|
|
7156
|
+
});
|
|
6522
7157
|
}
|
|
6523
|
-
metrics.send_request(
|
|
7158
|
+
metrics.send_request(
|
|
7159
|
+
{ method: "GET", endpoint, data },
|
|
7160
|
+
callback
|
|
7161
|
+
);
|
|
6524
7162
|
};
|
|
6525
|
-
|
|
6526
|
-
|
|
7163
|
+
const chunk2 = function(arr, size) {
|
|
7164
|
+
let chunks = [], i = 0, total = arr.length;
|
|
6527
7165
|
while (i < total) {
|
|
6528
7166
|
chunks.push(arr.slice(i, i += size));
|
|
6529
7167
|
}
|
|
6530
7168
|
return chunks;
|
|
6531
7169
|
};
|
|
6532
|
-
|
|
6533
|
-
|
|
7170
|
+
const send_batch_requests = function(options, callback) {
|
|
7171
|
+
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;
|
|
6534
7172
|
function send_event_batch(batch, cb) {
|
|
6535
7173
|
if (batch.length > 0) {
|
|
6536
7174
|
batch = batch.map(function(event) {
|
|
6537
|
-
event.properties;
|
|
6538
7175
|
if (endpoint === "/import" || event.properties.time) {
|
|
6539
7176
|
event.properties.time = ensure_timestamp(event.properties.time);
|
|
6540
7177
|
}
|
|
6541
7178
|
event.properties.token = event.properties.token || metrics.token;
|
|
6542
7179
|
return event;
|
|
6543
7180
|
});
|
|
6544
|
-
metrics.send_request(
|
|
7181
|
+
metrics.send_request(
|
|
7182
|
+
{ method: "POST", endpoint, data: batch },
|
|
7183
|
+
cb
|
|
7184
|
+
);
|
|
6545
7185
|
}
|
|
6546
7186
|
}
|
|
6547
7187
|
function send_next_request_batch(index) {
|
|
6548
|
-
|
|
7188
|
+
const request_batch = request_batches[index], cb = function(errors, results) {
|
|
6549
7189
|
index += 1;
|
|
6550
7190
|
if (index === total_request_batches) {
|
|
6551
7191
|
callback && callback(errors, results);
|
|
@@ -6578,7 +7218,7 @@ var require_mixpanel_node = __commonJS({
|
|
|
6578
7218
|
callback = options;
|
|
6579
7219
|
options = {};
|
|
6580
7220
|
}
|
|
6581
|
-
|
|
7221
|
+
const batch_options = {
|
|
6582
7222
|
event_list,
|
|
6583
7223
|
endpoint: "/track",
|
|
6584
7224
|
max_concurrent_requests: options.max_concurrent_requests,
|
|
@@ -6595,7 +7235,7 @@ var require_mixpanel_node = __commonJS({
|
|
|
6595
7235
|
metrics.send_event_request("/import", event, properties, callback);
|
|
6596
7236
|
};
|
|
6597
7237
|
metrics.import_batch = function(event_list, options, callback) {
|
|
6598
|
-
|
|
7238
|
+
let batch_options;
|
|
6599
7239
|
if (typeof options === "function" || !options) {
|
|
6600
7240
|
callback = options;
|
|
6601
7241
|
options = {};
|
|
@@ -6609,7 +7249,7 @@ var require_mixpanel_node = __commonJS({
|
|
|
6609
7249
|
send_batch_requests(batch_options, callback);
|
|
6610
7250
|
};
|
|
6611
7251
|
metrics.alias = function(distinct_id, alias, callback) {
|
|
6612
|
-
|
|
7252
|
+
const properties = {
|
|
6613
7253
|
distinct_id,
|
|
6614
7254
|
alias
|
|
6615
7255
|
};
|
|
@@ -8618,7 +9258,7 @@ var init_is_disjoint = __esm({
|
|
|
8618
9258
|
function isObjectLike(value) {
|
|
8619
9259
|
return typeof value === "object" && value !== null;
|
|
8620
9260
|
}
|
|
8621
|
-
function
|
|
9261
|
+
function isObject2(input) {
|
|
8622
9262
|
if (!isObjectLike(input) || Object.prototype.toString.call(input) !== "[object Object]") {
|
|
8623
9263
|
return false;
|
|
8624
9264
|
}
|
|
@@ -8638,7 +9278,7 @@ var init_is_object = __esm({
|
|
|
8638
9278
|
|
|
8639
9279
|
// ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_jwk.js
|
|
8640
9280
|
function isJWK(key) {
|
|
8641
|
-
return
|
|
9281
|
+
return isObject2(key) && typeof key.kty === "string";
|
|
8642
9282
|
}
|
|
8643
9283
|
function isPrivateJWK(key) {
|
|
8644
9284
|
return key.kty !== "oct" && typeof key.d === "string";
|
|
@@ -9282,7 +9922,7 @@ var init_produce = __esm({
|
|
|
9282
9922
|
ProduceJWT = class {
|
|
9283
9923
|
_payload;
|
|
9284
9924
|
constructor(payload = {}) {
|
|
9285
|
-
if (!
|
|
9925
|
+
if (!isObject2(payload)) {
|
|
9286
9926
|
throw new TypeError("JWT Claims Set MUST be an object");
|
|
9287
9927
|
}
|
|
9288
9928
|
this._payload = payload;
|
|
@@ -13337,10 +13977,10 @@ var init_esm4 = __esm({
|
|
|
13337
13977
|
}
|
|
13338
13978
|
});
|
|
13339
13979
|
|
|
13340
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
13980
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/event/event.js
|
|
13341
13981
|
var IdentifyOperation, SpecialEventType;
|
|
13342
13982
|
var init_event = __esm({
|
|
13343
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
13983
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/event/event.js"() {
|
|
13344
13984
|
(function(IdentifyOperation3) {
|
|
13345
13985
|
IdentifyOperation3["SET"] = "$set";
|
|
13346
13986
|
IdentifyOperation3["SET_ONCE"] = "$setOnce";
|
|
@@ -13361,10 +14001,10 @@ var init_event = __esm({
|
|
|
13361
14001
|
}
|
|
13362
14002
|
});
|
|
13363
14003
|
|
|
13364
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14004
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/constants.js
|
|
13365
14005
|
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;
|
|
13366
14006
|
var init_constants = __esm({
|
|
13367
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14007
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/constants.js"() {
|
|
13368
14008
|
UNSET_VALUE = "-";
|
|
13369
14009
|
AMPLITUDE_PREFIX = "AMP";
|
|
13370
14010
|
STORAGE_PREFIX = "".concat(AMPLITUDE_PREFIX, "_unsent");
|
|
@@ -13376,10 +14016,10 @@ var init_constants = __esm({
|
|
|
13376
14016
|
}
|
|
13377
14017
|
});
|
|
13378
14018
|
|
|
13379
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14019
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js
|
|
13380
14020
|
var MAX_PROPERTY_KEYS, isValidObject, isValidProperties;
|
|
13381
14021
|
var init_valid_properties = __esm({
|
|
13382
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14022
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js"() {
|
|
13383
14023
|
init_tslib_es6();
|
|
13384
14024
|
MAX_PROPERTY_KEYS = 1e3;
|
|
13385
14025
|
isValidObject = function(properties) {
|
|
@@ -13434,10 +14074,10 @@ var init_valid_properties = __esm({
|
|
|
13434
14074
|
}
|
|
13435
14075
|
});
|
|
13436
14076
|
|
|
13437
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14077
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/identify.js
|
|
13438
14078
|
var Identify, IdentifyOperation2, OrderedIdentifyOperations;
|
|
13439
14079
|
var init_identify = __esm({
|
|
13440
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14080
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/identify.js"() {
|
|
13441
14081
|
init_tslib_es6();
|
|
13442
14082
|
init_constants();
|
|
13443
14083
|
init_valid_properties();
|
|
@@ -13548,10 +14188,10 @@ var init_identify = __esm({
|
|
|
13548
14188
|
}
|
|
13549
14189
|
});
|
|
13550
14190
|
|
|
13551
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14191
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/messages.js
|
|
13552
14192
|
var SUCCESS_MESSAGE, UNEXPECTED_ERROR_MESSAGE, MAX_RETRIES_EXCEEDED_MESSAGE, OPT_OUT_MESSAGE, MISSING_API_KEY_MESSAGE, INVALID_API_KEY, CLIENT_NOT_INITIALIZED;
|
|
13553
14193
|
var init_messages = __esm({
|
|
13554
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14194
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/messages.js"() {
|
|
13555
14195
|
SUCCESS_MESSAGE = "Event tracked successfully";
|
|
13556
14196
|
UNEXPECTED_ERROR_MESSAGE = "Unexpected error occurred";
|
|
13557
14197
|
MAX_RETRIES_EXCEEDED_MESSAGE = "Event rejected due to exceeded retry count";
|
|
@@ -13562,10 +14202,10 @@ var init_messages = __esm({
|
|
|
13562
14202
|
}
|
|
13563
14203
|
});
|
|
13564
14204
|
|
|
13565
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14205
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/status.js
|
|
13566
14206
|
var Status;
|
|
13567
14207
|
var init_status = __esm({
|
|
13568
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14208
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/status.js"() {
|
|
13569
14209
|
(function(Status2) {
|
|
13570
14210
|
Status2["Unknown"] = "unknown";
|
|
13571
14211
|
Status2["Skipped"] = "skipped";
|
|
@@ -13580,10 +14220,10 @@ var init_status = __esm({
|
|
|
13580
14220
|
}
|
|
13581
14221
|
});
|
|
13582
14222
|
|
|
13583
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14223
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js
|
|
13584
14224
|
var buildResult;
|
|
13585
14225
|
var init_result_builder = __esm({
|
|
13586
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14226
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js"() {
|
|
13587
14227
|
init_status();
|
|
13588
14228
|
buildResult = function(event, code, message2) {
|
|
13589
14229
|
if (code === void 0) {
|
|
@@ -13597,10 +14237,10 @@ var init_result_builder = __esm({
|
|
|
13597
14237
|
}
|
|
13598
14238
|
});
|
|
13599
14239
|
|
|
13600
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14240
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js
|
|
13601
14241
|
var getGlobalScope;
|
|
13602
14242
|
var init_global_scope = __esm({
|
|
13603
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14243
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js"() {
|
|
13604
14244
|
getGlobalScope = function() {
|
|
13605
14245
|
var ampIntegrationContextName = "ampIntegrationContext";
|
|
13606
14246
|
if (typeof globalThis !== "undefined" && typeof globalThis[ampIntegrationContextName] !== "undefined") {
|
|
@@ -13623,10 +14263,10 @@ var init_global_scope = __esm({
|
|
|
13623
14263
|
}
|
|
13624
14264
|
});
|
|
13625
14265
|
|
|
13626
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14266
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js
|
|
13627
14267
|
var legacyUUID, hex, UUID2;
|
|
13628
14268
|
var init_uuid2 = __esm({
|
|
13629
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14269
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js"() {
|
|
13630
14270
|
init_tslib_es6();
|
|
13631
14271
|
init_global_scope();
|
|
13632
14272
|
legacyUUID = function(a) {
|
|
@@ -13670,10 +14310,10 @@ var init_uuid2 = __esm({
|
|
|
13670
14310
|
}
|
|
13671
14311
|
});
|
|
13672
14312
|
|
|
13673
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14313
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/timeline.js
|
|
13674
14314
|
var Timeline;
|
|
13675
14315
|
var init_timeline = __esm({
|
|
13676
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14316
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/timeline.js"() {
|
|
13677
14317
|
init_tslib_es6();
|
|
13678
14318
|
init_result_builder();
|
|
13679
14319
|
init_uuid2();
|
|
@@ -13975,10 +14615,10 @@ var init_timeline = __esm({
|
|
|
13975
14615
|
}
|
|
13976
14616
|
});
|
|
13977
14617
|
|
|
13978
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14618
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js
|
|
13979
14619
|
var createTrackEvent, createIdentifyEvent, createGroupIdentifyEvent, createGroupEvent, createRevenueEvent;
|
|
13980
14620
|
var init_event_builder = __esm({
|
|
13981
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14621
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js"() {
|
|
13982
14622
|
init_tslib_es6();
|
|
13983
14623
|
init_identify();
|
|
13984
14624
|
init_event();
|
|
@@ -14008,10 +14648,10 @@ var init_event_builder = __esm({
|
|
|
14008
14648
|
}
|
|
14009
14649
|
});
|
|
14010
14650
|
|
|
14011
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14651
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js
|
|
14012
14652
|
var returnWrapper;
|
|
14013
14653
|
var init_return_wrapper = __esm({
|
|
14014
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14654
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js"() {
|
|
14015
14655
|
returnWrapper = function(awaitable) {
|
|
14016
14656
|
return {
|
|
14017
14657
|
promise: awaitable || Promise.resolve()
|
|
@@ -14020,10 +14660,10 @@ var init_return_wrapper = __esm({
|
|
|
14020
14660
|
}
|
|
14021
14661
|
});
|
|
14022
14662
|
|
|
14023
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14663
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/core-client.js
|
|
14024
14664
|
var AmplitudeCore;
|
|
14025
14665
|
var init_core_client = __esm({
|
|
14026
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14666
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/core-client.js"() {
|
|
14027
14667
|
init_tslib_es6();
|
|
14028
14668
|
init_event();
|
|
14029
14669
|
init_identify();
|
|
@@ -14291,10 +14931,10 @@ var init_core_client = __esm({
|
|
|
14291
14931
|
}
|
|
14292
14932
|
});
|
|
14293
14933
|
|
|
14294
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14934
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/revenue.js
|
|
14295
14935
|
var Revenue, RevenueProperty;
|
|
14296
14936
|
var init_revenue = __esm({
|
|
14297
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
14937
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/revenue.js"() {
|
|
14298
14938
|
init_tslib_es6();
|
|
14299
14939
|
init_valid_properties();
|
|
14300
14940
|
Revenue = /** @class */
|
|
@@ -14371,10 +15011,10 @@ var init_revenue = __esm({
|
|
|
14371
15011
|
}
|
|
14372
15012
|
});
|
|
14373
15013
|
|
|
14374
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15014
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js
|
|
14375
15015
|
var chunk;
|
|
14376
15016
|
var init_chunk = __esm({
|
|
14377
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15017
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js"() {
|
|
14378
15018
|
chunk = function(arr, size) {
|
|
14379
15019
|
var chunkSize = Math.max(size, 1);
|
|
14380
15020
|
return arr.reduce(function(chunks, element, index) {
|
|
@@ -14389,10 +15029,10 @@ var init_chunk = __esm({
|
|
|
14389
15029
|
}
|
|
14390
15030
|
});
|
|
14391
15031
|
|
|
14392
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15032
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/loglevel.js
|
|
14393
15033
|
var LogLevel;
|
|
14394
15034
|
var init_loglevel = __esm({
|
|
14395
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15035
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/loglevel.js"() {
|
|
14396
15036
|
(function(LogLevel2) {
|
|
14397
15037
|
LogLevel2[LogLevel2["None"] = 0] = "None";
|
|
14398
15038
|
LogLevel2[LogLevel2["Error"] = 1] = "Error";
|
|
@@ -14403,10 +15043,10 @@ var init_loglevel = __esm({
|
|
|
14403
15043
|
}
|
|
14404
15044
|
});
|
|
14405
15045
|
|
|
14406
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15046
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/logger.js
|
|
14407
15047
|
var PREFIX, Logger;
|
|
14408
15048
|
var init_logger3 = __esm({
|
|
14409
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15049
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/logger.js"() {
|
|
14410
15050
|
init_loglevel();
|
|
14411
15051
|
PREFIX = "Amplitude Logger ";
|
|
14412
15052
|
Logger = /** @class */
|
|
@@ -14468,10 +15108,10 @@ var init_logger3 = __esm({
|
|
|
14468
15108
|
}
|
|
14469
15109
|
});
|
|
14470
15110
|
|
|
14471
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15111
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/config.js
|
|
14472
15112
|
var getDefaultConfig, Config, getServerUrl, createServerConfig, RequestMetadata;
|
|
14473
15113
|
var init_config = __esm({
|
|
14474
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15114
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/config.js"() {
|
|
14475
15115
|
init_constants();
|
|
14476
15116
|
init_logger3();
|
|
14477
15117
|
init_loglevel();
|
|
@@ -14572,19 +15212,19 @@ var init_config = __esm({
|
|
|
14572
15212
|
}
|
|
14573
15213
|
});
|
|
14574
15214
|
|
|
14575
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15215
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/status-code.js
|
|
14576
15216
|
function isSuccessStatusCode(code) {
|
|
14577
15217
|
return code >= 200 && code < 300;
|
|
14578
15218
|
}
|
|
14579
15219
|
var init_status_code = __esm({
|
|
14580
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15220
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/status-code.js"() {
|
|
14581
15221
|
}
|
|
14582
15222
|
});
|
|
14583
15223
|
|
|
14584
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15224
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js
|
|
14585
15225
|
var getStacktrace, getClientLogConfig, getValueByStringPath, getClientStates, debugWrapper;
|
|
14586
15226
|
var init_debug = __esm({
|
|
14587
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15227
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js"() {
|
|
14588
15228
|
init_tslib_es6();
|
|
14589
15229
|
init_loglevel();
|
|
14590
15230
|
getStacktrace = function(ignoreDepth) {
|
|
@@ -14702,7 +15342,7 @@ var init_debug = __esm({
|
|
|
14702
15342
|
}
|
|
14703
15343
|
});
|
|
14704
15344
|
|
|
14705
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15345
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js
|
|
14706
15346
|
function getErrorMessage(error) {
|
|
14707
15347
|
if (error instanceof Error)
|
|
14708
15348
|
return error.message;
|
|
@@ -14720,7 +15360,7 @@ function getResponseBodyString(res) {
|
|
|
14720
15360
|
}
|
|
14721
15361
|
var Destination;
|
|
14722
15362
|
var init_destination = __esm({
|
|
14723
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15363
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js"() {
|
|
14724
15364
|
init_tslib_es6();
|
|
14725
15365
|
init_status();
|
|
14726
15366
|
init_messages();
|
|
@@ -15111,10 +15751,10 @@ var init_destination = __esm({
|
|
|
15111
15751
|
}
|
|
15112
15752
|
});
|
|
15113
15753
|
|
|
15114
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15754
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js
|
|
15115
15755
|
var BaseTransport;
|
|
15116
15756
|
var init_base2 = __esm({
|
|
15117
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15757
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js"() {
|
|
15118
15758
|
init_status();
|
|
15119
15759
|
init_status_code();
|
|
15120
15760
|
BaseTransport = /** @class */
|
|
@@ -15216,10 +15856,10 @@ var init_base2 = __esm({
|
|
|
15216
15856
|
}
|
|
15217
15857
|
});
|
|
15218
15858
|
|
|
15219
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15859
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/server-zone.js
|
|
15220
15860
|
var ServerZone;
|
|
15221
15861
|
var init_server_zone = __esm({
|
|
15222
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15862
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/server-zone.js"() {
|
|
15223
15863
|
(function(ServerZone2) {
|
|
15224
15864
|
ServerZone2["US"] = "US";
|
|
15225
15865
|
ServerZone2["EU"] = "EU";
|
|
@@ -15228,17 +15868,17 @@ var init_server_zone = __esm({
|
|
|
15228
15868
|
}
|
|
15229
15869
|
});
|
|
15230
15870
|
|
|
15231
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15871
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/offline.js
|
|
15232
15872
|
var OfflineDisabled;
|
|
15233
15873
|
var init_offline = __esm({
|
|
15234
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15874
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/types/offline.js"() {
|
|
15235
15875
|
OfflineDisabled = null;
|
|
15236
15876
|
}
|
|
15237
15877
|
});
|
|
15238
15878
|
|
|
15239
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15879
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/index.js
|
|
15240
15880
|
var init_esm5 = __esm({
|
|
15241
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.
|
|
15881
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.35.2/node_modules/@amplitude/analytics-core/lib/esm/index.js"() {
|
|
15242
15882
|
init_core_client();
|
|
15243
15883
|
init_identify();
|
|
15244
15884
|
init_revenue();
|
|
@@ -15255,18 +15895,18 @@ var init_esm5 = __esm({
|
|
|
15255
15895
|
}
|
|
15256
15896
|
});
|
|
15257
15897
|
|
|
15258
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
15898
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/version.js
|
|
15259
15899
|
var VERSION;
|
|
15260
15900
|
var init_version3 = __esm({
|
|
15261
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
15262
|
-
VERSION = "1.5.
|
|
15901
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/version.js"() {
|
|
15902
|
+
VERSION = "1.5.31";
|
|
15263
15903
|
}
|
|
15264
15904
|
});
|
|
15265
15905
|
|
|
15266
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
15906
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/plugins/context.js
|
|
15267
15907
|
var Context2;
|
|
15268
15908
|
var init_context4 = __esm({
|
|
15269
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
15909
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/plugins/context.js"() {
|
|
15270
15910
|
init_tslib_es6();
|
|
15271
15911
|
init_esm5();
|
|
15272
15912
|
init_version3();
|
|
@@ -15301,7 +15941,7 @@ var init_context4 = __esm({
|
|
|
15301
15941
|
});
|
|
15302
15942
|
var Http;
|
|
15303
15943
|
var init_http = __esm({
|
|
15304
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
15944
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/transports/http.js"() {
|
|
15305
15945
|
init_tslib_es6();
|
|
15306
15946
|
init_esm5();
|
|
15307
15947
|
Http = /** @class */
|
|
@@ -15363,10 +16003,10 @@ var init_http = __esm({
|
|
|
15363
16003
|
}
|
|
15364
16004
|
});
|
|
15365
16005
|
|
|
15366
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16006
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/config.js
|
|
15367
16007
|
var NodeConfig, useNodeConfig;
|
|
15368
16008
|
var init_config2 = __esm({
|
|
15369
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16009
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/config.js"() {
|
|
15370
16010
|
init_tslib_es6();
|
|
15371
16011
|
init_esm5();
|
|
15372
16012
|
init_http();
|
|
@@ -15384,10 +16024,10 @@ var init_config2 = __esm({
|
|
|
15384
16024
|
}
|
|
15385
16025
|
});
|
|
15386
16026
|
|
|
15387
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16027
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/node-client.js
|
|
15388
16028
|
var AmplitudeNode, createInstance, node_client_default;
|
|
15389
16029
|
var init_node_client = __esm({
|
|
15390
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16030
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/node-client.js"() {
|
|
15391
16031
|
init_tslib_es6();
|
|
15392
16032
|
init_esm5();
|
|
15393
16033
|
init_context4();
|
|
@@ -15461,7 +16101,7 @@ var init_node_client = __esm({
|
|
|
15461
16101
|
}
|
|
15462
16102
|
});
|
|
15463
16103
|
|
|
15464
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16104
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/types.js
|
|
15465
16105
|
var types_exports = {};
|
|
15466
16106
|
__export(types_exports, {
|
|
15467
16107
|
IdentifyOperation: () => IdentifyOperation,
|
|
@@ -15472,12 +16112,12 @@ __export(types_exports, {
|
|
|
15472
16112
|
SpecialEventType: () => SpecialEventType
|
|
15473
16113
|
});
|
|
15474
16114
|
var init_types4 = __esm({
|
|
15475
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16115
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/types.js"() {
|
|
15476
16116
|
init_esm5();
|
|
15477
16117
|
}
|
|
15478
16118
|
});
|
|
15479
16119
|
|
|
15480
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16120
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/index.js
|
|
15481
16121
|
var esm_exports2 = {};
|
|
15482
16122
|
__export(esm_exports2, {
|
|
15483
16123
|
Identify: () => Identify,
|
|
@@ -15498,7 +16138,7 @@ __export(esm_exports2, {
|
|
|
15498
16138
|
});
|
|
15499
16139
|
var add, groupIdentify, identify, init, logEvent, remove, revenue, setGroup, setOptOut, track, flush;
|
|
15500
16140
|
var init_esm6 = __esm({
|
|
15501
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16141
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.31/node_modules/@amplitude/analytics-node/lib/esm/index.js"() {
|
|
15502
16142
|
init_node_client();
|
|
15503
16143
|
init_node_client();
|
|
15504
16144
|
init_esm5();
|