@shrfe/assets 1.0.63 → 1.0.65
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/css/sfe-styles.css +467 -0
- package/js/shrfe-core-umd.js +375 -63
- package/package.json +1 -1
- package/wc-lib/{p-3cc512be.entry.js → p-0b72ab12.entry.js} +1 -1
- package/wc-lib/{p-97aa8a56.entry.js → p-0cc19352.entry.js} +1 -1
- package/wc-lib/{p-84c4efae.entry.js → p-10c23c12.entry.js} +1 -1
- package/wc-lib/{p-99044e0f.entry.js → p-11d9c6ab.entry.js} +1 -1
- package/wc-lib/{p-35cafa93.entry.js → p-2eac5d59.entry.js} +1 -1
- package/wc-lib/{p-e725f44b.entry.js → p-372a4b08.entry.js} +1 -1
- package/wc-lib/{p-93a58264.entry.js → p-3b9cba49.entry.js} +1 -1
- package/wc-lib/p-434962b3.entry.js +1 -0
- package/wc-lib/{p-89af7770.entry.js → p-4b90088d.entry.js} +1 -1
- package/wc-lib/{p-04d897fe.entry.js → p-5a39bffb.entry.js} +1 -1
- package/wc-lib/{p-da22638b.entry.js → p-5ec334e6.entry.js} +2 -2
- package/wc-lib/{p-da60a5f2.entry.js → p-6e7ee60b.entry.js} +1 -1
- package/wc-lib/{p-12553973.entry.js → p-7799bd4f.entry.js} +1 -1
- package/wc-lib/{p-60b26a9b.entry.js → p-9af28040.entry.js} +1 -1
- package/wc-lib/{p-055adad5.entry.js → p-9c20ecd6.entry.js} +1 -1
- package/wc-lib/p-9oFec6fH.js +3 -0
- package/wc-lib/{p-325cda6a.entry.js → p-abd9b780.entry.js} +1 -1
- package/wc-lib/{p-1a22c124.entry.js → p-c117222e.entry.js} +1 -1
- package/wc-lib/{p-b3062a6b.js → p-cc5249f0.js} +1 -1
- package/wc-lib/{p-5e246cb4.entry.js → p-dcca5e23.entry.js} +1 -1
- package/wc-lib/{p-4e6e0f67.entry.js → p-e96984e8.entry.js} +1 -1
- package/wc-lib/wc-lib.esm.js +1 -1
- package/wc-lib/p-0039b730.entry.js +0 -1
- package/wc-lib/p-DdKztCEo.js +0 -3
package/js/shrfe-core-umd.js
CHANGED
|
@@ -9612,12 +9612,12 @@ module.exports = __nested_rspack_require_16377_16396__(207)["default"];
|
|
|
9612
9612
|
/***/ },
|
|
9613
9613
|
|
|
9614
9614
|
/***/ 207
|
|
9615
|
-
(__unused_webpack_module,
|
|
9615
|
+
(__unused_webpack_module, __webpack_exports__, __nested_rspack_require_16590_16609__) {
|
|
9616
9616
|
|
|
9617
9617
|
"use strict";
|
|
9618
9618
|
|
|
9619
9619
|
// EXPORTS
|
|
9620
|
-
__nested_rspack_require_16590_16609__.d(
|
|
9620
|
+
__nested_rspack_require_16590_16609__.d(__webpack_exports__, {
|
|
9621
9621
|
"default": () => (/* binding */ pusher)
|
|
9622
9622
|
});
|
|
9623
9623
|
|
|
@@ -13722,9 +13722,9 @@ runtime.setup(Pusher);
|
|
|
13722
13722
|
/******/ // startup
|
|
13723
13723
|
/******/ // Load entry module and return exports
|
|
13724
13724
|
/******/ // This entry module used 'module' so it can't be inlined
|
|
13725
|
-
/******/ var
|
|
13725
|
+
/******/ var __webpack_exports__ = __nested_rspack_require_142595__(721);
|
|
13726
13726
|
/******/
|
|
13727
|
-
/******/ return
|
|
13727
|
+
/******/ return __webpack_exports__;
|
|
13728
13728
|
/******/ })()
|
|
13729
13729
|
;
|
|
13730
13730
|
});
|
|
@@ -26041,7 +26041,7 @@ class HTTPService extends (/* unused pure expression or super */ null && (HTTPBa
|
|
|
26041
26041
|
|
|
26042
26042
|
;// CONCATENATED MODULE: ../../node_modules/@vue/shared/dist/shared.esm-bundler.js
|
|
26043
26043
|
/**
|
|
26044
|
-
* @vue/shared v3.5.
|
|
26044
|
+
* @vue/shared v3.5.43
|
|
26045
26045
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
26046
26046
|
* @license MIT
|
|
26047
26047
|
**/
|
|
@@ -26309,10 +26309,10 @@ function normalizeStyle(value) {
|
|
|
26309
26309
|
}
|
|
26310
26310
|
const listDelimiterRE = /;(?![^(]*\))/g;
|
|
26311
26311
|
const propertyDelimiterRE = /:([^]+)/;
|
|
26312
|
-
const styleCommentRE =
|
|
26312
|
+
const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
|
|
26313
26313
|
function parseStringStyle(cssText) {
|
|
26314
26314
|
const ret = {};
|
|
26315
|
-
cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
|
|
26315
|
+
cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
|
|
26316
26316
|
if (item) {
|
|
26317
26317
|
const tmp = item.split(propertyDelimiterRE);
|
|
26318
26318
|
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
|
|
@@ -26473,22 +26473,22 @@ function getEscapedCssVarName(key, doubleEscape) {
|
|
|
26473
26473
|
);
|
|
26474
26474
|
}
|
|
26475
26475
|
|
|
26476
|
-
function looseCompareArrays(a, b) {
|
|
26476
|
+
function looseCompareArrays(a, b, seen) {
|
|
26477
26477
|
if (a.length !== b.length) return false;
|
|
26478
26478
|
let equal = true;
|
|
26479
26479
|
for (let i = 0; equal && i < a.length; i++) {
|
|
26480
|
-
equal = looseEqual(a[i], b[i]);
|
|
26480
|
+
equal = looseEqual(a[i], b[i], seen);
|
|
26481
26481
|
}
|
|
26482
26482
|
return equal;
|
|
26483
26483
|
}
|
|
26484
|
-
function looseCompareCollections(a, b) {
|
|
26484
|
+
function looseCompareCollections(a, b, seen) {
|
|
26485
26485
|
if (a.size !== b.size) return false;
|
|
26486
26486
|
const candidates = Array.from(b);
|
|
26487
26487
|
const matched = new Uint8Array(candidates.length);
|
|
26488
26488
|
for (const item of a) {
|
|
26489
26489
|
let index = -1;
|
|
26490
26490
|
for (let i = 0; i < candidates.length; i++) {
|
|
26491
|
-
if (!matched[i] && looseEqual(item, candidates[i])) {
|
|
26491
|
+
if (!matched[i] && looseEqual(item, candidates[i], seen)) {
|
|
26492
26492
|
index = i;
|
|
26493
26493
|
break;
|
|
26494
26494
|
}
|
|
@@ -26498,7 +26498,47 @@ function looseCompareCollections(a, b) {
|
|
|
26498
26498
|
}
|
|
26499
26499
|
return true;
|
|
26500
26500
|
}
|
|
26501
|
-
function
|
|
26501
|
+
function looseCompareObjects(a, b, seen) {
|
|
26502
|
+
let aValidType = shared_esm_bundler_isMap(a);
|
|
26503
|
+
let bValidType = shared_esm_bundler_isMap(b);
|
|
26504
|
+
if (aValidType || bValidType) {
|
|
26505
|
+
return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
|
|
26506
|
+
}
|
|
26507
|
+
aValidType = shared_esm_bundler_isSet(a);
|
|
26508
|
+
bValidType = shared_esm_bundler_isSet(b);
|
|
26509
|
+
if (aValidType || bValidType) {
|
|
26510
|
+
return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
|
|
26511
|
+
}
|
|
26512
|
+
const aKeysCount = Object.keys(a).length;
|
|
26513
|
+
const bKeysCount = Object.keys(b).length;
|
|
26514
|
+
if (aKeysCount !== bKeysCount) {
|
|
26515
|
+
return false;
|
|
26516
|
+
}
|
|
26517
|
+
for (const key in a) {
|
|
26518
|
+
const aHasKey = a.hasOwnProperty(key);
|
|
26519
|
+
const bHasKey = b.hasOwnProperty(key);
|
|
26520
|
+
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key], seen)) {
|
|
26521
|
+
return false;
|
|
26522
|
+
}
|
|
26523
|
+
}
|
|
26524
|
+
return String(a) === String(b);
|
|
26525
|
+
}
|
|
26526
|
+
function looseCompareNested(a, b, seen, compare) {
|
|
26527
|
+
if (!seen) {
|
|
26528
|
+
seen = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
|
|
26529
|
+
}
|
|
26530
|
+
const [seenA, seenB] = seen;
|
|
26531
|
+
if (seenA.has(a) || seenB.has(b)) {
|
|
26532
|
+
return seenA.get(a) === b && seenB.get(b) === a;
|
|
26533
|
+
}
|
|
26534
|
+
seenA.set(a, b);
|
|
26535
|
+
seenB.set(b, a);
|
|
26536
|
+
const equal = compare(a, b, seen);
|
|
26537
|
+
seenA.delete(a);
|
|
26538
|
+
seenB.delete(b);
|
|
26539
|
+
return equal;
|
|
26540
|
+
}
|
|
26541
|
+
function looseEqual(a, b, seen) {
|
|
26502
26542
|
if (a === b) return true;
|
|
26503
26543
|
let aValidType = shared_esm_bundler_isDate(a);
|
|
26504
26544
|
let bValidType = shared_esm_bundler_isDate(b);
|
|
@@ -26513,7 +26553,7 @@ function looseEqual(a, b) {
|
|
|
26513
26553
|
aValidType = shared_esm_bundler_isArray(a);
|
|
26514
26554
|
bValidType = shared_esm_bundler_isArray(b);
|
|
26515
26555
|
if (aValidType || bValidType) {
|
|
26516
|
-
return aValidType && bValidType ?
|
|
26556
|
+
return aValidType && bValidType ? looseCompareNested(a, b, seen, looseCompareArrays) : false;
|
|
26517
26557
|
}
|
|
26518
26558
|
aValidType = shared_esm_bundler_isObject(a);
|
|
26519
26559
|
bValidType = shared_esm_bundler_isObject(b);
|
|
@@ -26521,28 +26561,7 @@ function looseEqual(a, b) {
|
|
|
26521
26561
|
if (!aValidType || !bValidType) {
|
|
26522
26562
|
return false;
|
|
26523
26563
|
}
|
|
26524
|
-
|
|
26525
|
-
bValidType = shared_esm_bundler_isMap(b);
|
|
26526
|
-
if (aValidType || bValidType) {
|
|
26527
|
-
return aValidType && bValidType ? looseCompareCollections(a, b) : false;
|
|
26528
|
-
}
|
|
26529
|
-
aValidType = shared_esm_bundler_isSet(a);
|
|
26530
|
-
bValidType = shared_esm_bundler_isSet(b);
|
|
26531
|
-
if (aValidType || bValidType) {
|
|
26532
|
-
return aValidType && bValidType ? looseCompareCollections(a, b) : false;
|
|
26533
|
-
}
|
|
26534
|
-
const aKeysCount = Object.keys(a).length;
|
|
26535
|
-
const bKeysCount = Object.keys(b).length;
|
|
26536
|
-
if (aKeysCount !== bKeysCount) {
|
|
26537
|
-
return false;
|
|
26538
|
-
}
|
|
26539
|
-
for (const key in a) {
|
|
26540
|
-
const aHasKey = a.hasOwnProperty(key);
|
|
26541
|
-
const bHasKey = b.hasOwnProperty(key);
|
|
26542
|
-
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
|
|
26543
|
-
return false;
|
|
26544
|
-
}
|
|
26545
|
-
}
|
|
26564
|
+
return looseCompareNested(a, b, seen, looseCompareObjects);
|
|
26546
26565
|
}
|
|
26547
26566
|
return String(a) === String(b);
|
|
26548
26567
|
}
|
|
@@ -26606,7 +26625,7 @@ function normalizeCssVarValue(value) {
|
|
|
26606
26625
|
|
|
26607
26626
|
;// CONCATENATED MODULE: ../../node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js
|
|
26608
26627
|
/**
|
|
26609
|
-
* @vue/reactivity v3.5.
|
|
26628
|
+
* @vue/reactivity v3.5.43
|
|
26610
26629
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
26611
26630
|
* @license MIT
|
|
26612
26631
|
**/
|
|
@@ -27326,7 +27345,9 @@ function reactiveReadArray(array) {
|
|
|
27326
27345
|
const raw = toRaw(array);
|
|
27327
27346
|
if (raw === array) return raw;
|
|
27328
27347
|
track(raw, "iterate", ARRAY_ITERATE_KEY);
|
|
27329
|
-
|
|
27348
|
+
if (isShallow(array)) return raw;
|
|
27349
|
+
if (!isReadonly(array)) return raw.map(toReactive);
|
|
27350
|
+
return isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly);
|
|
27330
27351
|
}
|
|
27331
27352
|
function shallowReadArray(arr) {
|
|
27332
27353
|
track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
|
|
@@ -28658,7 +28679,7 @@ if (typeof(window) === 'undefined') {
|
|
|
28658
28679
|
|
|
28659
28680
|
var Config = {
|
|
28660
28681
|
DEBUG: false,
|
|
28661
|
-
LIB_VERSION: '2.
|
|
28682
|
+
LIB_VERSION: '2.83.0'
|
|
28662
28683
|
};
|
|
28663
28684
|
|
|
28664
28685
|
// Window global names for async modules
|
|
@@ -29896,6 +29917,16 @@ function serializeElementNode(n2, options) {
|
|
|
29896
29917
|
attributes.checked = checked;
|
|
29897
29918
|
}
|
|
29898
29919
|
}
|
|
29920
|
+
if ((tagName === "input" || tagName === "textarea") && attributes.placeholder) {
|
|
29921
|
+
attributes.placeholder = maskInputValue({
|
|
29922
|
+
element: n2,
|
|
29923
|
+
type: getInputType(n2),
|
|
29924
|
+
tagName: tagName,
|
|
29925
|
+
value: attributes.placeholder,
|
|
29926
|
+
maskInputOptions: maskInputOptions,
|
|
29927
|
+
maskInputFn: maskInputFn
|
|
29928
|
+
});
|
|
29929
|
+
}
|
|
29899
29930
|
if (tagName === "option") {
|
|
29900
29931
|
if (n2.selected && !maskInputOptions["select"]) {
|
|
29901
29932
|
attributes.selected = true;
|
|
@@ -39473,7 +39504,7 @@ var mixpanel_module_MutationBuffer = /*#__PURE__*/ function() {
|
|
|
39473
39504
|
var target = m.target;
|
|
39474
39505
|
var attributeName = m.attributeName;
|
|
39475
39506
|
var value1 = m.target.getAttribute(attributeName);
|
|
39476
|
-
if (attributeName === "value") {
|
|
39507
|
+
if (attributeName === "value" || attributeName === "placeholder") {
|
|
39477
39508
|
var type = getInputType(target);
|
|
39478
39509
|
value1 = maskInputValue({
|
|
39479
39510
|
element: target,
|
|
@@ -47598,12 +47629,7 @@ var nativeBind = FuncProto.bind,
|
|
|
47598
47629
|
nativeIsArray = Array.isArray,
|
|
47599
47630
|
breaker = {};
|
|
47600
47631
|
|
|
47601
|
-
var mixpanel_module_ = {
|
|
47602
|
-
trim: function(str) {
|
|
47603
|
-
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill
|
|
47604
|
-
return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
|
|
47605
|
-
}
|
|
47606
|
-
};
|
|
47632
|
+
var mixpanel_module_ = {};
|
|
47607
47633
|
|
|
47608
47634
|
// Console override
|
|
47609
47635
|
var console$1 = {
|
|
@@ -48486,7 +48512,11 @@ mixpanel_module_.HTTPBuildQuery = function(formdata, arg_separator) {
|
|
|
48486
48512
|
mixpanel_module_.getQueryParam = function(url, param) {
|
|
48487
48513
|
// Expects a raw URL
|
|
48488
48514
|
|
|
48489
|
-
|
|
48515
|
+
// Escape the RegExp metacharacters the param name may contain before
|
|
48516
|
+
// interpolating it into `regexS`. Backslash is escaped in the same pass as
|
|
48517
|
+
// the brackets (a single character class), so a param name is never able to
|
|
48518
|
+
// introduce an unintended escape sequence (CodeQL js/incomplete-sanitization).
|
|
48519
|
+
param = param.replace(/[[\]\\]/g, '\\$&');
|
|
48490
48520
|
var regexS = '[\\?&]' + param + '=([^&#]*)',
|
|
48491
48521
|
regex = new RegExp(regexS),
|
|
48492
48522
|
results = regex.exec(url);
|
|
@@ -51056,7 +51086,7 @@ function getSafeText(el, ev, allowElementCallback, allowSelectors) {
|
|
|
51056
51086
|
if (shouldTrackElementDetails(el, ev, allowElementCallback, allowSelectors) && el.childNodes && el.childNodes.length) {
|
|
51057
51087
|
mixpanel_module_.each(el.childNodes, function(child) {
|
|
51058
51088
|
if (isTextNode(child) && child.textContent) {
|
|
51059
|
-
elText +=
|
|
51089
|
+
elText += child.textContent.trim()
|
|
51060
51090
|
// scrub potentially sensitive values
|
|
51061
51091
|
.split(/(\s+)/).filter(shouldTrackValue).join('')
|
|
51062
51092
|
// normalize whitespace
|
|
@@ -51067,7 +51097,7 @@ function getSafeText(el, ev, allowElementCallback, allowSelectors) {
|
|
|
51067
51097
|
});
|
|
51068
51098
|
}
|
|
51069
51099
|
|
|
51070
|
-
return
|
|
51100
|
+
return elText.trim();
|
|
51071
51101
|
}
|
|
51072
51102
|
|
|
51073
51103
|
function guessRealClickTarget(ev) {
|
|
@@ -51319,7 +51349,7 @@ function shouldTrackValue(value) {
|
|
|
51319
51349
|
}
|
|
51320
51350
|
|
|
51321
51351
|
if (typeof value === 'string') {
|
|
51322
|
-
value =
|
|
51352
|
+
value = value.trim();
|
|
51323
51353
|
|
|
51324
51354
|
// check to see if input value looks like a credit card number
|
|
51325
51355
|
// see: https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9781449327453/ch04s20.html
|
|
@@ -52174,6 +52204,25 @@ function initXhrObserver(cb, win, options) {
|
|
|
52174
52204
|
};
|
|
52175
52205
|
}
|
|
52176
52206
|
|
|
52207
|
+
/**
|
|
52208
|
+
* Build the Request used to inspect an outgoing fetch call.
|
|
52209
|
+
*
|
|
52210
|
+
* Constructing a Request from another Request marks the source's body as used, which makes
|
|
52211
|
+
* the caller's own fetch fail with "Cannot construct a Request with a Request object that has
|
|
52212
|
+
* already been used". Clone Request inputs first so the object the caller passed stays intact.
|
|
52213
|
+
*
|
|
52214
|
+
* @param {RequestInfo | URL} input
|
|
52215
|
+
* @param {RequestInit} [init]
|
|
52216
|
+
* @returns {Request}
|
|
52217
|
+
*/
|
|
52218
|
+
function buildRecordedRequest(input, init) {
|
|
52219
|
+
if (typeof Request !== 'undefined' && input instanceof Request) {
|
|
52220
|
+
var cloned = input.clone();
|
|
52221
|
+
return init ? new Request(cloned, init) : cloned;
|
|
52222
|
+
}
|
|
52223
|
+
return new Request(input, init);
|
|
52224
|
+
}
|
|
52225
|
+
|
|
52177
52226
|
/**
|
|
52178
52227
|
* @param {networkCallback} cb
|
|
52179
52228
|
* @param {Window} win
|
|
@@ -52189,7 +52238,7 @@ function initFetchObserver(cb, win, options) {
|
|
|
52189
52238
|
|
|
52190
52239
|
var restorePatch = patch(win, 'fetch', function(/** @type {typeof fetch} */ originalFetch) {
|
|
52191
52240
|
return function() {
|
|
52192
|
-
var req =
|
|
52241
|
+
var req = buildRecordedRequest(arguments[0], arguments[1]);
|
|
52193
52242
|
/** @type {Response | undefined} */
|
|
52194
52243
|
var res;
|
|
52195
52244
|
/** @type {Partial<NetworkRequest>} */
|
|
@@ -53696,6 +53745,260 @@ function requireLogic () {
|
|
|
53696
53745
|
var logicExports = requireLogic();
|
|
53697
53746
|
var mixpanel_module_jsonLogic = /*@__PURE__*/getDefaultExportFromCjs(logicExports);
|
|
53698
53747
|
|
|
53748
|
+
// Strict RFC3339 guard for datetime strings. The date and hour fields are captured so the calendar
|
|
53749
|
+
// can be validated separately; the regex only constrains their shape.
|
|
53750
|
+
var RFC3339_REGEX = /^(\d{4})-(\d{2})-(\d{2})[Tt](\d{2}):\d{2}:\d{2}(\.\d+)?([Zz]|[+-]\d{2}:\d{2})$/;
|
|
53751
|
+
|
|
53752
|
+
// SemVer 2.0.0 requires major.minor.patch; partial versions are zero-padded to this.
|
|
53753
|
+
var SEMVER_PARTS = 3;
|
|
53754
|
+
|
|
53755
|
+
// Longest operand the semver regex is allowed to see. A real version never approaches this; the
|
|
53756
|
+
// bound matches MAX_LENGTH in node-semver, and keeps an arbitrarily long property value off the
|
|
53757
|
+
// regex regardless of how the engine schedules backtracking.
|
|
53758
|
+
var MAX_SEMVER_LENGTH = 256;
|
|
53759
|
+
|
|
53760
|
+
// Epoch milliseconds are compared as int64 elsewhere, so anything at or beyond this is out of range.
|
|
53761
|
+
var MAX_EPOCH_MS = 9223372036854775808;
|
|
53762
|
+
|
|
53763
|
+
// Using the official semantic versioning 2.0.0 regular expression to handle cross-platform validation
|
|
53764
|
+
// differences on other SDK's. For example, some platforms allow leading zeros even though it is not valid
|
|
53765
|
+
// as part of the Semver 2.0.0 spec. See https://semver.org/
|
|
53766
|
+
var SEMVER_REGEX = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
|
|
53767
|
+
|
|
53768
|
+
// Registers custom operators into the JSONLogic engine.
|
|
53769
|
+
// 1. Semantic Versioning 2.0.0 comparison
|
|
53770
|
+
// 2. RFC3339 datetime comparison
|
|
53771
|
+
function registerCustomOperators(jsonLogic) {
|
|
53772
|
+
jsonLogic.add_operation('semver_compare', semverCompare);
|
|
53773
|
+
jsonLogic.add_operation('datetime_compare', datetimeCompare);
|
|
53774
|
+
}
|
|
53775
|
+
|
|
53776
|
+
// Implements a custom operation for semantic versioning comparison that conforms to the semver 2.0.0 standard.
|
|
53777
|
+
// Prior to comparison, any leading version prefix is stripped.
|
|
53778
|
+
function semverCompare() {
|
|
53779
|
+
var ops = operands(arguments);
|
|
53780
|
+
if (!ops) {
|
|
53781
|
+
return false;
|
|
53782
|
+
}
|
|
53783
|
+
if (typeof ops.actual !== 'string' || typeof ops.target !== 'string') {
|
|
53784
|
+
return false;
|
|
53785
|
+
}
|
|
53786
|
+
if (ops.actual.length > MAX_SEMVER_LENGTH || ops.target.length > MAX_SEMVER_LENGTH) {
|
|
53787
|
+
return false;
|
|
53788
|
+
}
|
|
53789
|
+
var actual = normalizeSemver(ops.actual);
|
|
53790
|
+
var target = normalizeSemver(ops.target);
|
|
53791
|
+
if (!SEMVER_REGEX.test(actual) || !SEMVER_REGEX.test(target)) {
|
|
53792
|
+
return false;
|
|
53793
|
+
}
|
|
53794
|
+
var cmp = compareSemver(actual, target);
|
|
53795
|
+
return comparatorMatches(cmp, ops.symbol);
|
|
53796
|
+
}
|
|
53797
|
+
|
|
53798
|
+
// Strip optional build metadata and separate the core version from pre-release identifiers
|
|
53799
|
+
function splitSemver(version) {
|
|
53800
|
+
var plus = version.indexOf('+');
|
|
53801
|
+
if (plus !== -1) {
|
|
53802
|
+
version = version.slice(0, plus);
|
|
53803
|
+
}
|
|
53804
|
+
var dash = version.indexOf('-');
|
|
53805
|
+
if (dash === -1) {
|
|
53806
|
+
return {core: version.split('.'), prerelease: []};
|
|
53807
|
+
}
|
|
53808
|
+
return {core: version.slice(0, dash).split('.'), prerelease: version.slice(dash + 1).split('.')};
|
|
53809
|
+
}
|
|
53810
|
+
|
|
53811
|
+
function isNumericIdentifier(identifier) {
|
|
53812
|
+
return /^[0-9]+$/.test(identifier);
|
|
53813
|
+
}
|
|
53814
|
+
|
|
53815
|
+
// Numeric identifiers carry no leading zeros, so the longer run of digits is the larger number.
|
|
53816
|
+
// Comparing them as digits rather than as numbers keeps versions past Number.MAX_SAFE_INTEGER ordered
|
|
53817
|
+
// correctly.
|
|
53818
|
+
function compareNumeric(a, b) {
|
|
53819
|
+
if (a.length !== b.length) {
|
|
53820
|
+
return a.length < b.length ? -1 : 1;
|
|
53821
|
+
}
|
|
53822
|
+
return a < b ? -1 : (a > b ? 1 : 0);
|
|
53823
|
+
}
|
|
53824
|
+
|
|
53825
|
+
// SemVer 2.0.0 section 11.4: digits compare numerically, a numeric identifier ranks below an
|
|
53826
|
+
// alphanumeric one, and anything else compares by ASCII order.
|
|
53827
|
+
function comparePrereleaseIdentifier(a, b) {
|
|
53828
|
+
var aNumeric = isNumericIdentifier(a);
|
|
53829
|
+
var bNumeric = isNumericIdentifier(b);
|
|
53830
|
+
if (aNumeric && bNumeric) {
|
|
53831
|
+
return compareNumeric(a, b);
|
|
53832
|
+
}
|
|
53833
|
+
if (aNumeric) {
|
|
53834
|
+
return -1;
|
|
53835
|
+
}
|
|
53836
|
+
if (bNumeric) {
|
|
53837
|
+
return 1;
|
|
53838
|
+
}
|
|
53839
|
+
return a < b ? -1 : (a > b ? 1 : 0);
|
|
53840
|
+
}
|
|
53841
|
+
|
|
53842
|
+
// Ordering per SemVer 2.0.0 section 11. Both operands have already been normalized and matched against
|
|
53843
|
+
// the official regex, so the core holds exactly three numeric identifiers and every prerelease field is
|
|
53844
|
+
// well-formed; the split needs no error path.
|
|
53845
|
+
function compareSemver(actualVersion, targetVersion) {
|
|
53846
|
+
var actual = splitSemver(actualVersion);
|
|
53847
|
+
var target = splitSemver(targetVersion);
|
|
53848
|
+
var i, result;
|
|
53849
|
+
|
|
53850
|
+
for (i = 0; i < actual.core.length; i++) {
|
|
53851
|
+
result = compareNumeric(actual.core[i], target.core[i]);
|
|
53852
|
+
if (result !== 0) {
|
|
53853
|
+
return result;
|
|
53854
|
+
}
|
|
53855
|
+
}
|
|
53856
|
+
|
|
53857
|
+
// A prerelease ranks below the release it belongs to (section 11.3).
|
|
53858
|
+
if (!actual.prerelease.length && !target.prerelease.length) {
|
|
53859
|
+
return 0;
|
|
53860
|
+
}
|
|
53861
|
+
if (!actual.prerelease.length) {
|
|
53862
|
+
return 1;
|
|
53863
|
+
}
|
|
53864
|
+
if (!target.prerelease.length) {
|
|
53865
|
+
return -1;
|
|
53866
|
+
}
|
|
53867
|
+
|
|
53868
|
+
var shared = Math.min(actual.prerelease.length, target.prerelease.length);
|
|
53869
|
+
for (i = 0; i < shared; i++) {
|
|
53870
|
+
result = comparePrereleaseIdentifier(actual.prerelease[i], target.prerelease[i]);
|
|
53871
|
+
if (result !== 0) {
|
|
53872
|
+
return result;
|
|
53873
|
+
}
|
|
53874
|
+
}
|
|
53875
|
+
// Every field so far is equal, so the longer list wins (section 11.4.4).
|
|
53876
|
+
if (actual.prerelease.length !== target.prerelease.length) {
|
|
53877
|
+
return actual.prerelease.length < target.prerelease.length ? -1 : 1;
|
|
53878
|
+
}
|
|
53879
|
+
return 0;
|
|
53880
|
+
}
|
|
53881
|
+
|
|
53882
|
+
// Implements a custom operation for datetime comparison.
|
|
53883
|
+
// The target value stored on the feature flag is the millisecond epoch, whereas the actual value provided at evaluation time must be RFC-3339 formatted.
|
|
53884
|
+
function datetimeCompare() {
|
|
53885
|
+
var ops = operands(arguments);
|
|
53886
|
+
if (!ops) {
|
|
53887
|
+
return false;
|
|
53888
|
+
}
|
|
53889
|
+
var actualSec = convertRfc3339ToUnixSeconds(ops.actual);
|
|
53890
|
+
var targetSec = convertUnixMillisecondsToSeconds(ops.target);
|
|
53891
|
+
if (actualSec === null || targetSec === null) {
|
|
53892
|
+
return false;
|
|
53893
|
+
}
|
|
53894
|
+
var cmp = actualSec - targetSec;
|
|
53895
|
+
return comparatorMatches(cmp, ops.symbol);
|
|
53896
|
+
}
|
|
53897
|
+
|
|
53898
|
+
function operands(args) {
|
|
53899
|
+
if (args.length !== 3) {
|
|
53900
|
+
return null;
|
|
53901
|
+
}
|
|
53902
|
+
return { actual: args[0], symbol: args[1], target: args[2] };
|
|
53903
|
+
}
|
|
53904
|
+
|
|
53905
|
+
function comparatorMatches(cmp, symbol) {
|
|
53906
|
+
switch (symbol) {
|
|
53907
|
+
case '===':
|
|
53908
|
+
return cmp === 0;
|
|
53909
|
+
case '!==':
|
|
53910
|
+
return cmp !== 0;
|
|
53911
|
+
case '<':
|
|
53912
|
+
return cmp < 0;
|
|
53913
|
+
case '<=':
|
|
53914
|
+
return cmp <= 0;
|
|
53915
|
+
case '>':
|
|
53916
|
+
return cmp > 0;
|
|
53917
|
+
case '>=':
|
|
53918
|
+
return cmp >= 0;
|
|
53919
|
+
default:
|
|
53920
|
+
return false;
|
|
53921
|
+
}
|
|
53922
|
+
}
|
|
53923
|
+
|
|
53924
|
+
function normalizeSemver(version) {
|
|
53925
|
+
var stripped = version.trim().replace(/^[vV]/, '');
|
|
53926
|
+
|
|
53927
|
+
var suffixStart = stripped.length;
|
|
53928
|
+
var separators = ['-', '+'];
|
|
53929
|
+
for (var i = 0; i < separators.length; i++) {
|
|
53930
|
+
var index = stripped.indexOf(separators[i]);
|
|
53931
|
+
if (index !== -1 && index < suffixStart) {
|
|
53932
|
+
suffixStart = index;
|
|
53933
|
+
}
|
|
53934
|
+
}
|
|
53935
|
+
|
|
53936
|
+
var core = stripped.slice(0, suffixStart);
|
|
53937
|
+
var suffix = stripped.slice(suffixStart);
|
|
53938
|
+
|
|
53939
|
+
var parts = core.split('.');
|
|
53940
|
+
while (parts.length < SEMVER_PARTS) {
|
|
53941
|
+
parts.push('0');
|
|
53942
|
+
}
|
|
53943
|
+
return parts.join('.') + suffix;
|
|
53944
|
+
}
|
|
53945
|
+
|
|
53946
|
+
// The regex constrains each field to two digits, which still admits a date that cannot exist, such as
|
|
53947
|
+
// 2026-02-30 or 29 February in a common year. Writing the fields into a Date and reading them back
|
|
53948
|
+
// settles it: out-of-range fields are normalized into a real instant, so a date that does not exist
|
|
53949
|
+
// comes back carrying different fields than it went in with. The three-argument setUTCFullYear sets
|
|
53950
|
+
// all three at once, which judges 29 February against the year given rather than a placeholder, and
|
|
53951
|
+
// leaves years 0 through 99 alone where Date.UTC would map them into the 1900s. The hour is checked
|
|
53952
|
+
// separately because it is not part of the round trip; RFC 3339 section 5.6 allows hours 00 through 23.
|
|
53953
|
+
function isRealCalendarDate(year, month, day, hour) {
|
|
53954
|
+
if (hour > 23) {
|
|
53955
|
+
return false;
|
|
53956
|
+
}
|
|
53957
|
+
var dt = new Date();
|
|
53958
|
+
dt.setUTCFullYear(year, month - 1, day);
|
|
53959
|
+
return dt.getUTCFullYear() === year && dt.getUTCMonth() === month - 1 && dt.getUTCDate() === day;
|
|
53960
|
+
}
|
|
53961
|
+
|
|
53962
|
+
function convertRfc3339ToUnixSeconds(v) {
|
|
53963
|
+
if (typeof v !== 'string') {
|
|
53964
|
+
return null;
|
|
53965
|
+
}
|
|
53966
|
+
var normalized = v.trim().toUpperCase();
|
|
53967
|
+
var fields = RFC3339_REGEX.exec(normalized);
|
|
53968
|
+
if (!fields) {
|
|
53969
|
+
return null;
|
|
53970
|
+
}
|
|
53971
|
+
if (!isRealCalendarDate(Number(fields[1]), Number(fields[2]), Number(fields[3]), Number(fields[4]))) {
|
|
53972
|
+
return null;
|
|
53973
|
+
}
|
|
53974
|
+
var parsed = new Date(normalized);
|
|
53975
|
+
var ms = parsed.getTime();
|
|
53976
|
+
if (isNaN(ms)) {
|
|
53977
|
+
return null;
|
|
53978
|
+
}
|
|
53979
|
+
return Math.floor(ms / 1000);
|
|
53980
|
+
}
|
|
53981
|
+
|
|
53982
|
+
function convertUnixMillisecondsToSeconds(v) {
|
|
53983
|
+
if (typeof v !== 'number' || !isFinite(v)) {
|
|
53984
|
+
return null;
|
|
53985
|
+
}
|
|
53986
|
+
// A value int64 cannot represent is not a real timestamp; treating one as a bound would let a
|
|
53987
|
+
// nonsense target define a rollout window.
|
|
53988
|
+
if (v >= MAX_EPOCH_MS || v <= -9223372036854776e3) {
|
|
53989
|
+
return null;
|
|
53990
|
+
}
|
|
53991
|
+
return truncate(v / 1000);
|
|
53992
|
+
}
|
|
53993
|
+
|
|
53994
|
+
function truncate(n) {
|
|
53995
|
+
return n < 0 ? Math.ceil(n) : Math.floor(n);
|
|
53996
|
+
}
|
|
53997
|
+
|
|
53998
|
+
// Register typed runtime-targeting operators (semver_compare, datetime_compare) into the JsonLogic engine.
|
|
53999
|
+
// Registration happens lazily, when the async targeting bundle loads.
|
|
54000
|
+
registerCustomOperators(mixpanel_module_jsonLogic);
|
|
54001
|
+
|
|
53699
54002
|
/**
|
|
53700
54003
|
* Check if an event matches the given criteria
|
|
53701
54004
|
* @param {string} eventName - The name of the event being checked
|
|
@@ -55264,26 +55567,31 @@ FeatureFlagManager.prototype.getTargeting = function() {
|
|
|
55264
55567
|
* When a match is found (event name matches and property filters pass), this method:
|
|
55265
55568
|
* - Switches the flag to the pending variant
|
|
55266
55569
|
* - Marks the event as activated for this session
|
|
55267
|
-
* - Records the activation via the API
|
|
55570
|
+
* - Records the activation via the API
|
|
55571
|
+
*
|
|
55572
|
+
* @returns {Promise} Resolves once the pending events have been processed and their recording
|
|
55573
|
+
* requests have settled. The promise never rejects, so callers that ignore it cannot produce an
|
|
55574
|
+
* unhandled rejection.
|
|
55268
55575
|
*/
|
|
55269
55576
|
FeatureFlagManager.prototype.checkFirstTimeEvents = function(eventName, properties) {
|
|
55270
55577
|
if (!this.pendingFirstTimeEvents || mixpanel_module_.isEmptyObject(this.pendingFirstTimeEvents)) {
|
|
55271
|
-
return;
|
|
55578
|
+
return Promise.resolve();
|
|
55272
55579
|
}
|
|
55273
55580
|
|
|
55274
55581
|
// Check if targeting promise exists (either bundled or async loaded)
|
|
55275
55582
|
if (mixpanel_module_win[TARGETING_GLOBAL_NAME] && mixpanel_module_.isFunction(mixpanel_module_win[TARGETING_GLOBAL_NAME].then)) {
|
|
55276
|
-
|
|
55277
|
-
|
|
55583
|
+
// The catch is part of the returned chain so the promise handed back always resolves.
|
|
55584
|
+
return mixpanel_module_win[TARGETING_GLOBAL_NAME].then(function(library) {
|
|
55585
|
+
return this._processFirstTimeEventCheck(eventName, properties, library);
|
|
55278
55586
|
}.bind(this)).catch(function() {
|
|
55279
55587
|
// If targeting failed to load, process with null
|
|
55280
55588
|
// Events without property filters will still match
|
|
55281
|
-
this._processFirstTimeEventCheck(eventName, properties, null);
|
|
55589
|
+
return this._processFirstTimeEventCheck(eventName, properties, null);
|
|
55282
55590
|
}.bind(this));
|
|
55283
55591
|
} else {
|
|
55284
55592
|
// No targeting available, process with null
|
|
55285
55593
|
// Events without property filters will still match
|
|
55286
|
-
this._processFirstTimeEventCheck(eventName, properties, null);
|
|
55594
|
+
return this._processFirstTimeEventCheck(eventName, properties, null);
|
|
55287
55595
|
}
|
|
55288
55596
|
};
|
|
55289
55597
|
|
|
@@ -55292,8 +55600,10 @@ FeatureFlagManager.prototype.checkFirstTimeEvents = function(eventName, properti
|
|
|
55292
55600
|
* @param {string} eventName - The name of the event being tracked
|
|
55293
55601
|
* @param {Object} properties - Event properties to evaluate against property filters
|
|
55294
55602
|
* @param {Object} targeting - The loaded targeting library
|
|
55603
|
+
* @returns {Promise} Resolves once every recording request started here has settled.
|
|
55295
55604
|
*/
|
|
55296
55605
|
FeatureFlagManager.prototype._processFirstTimeEventCheck = function(eventName, properties, targeting) {
|
|
55606
|
+
var recordings = [];
|
|
55297
55607
|
mixpanel_module_.each(this.pendingFirstTimeEvents, function(pendingEvent, eventKey) {
|
|
55298
55608
|
if (this.activatedFirstTimeEvents[eventKey]) {
|
|
55299
55609
|
return;
|
|
@@ -55350,12 +55660,13 @@ FeatureFlagManager.prototype._processFirstTimeEventCheck = function(eventName, p
|
|
|
55350
55660
|
this.trackedFeatures.delete(flagKey);
|
|
55351
55661
|
this.activatedFirstTimeEvents[eventKey] = true;
|
|
55352
55662
|
|
|
55353
|
-
this.recordFirstTimeEvent(
|
|
55663
|
+
recordings.push(this.recordFirstTimeEvent(
|
|
55354
55664
|
pendingEvent['flag_id'],
|
|
55355
55665
|
pendingEvent['project_id'],
|
|
55356
55666
|
pendingEvent['first_time_event_hash']
|
|
55357
|
-
);
|
|
55667
|
+
));
|
|
55358
55668
|
}, this);
|
|
55669
|
+
return Promise.all(recordings);
|
|
55359
55670
|
};
|
|
55360
55671
|
|
|
55361
55672
|
FeatureFlagManager.prototype.getFirstTimeEventApiRoute = function(flagId) {
|
|
@@ -55381,8 +55692,9 @@ FeatureFlagManager.prototype.recordFirstTimeEvent = function(flagId, projectId,
|
|
|
55381
55692
|
|
|
55382
55693
|
logger$1.log('Recording first-time event for flag: ' + flagId);
|
|
55383
55694
|
|
|
55384
|
-
//
|
|
55385
|
-
|
|
55695
|
+
// The caller chains this so it can wait for the recording to settle. The catch below keeps the
|
|
55696
|
+
// returned promise resolved on failure, so a dropped request never rejects the chain.
|
|
55697
|
+
return this.fetch.call(mixpanel_module_win, url, {
|
|
55386
55698
|
'method': 'POST',
|
|
55387
55699
|
'headers': {
|
|
55388
55700
|
'Content-Type': 'application/json',
|
|
@@ -55981,7 +56293,7 @@ DomTracker.prototype.track = function(query, event_name, properties, user_callba
|
|
|
55981
56293
|
that.event_handler(e, this, options);
|
|
55982
56294
|
|
|
55983
56295
|
// in case the mixpanel servers don't get back to us in time
|
|
55984
|
-
|
|
56296
|
+
mixpanel_module_win.setTimeout(that.track_callback(user_callback, props, options, true), timeout);
|
|
55985
56297
|
|
|
55986
56298
|
// fire the tracking event
|
|
55987
56299
|
that.mp.track(event_name, props, that.track_callback(user_callback, props, options));
|
|
@@ -56061,10 +56373,10 @@ LinkTracker.prototype.event_handler = function(evt, element, options) {
|
|
|
56061
56373
|
};
|
|
56062
56374
|
|
|
56063
56375
|
LinkTracker.prototype.after_track_handler = function(props, options) {
|
|
56064
|
-
if (options.new_tab) { return; }
|
|
56376
|
+
if (options.new_tab || !options.href) { return; }
|
|
56065
56377
|
|
|
56066
56378
|
setTimeout(function() {
|
|
56067
|
-
|
|
56379
|
+
mixpanel_module_win.location = options.href;
|
|
56068
56380
|
}, 0);
|
|
56069
56381
|
};
|
|
56070
56382
|
|