@microsoft/1ds-post-js 4.0.1 → 4.0.2-nightly3.2307-25
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/README.md +10 -26
- package/bundle/es5/{ms.post-4.0.1.gbl.js → ms.post-4.0.2-nightly3.2307-25.gbl.js} +507 -426
- package/bundle/es5/ms.post-4.0.2-nightly3.2307-25.gbl.js.map +1 -0
- package/bundle/es5/ms.post-4.0.2-nightly3.2307-25.gbl.min.js +7 -0
- package/bundle/es5/ms.post-4.0.2-nightly3.2307-25.gbl.min.js.map +1 -0
- package/bundle/es5/ms.post-4.0.2-nightly3.2307-25.integrity.json +46 -0
- package/bundle/es5/{ms.post-4.0.1.js → ms.post-4.0.2-nightly3.2307-25.js} +507 -426
- package/bundle/es5/ms.post-4.0.2-nightly3.2307-25.js.map +1 -0
- package/bundle/es5/ms.post-4.0.2-nightly3.2307-25.min.js +7 -0
- package/bundle/es5/ms.post-4.0.2-nightly3.2307-25.min.js.map +1 -0
- package/bundle/es5/ms.post.gbl.js +506 -425
- package/bundle/es5/ms.post.gbl.js.map +1 -1
- package/bundle/es5/ms.post.gbl.min.js +2 -2
- package/bundle/es5/ms.post.gbl.min.js.map +1 -1
- package/bundle/es5/ms.post.integrity.json +17 -17
- package/bundle/es5/ms.post.js +506 -425
- package/bundle/es5/ms.post.js.map +1 -1
- package/bundle/es5/ms.post.min.js +2 -2
- package/bundle/es5/ms.post.min.js.map +1 -1
- package/dist/es5/ms.post.js +504 -423
- package/dist/es5/ms.post.js.map +1 -1
- package/dist/es5/ms.post.min.js +2 -2
- package/dist/es5/ms.post.min.js.map +1 -1
- package/dist-es5/BatchNotificationActions.js +1 -1
- package/dist-es5/ClockSkewManager.js +8 -8
- package/dist-es5/ClockSkewManager.js.map +1 -1
- package/dist-es5/DataModels.js +1 -1
- package/dist-es5/EventBatch.js +13 -12
- package/dist-es5/EventBatch.js.map +1 -1
- package/dist-es5/HttpManager.js +173 -173
- package/dist-es5/HttpManager.js.map +1 -1
- package/dist-es5/Index.js +3 -3
- package/dist-es5/Index.js.map +1 -1
- package/dist-es5/InternalConstants.js +1 -1
- package/dist-es5/KillSwitch.js +8 -8
- package/dist-es5/KillSwitch.js.map +1 -1
- package/dist-es5/PostChannel.js +92 -90
- package/dist-es5/PostChannel.js.map +1 -1
- package/dist-es5/RetryPolicy.js +1 -1
- package/dist-es5/Serializer.js +4 -5
- package/dist-es5/Serializer.js.map +1 -1
- package/dist-es5/TimeoutOverrideWrapper.js +1 -1
- package/dist-es5/__DynamicConstants.js +83 -0
- package/dist-es5/__DynamicConstants.js.map +1 -0
- package/dist-es5/typings/XDomainRequest.js +1 -1
- package/package.json +39 -23
- package/types/1ds-post-js.d.ts +5 -3
- package/types/1ds-post-js.namespaced.d.ts +5 -3
- package/bundle/es5/ms.post-4.0.1.gbl.js.map +0 -1
- package/bundle/es5/ms.post-4.0.1.gbl.min.js +0 -7
- package/bundle/es5/ms.post-4.0.1.gbl.min.js.map +0 -1
- package/bundle/es5/ms.post-4.0.1.integrity.json +0 -46
- package/bundle/es5/ms.post-4.0.1.js.map +0 -1
- package/bundle/es5/ms.post-4.0.1.min.js +0 -7
- package/bundle/es5/ms.post-4.0.1.min.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* 1DS JS SDK POST plugin, 4.0.
|
|
2
|
+
* 1DS JS SDK POST plugin, 4.0.2-nightly3.2307-25
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
* (Microsoft Internal Only)
|
|
5
5
|
*/
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
typeof exports === "object" && typeof module !== undef ? factory(exports) :
|
|
9
9
|
typeof define === "function" && define.amd ? define(["exports"], factory) :
|
|
10
10
|
(function(global){
|
|
11
|
-
var nsKey, key, nm, theExports = {}, modName = "
|
|
12
|
-
var mods={}, modDetail=mods[modName]={}, ver="4.0.
|
|
11
|
+
var nsKey, key, nm, theExports = {}, modName = "es5_ms_post_4_0_2_nightly3_2307_25", msMod="__ms$mod__";
|
|
12
|
+
var mods={}, modDetail=mods[modName]={}, ver="4.0.2-nightly3.2307-25";
|
|
13
13
|
// Versioned namespace "oneDS4"
|
|
14
14
|
var exportNs=global, nsKey="oneDS4", exportNs=exportNs[nsKey]=(exportNs[nsKey]||{});
|
|
15
15
|
// Global namespace "oneDS"
|
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
'use strict';
|
|
31
31
|
|
|
32
32
|
|
|
33
|
+
var RT_PROFILE = "REAL_TIME";
|
|
34
|
+
var NRT_PROFILE = "NEAR_REAL_TIME";
|
|
35
|
+
var BE_PROFILE = "BEST_EFFORT";
|
|
36
|
+
|
|
33
37
|
var strShimFunction = "function";
|
|
34
38
|
var strShimObject = "object";
|
|
35
39
|
var strShimUndefined = "undefined";
|
|
@@ -243,23 +247,43 @@ function dumpObj(object, format) {
|
|
|
243
247
|
return objToString(object) + ": " + propertyValueDump;
|
|
244
248
|
}
|
|
245
249
|
|
|
246
|
-
|
|
250
|
+
var _arrSlice = ArrProto[SLICE];
|
|
251
|
+
var _throwMissingFunction = function (funcName, thisArg) {
|
|
252
|
+
throwTypeError("'" + asString(funcName) + "' not defined for " + dumpObj(thisArg));
|
|
253
|
+
};
|
|
254
|
+
var _unwrapInstFunction = function (funcName) {
|
|
255
|
+
return function (thisArg) {
|
|
256
|
+
return thisArg[funcName].apply(thisArg, _arrSlice.call(arguments, 1));
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
var _unwrapFunction = function (funcName, clsProto) {
|
|
260
|
+
var clsFn = clsProto && clsProto[funcName];
|
|
261
|
+
return function (thisArg) {
|
|
262
|
+
var theFunc = (thisArg && thisArg[funcName]) || clsFn;
|
|
263
|
+
if (theFunc) {
|
|
264
|
+
return theFunc.apply(thisArg, _arrSlice.call(arguments, 1));
|
|
265
|
+
}
|
|
266
|
+
_throwMissingFunction(funcName, thisArg);
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
var _unwrapFunctionWithPoly = function (funcName, clsProto, polyFunc) {
|
|
270
|
+
var clsFn = clsProto && clsProto[funcName];
|
|
247
271
|
return function (thisArg) {
|
|
248
|
-
var theFunc = (thisArg && thisArg[funcName]) ||
|
|
272
|
+
var theFunc = (thisArg && thisArg[funcName]) || clsFn;
|
|
249
273
|
if (theFunc || polyFunc) {
|
|
250
274
|
var theArgs = arguments;
|
|
251
|
-
return (theFunc || polyFunc).apply(thisArg, theFunc ?
|
|
275
|
+
return (theFunc || polyFunc).apply(thisArg, theFunc ? _arrSlice.call(theArgs, 1) : theArgs);
|
|
252
276
|
}
|
|
253
|
-
|
|
277
|
+
_throwMissingFunction(funcName, thisArg);
|
|
254
278
|
};
|
|
255
|
-
}
|
|
279
|
+
};
|
|
256
280
|
|
|
257
281
|
var mathMax = MathCls.max;
|
|
258
282
|
|
|
259
283
|
var strSlice = _unwrapFunction(SLICE, StrProto);
|
|
260
284
|
|
|
261
285
|
var strSubstring = _unwrapFunction("substring", StrProto);
|
|
262
|
-
var strSubstr =
|
|
286
|
+
var strSubstr = _unwrapFunctionWithPoly("substr", StrProto, polyStrSubstr);
|
|
263
287
|
function polyStrSubstr(value, start, length) {
|
|
264
288
|
if (isNullOrUndefined(value)) {
|
|
265
289
|
throwTypeError("'polyStrSubstr called with invalid " + dumpObj(value));
|
|
@@ -280,7 +304,7 @@ function strLeft(value, count) {
|
|
|
280
304
|
return strSubstring(value, 0, count);
|
|
281
305
|
}
|
|
282
306
|
|
|
283
|
-
var strStartsWith =
|
|
307
|
+
var strStartsWith = _unwrapFunctionWithPoly("startsWith", StrProto, polyStrStartsWith);
|
|
284
308
|
function polyStrStartsWith(value, searchString, position) {
|
|
285
309
|
if (!isString(value)) {
|
|
286
310
|
throwTypeError("'" + dumpObj(value) + "' is not a string");
|
|
@@ -397,15 +421,13 @@ var _cachedWindow;
|
|
|
397
421
|
var _cachedDocument;
|
|
398
422
|
var _cachedNavigator;
|
|
399
423
|
var _isNode;
|
|
400
|
-
function
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
function getGlobal(useCached) {
|
|
404
|
-
(!_cachedGlobal || useCached === false || (_globalLazyTestHooks.lzy && !_cachedGlobal.b)) && (_cachedGlobal = safeGetLazy(_getGlobalValue, NULL_VALUE));
|
|
424
|
+
var lazySafeGetInst = function (name) { return safeGetLazy(function () { return getInst(name) || UNDEF_VALUE; }, UNDEF_VALUE); };
|
|
425
|
+
var getGlobal = function (useCached) {
|
|
426
|
+
(!_cachedGlobal || useCached === false || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedGlobal.b)) && (_cachedGlobal = safeGetLazy(_getGlobalValue, NULL_VALUE));
|
|
405
427
|
return _cachedGlobal.v;
|
|
406
|
-
}
|
|
407
|
-
function
|
|
408
|
-
var gbl = getGlobal(useCached);
|
|
428
|
+
};
|
|
429
|
+
var getInst = function (name, useCached) {
|
|
430
|
+
var gbl = (!_cachedGlobal || useCached === false) ? getGlobal(useCached) : _cachedGlobal.v;
|
|
409
431
|
if (gbl && gbl[name]) {
|
|
410
432
|
return gbl[name];
|
|
411
433
|
}
|
|
@@ -413,32 +435,26 @@ function getInst(name, useCached) {
|
|
|
413
435
|
return _cachedWindow.v;
|
|
414
436
|
}
|
|
415
437
|
return NULL_VALUE;
|
|
416
|
-
}
|
|
417
|
-
function
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
function getDocument() {
|
|
421
|
-
(!_cachedDocument || (_globalLazyTestHooks.lzy && !_cachedDocument.b)) && (_cachedDocument = lazySafeGetInst("document"));
|
|
438
|
+
};
|
|
439
|
+
var hasDocument = function () { return !!getDocument(); };
|
|
440
|
+
var getDocument = function () {
|
|
441
|
+
(!_cachedDocument || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedDocument.b)) && (_cachedDocument = lazySafeGetInst("document"));
|
|
422
442
|
return _cachedDocument.v;
|
|
423
|
-
}
|
|
424
|
-
function
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
function getWindow() {
|
|
428
|
-
(!_cachedWindow || (_globalLazyTestHooks.lzy && !_cachedWindow.b)) && (_cachedWindow = lazySafeGetInst(WINDOW));
|
|
443
|
+
};
|
|
444
|
+
var hasWindow = function () { return !!getWindow(); };
|
|
445
|
+
var getWindow = function () {
|
|
446
|
+
(!_cachedWindow || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedWindow.b)) && (_cachedWindow = lazySafeGetInst(WINDOW));
|
|
429
447
|
return _cachedWindow.v;
|
|
430
|
-
}
|
|
431
|
-
function
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
function getNavigator() {
|
|
435
|
-
(!_cachedNavigator || (_globalLazyTestHooks.lzy && !_cachedNavigator.b)) && (_cachedNavigator = lazySafeGetInst("navigator"));
|
|
448
|
+
};
|
|
449
|
+
var hasNavigator = function () { return !!getNavigator(); };
|
|
450
|
+
var getNavigator = function () {
|
|
451
|
+
(!_cachedNavigator || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedNavigator.b)) && (_cachedNavigator = lazySafeGetInst("navigator"));
|
|
436
452
|
return _cachedNavigator.v;
|
|
437
|
-
}
|
|
438
|
-
function
|
|
453
|
+
};
|
|
454
|
+
var isNode = function () {
|
|
439
455
|
!_isNode && (_isNode = safeGetLazy(function () { return !!(process && (process.versions || {}).node); }, false));
|
|
440
456
|
return _isNode.v;
|
|
441
|
-
}
|
|
457
|
+
};
|
|
442
458
|
|
|
443
459
|
var _symbol;
|
|
444
460
|
var _symbolFor;
|
|
@@ -479,36 +495,54 @@ function isIterable(value) {
|
|
|
479
495
|
return !isStrictNullOrUndefined(value) && isFunction(value[getKnownSymbol(3 )]);
|
|
480
496
|
}
|
|
481
497
|
|
|
498
|
+
var _iterSymbol;
|
|
482
499
|
function iterForOf(iter, callbackfn, thisArg) {
|
|
483
500
|
if (iter) {
|
|
484
501
|
if (!isIterator(iter)) {
|
|
485
|
-
|
|
486
|
-
iter = iter[
|
|
502
|
+
!_iterSymbol && (_iterSymbol = getLazy(function () { return getKnownSymbol(3 ); }));
|
|
503
|
+
iter = iter[_iterSymbol.v] ? iter[_iterSymbol.v]() : null;
|
|
487
504
|
}
|
|
488
505
|
if (isIterator(iter)) {
|
|
506
|
+
var err = void 0;
|
|
507
|
+
var iterResult = void 0;
|
|
489
508
|
try {
|
|
490
509
|
var count = 0;
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
if (callbackfn.call(thisArg || iter, value[VALUE], count, iter) === -1) {
|
|
510
|
+
while (!(iterResult = iter.next())[DONE]) {
|
|
511
|
+
if (callbackfn.call(thisArg || iter, iterResult[VALUE], count, iter) === -1) {
|
|
494
512
|
break;
|
|
495
513
|
}
|
|
496
514
|
count++;
|
|
497
|
-
value = iter.next();
|
|
498
515
|
}
|
|
499
|
-
iter.return && iter.return(value);
|
|
500
516
|
}
|
|
501
|
-
catch (
|
|
502
|
-
|
|
517
|
+
catch (failed) {
|
|
518
|
+
err = { e: failed };
|
|
519
|
+
if (iter.throw) {
|
|
520
|
+
iterResult = null;
|
|
521
|
+
iter.throw(err);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
finally {
|
|
525
|
+
try {
|
|
526
|
+
if (iterResult && !iterResult[DONE]) {
|
|
527
|
+
iter.return && iter.return(iterResult);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
finally {
|
|
531
|
+
if (err) {
|
|
532
|
+
throw err.e;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
503
535
|
}
|
|
504
536
|
}
|
|
505
537
|
}
|
|
506
538
|
}
|
|
507
539
|
|
|
540
|
+
var fnApply = _unwrapInstFunction("apply");
|
|
541
|
+
|
|
508
542
|
function arrAppend(target, elms) {
|
|
509
543
|
if (!isUndefined(elms) && target) {
|
|
510
544
|
if (isArray(elms)) {
|
|
511
|
-
target.push
|
|
545
|
+
fnApply(target.push, target, elms);
|
|
512
546
|
}
|
|
513
547
|
else if (isIterator(elms) || isIterable(elms)) {
|
|
514
548
|
iterForOf(elms, function (elm) {
|
|
@@ -539,6 +573,8 @@ var arrIndexOf = _unwrapFunction(INDEX_OF, ArrProto);
|
|
|
539
573
|
|
|
540
574
|
var arrSlice = _unwrapFunction(SLICE, ArrProto);
|
|
541
575
|
|
|
576
|
+
var fnCall = _unwrapInstFunction("call");
|
|
577
|
+
|
|
542
578
|
var _objCreate = ObjClass["create"];
|
|
543
579
|
var objCreate = _objCreate || polyObjCreate;
|
|
544
580
|
function polyObjCreate(obj) {
|
|
@@ -599,7 +635,7 @@ function createCustomError(name, constructCb, errorBase) {
|
|
|
599
635
|
var _this = this;
|
|
600
636
|
try {
|
|
601
637
|
_safeSetName(theBaseClass, name);
|
|
602
|
-
var _self = theBaseClass
|
|
638
|
+
var _self = fnApply(theBaseClass, _this, arrSlice(arguments)) || _this;
|
|
603
639
|
if (_self !== _this) {
|
|
604
640
|
var orgProto = objGetPrototypeOf(_this);
|
|
605
641
|
if (orgProto !== objGetPrototypeOf(_self)) {
|
|
@@ -636,7 +672,7 @@ function _createTrimFn(exp) {
|
|
|
636
672
|
}
|
|
637
673
|
var polyStrTrim = _createTrimFn(/^\s+|(?=\s)\s+$/g);
|
|
638
674
|
|
|
639
|
-
var strTrim =
|
|
675
|
+
var strTrim = _unwrapFunctionWithPoly("trim", StrProto, polyStrTrim);
|
|
640
676
|
|
|
641
677
|
var _fnToString;
|
|
642
678
|
var _objCtrFnString;
|
|
@@ -652,7 +688,7 @@ function isPlainObject(value) {
|
|
|
652
688
|
if (value !== _gblWindow) {
|
|
653
689
|
if (!_objCtrFnString) {
|
|
654
690
|
_fnToString = Function[PROTOTYPE].toString;
|
|
655
|
-
_objCtrFnString = _fnToString
|
|
691
|
+
_objCtrFnString = fnCall(_fnToString, ObjClass);
|
|
656
692
|
}
|
|
657
693
|
try {
|
|
658
694
|
var proto = objGetPrototypeOf(value);
|
|
@@ -672,7 +708,7 @@ function isPlainObject(value) {
|
|
|
672
708
|
|
|
673
709
|
var _perf;
|
|
674
710
|
function getPerformance() {
|
|
675
|
-
(!_perf || (
|
|
711
|
+
(!_perf || (!_perf.b && _globalLazyTestHooks && _globalLazyTestHooks.lzy)) && (_perf = lazySafeGetInst("performance"));
|
|
676
712
|
return _perf.v;
|
|
677
713
|
}
|
|
678
714
|
function perfNow() {
|
|
@@ -754,7 +790,7 @@ function _createTimeoutWith(self, startTimer, overrideFn, theArgs) {
|
|
|
754
790
|
var timerFn = theArgs[0];
|
|
755
791
|
theArgs[0] = function () {
|
|
756
792
|
handler.dn();
|
|
757
|
-
timerFn
|
|
793
|
+
fnApply(timerFn, self, arrSlice(arguments));
|
|
758
794
|
};
|
|
759
795
|
var handler = _createTimerHandler(startTimer, function (timerId) {
|
|
760
796
|
if (timerId) {
|
|
@@ -762,11 +798,11 @@ function _createTimeoutWith(self, startTimer, overrideFn, theArgs) {
|
|
|
762
798
|
timerId.refresh();
|
|
763
799
|
return timerId;
|
|
764
800
|
}
|
|
765
|
-
clearFn
|
|
801
|
+
fnApply(clearFn, self, [timerId]);
|
|
766
802
|
}
|
|
767
|
-
return setFn
|
|
803
|
+
return fnApply(setFn, self, theArgs);
|
|
768
804
|
}, function (timerId) {
|
|
769
|
-
clearFn
|
|
805
|
+
fnApply(clearFn, self, [timerId]);
|
|
770
806
|
});
|
|
771
807
|
return handler.h;
|
|
772
808
|
}
|
|
@@ -1062,9 +1098,9 @@ var EventsDiscardedReason = createEnumStyle({
|
|
|
1062
1098
|
QueueFull: 5
|
|
1063
1099
|
});
|
|
1064
1100
|
|
|
1065
|
-
var _DYN_TO_LOWER_CASE = "toLowerCase";
|
|
1101
|
+
var _DYN_TO_LOWER_CASE$1 = "toLowerCase";
|
|
1066
1102
|
var _DYN_BLK_VAL = "blkVal";
|
|
1067
|
-
var _DYN_LENGTH = "length";
|
|
1103
|
+
var _DYN_LENGTH$2 = "length";
|
|
1068
1104
|
var _DYN_RD_ONLY = "rdOnly";
|
|
1069
1105
|
var _DYN_NOTIFY = "notify";
|
|
1070
1106
|
var _DYN_WARN_TO_CONSOLE = "warnToConsole";
|
|
@@ -1073,12 +1109,12 @@ var _DYN_SET_DF = "setDf";
|
|
|
1073
1109
|
var _DYN_WATCH = "watch";
|
|
1074
1110
|
var _DYN_LOGGER = "logger";
|
|
1075
1111
|
var _DYN_APPLY = "apply";
|
|
1076
|
-
var _DYN_PUSH = "push";
|
|
1077
|
-
var _DYN_SPLICE = "splice";
|
|
1112
|
+
var _DYN_PUSH$1 = "push";
|
|
1113
|
+
var _DYN_SPLICE$1 = "splice";
|
|
1078
1114
|
var _DYN_HDLR = "hdlr";
|
|
1079
1115
|
var _DYN_CANCEL = "cancel";
|
|
1080
|
-
var _DYN_INITIALIZE = "initialize";
|
|
1081
|
-
var _DYN_IDENTIFIER = "identifier";
|
|
1116
|
+
var _DYN_INITIALIZE$1 = "initialize";
|
|
1117
|
+
var _DYN_IDENTIFIER$1 = "identifier";
|
|
1082
1118
|
var _DYN_IS_INITIALIZED = "isInitialized";
|
|
1083
1119
|
var _DYN_GET_PLUGIN = "getPlugin";
|
|
1084
1120
|
var _DYN_NAME = "name";
|
|
@@ -1098,7 +1134,7 @@ var _DYN_UPDATE = "update";
|
|
|
1098
1134
|
var _DYN_GET_NEXT = "getNext";
|
|
1099
1135
|
var _DYN_SET_NEXT_PLUGIN = "setNextPlugin";
|
|
1100
1136
|
var _DYN_USER_AGENT = "userAgent";
|
|
1101
|
-
var _DYN_SPLIT = "split";
|
|
1137
|
+
var _DYN_SPLIT$1 = "split";
|
|
1102
1138
|
var _DYN_NODE_TYPE = "nodeType";
|
|
1103
1139
|
var _DYN_REPLACE = "replace";
|
|
1104
1140
|
var _DYN_LOG_INTERNAL_MESSAGE = "logInternalMessage";
|
|
@@ -1113,7 +1149,7 @@ var aggregationErrorType;
|
|
|
1113
1149
|
function throwAggregationError(message, sourceErrors) {
|
|
1114
1150
|
if (!aggregationErrorType) {
|
|
1115
1151
|
aggregationErrorType = createCustomError("AggregationError", function (self, args) {
|
|
1116
|
-
if (args[_DYN_LENGTH ] > 1) {
|
|
1152
|
+
if (args[_DYN_LENGTH$2 ] > 1) {
|
|
1117
1153
|
self.errors = args[1];
|
|
1118
1154
|
}
|
|
1119
1155
|
});
|
|
@@ -1125,13 +1161,6 @@ function throwAggregationError(message, sourceErrors) {
|
|
|
1125
1161
|
throw new aggregationErrorType(theMessage, sourceErrors || []);
|
|
1126
1162
|
}
|
|
1127
1163
|
|
|
1128
|
-
var _theLogger = null;
|
|
1129
|
-
function _debugLog(id, message) {
|
|
1130
|
-
if (_theLogger) {
|
|
1131
|
-
_theLogger(id, message);
|
|
1132
|
-
}
|
|
1133
|
-
}
|
|
1134
|
-
|
|
1135
1164
|
var STRING_STATES = [
|
|
1136
1165
|
"pending", "resolving", "resolved", "rejected"
|
|
1137
1166
|
];
|
|
@@ -1194,14 +1223,11 @@ function _createPromise(newPromise, processor, executor) {
|
|
|
1194
1223
|
_handled = true;
|
|
1195
1224
|
_unHandledRejectionHandler && _unHandledRejectionHandler.cancel();
|
|
1196
1225
|
_unHandledRejectionHandler = null;
|
|
1197
|
-
_debugLog(_toString(), "then(" + dumpFnObj(onResolved) + ", " + dumpFnObj(onResolved) + ")");
|
|
1198
1226
|
var thenPromise = newPromise(function (resolve, reject) {
|
|
1199
1227
|
_queue.push(function () {
|
|
1200
1228
|
try {
|
|
1201
|
-
_debugLog(_toString(), "Handling settled value " + dumpFnObj(_settledValue));
|
|
1202
1229
|
var handler = _state === 2 ? onResolved : onRejected;
|
|
1203
1230
|
var value = isUndefined(handler) ? _settledValue : (isFunction(handler) ? handler(_settledValue) : handler);
|
|
1204
|
-
_debugLog(_toString(), "Handling Result " + dumpFnObj(value));
|
|
1205
1231
|
if (isPromiseLike(value)) {
|
|
1206
1232
|
value.then(resolve, reject);
|
|
1207
1233
|
}
|
|
@@ -1219,12 +1245,10 @@ function _createPromise(newPromise, processor, executor) {
|
|
|
1219
1245
|
reject(e);
|
|
1220
1246
|
}
|
|
1221
1247
|
});
|
|
1222
|
-
_debugLog(_toString(), "Added to Queue " + _queue.length);
|
|
1223
1248
|
if (_hasResolved) {
|
|
1224
1249
|
_processQueue();
|
|
1225
1250
|
}
|
|
1226
1251
|
}, additionalArgs);
|
|
1227
|
-
_debugLog(_toString(), "Created -> " + thenPromise.toString());
|
|
1228
1252
|
return thenPromise;
|
|
1229
1253
|
}
|
|
1230
1254
|
finally {
|
|
@@ -1255,49 +1279,37 @@ function _createPromise(newPromise, processor, executor) {
|
|
|
1255
1279
|
if (_queue.length > 0) {
|
|
1256
1280
|
var pending = _queue.slice();
|
|
1257
1281
|
_queue = [];
|
|
1258
|
-
_debugLog(_toString(), "Processing queue " + pending.length);
|
|
1259
1282
|
_handled = true;
|
|
1260
1283
|
processor(pending);
|
|
1261
|
-
_debugLog(_toString(), "Processing done");
|
|
1262
1284
|
_unHandledRejectionHandler && _unHandledRejectionHandler.cancel();
|
|
1263
1285
|
_unHandledRejectionHandler = null;
|
|
1264
1286
|
}
|
|
1265
|
-
else {
|
|
1266
|
-
_debugLog(_toString(), "Empty Processing queue ");
|
|
1267
|
-
}
|
|
1268
1287
|
};
|
|
1269
1288
|
var _createSettleIfFn = function (newState, allowState) {
|
|
1270
1289
|
return function (theValue) {
|
|
1271
1290
|
if (_state === allowState) {
|
|
1272
1291
|
if (newState === 2 && isPromiseLike(theValue)) {
|
|
1273
1292
|
_state = 1 ;
|
|
1274
|
-
_debugLog(_toString(), "Resolving");
|
|
1275
1293
|
theValue.then(_createSettleIfFn(2 , 1 ), _createSettleIfFn(3 , 1 ));
|
|
1276
1294
|
return;
|
|
1277
1295
|
}
|
|
1278
1296
|
_state = newState;
|
|
1279
1297
|
_hasResolved = true;
|
|
1280
1298
|
_settledValue = theValue;
|
|
1281
|
-
_debugLog(_toString(), _strState());
|
|
1282
1299
|
_processQueue();
|
|
1283
1300
|
if (!_handled && newState === 3 && !_unHandledRejectionHandler) {
|
|
1284
1301
|
_unHandledRejectionHandler = scheduleTimeout(_notifyUnhandledRejection, _unhandledRejectionTimeout);
|
|
1285
1302
|
}
|
|
1286
1303
|
}
|
|
1287
|
-
else {
|
|
1288
|
-
_debugLog(_toString(), "Already " + _strState());
|
|
1289
|
-
}
|
|
1290
1304
|
};
|
|
1291
1305
|
};
|
|
1292
1306
|
var _notifyUnhandledRejection = function () {
|
|
1293
1307
|
if (!_handled) {
|
|
1294
1308
|
if (isNode()) {
|
|
1295
|
-
_debugLog(_toString(), "Emitting " + NODE_UNHANDLED_REJECTION);
|
|
1296
1309
|
process.emit(NODE_UNHANDLED_REJECTION, _settledValue, _thePromise);
|
|
1297
1310
|
}
|
|
1298
1311
|
else {
|
|
1299
1312
|
var gbl = getWindow() || getGlobal();
|
|
1300
|
-
_debugLog(_toString(), "Emitting " + UNHANDLED_REJECTION);
|
|
1301
1313
|
emitEvent(gbl, UNHANDLED_REJECTION, function (theEvt) {
|
|
1302
1314
|
objDefine(theEvt, "promise", { g: function () { return _thePromise; } });
|
|
1303
1315
|
theEvt.reason = _settledValue;
|
|
@@ -1327,14 +1339,12 @@ function _createPromise(newPromise, processor, executor) {
|
|
|
1327
1339
|
}
|
|
1328
1340
|
var _rejectFn = _createSettleIfFn(3 , 0 );
|
|
1329
1341
|
try {
|
|
1330
|
-
_debugLog(_toString(), "Executing");
|
|
1331
1342
|
executor.call(_thePromise, _createSettleIfFn(2 , 0 ), _rejectFn);
|
|
1332
1343
|
}
|
|
1333
1344
|
catch (e) {
|
|
1334
1345
|
_rejectFn(e);
|
|
1335
1346
|
}
|
|
1336
1347
|
})();
|
|
1337
|
-
_debugLog(_toString(), "Returning");
|
|
1338
1348
|
return _thePromise;
|
|
1339
1349
|
}
|
|
1340
1350
|
|
|
@@ -1558,13 +1568,13 @@ function isIE() {
|
|
|
1558
1568
|
var nav = getNavigator();
|
|
1559
1569
|
if (nav && (nav[_DYN_USER_AGENT ] !== _navUserAgentCheck || _isTrident === null)) {
|
|
1560
1570
|
_navUserAgentCheck = nav[_DYN_USER_AGENT ];
|
|
1561
|
-
var userAgent = (_navUserAgentCheck || STR_EMPTY$2)[_DYN_TO_LOWER_CASE ]();
|
|
1571
|
+
var userAgent = (_navUserAgentCheck || STR_EMPTY$2)[_DYN_TO_LOWER_CASE$1 ]();
|
|
1562
1572
|
_isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));
|
|
1563
1573
|
}
|
|
1564
1574
|
return _isTrident;
|
|
1565
1575
|
}
|
|
1566
|
-
function isBeaconsSupported() {
|
|
1567
|
-
if (_beaconsSupported === null) {
|
|
1576
|
+
function isBeaconsSupported(useCached) {
|
|
1577
|
+
if (_beaconsSupported === null || useCached === false) {
|
|
1568
1578
|
_beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon);
|
|
1569
1579
|
}
|
|
1570
1580
|
return _beaconsSupported;
|
|
@@ -1660,7 +1670,7 @@ function newId(maxLength) {
|
|
|
1660
1670
|
var number = random32() >>> 0;
|
|
1661
1671
|
var chars = 0;
|
|
1662
1672
|
var result = STR_EMPTY$2;
|
|
1663
|
-
while (result[_DYN_LENGTH ] < maxLength) {
|
|
1673
|
+
while (result[_DYN_LENGTH$2 ] < maxLength) {
|
|
1664
1674
|
chars++;
|
|
1665
1675
|
result += base64chars.charAt(number & 0x3F);
|
|
1666
1676
|
number >>>= 6;
|
|
@@ -1672,7 +1682,7 @@ function newId(maxLength) {
|
|
|
1672
1682
|
return result;
|
|
1673
1683
|
}
|
|
1674
1684
|
|
|
1675
|
-
var version = '3.0.
|
|
1685
|
+
var version = '3.0.3-nightly3.2307-25';
|
|
1676
1686
|
var instanceName = "." + newId(6);
|
|
1677
1687
|
var _dataUid = 0;
|
|
1678
1688
|
function _canAcceptData(target) {
|
|
@@ -1740,7 +1750,7 @@ function _getDefault(dynamicHandler, theConfig, cfgDefaults) {
|
|
|
1740
1750
|
if (!isArray(fallbacks)) {
|
|
1741
1751
|
fallbacks = [fallbacks];
|
|
1742
1752
|
}
|
|
1743
|
-
for (var lp = 0; lp < fallbacks[_DYN_LENGTH ]; lp++) {
|
|
1753
|
+
for (var lp = 0; lp < fallbacks[_DYN_LENGTH$2 ]; lp++) {
|
|
1744
1754
|
var fallback = fallbacks[lp];
|
|
1745
1755
|
var fbValue = theConfig[fallback];
|
|
1746
1756
|
if (isDefaultValid(fbValue)) {
|
|
@@ -1775,7 +1785,7 @@ function _resolveDefaultValue(dynamicHandler, theConfig, cfgDefaults) {
|
|
|
1775
1785
|
var newValue_1;
|
|
1776
1786
|
if (isArray(theValue)) {
|
|
1777
1787
|
newValue_1 = [];
|
|
1778
|
-
newValue_1[_DYN_LENGTH ] = theValue[_DYN_LENGTH ];
|
|
1788
|
+
newValue_1[_DYN_LENGTH$2 ] = theValue[_DYN_LENGTH$2 ];
|
|
1779
1789
|
}
|
|
1780
1790
|
else if (isPlainObject(theValue)) {
|
|
1781
1791
|
newValue_1 = {};
|
|
@@ -1866,7 +1876,7 @@ function _cfgDeepCopy(source) {
|
|
|
1866
1876
|
var target_1;
|
|
1867
1877
|
if (isArray(source)) {
|
|
1868
1878
|
target_1 = [];
|
|
1869
|
-
target_1[_DYN_LENGTH ] = source[_DYN_LENGTH ];
|
|
1879
|
+
target_1[_DYN_LENGTH$2 ] = source[_DYN_LENGTH$2 ];
|
|
1870
1880
|
}
|
|
1871
1881
|
else if (isPlainObject(source)) {
|
|
1872
1882
|
target_1 = {};
|
|
@@ -1950,7 +1960,7 @@ function _createDynamicProperty(state, theConfig, name, value) {
|
|
|
1950
1960
|
trk: function (handler) {
|
|
1951
1961
|
if (handler && handler.fn) {
|
|
1952
1962
|
if (arrIndexOf(detail.h, handler) === -1) {
|
|
1953
|
-
detail.h[_DYN_PUSH ](handler);
|
|
1963
|
+
detail.h[_DYN_PUSH$1 ](handler);
|
|
1954
1964
|
}
|
|
1955
1965
|
state.trk(handler, detail);
|
|
1956
1966
|
}
|
|
@@ -1958,7 +1968,7 @@ function _createDynamicProperty(state, theConfig, name, value) {
|
|
|
1958
1968
|
clr: function (handler) {
|
|
1959
1969
|
var idx = arrIndexOf(detail.h, handler);
|
|
1960
1970
|
if (idx !== -1) {
|
|
1961
|
-
detail.h[_DYN_SPLICE ](idx, 1);
|
|
1971
|
+
detail.h[_DYN_SPLICE$1 ](idx, 1);
|
|
1962
1972
|
}
|
|
1963
1973
|
}
|
|
1964
1974
|
};
|
|
@@ -2162,7 +2172,7 @@ function _createState(cfgHandler) {
|
|
|
2162
2172
|
_useHandler(handler, handler.fn);
|
|
2163
2173
|
}
|
|
2164
2174
|
catch (e) {
|
|
2165
|
-
watcherFailures_1[_DYN_PUSH ](e);
|
|
2175
|
+
watcherFailures_1[_DYN_PUSH$1 ](e);
|
|
2166
2176
|
}
|
|
2167
2177
|
}
|
|
2168
2178
|
}
|
|
@@ -2172,16 +2182,16 @@ function _createState(cfgHandler) {
|
|
|
2172
2182
|
_notifyWatchers();
|
|
2173
2183
|
}
|
|
2174
2184
|
catch (e) {
|
|
2175
|
-
watcherFailures_1[_DYN_PUSH ](e);
|
|
2185
|
+
watcherFailures_1[_DYN_PUSH$1 ](e);
|
|
2176
2186
|
}
|
|
2177
2187
|
}
|
|
2178
|
-
if (watcherFailures_1[_DYN_LENGTH ] > 0) {
|
|
2188
|
+
if (watcherFailures_1[_DYN_LENGTH$2 ] > 0) {
|
|
2179
2189
|
throwAggregationError("Watcher error(s): ", watcherFailures_1);
|
|
2180
2190
|
}
|
|
2181
2191
|
}
|
|
2182
2192
|
}
|
|
2183
2193
|
function _addWatcher(detail) {
|
|
2184
|
-
if (detail && detail.h[_DYN_LENGTH ] > 0) {
|
|
2194
|
+
if (detail && detail.h[_DYN_LENGTH$2 ] > 0) {
|
|
2185
2195
|
if (!_waitingHandlers) {
|
|
2186
2196
|
_waitingHandlers = [];
|
|
2187
2197
|
}
|
|
@@ -2191,10 +2201,10 @@ function _createState(cfgHandler) {
|
|
|
2191
2201
|
_notifyWatchers();
|
|
2192
2202
|
}, 0);
|
|
2193
2203
|
}
|
|
2194
|
-
for (var idx = 0; idx < detail.h[_DYN_LENGTH ]; idx++) {
|
|
2204
|
+
for (var idx = 0; idx < detail.h[_DYN_LENGTH$2 ]; idx++) {
|
|
2195
2205
|
var handler = detail.h[idx];
|
|
2196
2206
|
if (handler && arrIndexOf(_waitingHandlers, handler) === -1) {
|
|
2197
|
-
_waitingHandlers[_DYN_PUSH ](handler);
|
|
2207
|
+
_waitingHandlers[_DYN_PUSH$1 ](handler);
|
|
2198
2208
|
}
|
|
2199
2209
|
}
|
|
2200
2210
|
}
|
|
@@ -2203,7 +2213,7 @@ function _createState(cfgHandler) {
|
|
|
2203
2213
|
if (handler) {
|
|
2204
2214
|
var details = handler[dynamicPropertyDetail] = handler[dynamicPropertyDetail] || [];
|
|
2205
2215
|
if (arrIndexOf(details, detail) === -1) {
|
|
2206
|
-
details[_DYN_PUSH ](detail);
|
|
2216
|
+
details[_DYN_PUSH$1 ](detail);
|
|
2207
2217
|
}
|
|
2208
2218
|
}
|
|
2209
2219
|
}
|
|
@@ -2491,14 +2501,14 @@ var DiagnosticLogger = /** @class */ (function () {
|
|
|
2491
2501
|
}
|
|
2492
2502
|
if (logMessage) {
|
|
2493
2503
|
if (severity <= _loggingLevelTelemetry) {
|
|
2494
|
-
_self.queue[_DYN_PUSH ](message);
|
|
2504
|
+
_self.queue[_DYN_PUSH$1 ](message);
|
|
2495
2505
|
_messageCount++;
|
|
2496
2506
|
_debugExtMsg((severity === 1 ? "error" : "warn"), message);
|
|
2497
2507
|
}
|
|
2498
2508
|
if (_messageCount === _maxInternalMessageLimit) {
|
|
2499
2509
|
var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
|
|
2500
2510
|
var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false);
|
|
2501
|
-
_self.queue[_DYN_PUSH ](throttleMessage);
|
|
2511
|
+
_self.queue[_DYN_PUSH$1 ](throttleMessage);
|
|
2502
2512
|
if (severity === 1 ) {
|
|
2503
2513
|
_self.errorToConsole(throttleLimitMessage);
|
|
2504
2514
|
}
|
|
@@ -2594,7 +2604,7 @@ var PerfEvent = /** @class */ (function () {
|
|
|
2594
2604
|
var childTime = 0;
|
|
2595
2605
|
var childEvts = _self[_DYN_GET_CTX ](PerfEvent[strChildrenContextKey]);
|
|
2596
2606
|
if (isArray(childEvts)) {
|
|
2597
|
-
for (var lp = 0; lp < childEvts[_DYN_LENGTH ]; lp++) {
|
|
2607
|
+
for (var lp = 0; lp < childEvts[_DYN_LENGTH$2 ]; lp++) {
|
|
2598
2608
|
var childEvt = childEvts[lp];
|
|
2599
2609
|
if (childEvt) {
|
|
2600
2610
|
childTime += childEvt[_DYN_TIME ];
|
|
@@ -2631,7 +2641,7 @@ function doPerf(mgrSource, getSource, func, details, isAsync) {
|
|
|
2631
2641
|
children = [];
|
|
2632
2642
|
currentActive[_DYN_SET_CTX ](PerfEvent[strChildrenContextKey], children);
|
|
2633
2643
|
}
|
|
2634
|
-
children[_DYN_PUSH ](perfEvt);
|
|
2644
|
+
children[_DYN_PUSH$1 ](perfEvt);
|
|
2635
2645
|
}
|
|
2636
2646
|
}
|
|
2637
2647
|
perfMgr[_DYN_SET_CTX ](doPerfActiveKey, perfEvt);
|
|
@@ -2714,7 +2724,7 @@ function _createInternalContext(telemetryChain, dynamicHandler, core, startAt) {
|
|
|
2714
2724
|
args[_i - 2] = arguments[_i];
|
|
2715
2725
|
}
|
|
2716
2726
|
if (onComplete) {
|
|
2717
|
-
_onComplete[_DYN_PUSH ]({
|
|
2727
|
+
_onComplete[_DYN_PUSH$1 ]({
|
|
2718
2728
|
func: onComplete,
|
|
2719
2729
|
self: !isUndefined(that) ? that : context.ctx,
|
|
2720
2730
|
args: args
|
|
@@ -2726,7 +2736,7 @@ function _createInternalContext(telemetryChain, dynamicHandler, core, startAt) {
|
|
|
2726
2736
|
_nextProxy = nextProxy ? nextProxy[_DYN_GET_NEXT ]() : null;
|
|
2727
2737
|
if (!nextProxy) {
|
|
2728
2738
|
var onComplete = _onComplete;
|
|
2729
|
-
if (onComplete && onComplete[_DYN_LENGTH ] > 0) {
|
|
2739
|
+
if (onComplete && onComplete[_DYN_LENGTH$2 ] > 0) {
|
|
2730
2740
|
arrForEach(onComplete, function (completeDetails) {
|
|
2731
2741
|
try {
|
|
2732
2742
|
completeDetails.func.call(completeDetails.self, completeDetails.args);
|
|
@@ -2867,7 +2877,7 @@ function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) {
|
|
|
2867
2877
|
function createTelemetryProxyChain(plugins, config, core, startAt) {
|
|
2868
2878
|
var firstProxy = null;
|
|
2869
2879
|
var add = startAt ? false : true;
|
|
2870
|
-
if (isArray(plugins) && plugins[_DYN_LENGTH ] > 0) {
|
|
2880
|
+
if (isArray(plugins) && plugins[_DYN_LENGTH$2 ] > 0) {
|
|
2871
2881
|
var lastProxy_1 = null;
|
|
2872
2882
|
arrForEach(plugins, function (thePlugin) {
|
|
2873
2883
|
if (!add && startAt === thePlugin) {
|
|
@@ -2896,7 +2906,7 @@ function createTelemetryPluginProxy(plugin, config, core) {
|
|
|
2896
2906
|
var hasSetNext = isFunction(plugin[_DYN_SET_NEXT_PLUGIN ]);
|
|
2897
2907
|
var chainId;
|
|
2898
2908
|
if (plugin) {
|
|
2899
|
-
chainId = plugin[_DYN_IDENTIFIER ] + "-" + plugin[STR_PRIORITY ] + "-" + _chainId++;
|
|
2909
|
+
chainId = plugin[_DYN_IDENTIFIER$1 ] + "-" + plugin[STR_PRIORITY ] + "-" + _chainId++;
|
|
2900
2910
|
}
|
|
2901
2911
|
else {
|
|
2902
2912
|
chainId = "Unknown-0-" + _chainId++;
|
|
@@ -2928,7 +2938,7 @@ function createTelemetryPluginProxy(plugin, config, core) {
|
|
|
2928
2938
|
}
|
|
2929
2939
|
function _processChain(itemCtx, processPluginFn, name, details, isAsync) {
|
|
2930
2940
|
var hasRun = false;
|
|
2931
|
-
var identifier = plugin ? plugin[_DYN_IDENTIFIER ] : strTelemetryPluginChain;
|
|
2941
|
+
var identifier = plugin ? plugin[_DYN_IDENTIFIER$1 ] : strTelemetryPluginChain;
|
|
2932
2942
|
var hasRunContext = itemCtx[strHasRunFlags];
|
|
2933
2943
|
if (!hasRunContext) {
|
|
2934
2944
|
hasRunContext = itemCtx[strHasRunFlags] = {};
|
|
@@ -3023,7 +3033,7 @@ function createUnloadHandlerContainer() {
|
|
|
3023
3033
|
var handlers = [];
|
|
3024
3034
|
function _addHandler(handler) {
|
|
3025
3035
|
if (handler) {
|
|
3026
|
-
handlers[_DYN_PUSH ](handler);
|
|
3036
|
+
handlers[_DYN_PUSH$1 ](handler);
|
|
3027
3037
|
}
|
|
3028
3038
|
}
|
|
3029
3039
|
function _runHandlers(unloadCtx, unloadState) {
|
|
@@ -3083,7 +3093,7 @@ var BaseTelemetryPlugin = /** @class */ (function () {
|
|
|
3083
3093
|
var _hookContainer;
|
|
3084
3094
|
_initDefaults();
|
|
3085
3095
|
dynamicProto(BaseTelemetryPlugin, _self, function (_self) {
|
|
3086
|
-
_self[_DYN_INITIALIZE ] = function (config, core, extensions, pluginChain) {
|
|
3096
|
+
_self[_DYN_INITIALIZE$1 ] = function (config, core, extensions, pluginChain) {
|
|
3087
3097
|
_setDefaults(config, core, pluginChain);
|
|
3088
3098
|
_isinitialized = true;
|
|
3089
3099
|
};
|
|
@@ -3262,7 +3272,7 @@ function _getEvtNamespace(eventName, evtNamespace) {
|
|
|
3262
3272
|
var parsedEvent = (eventNamespace.exec(eventName || STR_EMPTY$2) || []);
|
|
3263
3273
|
return _a = {},
|
|
3264
3274
|
_a[_DYN_TYPE ] = parsedEvent[1],
|
|
3265
|
-
_a.ns = ((parsedEvent[2] || STR_EMPTY$2).replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, STR_EMPTY$2)[_DYN_SPLIT ](".").sort()).join("."),
|
|
3275
|
+
_a.ns = ((parsedEvent[2] || STR_EMPTY$2).replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, STR_EMPTY$2)[_DYN_SPLIT$1 ](".").sort()).join("."),
|
|
3266
3276
|
_a;
|
|
3267
3277
|
}
|
|
3268
3278
|
function _getRegisteredEvents(target, evtName, addDefault) {
|
|
@@ -3299,14 +3309,14 @@ function _doAttach(obj, evtName, handlerRef, useCapture) {
|
|
|
3299
3309
|
return result;
|
|
3300
3310
|
}
|
|
3301
3311
|
function _doUnregister(target, events, evtName, unRegFn) {
|
|
3302
|
-
var idx = events[_DYN_LENGTH ];
|
|
3312
|
+
var idx = events[_DYN_LENGTH$2 ];
|
|
3303
3313
|
while (idx--) {
|
|
3304
3314
|
var theEvent = events[idx];
|
|
3305
3315
|
if (theEvent) {
|
|
3306
3316
|
if (!evtName.ns || evtName.ns === theEvent.evtName.ns) {
|
|
3307
3317
|
if (!unRegFn || unRegFn(theEvent)) {
|
|
3308
3318
|
_doDetach(target, theEvent.evtName, theEvent[_DYN_HANDLER ], theEvent.capture);
|
|
3309
|
-
events[_DYN_SPLICE ](idx, 1);
|
|
3319
|
+
events[_DYN_SPLICE$1 ](idx, 1);
|
|
3310
3320
|
}
|
|
3311
3321
|
}
|
|
3312
3322
|
}
|
|
@@ -3321,7 +3331,7 @@ function _unregisterEvents(target, evtName, unRegFn) {
|
|
|
3321
3331
|
objForEachKey(eventCache, function (evtType, events) {
|
|
3322
3332
|
_doUnregister(target, events, evtName, unRegFn);
|
|
3323
3333
|
});
|
|
3324
|
-
if (objKeys(eventCache)[_DYN_LENGTH ] === 0) {
|
|
3334
|
+
if (objKeys(eventCache)[_DYN_LENGTH$2 ] === 0) {
|
|
3325
3335
|
elmNodeData.kill(target, strEvents);
|
|
3326
3336
|
}
|
|
3327
3337
|
}
|
|
@@ -3335,7 +3345,7 @@ function mergeEvtNamespace(theNamespace, namespaces) {
|
|
|
3335
3345
|
else {
|
|
3336
3346
|
newNamespaces = [theNamespace, namespaces];
|
|
3337
3347
|
}
|
|
3338
|
-
newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns)[_DYN_SPLIT ](".");
|
|
3348
|
+
newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns)[_DYN_SPLIT$1 ](".");
|
|
3339
3349
|
}
|
|
3340
3350
|
else {
|
|
3341
3351
|
newNamespaces = theNamespace;
|
|
@@ -3358,7 +3368,7 @@ function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) {
|
|
|
3358
3368
|
_a[_DYN_HANDLER ] = handlerRef,
|
|
3359
3369
|
_a.capture = useCapture,
|
|
3360
3370
|
_a);
|
|
3361
|
-
_getRegisteredEvents(target, evtName.type)[_DYN_PUSH ](registeredEvent);
|
|
3371
|
+
_getRegisteredEvents(target, evtName.type)[_DYN_PUSH$1 ](registeredEvent);
|
|
3362
3372
|
}
|
|
3363
3373
|
}
|
|
3364
3374
|
catch (e) {
|
|
@@ -3413,7 +3423,7 @@ function removeEventHandler(eventName, callback, evtNamespace) {
|
|
|
3413
3423
|
}
|
|
3414
3424
|
function _addEventListeners(events, listener, excludeEvents, evtNamespace) {
|
|
3415
3425
|
var added = false;
|
|
3416
|
-
if (listener && events && events[_DYN_LENGTH ] > 0) {
|
|
3426
|
+
if (listener && events && events[_DYN_LENGTH$2 ] > 0) {
|
|
3417
3427
|
arrForEach(events, function (name) {
|
|
3418
3428
|
if (name) {
|
|
3419
3429
|
if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) {
|
|
@@ -3428,7 +3438,7 @@ function addEventListeners(events, listener, excludeEvents, evtNamespace) {
|
|
|
3428
3438
|
var added = false;
|
|
3429
3439
|
if (listener && events && isArray(events)) {
|
|
3430
3440
|
added = _addEventListeners(events, listener, excludeEvents, evtNamespace);
|
|
3431
|
-
if (!added && excludeEvents && excludeEvents[_DYN_LENGTH ] > 0) {
|
|
3441
|
+
if (!added && excludeEvents && excludeEvents[_DYN_LENGTH$2 ] > 0) {
|
|
3432
3442
|
added = _addEventListeners(events, listener, null, evtNamespace);
|
|
3433
3443
|
}
|
|
3434
3444
|
}
|
|
@@ -3494,8 +3504,14 @@ function removePageShowEventListener(listener, evtNamespace) {
|
|
|
3494
3504
|
|
|
3495
3505
|
var STR_EMPTY$1 = "";
|
|
3496
3506
|
|
|
3507
|
+
var _DYN_TIMINGS$1 = "timings";
|
|
3508
|
+
var _DYN_VALUE = "value";
|
|
3509
|
+
var _DYN_KIND = "kind";
|
|
3510
|
+
var _DYN_LENGTH$1 = "length";
|
|
3511
|
+
var _DYN_PROCESS_TELEMETRY_ST0 = "processTelemetryStart";
|
|
3512
|
+
|
|
3497
3513
|
var _a$1;
|
|
3498
|
-
var Version = '4.0.
|
|
3514
|
+
var Version = '4.0.2-nightly3.2307-25';
|
|
3499
3515
|
var FullVersionString = "1DS-Web-JS-" + Version;
|
|
3500
3516
|
var ObjHasOwnProperty = ObjProto$1.hasOwnProperty;
|
|
3501
3517
|
var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
|
|
@@ -3535,21 +3551,21 @@ function sanitizeProperty(name, property, stringifyObjects) {
|
|
|
3535
3551
|
else if (propType === "object" && !ObjHasOwnProperty.call(property, "value")) {
|
|
3536
3552
|
property = { value: stringifyObjects ? JSON.stringify(property) : property };
|
|
3537
3553
|
}
|
|
3538
|
-
else if (isNullOrUndefined(property
|
|
3539
|
-
|| property
|
|
3540
|
-
&& !isNumber(property
|
|
3541
|
-
&& !isArray(property
|
|
3554
|
+
else if (isNullOrUndefined(property[_DYN_VALUE ])
|
|
3555
|
+
|| property[_DYN_VALUE ] === STR_EMPTY$1 || (!isString(property[_DYN_VALUE ])
|
|
3556
|
+
&& !isNumber(property[_DYN_VALUE ]) && !isBoolean(property[_DYN_VALUE ])
|
|
3557
|
+
&& !isArray(property[_DYN_VALUE ]))) {
|
|
3542
3558
|
return null;
|
|
3543
3559
|
}
|
|
3544
|
-
if (isArray(property
|
|
3545
|
-
!isArrayValid(property
|
|
3560
|
+
if (isArray(property[_DYN_VALUE ]) &&
|
|
3561
|
+
!isArrayValid(property[_DYN_VALUE ])) {
|
|
3546
3562
|
return null;
|
|
3547
3563
|
}
|
|
3548
|
-
if (!isNullOrUndefined(property
|
|
3549
|
-
if (isArray(property
|
|
3564
|
+
if (!isNullOrUndefined(property[_DYN_KIND ])) {
|
|
3565
|
+
if (isArray(property[_DYN_VALUE ]) || !isValueKind(property[_DYN_KIND ])) {
|
|
3550
3566
|
return null;
|
|
3551
3567
|
}
|
|
3552
|
-
property
|
|
3568
|
+
property[_DYN_VALUE ] = property[_DYN_VALUE ].toString();
|
|
3553
3569
|
}
|
|
3554
3570
|
return property;
|
|
3555
3571
|
}
|
|
@@ -3586,7 +3602,7 @@ function extend(obj, obj2, obj3, obj4, obj5) {
|
|
|
3586
3602
|
var extended = {};
|
|
3587
3603
|
var deep = false;
|
|
3588
3604
|
var i = 0;
|
|
3589
|
-
var length = arguments
|
|
3605
|
+
var length = arguments[_DYN_LENGTH$1 ];
|
|
3590
3606
|
var theArgs = arguments;
|
|
3591
3607
|
if (isBoolean(theArgs[0])) {
|
|
3592
3608
|
deep = theArgs[0];
|
|
@@ -3632,13 +3648,13 @@ function isDataType(value) {
|
|
|
3632
3648
|
return false;
|
|
3633
3649
|
}
|
|
3634
3650
|
function isArrayValid(value) {
|
|
3635
|
-
return value
|
|
3651
|
+
return value[_DYN_LENGTH$1 ] > 0;
|
|
3636
3652
|
}
|
|
3637
3653
|
function setProcessTelemetryTimings(event, identifier) {
|
|
3638
3654
|
var evt = event;
|
|
3639
|
-
evt
|
|
3640
|
-
evt
|
|
3641
|
-
evt
|
|
3655
|
+
evt[_DYN_TIMINGS$1 ] = evt[_DYN_TIMINGS$1 ] || {};
|
|
3656
|
+
evt[_DYN_TIMINGS$1 ][_DYN_PROCESS_TELEMETRY_ST0 ] = evt[_DYN_TIMINGS$1 ][_DYN_PROCESS_TELEMETRY_ST0 ] || {};
|
|
3657
|
+
evt[_DYN_TIMINGS$1 ][_DYN_PROCESS_TELEMETRY_ST0 ][identifier] = getTime();
|
|
3642
3658
|
}
|
|
3643
3659
|
function getFieldValueType(value) {
|
|
3644
3660
|
var theType = 0 ;
|
|
@@ -3657,12 +3673,12 @@ function getFieldValueType(value) {
|
|
|
3657
3673
|
theType = 4 ;
|
|
3658
3674
|
if (isArray(value)) {
|
|
3659
3675
|
theType = 4096 ;
|
|
3660
|
-
if (value
|
|
3676
|
+
if (value[_DYN_LENGTH$1 ] > 0) {
|
|
3661
3677
|
theType |= getFieldValueType(value[0]);
|
|
3662
3678
|
}
|
|
3663
3679
|
}
|
|
3664
3680
|
else if (ObjHasOwnProperty.call(value, "value")) {
|
|
3665
|
-
theType = 8192 | getFieldValueType(value
|
|
3681
|
+
theType = 8192 | getFieldValueType(value[_DYN_VALUE ]);
|
|
3666
3682
|
}
|
|
3667
3683
|
}
|
|
3668
3684
|
}
|
|
@@ -3701,10 +3717,6 @@ function isGreaterThanZero(value) {
|
|
|
3701
3717
|
return value > 0;
|
|
3702
3718
|
}
|
|
3703
3719
|
|
|
3704
|
-
var RT_PROFILE = "REAL_TIME";
|
|
3705
|
-
var NRT_PROFILE = "NEAR_REAL_TIME";
|
|
3706
|
-
var BE_PROFILE = "BEST_EFFORT";
|
|
3707
|
-
|
|
3708
3720
|
var STR_EMPTY = "";
|
|
3709
3721
|
var STR_POST_METHOD = "POST";
|
|
3710
3722
|
var STR_DISABLED_PROPERTY_NAME = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
|
|
@@ -3733,6 +3745,75 @@ var STR_MSFPC = "msfpc";
|
|
|
3733
3745
|
var STR_TRACE = "trace";
|
|
3734
3746
|
var STR_USER = "user";
|
|
3735
3747
|
|
|
3748
|
+
var _DYN_ALLOW_REQUEST_SENDIN0 = "allowRequestSending";
|
|
3749
|
+
var _DYN_FIRST_REQUEST_SENT = "firstRequestSent";
|
|
3750
|
+
var _DYN_SHOULD_ADD_CLOCK_SKE1 = "shouldAddClockSkewHeaders";
|
|
3751
|
+
var _DYN_GET_CLOCK_SKEW_HEADE2 = "getClockSkewHeaderValue";
|
|
3752
|
+
var _DYN_SET_CLOCK_SKEW = "setClockSkew";
|
|
3753
|
+
var _DYN_DATA = "data";
|
|
3754
|
+
var _DYN_LENGTH = "length";
|
|
3755
|
+
var _DYN_CONCAT = "concat";
|
|
3756
|
+
var _DYN_I_KEY = "iKey";
|
|
3757
|
+
var _DYN_COUNT = "count";
|
|
3758
|
+
var _DYN_EVENTS = "events";
|
|
3759
|
+
var _DYN_PUSH = "push";
|
|
3760
|
+
var _DYN_SPLIT = "split";
|
|
3761
|
+
var _DYN_SPLICE = "splice";
|
|
3762
|
+
var _DYN_TO_LOWER_CASE = "toLowerCase";
|
|
3763
|
+
var _DYN_HDRS = "hdrs";
|
|
3764
|
+
var _DYN_USE_HDRS = "useHdrs";
|
|
3765
|
+
var _DYN_INITIALIZE = "initialize";
|
|
3766
|
+
var _DYN_SET_TIMEOUT_OVERRIDE = "setTimeoutOverride";
|
|
3767
|
+
var _DYN_CLEAR_TIMEOUT_OVERRI3 = "clearTimeoutOverride";
|
|
3768
|
+
var _DYN_PAYLOAD_PREPROCESSOR = "payloadPreprocessor";
|
|
3769
|
+
var _DYN_OVERRIDE_ENDPOINT_UR4 = "overrideEndpointUrl";
|
|
3770
|
+
var _DYN_AVOID_OPTIONS = "avoidOptions";
|
|
3771
|
+
var _DYN_DISABLE_EVENT_TIMING5 = "disableEventTimings";
|
|
3772
|
+
var _DYN_STRINGIFY_OBJECTS = "stringifyObjects";
|
|
3773
|
+
var _DYN_ENABLE_COMPOUND_KEY = "enableCompoundKey";
|
|
3774
|
+
var _DYN_DISABLE_XHR_SYNC = "disableXhrSync";
|
|
3775
|
+
var _DYN_DISABLE_FETCH_KEEP_A6 = "disableFetchKeepAlive";
|
|
3776
|
+
var _DYN_USE_SEND_BEACON = "useSendBeacon";
|
|
3777
|
+
var _DYN_ALWAYS_USE_XHR_OVERR7 = "alwaysUseXhrOverride";
|
|
3778
|
+
var _DYN_UNLOAD_TRANSPORTS = "unloadTransports";
|
|
3779
|
+
var _DYN_URL_STRING = "urlString";
|
|
3780
|
+
var _DYN_TIMEOUT = "timeout";
|
|
3781
|
+
var _DYN_ONTIMEOUT = "ontimeout";
|
|
3782
|
+
var _DYN__SEND_REASON = "_sendReason";
|
|
3783
|
+
var _DYN_HEADERS = "headers";
|
|
3784
|
+
var _DYN_GET_RESPONSE_HEADER = "getResponseHeader";
|
|
3785
|
+
var _DYN_GET_ALL_RESPONSE_HEA8 = "getAllResponseHeaders";
|
|
3786
|
+
var _DYN__THE_PAYLOAD = "_thePayload";
|
|
3787
|
+
var _DYN_BATCHES = "batches";
|
|
3788
|
+
var _DYN_SEND_TYPE = "sendType";
|
|
3789
|
+
var _DYN_CAN_SEND_REQUEST = "canSendRequest";
|
|
3790
|
+
var _DYN_SEND_QUEUED_REQUESTS = "sendQueuedRequests";
|
|
3791
|
+
var _DYN_IS_COMPLETELY_IDLE = "isCompletelyIdle";
|
|
3792
|
+
var _DYN_SET_UNLOADING = "setUnloading";
|
|
3793
|
+
var _DYN_IS_TENANT_KILLED = "isTenantKilled";
|
|
3794
|
+
var _DYN_SEND_SYNCHRONOUS_BAT9 = "sendSynchronousBatch";
|
|
3795
|
+
var _DYN__TRANSPORT = "_transport";
|
|
3796
|
+
var _DYN_GET_WPARAM = "getWParam";
|
|
3797
|
+
var _DYN_IS_BEACON = "isBeacon";
|
|
3798
|
+
var _DYN_TIMINGS = "timings";
|
|
3799
|
+
var _DYN_IS_TEARDOWN = "isTeardown";
|
|
3800
|
+
var _DYN_IS_SYNC = "isSync";
|
|
3801
|
+
var _DYN_SEND_POST = "sendPOST";
|
|
3802
|
+
var _DYN_SET_KILL_SWITCH_TENA10 = "setKillSwitchTenants";
|
|
3803
|
+
var _DYN__BACK_OFF_TRANSMISSI11 = "_backOffTransmission";
|
|
3804
|
+
var _DYN_IDENTIFIER = "identifier";
|
|
3805
|
+
var _DYN_DISABLE_OPTIMIZE_OBJ = "disableOptimizeObj";
|
|
3806
|
+
var _DYN_IGNORE_MC1_MS0_COOKI12 = "ignoreMc1Ms0CookieProcessing";
|
|
3807
|
+
var _DYN_EVENTS_LIMIT_IN_MEM = "eventsLimitInMem";
|
|
3808
|
+
var _DYN_AUTO_FLUSH_EVENTS_LI13 = "autoFlushEventsLimit";
|
|
3809
|
+
var _DYN_DISABLE_AUTO_BATCH_F14 = "disableAutoBatchFlushLimit";
|
|
3810
|
+
var _DYN_OVERRIDE_INSTRUMENTA15 = "overrideInstrumentationKey";
|
|
3811
|
+
var _DYN_DISABLE_TELEMETRY = "disableTelemetry";
|
|
3812
|
+
var _DYN_SEND_ATTEMPT = "sendAttempt";
|
|
3813
|
+
var _DYN_LATENCY = "latency";
|
|
3814
|
+
var _DYN_BASE_DATA = "baseData";
|
|
3815
|
+
var _DYN_SYNC = "sync";
|
|
3816
|
+
|
|
3736
3817
|
function _getEventMsfpc(theEvent) {
|
|
3737
3818
|
var intWeb = ((theEvent.ext || {})["intweb"]);
|
|
3738
3819
|
if (intWeb && isValueAssigned(intWeb[STR_MSFPC])) {
|
|
@@ -3742,31 +3823,31 @@ function _getEventMsfpc(theEvent) {
|
|
|
3742
3823
|
}
|
|
3743
3824
|
function _getMsfpc(theEvents) {
|
|
3744
3825
|
var msfpc = null;
|
|
3745
|
-
for (var lp = 0; msfpc === null && lp < theEvents
|
|
3826
|
+
for (var lp = 0; msfpc === null && lp < theEvents[_DYN_LENGTH ]; lp++) {
|
|
3746
3827
|
msfpc = _getEventMsfpc(theEvents[lp]);
|
|
3747
3828
|
}
|
|
3748
3829
|
return msfpc;
|
|
3749
3830
|
}
|
|
3750
3831
|
var EventBatch = /** @class */ (function () {
|
|
3751
3832
|
function EventBatch(iKey, addEvents) {
|
|
3752
|
-
var events = addEvents ? []
|
|
3833
|
+
var events = addEvents ? [][_DYN_CONCAT ](addEvents) : [];
|
|
3753
3834
|
var _self = this;
|
|
3754
3835
|
var _msfpc = _getMsfpc(events);
|
|
3755
|
-
_self
|
|
3836
|
+
_self[_DYN_I_KEY ] = function () {
|
|
3756
3837
|
return iKey;
|
|
3757
3838
|
};
|
|
3758
3839
|
_self.Msfpc = function () {
|
|
3759
3840
|
return _msfpc || STR_EMPTY;
|
|
3760
3841
|
};
|
|
3761
|
-
_self
|
|
3762
|
-
return events
|
|
3842
|
+
_self[_DYN_COUNT ] = function () {
|
|
3843
|
+
return events[_DYN_LENGTH ];
|
|
3763
3844
|
};
|
|
3764
|
-
_self
|
|
3845
|
+
_self[_DYN_EVENTS ] = function () {
|
|
3765
3846
|
return events;
|
|
3766
3847
|
};
|
|
3767
3848
|
_self.addEvent = function (theEvent) {
|
|
3768
3849
|
if (theEvent) {
|
|
3769
|
-
events
|
|
3850
|
+
events[_DYN_PUSH ](theEvent);
|
|
3770
3851
|
if (!_msfpc) {
|
|
3771
3852
|
_msfpc = _getEventMsfpc(theEvent);
|
|
3772
3853
|
}
|
|
@@ -3774,14 +3855,14 @@ var EventBatch = /** @class */ (function () {
|
|
|
3774
3855
|
}
|
|
3775
3856
|
return false;
|
|
3776
3857
|
};
|
|
3777
|
-
_self
|
|
3858
|
+
_self[_DYN_SPLIT ] = function (fromEvent, numEvents) {
|
|
3778
3859
|
var theEvents;
|
|
3779
|
-
if (fromEvent < events
|
|
3780
|
-
var cnt = events
|
|
3860
|
+
if (fromEvent < events[_DYN_LENGTH ]) {
|
|
3861
|
+
var cnt = events[_DYN_LENGTH ] - fromEvent;
|
|
3781
3862
|
if (!isNullOrUndefined(numEvents)) {
|
|
3782
3863
|
cnt = numEvents < cnt ? numEvents : cnt;
|
|
3783
3864
|
}
|
|
3784
|
-
theEvents = events
|
|
3865
|
+
theEvents = events[_DYN_SPLICE ](fromEvent, cnt);
|
|
3785
3866
|
_msfpc = _getMsfpc(events);
|
|
3786
3867
|
}
|
|
3787
3868
|
return new EventBatch(iKey, theEvents);
|
|
@@ -3801,10 +3882,10 @@ var ClockSkewManager = /** @class */ (function () {
|
|
|
3801
3882
|
var _clockSkewHeaderValue = "use-collector-delta";
|
|
3802
3883
|
var _clockSkewSet = false;
|
|
3803
3884
|
dynamicProto(ClockSkewManager, this, function (_self) {
|
|
3804
|
-
_self
|
|
3885
|
+
_self[_DYN_ALLOW_REQUEST_SENDIN0 ] = function () {
|
|
3805
3886
|
return _allowRequestSending;
|
|
3806
3887
|
};
|
|
3807
|
-
_self
|
|
3888
|
+
_self[_DYN_FIRST_REQUEST_SENT ] = function () {
|
|
3808
3889
|
if (_isFirstRequest) {
|
|
3809
3890
|
_isFirstRequest = false;
|
|
3810
3891
|
if (!_clockSkewSet) {
|
|
@@ -3812,13 +3893,13 @@ var ClockSkewManager = /** @class */ (function () {
|
|
|
3812
3893
|
}
|
|
3813
3894
|
}
|
|
3814
3895
|
};
|
|
3815
|
-
_self
|
|
3896
|
+
_self[_DYN_SHOULD_ADD_CLOCK_SKE1 ] = function () {
|
|
3816
3897
|
return _shouldAddClockSkewHeaders;
|
|
3817
3898
|
};
|
|
3818
|
-
_self
|
|
3899
|
+
_self[_DYN_GET_CLOCK_SKEW_HEADE2 ] = function () {
|
|
3819
3900
|
return _clockSkewHeaderValue;
|
|
3820
3901
|
};
|
|
3821
|
-
_self
|
|
3902
|
+
_self[_DYN_SET_CLOCK_SKEW ] = function (timeDeltaInMillis) {
|
|
3822
3903
|
if (!_clockSkewSet) {
|
|
3823
3904
|
if (timeDeltaInMillis) {
|
|
3824
3905
|
_clockSkewHeaderValue = timeDeltaInMillis;
|
|
@@ -3845,21 +3926,21 @@ var KillSwitch = /** @class */ (function () {
|
|
|
3845
3926
|
var result = [];
|
|
3846
3927
|
if (values) {
|
|
3847
3928
|
arrForEach(values, function (value) {
|
|
3848
|
-
result
|
|
3929
|
+
result[_DYN_PUSH ](strTrim(value));
|
|
3849
3930
|
});
|
|
3850
3931
|
}
|
|
3851
3932
|
return result;
|
|
3852
3933
|
}
|
|
3853
3934
|
dynamicProto(KillSwitch, this, function (_self) {
|
|
3854
|
-
_self
|
|
3935
|
+
_self[_DYN_SET_KILL_SWITCH_TENA10 ] = function (killTokens, killDuration) {
|
|
3855
3936
|
if (killTokens && killDuration) {
|
|
3856
3937
|
try {
|
|
3857
|
-
var killedTokens = _normalizeTenants(killTokens
|
|
3938
|
+
var killedTokens = _normalizeTenants(killTokens[_DYN_SPLIT ](","));
|
|
3858
3939
|
if (killDuration === "this-request-only") {
|
|
3859
3940
|
return killedTokens;
|
|
3860
3941
|
}
|
|
3861
3942
|
var durationMs = parseInt(killDuration, 10) * SecToMsMultiplier;
|
|
3862
|
-
for (var i = 0; i < killedTokens
|
|
3943
|
+
for (var i = 0; i < killedTokens[_DYN_LENGTH ]; ++i) {
|
|
3863
3944
|
_killedTokenDictionary[killedTokens[i]] = utcNow() + durationMs;
|
|
3864
3945
|
}
|
|
3865
3946
|
}
|
|
@@ -3869,7 +3950,7 @@ var KillSwitch = /** @class */ (function () {
|
|
|
3869
3950
|
}
|
|
3870
3951
|
return [];
|
|
3871
3952
|
};
|
|
3872
|
-
_self
|
|
3953
|
+
_self[_DYN_IS_TENANT_KILLED ] = function (tenantToken) {
|
|
3873
3954
|
var killDictionary = _killedTokenDictionary;
|
|
3874
3955
|
var name = strTrim(tenantToken);
|
|
3875
3956
|
if (killDictionary[name] !== undefined && killDictionary[name] > utcNow()) {
|
|
@@ -3992,10 +4073,10 @@ var Serializer = /** @class */ (function () {
|
|
|
3992
4073
|
}
|
|
3993
4074
|
lp++;
|
|
3994
4075
|
}
|
|
3995
|
-
if (sizeExceeded
|
|
4076
|
+
if (sizeExceeded.length > 0) {
|
|
3996
4077
|
payload.sizeExceed.push(EventBatch.create(theBatch.iKey(), sizeExceeded));
|
|
3997
4078
|
}
|
|
3998
|
-
if (failedEvts
|
|
4079
|
+
if (failedEvts.length > 0) {
|
|
3999
4080
|
payload.failedEvts.push(EventBatch.create(theBatch.iKey(), failedEvts));
|
|
4000
4081
|
}
|
|
4001
4082
|
if (eventsAdded) {
|
|
@@ -4163,7 +4244,7 @@ function createTimeoutWrapper(argSetTimeout, argClearTimeout) {
|
|
|
4163
4244
|
var _a;
|
|
4164
4245
|
var strSendAttempt = "sendAttempt";
|
|
4165
4246
|
var _noResponseQs = "&" + STR_NO_RESPONSE_BODY + "=true";
|
|
4166
|
-
var UrlQueryString = "?cors=true&" + STR_CONTENT_TYPE_HEADER
|
|
4247
|
+
var UrlQueryString = "?cors=true&" + STR_CONTENT_TYPE_HEADER[_DYN_TO_LOWER_CASE ]() + "=" + DEFAULT_CONTENT_TYPE;
|
|
4167
4248
|
var _eventActionMap = (_a = {},
|
|
4168
4249
|
_a[1 ] = STR_REQUEUE,
|
|
4169
4250
|
_a[100 ] = STR_REQUEUE,
|
|
@@ -4198,12 +4279,12 @@ function _hasHeader(headers, header) {
|
|
|
4198
4279
|
var hasHeader = false;
|
|
4199
4280
|
if (headers && header) {
|
|
4200
4281
|
var keys = objKeys(headers);
|
|
4201
|
-
if (keys && keys
|
|
4202
|
-
var lowerHeader = header
|
|
4203
|
-
for (var lp = 0; lp < keys
|
|
4282
|
+
if (keys && keys[_DYN_LENGTH ] > 0) {
|
|
4283
|
+
var lowerHeader = header[_DYN_TO_LOWER_CASE ]();
|
|
4284
|
+
for (var lp = 0; lp < keys[_DYN_LENGTH ]; lp++) {
|
|
4204
4285
|
var value = keys[lp];
|
|
4205
4286
|
if (value && objHasOwnProperty(header, value) &&
|
|
4206
|
-
value
|
|
4287
|
+
value[_DYN_TO_LOWER_CASE ]() === lowerHeader) {
|
|
4207
4288
|
hasHeader = true;
|
|
4208
4289
|
break;
|
|
4209
4290
|
}
|
|
@@ -4213,10 +4294,10 @@ function _hasHeader(headers, header) {
|
|
|
4213
4294
|
return hasHeader;
|
|
4214
4295
|
}
|
|
4215
4296
|
function _addRequestDetails(details, name, value, useHeaders) {
|
|
4216
|
-
if (name && value && value
|
|
4297
|
+
if (name && value && value[_DYN_LENGTH ] > 0) {
|
|
4217
4298
|
if (useHeaders && _collectorQsHeaders[name]) {
|
|
4218
|
-
details
|
|
4219
|
-
details
|
|
4299
|
+
details[_DYN_HDRS ][_collectorQsHeaders[name]] = value;
|
|
4300
|
+
details[_DYN_USE_HDRS ] = true;
|
|
4220
4301
|
}
|
|
4221
4302
|
else {
|
|
4222
4303
|
details.url += "&" + name + "=" + value;
|
|
@@ -4226,27 +4307,27 @@ function _addRequestDetails(details, name, value, useHeaders) {
|
|
|
4226
4307
|
function _prependTransports(theTransports, newTransports) {
|
|
4227
4308
|
if (newTransports) {
|
|
4228
4309
|
if (isNumber(newTransports)) {
|
|
4229
|
-
theTransports = [newTransports]
|
|
4310
|
+
theTransports = [newTransports][_DYN_CONCAT ](theTransports);
|
|
4230
4311
|
}
|
|
4231
4312
|
else if (isArray(newTransports)) {
|
|
4232
|
-
theTransports = newTransports
|
|
4313
|
+
theTransports = newTransports[_DYN_CONCAT ](theTransports);
|
|
4233
4314
|
}
|
|
4234
4315
|
}
|
|
4235
4316
|
return theTransports;
|
|
4236
4317
|
}
|
|
4237
4318
|
function _addQueryStringParameter(qsParams, name, value) {
|
|
4238
|
-
for (var i = 0; i < qsParams
|
|
4319
|
+
for (var i = 0; i < qsParams[_DYN_LENGTH ]; i++) {
|
|
4239
4320
|
if (qsParams[i].name === name) {
|
|
4240
4321
|
qsParams[i].value = value;
|
|
4241
4322
|
return;
|
|
4242
4323
|
}
|
|
4243
4324
|
}
|
|
4244
|
-
qsParams
|
|
4325
|
+
qsParams[_DYN_PUSH ]({ name: name, value: value });
|
|
4245
4326
|
}
|
|
4246
4327
|
function _removeQueryStringParameter(qsParams, name) {
|
|
4247
|
-
for (var i = 0; i < qsParams
|
|
4328
|
+
for (var i = 0; i < qsParams[_DYN_LENGTH ]; i++) {
|
|
4248
4329
|
if (qsParams[i].name === name) {
|
|
4249
|
-
qsParams
|
|
4330
|
+
qsParams[_DYN_SPLICE ](i, 1);
|
|
4250
4331
|
return;
|
|
4251
4332
|
}
|
|
4252
4333
|
}
|
|
@@ -4286,7 +4367,7 @@ var HttpManager = /** @class */ (function () {
|
|
|
4286
4367
|
dynamicProto(HttpManager, this, function (_self) {
|
|
4287
4368
|
_initDefaults();
|
|
4288
4369
|
var _sendCredentials = true;
|
|
4289
|
-
_self
|
|
4370
|
+
_self[_DYN_INITIALIZE ] = function (theConfig, core, postChannel) {
|
|
4290
4371
|
if (!_isInitialized) {
|
|
4291
4372
|
_core = core;
|
|
4292
4373
|
_cookieMgr = core.getCookieMgr();
|
|
@@ -4296,43 +4377,43 @@ var HttpManager = /** @class */ (function () {
|
|
|
4296
4377
|
var _a;
|
|
4297
4378
|
var coreConfig = details.cfg;
|
|
4298
4379
|
var channelConfig = details.cfg.extensionConfig[postChannel.identifier];
|
|
4299
|
-
_timeoutWrapper = createTimeoutWrapper(channelConfig
|
|
4380
|
+
_timeoutWrapper = createTimeoutWrapper(channelConfig[_DYN_SET_TIMEOUT_OVERRIDE ], channelConfig[_DYN_CLEAR_TIMEOUT_OVERRI3 ]);
|
|
4300
4381
|
if (isValueAssigned(coreConfig.anonCookieName)) {
|
|
4301
4382
|
_addQueryStringParameter(_queryStringParameters, "anoncknm", coreConfig.anonCookieName);
|
|
4302
4383
|
}
|
|
4303
4384
|
else {
|
|
4304
4385
|
_removeQueryStringParameter(_queryStringParameters, "anoncknm");
|
|
4305
4386
|
}
|
|
4306
|
-
_sendHook = channelConfig
|
|
4387
|
+
_sendHook = channelConfig[_DYN_PAYLOAD_PREPROCESSOR ];
|
|
4307
4388
|
_sendListener = channelConfig.payloadListener;
|
|
4308
4389
|
var httpInterface = channelConfig.httpXHROverride;
|
|
4309
|
-
var endpointUrl = channelConfig
|
|
4390
|
+
var endpointUrl = channelConfig[_DYN_OVERRIDE_ENDPOINT_UR4 ] ? channelConfig[_DYN_OVERRIDE_ENDPOINT_UR4 ] : coreConfig.endpointUrl;
|
|
4310
4391
|
_urlString = endpointUrl + UrlQueryString;
|
|
4311
|
-
_useHeaders = !isUndefined(channelConfig
|
|
4312
|
-
_enableEventTimings = !channelConfig
|
|
4392
|
+
_useHeaders = !isUndefined(channelConfig[_DYN_AVOID_OPTIONS ]) ? !channelConfig[_DYN_AVOID_OPTIONS ] : true;
|
|
4393
|
+
_enableEventTimings = !channelConfig[_DYN_DISABLE_EVENT_TIMING5 ];
|
|
4313
4394
|
var valueSanitizer = channelConfig.valueSanitizer;
|
|
4314
|
-
var stringifyObjects = channelConfig
|
|
4315
|
-
var enableCompoundKey = !!coreConfig
|
|
4316
|
-
if (!isUndefined(channelConfig
|
|
4317
|
-
enableCompoundKey = !!channelConfig
|
|
4395
|
+
var stringifyObjects = channelConfig[_DYN_STRINGIFY_OBJECTS ];
|
|
4396
|
+
var enableCompoundKey = !!coreConfig[_DYN_ENABLE_COMPOUND_KEY ];
|
|
4397
|
+
if (!isUndefined(channelConfig[_DYN_ENABLE_COMPOUND_KEY ])) {
|
|
4398
|
+
enableCompoundKey = !!channelConfig[_DYN_ENABLE_COMPOUND_KEY ];
|
|
4318
4399
|
}
|
|
4319
4400
|
_xhrTimeout = channelConfig.xhrTimeout;
|
|
4320
|
-
_disableXhrSync = !!channelConfig
|
|
4321
|
-
_disableFetchKeepAlive = !!channelConfig
|
|
4401
|
+
_disableXhrSync = !!channelConfig[_DYN_DISABLE_XHR_SYNC ];
|
|
4402
|
+
_disableFetchKeepAlive = !!channelConfig[_DYN_DISABLE_FETCH_KEEP_A6 ];
|
|
4322
4403
|
_addNoResponse = channelConfig.addNoResponse !== false;
|
|
4323
4404
|
_useBeacons = !isReactNative();
|
|
4324
4405
|
_serializer = new Serializer(_core, valueSanitizer, stringifyObjects, enableCompoundKey);
|
|
4325
|
-
if (!isNullOrUndefined(channelConfig
|
|
4326
|
-
_useBeacons = !!channelConfig
|
|
4406
|
+
if (!isNullOrUndefined(channelConfig[_DYN_USE_SEND_BEACON ])) {
|
|
4407
|
+
_useBeacons = !!channelConfig[_DYN_USE_SEND_BEACON ];
|
|
4327
4408
|
}
|
|
4328
4409
|
var syncHttpInterface = httpInterface;
|
|
4329
|
-
var beaconHttpInterface = channelConfig
|
|
4330
|
-
var fetchSyncHttpInterface = channelConfig
|
|
4410
|
+
var beaconHttpInterface = channelConfig[_DYN_ALWAYS_USE_XHR_OVERR7 ] ? httpInterface : null;
|
|
4411
|
+
var fetchSyncHttpInterface = channelConfig[_DYN_ALWAYS_USE_XHR_OVERR7 ] ? httpInterface : null;
|
|
4331
4412
|
var beaconUnloadTransports = [3 , 2 ];
|
|
4332
4413
|
if (!httpInterface) {
|
|
4333
4414
|
_customHttpInterface = false;
|
|
4334
4415
|
var location_1 = getLocation();
|
|
4335
|
-
if (location_1 && location_1.protocol && location_1.protocol
|
|
4416
|
+
if (location_1 && location_1.protocol && location_1.protocol[_DYN_TO_LOWER_CASE ]() === "file:") {
|
|
4336
4417
|
_sendCredentials = false;
|
|
4337
4418
|
}
|
|
4338
4419
|
var theTransports = [];
|
|
@@ -4351,7 +4432,7 @@ var HttpManager = /** @class */ (function () {
|
|
|
4351
4432
|
syncHttpInterface = _getSenderInterface(theTransports, true);
|
|
4352
4433
|
}
|
|
4353
4434
|
if (!beaconHttpInterface) {
|
|
4354
|
-
beaconUnloadTransports = _prependTransports(beaconUnloadTransports, channelConfig
|
|
4435
|
+
beaconUnloadTransports = _prependTransports(beaconUnloadTransports, channelConfig[_DYN_UNLOAD_TRANSPORTS ]);
|
|
4355
4436
|
beaconHttpInterface = _getSenderInterface(beaconUnloadTransports, true);
|
|
4356
4437
|
}
|
|
4357
4438
|
_canHaveReducedPayload = !_customHttpInterface && ((_useBeacons && isBeaconsSupported()) || (!_disableFetchKeepAlive && isFetchSupported(true)));
|
|
@@ -4366,12 +4447,12 @@ var HttpManager = /** @class */ (function () {
|
|
|
4366
4447
|
}
|
|
4367
4448
|
};
|
|
4368
4449
|
_self.addResponseHandler = function (responseHandler) {
|
|
4369
|
-
_responseHandlers
|
|
4450
|
+
_responseHandlers[_DYN_PUSH ](responseHandler);
|
|
4370
4451
|
return {
|
|
4371
4452
|
rm: function () {
|
|
4372
4453
|
var index = _responseHandlers.indexOf(responseHandler);
|
|
4373
4454
|
if (index >= 0) {
|
|
4374
|
-
_responseHandlers
|
|
4455
|
+
_responseHandlers[_DYN_SPLICE ](index, 1);
|
|
4375
4456
|
}
|
|
4376
4457
|
}
|
|
4377
4458
|
};
|
|
@@ -4380,7 +4461,7 @@ var HttpManager = /** @class */ (function () {
|
|
|
4380
4461
|
var transportType = 0 ;
|
|
4381
4462
|
var sendPostFunc = null;
|
|
4382
4463
|
var lp = 0;
|
|
4383
|
-
while (sendPostFunc == null && lp < transports
|
|
4464
|
+
while (sendPostFunc == null && lp < transports[_DYN_LENGTH ]) {
|
|
4384
4465
|
transportType = transports[lp];
|
|
4385
4466
|
if (transportType === 1 ) {
|
|
4386
4467
|
if (useXDomainRequest()) {
|
|
@@ -4412,9 +4493,9 @@ var HttpManager = /** @class */ (function () {
|
|
|
4412
4493
|
};
|
|
4413
4494
|
function _xdrSendPost(payload, oncomplete, sync) {
|
|
4414
4495
|
var xdr = new XDomainRequest();
|
|
4415
|
-
xdr.open(STR_POST_METHOD, payload
|
|
4416
|
-
if (payload
|
|
4417
|
-
xdr
|
|
4496
|
+
xdr.open(STR_POST_METHOD, payload[_DYN_URL_STRING ]);
|
|
4497
|
+
if (payload[_DYN_TIMEOUT ]) {
|
|
4498
|
+
xdr[_DYN_TIMEOUT ] = payload[_DYN_TIMEOUT ];
|
|
4418
4499
|
}
|
|
4419
4500
|
xdr.onload = function () {
|
|
4420
4501
|
var response = _getResponseText(xdr);
|
|
@@ -4424,16 +4505,16 @@ var HttpManager = /** @class */ (function () {
|
|
|
4424
4505
|
xdr.onerror = function () {
|
|
4425
4506
|
_doOnComplete(oncomplete, 400, {});
|
|
4426
4507
|
};
|
|
4427
|
-
xdr
|
|
4508
|
+
xdr[_DYN_ONTIMEOUT ] = function () {
|
|
4428
4509
|
_doOnComplete(oncomplete, 500, {});
|
|
4429
4510
|
};
|
|
4430
4511
|
xdr.onprogress = function () { };
|
|
4431
4512
|
if (sync) {
|
|
4432
|
-
xdr.send(payload
|
|
4513
|
+
xdr.send(payload[_DYN_DATA ]);
|
|
4433
4514
|
}
|
|
4434
4515
|
else {
|
|
4435
4516
|
_timeoutWrapper.set(function () {
|
|
4436
|
-
xdr.send(payload
|
|
4517
|
+
xdr.send(payload[_DYN_DATA ]);
|
|
4437
4518
|
}, 0);
|
|
4438
4519
|
}
|
|
4439
4520
|
}
|
|
@@ -4472,18 +4553,18 @@ var HttpManager = /** @class */ (function () {
|
|
|
4472
4553
|
}
|
|
4473
4554
|
function _fetchSendPost(payload, oncomplete, sync) {
|
|
4474
4555
|
var _a;
|
|
4475
|
-
var theUrl = payload
|
|
4556
|
+
var theUrl = payload[_DYN_URL_STRING ];
|
|
4476
4557
|
var ignoreResponse = false;
|
|
4477
4558
|
var responseHandled = false;
|
|
4478
4559
|
var requestInit = (_a = {
|
|
4479
|
-
body: payload
|
|
4560
|
+
body: payload[_DYN_DATA ],
|
|
4480
4561
|
method: STR_POST_METHOD
|
|
4481
4562
|
},
|
|
4482
4563
|
_a[STR_DISABLED_PROPERTY_NAME] = true,
|
|
4483
4564
|
_a);
|
|
4484
4565
|
if (sync) {
|
|
4485
4566
|
requestInit.keepalive = true;
|
|
4486
|
-
if (payload
|
|
4567
|
+
if (payload[_DYN__SEND_REASON ] === 2 ) {
|
|
4487
4568
|
ignoreResponse = true;
|
|
4488
4569
|
if (_addNoResponse) {
|
|
4489
4570
|
theUrl += _noResponseQs;
|
|
@@ -4493,13 +4574,13 @@ var HttpManager = /** @class */ (function () {
|
|
|
4493
4574
|
if (_sendCredentials) {
|
|
4494
4575
|
requestInit.credentials = "include";
|
|
4495
4576
|
}
|
|
4496
|
-
if (payload.headers && objKeys(payload.headers)
|
|
4497
|
-
requestInit
|
|
4577
|
+
if (payload.headers && objKeys(payload.headers)[_DYN_LENGTH ] > 0) {
|
|
4578
|
+
requestInit[_DYN_HEADERS ] = payload[_DYN_HEADERS ];
|
|
4498
4579
|
}
|
|
4499
4580
|
fetch(theUrl, requestInit).then(function (response) {
|
|
4500
4581
|
var headerMap = {};
|
|
4501
4582
|
var responseText = STR_EMPTY;
|
|
4502
|
-
var headers = response
|
|
4583
|
+
var headers = response[_DYN_HEADERS ];
|
|
4503
4584
|
if (headers) {
|
|
4504
4585
|
headers["forEach"](function (value, name) {
|
|
4505
4586
|
headerMap[name] = value;
|
|
@@ -4525,20 +4606,20 @@ var HttpManager = /** @class */ (function () {
|
|
|
4525
4606
|
responseHandled = true;
|
|
4526
4607
|
_doOnComplete(oncomplete, 200, {});
|
|
4527
4608
|
}
|
|
4528
|
-
if (!responseHandled && payload
|
|
4609
|
+
if (!responseHandled && payload[_DYN_TIMEOUT ] > 0) {
|
|
4529
4610
|
_timeoutWrapper.set(function () {
|
|
4530
4611
|
if (!responseHandled) {
|
|
4531
4612
|
responseHandled = true;
|
|
4532
4613
|
_doOnComplete(oncomplete, 500, {});
|
|
4533
4614
|
}
|
|
4534
|
-
}, payload
|
|
4615
|
+
}, payload[_DYN_TIMEOUT ]);
|
|
4535
4616
|
}
|
|
4536
4617
|
}
|
|
4537
4618
|
function _xhrSendPost(payload, oncomplete, sync) {
|
|
4538
|
-
var theUrl = payload
|
|
4619
|
+
var theUrl = payload[_DYN_URL_STRING ];
|
|
4539
4620
|
function _appendHeader(theHeaders, xhr, name) {
|
|
4540
|
-
if (!theHeaders[name] && xhr && xhr
|
|
4541
|
-
var value = xhr
|
|
4621
|
+
if (!theHeaders[name] && xhr && xhr[_DYN_GET_RESPONSE_HEADER ]) {
|
|
4622
|
+
var value = xhr[_DYN_GET_RESPONSE_HEADER ](name);
|
|
4542
4623
|
if (value) {
|
|
4543
4624
|
theHeaders[name] = strTrim(value);
|
|
4544
4625
|
}
|
|
@@ -4547,24 +4628,24 @@ var HttpManager = /** @class */ (function () {
|
|
|
4547
4628
|
}
|
|
4548
4629
|
function _getAllResponseHeaders(xhr) {
|
|
4549
4630
|
var theHeaders = {};
|
|
4550
|
-
if (!xhr
|
|
4631
|
+
if (!xhr[_DYN_GET_ALL_RESPONSE_HEA8 ]) {
|
|
4551
4632
|
theHeaders = _appendHeader(theHeaders, xhr, STR_TIME_DELTA_HEADER);
|
|
4552
4633
|
theHeaders = _appendHeader(theHeaders, xhr, STR_KILL_DURATION_HEADER);
|
|
4553
4634
|
theHeaders = _appendHeader(theHeaders, xhr, STR_KILL_DURATION_SECONDS_HEADER);
|
|
4554
4635
|
}
|
|
4555
4636
|
else {
|
|
4556
|
-
theHeaders = _convertAllHeadersToMap(xhr
|
|
4637
|
+
theHeaders = _convertAllHeadersToMap(xhr[_DYN_GET_ALL_RESPONSE_HEA8 ]());
|
|
4557
4638
|
}
|
|
4558
4639
|
return theHeaders;
|
|
4559
4640
|
}
|
|
4560
4641
|
function xhrComplete(xhr, responseTxt) {
|
|
4561
4642
|
_doOnComplete(oncomplete, xhr.status, _getAllResponseHeaders(xhr), responseTxt);
|
|
4562
4643
|
}
|
|
4563
|
-
if (sync && payload
|
|
4644
|
+
if (sync && payload[_DYN_DISABLE_XHR_SYNC ]) {
|
|
4564
4645
|
sync = false;
|
|
4565
4646
|
}
|
|
4566
|
-
var xhrRequest = openXhr(STR_POST_METHOD, theUrl, _sendCredentials, true, sync, payload
|
|
4567
|
-
objForEachKey(payload
|
|
4647
|
+
var xhrRequest = openXhr(STR_POST_METHOD, theUrl, _sendCredentials, true, sync, payload[_DYN_TIMEOUT ]);
|
|
4648
|
+
objForEachKey(payload[_DYN_HEADERS ], function (name, value) {
|
|
4568
4649
|
xhrRequest.setRequestHeader(name, value);
|
|
4569
4650
|
});
|
|
4570
4651
|
xhrRequest.onload = function () {
|
|
@@ -4575,10 +4656,10 @@ var HttpManager = /** @class */ (function () {
|
|
|
4575
4656
|
xhrRequest.onerror = function () {
|
|
4576
4657
|
xhrComplete(xhrRequest);
|
|
4577
4658
|
};
|
|
4578
|
-
xhrRequest
|
|
4659
|
+
xhrRequest[_DYN_ONTIMEOUT ] = function () {
|
|
4579
4660
|
xhrComplete(xhrRequest);
|
|
4580
4661
|
};
|
|
4581
|
-
xhrRequest.send(payload
|
|
4662
|
+
xhrRequest.send(payload[_DYN_DATA ]);
|
|
4582
4663
|
}
|
|
4583
4664
|
function _doOnComplete(oncomplete, status, headers, response) {
|
|
4584
4665
|
try {
|
|
@@ -4591,28 +4672,28 @@ var HttpManager = /** @class */ (function () {
|
|
|
4591
4672
|
function _beaconSendPost(payload, oncomplete, sync) {
|
|
4592
4673
|
var internalPayloadData = payload;
|
|
4593
4674
|
var status = 200;
|
|
4594
|
-
var thePayload = internalPayloadData
|
|
4595
|
-
var theUrl = payload
|
|
4675
|
+
var thePayload = internalPayloadData[_DYN__THE_PAYLOAD ];
|
|
4676
|
+
var theUrl = payload[_DYN_URL_STRING ] + (_addNoResponse ? _noResponseQs : STR_EMPTY);
|
|
4596
4677
|
try {
|
|
4597
4678
|
var nav_1 = getNavigator();
|
|
4598
|
-
if (!nav_1.sendBeacon(theUrl, payload
|
|
4679
|
+
if (!nav_1.sendBeacon(theUrl, payload[_DYN_DATA ])) {
|
|
4599
4680
|
if (thePayload) {
|
|
4600
4681
|
var droppedBatches_1 = [];
|
|
4601
|
-
arrForEach(thePayload
|
|
4602
|
-
if (droppedBatches_1 && theBatch && theBatch
|
|
4603
|
-
var theEvents = theBatch
|
|
4604
|
-
for (var lp = 0; lp < theEvents
|
|
4682
|
+
arrForEach(thePayload[_DYN_BATCHES ], function (theBatch) {
|
|
4683
|
+
if (droppedBatches_1 && theBatch && theBatch[_DYN_COUNT ]() > 0) {
|
|
4684
|
+
var theEvents = theBatch[_DYN_EVENTS ]();
|
|
4685
|
+
for (var lp = 0; lp < theEvents[_DYN_LENGTH ]; lp++) {
|
|
4605
4686
|
if (!nav_1.sendBeacon(theUrl, _serializer.getEventBlob(theEvents[lp]))) {
|
|
4606
|
-
droppedBatches_1
|
|
4687
|
+
droppedBatches_1[_DYN_PUSH ](theBatch[_DYN_SPLIT ](lp));
|
|
4607
4688
|
break;
|
|
4608
4689
|
}
|
|
4609
4690
|
}
|
|
4610
4691
|
}
|
|
4611
4692
|
else {
|
|
4612
|
-
droppedBatches_1
|
|
4693
|
+
droppedBatches_1[_DYN_PUSH ](theBatch[_DYN_SPLIT ](0));
|
|
4613
4694
|
}
|
|
4614
4695
|
});
|
|
4615
|
-
_sendBatchesNotification(droppedBatches_1, 8003 , thePayload
|
|
4696
|
+
_sendBatchesNotification(droppedBatches_1, 8003 , thePayload[_DYN_SEND_TYPE ], true);
|
|
4616
4697
|
}
|
|
4617
4698
|
else {
|
|
4618
4699
|
status = 0;
|
|
@@ -4639,10 +4720,10 @@ var HttpManager = /** @class */ (function () {
|
|
|
4639
4720
|
_self.addHeader = function (name, value) {
|
|
4640
4721
|
_headers[name] = value;
|
|
4641
4722
|
};
|
|
4642
|
-
_self
|
|
4643
|
-
return _hasIdleConnection() && _clockSkewManager
|
|
4723
|
+
_self[_DYN_CAN_SEND_REQUEST ] = function () {
|
|
4724
|
+
return _hasIdleConnection() && _clockSkewManager[_DYN_ALLOW_REQUEST_SENDIN0 ]();
|
|
4644
4725
|
};
|
|
4645
|
-
_self
|
|
4726
|
+
_self[_DYN_SEND_QUEUED_REQUESTS ] = function (sendType, sendReason) {
|
|
4646
4727
|
if (isUndefined(sendType)) {
|
|
4647
4728
|
sendType = 0 ;
|
|
4648
4729
|
}
|
|
@@ -4654,23 +4735,23 @@ var HttpManager = /** @class */ (function () {
|
|
|
4654
4735
|
_sendBatches(_clearQueue(), 0, false, sendType, sendReason || 0 );
|
|
4655
4736
|
}
|
|
4656
4737
|
};
|
|
4657
|
-
_self
|
|
4658
|
-
return !_paused && _outstandingRequests === 0 && _batchQueue
|
|
4738
|
+
_self[_DYN_IS_COMPLETELY_IDLE ] = function () {
|
|
4739
|
+
return !_paused && _outstandingRequests === 0 && _batchQueue[_DYN_LENGTH ] === 0;
|
|
4659
4740
|
};
|
|
4660
|
-
_self
|
|
4741
|
+
_self[_DYN_SET_UNLOADING ] = function (value) {
|
|
4661
4742
|
_isUnloading = value;
|
|
4662
4743
|
};
|
|
4663
4744
|
_self.addBatch = function (theBatch) {
|
|
4664
|
-
if (theBatch && theBatch
|
|
4665
|
-
if (_killSwitch.isTenantKilled(theBatch
|
|
4745
|
+
if (theBatch && theBatch[_DYN_COUNT ]() > 0) {
|
|
4746
|
+
if (_killSwitch.isTenantKilled(theBatch[_DYN_I_KEY ]())) {
|
|
4666
4747
|
return false;
|
|
4667
4748
|
}
|
|
4668
|
-
_batchQueue
|
|
4749
|
+
_batchQueue[_DYN_PUSH ](theBatch);
|
|
4669
4750
|
}
|
|
4670
4751
|
return true;
|
|
4671
4752
|
};
|
|
4672
4753
|
_self.teardown = function () {
|
|
4673
|
-
if (_batchQueue
|
|
4754
|
+
if (_batchQueue[_DYN_LENGTH ] > 0) {
|
|
4674
4755
|
_sendBatches(_clearQueue(), 0, true, 2 , 2 );
|
|
4675
4756
|
}
|
|
4676
4757
|
arrForEach(_unloadHooks, function (hook) {
|
|
@@ -4683,10 +4764,10 @@ var HttpManager = /** @class */ (function () {
|
|
|
4683
4764
|
};
|
|
4684
4765
|
_self.resume = function () {
|
|
4685
4766
|
_paused = false;
|
|
4686
|
-
_self
|
|
4767
|
+
_self[_DYN_SEND_QUEUED_REQUESTS ](0 , 4 );
|
|
4687
4768
|
};
|
|
4688
|
-
_self
|
|
4689
|
-
if (batch && batch
|
|
4769
|
+
_self[_DYN_SEND_SYNCHRONOUS_BAT9 ] = function (batch, sendType, sendReason) {
|
|
4770
|
+
if (batch && batch[_DYN_COUNT ]() > 0) {
|
|
4690
4771
|
if (isNullOrUndefined(sendType)) {
|
|
4691
4772
|
sendType = 1 ;
|
|
4692
4773
|
}
|
|
@@ -4707,8 +4788,8 @@ var HttpManager = /** @class */ (function () {
|
|
|
4707
4788
|
}
|
|
4708
4789
|
function _canSendPayload(theBatches, sendType, retryCnt) {
|
|
4709
4790
|
var result = false;
|
|
4710
|
-
if (theBatches && theBatches
|
|
4711
|
-
result = (sendType !== 0 ) || (_hasIdleConnection() && (retryCnt > 0 || _clockSkewManager
|
|
4791
|
+
if (theBatches && theBatches[_DYN_LENGTH ] > 0 && !_paused && _sendInterfaces[sendType] && _serializer) {
|
|
4792
|
+
result = (sendType !== 0 ) || (_hasIdleConnection() && (retryCnt > 0 || _clockSkewManager[_DYN_ALLOW_REQUEST_SENDIN0 ]()));
|
|
4712
4793
|
}
|
|
4713
4794
|
return result;
|
|
4714
4795
|
}
|
|
@@ -4717,15 +4798,15 @@ var HttpManager = /** @class */ (function () {
|
|
|
4717
4798
|
if (theBatches) {
|
|
4718
4799
|
arrForEach(theBatches, function (theBatch, idx) {
|
|
4719
4800
|
values[idx] = {
|
|
4720
|
-
iKey: theBatch
|
|
4721
|
-
evts: theBatch
|
|
4801
|
+
iKey: theBatch[_DYN_I_KEY ](),
|
|
4802
|
+
evts: theBatch[_DYN_EVENTS ]()
|
|
4722
4803
|
};
|
|
4723
4804
|
});
|
|
4724
4805
|
}
|
|
4725
4806
|
return values;
|
|
4726
4807
|
}
|
|
4727
4808
|
function _sendBatches(theBatches, retryCount, isTeardown, sendType, sendReason) {
|
|
4728
|
-
if (!theBatches || theBatches
|
|
4809
|
+
if (!theBatches || theBatches[_DYN_LENGTH ] === 0) {
|
|
4729
4810
|
return;
|
|
4730
4811
|
}
|
|
4731
4812
|
if (_paused) {
|
|
@@ -4744,21 +4825,21 @@ var HttpManager = /** @class */ (function () {
|
|
|
4744
4825
|
var thePayload = null;
|
|
4745
4826
|
var serializationStart = getTime();
|
|
4746
4827
|
var sendInterface = _sendInterfaces[sendType] || (isSynchronous_1 ? _sendInterfaces[1 ] : _sendInterfaces[0 ]);
|
|
4747
|
-
var sendTransport = sendInterface && sendInterface
|
|
4828
|
+
var sendTransport = sendInterface && sendInterface[_DYN__TRANSPORT ];
|
|
4748
4829
|
var isReducedPayload = _canHaveReducedPayload && (_isUnloading || _isBeaconPayload(sendType) || (sendTransport === 3 || (sendInterface._isSync && sendTransport === 2 )));
|
|
4749
4830
|
while (_canSendPayload(theBatches, sendType, retryCount)) {
|
|
4750
4831
|
var theBatch = theBatches.shift();
|
|
4751
|
-
if (theBatch && theBatch
|
|
4752
|
-
if (!_killSwitch.isTenantKilled(theBatch
|
|
4832
|
+
if (theBatch && theBatch[_DYN_COUNT ]() > 0) {
|
|
4833
|
+
if (!_killSwitch.isTenantKilled(theBatch[_DYN_I_KEY ]())) {
|
|
4753
4834
|
thePayload = thePayload || _serializer.createPayload(retryCount, isTeardown, isSynchronous_1, isReducedPayload, sendReason, sendType);
|
|
4754
4835
|
if (!_serializer.appendPayload(thePayload, theBatch, maxEventsPerBatch)) {
|
|
4755
4836
|
_doPayloadSend(thePayload, serializationStart, getTime(), sendReason);
|
|
4756
4837
|
serializationStart = getTime();
|
|
4757
|
-
theBatches = [theBatch]
|
|
4838
|
+
theBatches = [theBatch][_DYN_CONCAT ](theBatches);
|
|
4758
4839
|
thePayload = null;
|
|
4759
4840
|
}
|
|
4760
4841
|
else if (thePayload.overflow !== null) {
|
|
4761
|
-
theBatches = [thePayload.overflow]
|
|
4842
|
+
theBatches = [thePayload.overflow][_DYN_CONCAT ](theBatches);
|
|
4762
4843
|
thePayload.overflow = null;
|
|
4763
4844
|
_doPayloadSend(thePayload, serializationStart, getTime(), sendReason);
|
|
4764
4845
|
serializationStart = getTime();
|
|
@@ -4766,15 +4847,15 @@ var HttpManager = /** @class */ (function () {
|
|
|
4766
4847
|
}
|
|
4767
4848
|
}
|
|
4768
4849
|
else {
|
|
4769
|
-
droppedBatches
|
|
4850
|
+
droppedBatches[_DYN_PUSH ](theBatch);
|
|
4770
4851
|
}
|
|
4771
4852
|
}
|
|
4772
4853
|
}
|
|
4773
4854
|
if (thePayload) {
|
|
4774
4855
|
_doPayloadSend(thePayload, serializationStart, getTime(), sendReason);
|
|
4775
4856
|
}
|
|
4776
|
-
if (theBatches
|
|
4777
|
-
_batchQueue = theBatches
|
|
4857
|
+
if (theBatches[_DYN_LENGTH ] > 0) {
|
|
4858
|
+
_batchQueue = theBatches[_DYN_CONCAT ](_batchQueue);
|
|
4778
4859
|
}
|
|
4779
4860
|
_sendBatchesNotification(droppedBatches, 8004 , sendType);
|
|
4780
4861
|
}, function () { return ({ batches: _createDebugBatches(orgBatches_1), retryCount: retryCount, isTeardown: isTeardown, isSynchronous: isSynchronous_1, sendReason: sendReason, useSendBeacon: _isBeaconPayload(sendType), sendType: sendType }); }, !isSynchronous_1);
|
|
@@ -4795,20 +4876,20 @@ var HttpManager = /** @class */ (function () {
|
|
|
4795
4876
|
_addRequestDetails(requestDetails, _collectorHeaderToQs[name], value, false);
|
|
4796
4877
|
}
|
|
4797
4878
|
else {
|
|
4798
|
-
requestDetails
|
|
4799
|
-
requestDetails
|
|
4879
|
+
requestDetails[_DYN_HDRS ][name] = value;
|
|
4880
|
+
requestDetails[_DYN_USE_HDRS ] = true;
|
|
4800
4881
|
}
|
|
4801
4882
|
});
|
|
4802
4883
|
}
|
|
4803
4884
|
else {
|
|
4804
|
-
requestDetails
|
|
4805
|
-
requestDetails.useHdrs = (objKeys(requestDetails.hdrs)
|
|
4885
|
+
requestDetails[_DYN_HDRS ] = extend(requestDetails[_DYN_HDRS ], _headers);
|
|
4886
|
+
requestDetails.useHdrs = (objKeys(requestDetails.hdrs)[_DYN_LENGTH ] > 0);
|
|
4806
4887
|
}
|
|
4807
4888
|
_addRequestDetails(requestDetails, STR_CLIENT_ID, "NO_AUTH", useHeaders);
|
|
4808
4889
|
_addRequestDetails(requestDetails, STR_CLIENT_VERSION, FullVersionString, useHeaders);
|
|
4809
4890
|
var apiQsKeys = STR_EMPTY;
|
|
4810
4891
|
arrForEach(thePayload.apiKeys, function (apiKey) {
|
|
4811
|
-
if (apiQsKeys
|
|
4892
|
+
if (apiQsKeys[_DYN_LENGTH ] > 0) {
|
|
4812
4893
|
apiQsKeys += ",";
|
|
4813
4894
|
}
|
|
4814
4895
|
apiQsKeys += apiKey;
|
|
@@ -4819,16 +4900,16 @@ var HttpManager = /** @class */ (function () {
|
|
|
4819
4900
|
if (isValueAssigned(msfpc)) {
|
|
4820
4901
|
requestDetails.url += "&ext.intweb.msfpc=" + msfpc;
|
|
4821
4902
|
}
|
|
4822
|
-
if (_clockSkewManager
|
|
4823
|
-
_addRequestDetails(requestDetails, STR_TIME_DELTA_TO_APPLY, _clockSkewManager
|
|
4903
|
+
if (_clockSkewManager[_DYN_SHOULD_ADD_CLOCK_SKE1 ]()) {
|
|
4904
|
+
_addRequestDetails(requestDetails, STR_TIME_DELTA_TO_APPLY, _clockSkewManager[_DYN_GET_CLOCK_SKEW_HEADE2 ](), useHeaders);
|
|
4824
4905
|
}
|
|
4825
|
-
if (_core
|
|
4826
|
-
var wParam = _core
|
|
4906
|
+
if (_core[_DYN_GET_WPARAM ]) {
|
|
4907
|
+
var wParam = _core[_DYN_GET_WPARAM ]();
|
|
4827
4908
|
if (wParam >= 0) {
|
|
4828
4909
|
requestDetails.url += "&w=" + wParam;
|
|
4829
4910
|
}
|
|
4830
4911
|
}
|
|
4831
|
-
for (var i = 0; i < _queryStringParameters
|
|
4912
|
+
for (var i = 0; i < _queryStringParameters[_DYN_LENGTH ]; i++) {
|
|
4832
4913
|
requestDetails.url += "&" + _queryStringParameters[i].name + "=" + _queryStringParameters[i].value;
|
|
4833
4914
|
}
|
|
4834
4915
|
return requestDetails;
|
|
@@ -4838,27 +4919,27 @@ var HttpManager = /** @class */ (function () {
|
|
|
4838
4919
|
timings[name][_postManager.identifier] = value;
|
|
4839
4920
|
}
|
|
4840
4921
|
function _doPayloadSend(thePayload, serializationStart, serializationCompleted, sendReason) {
|
|
4841
|
-
if (thePayload && thePayload.payloadBlob && thePayload.payloadBlob
|
|
4922
|
+
if (thePayload && thePayload.payloadBlob && thePayload.payloadBlob[_DYN_LENGTH ] > 0) {
|
|
4842
4923
|
var useSendHook_1 = !!_sendHook;
|
|
4843
4924
|
var sendInterface_1 = _sendInterfaces[thePayload.sendType];
|
|
4844
|
-
if (!_isBeaconPayload(thePayload
|
|
4925
|
+
if (!_isBeaconPayload(thePayload[_DYN_SEND_TYPE ]) && thePayload[_DYN_IS_BEACON ] && thePayload.sendReason === 2 ) {
|
|
4845
4926
|
sendInterface_1 = _sendInterfaces[2 ] || _sendInterfaces[3 ] || sendInterface_1;
|
|
4846
4927
|
}
|
|
4847
4928
|
var useHeaders_1 = _useHeaders;
|
|
4848
|
-
if (thePayload.isBeacon || sendInterface_1
|
|
4929
|
+
if (thePayload.isBeacon || sendInterface_1[_DYN__TRANSPORT ] === 3 ) {
|
|
4849
4930
|
useHeaders_1 = false;
|
|
4850
4931
|
}
|
|
4851
4932
|
var requestDetails_1 = _buildRequestDetails(thePayload, useHeaders_1);
|
|
4852
|
-
useHeaders_1 = useHeaders_1 || requestDetails_1
|
|
4933
|
+
useHeaders_1 = useHeaders_1 || requestDetails_1[_DYN_USE_HDRS ];
|
|
4853
4934
|
var sendEventStart_1 = getTime();
|
|
4854
4935
|
doPerf(_core, function () { return "HttpManager:_doPayloadSend"; }, function () {
|
|
4855
|
-
for (var batchLp = 0; batchLp < thePayload.batches
|
|
4856
|
-
var theBatch = thePayload
|
|
4857
|
-
var theEvents = theBatch
|
|
4858
|
-
for (var evtLp = 0; evtLp < theEvents
|
|
4936
|
+
for (var batchLp = 0; batchLp < thePayload.batches[_DYN_LENGTH ]; batchLp++) {
|
|
4937
|
+
var theBatch = thePayload[_DYN_BATCHES ][batchLp];
|
|
4938
|
+
var theEvents = theBatch[_DYN_EVENTS ]();
|
|
4939
|
+
for (var evtLp = 0; evtLp < theEvents[_DYN_LENGTH ]; evtLp++) {
|
|
4859
4940
|
var telemetryItem = theEvents[evtLp];
|
|
4860
4941
|
if (_enableEventTimings) {
|
|
4861
|
-
var timings = telemetryItem
|
|
4942
|
+
var timings = telemetryItem[_DYN_TIMINGS ] = telemetryItem[_DYN_TIMINGS ] || {};
|
|
4862
4943
|
_setTimingValue(timings, "sendEventStart", sendEventStart_1);
|
|
4863
4944
|
_setTimingValue(timings, "serializationStart", serializationStart);
|
|
4864
4945
|
_setTimingValue(timings, "serializationCompleted", serializationCompleted);
|
|
@@ -4866,11 +4947,11 @@ var HttpManager = /** @class */ (function () {
|
|
|
4866
4947
|
telemetryItem[strSendAttempt] > 0 ? telemetryItem[strSendAttempt]++ : telemetryItem[strSendAttempt] = 1;
|
|
4867
4948
|
}
|
|
4868
4949
|
}
|
|
4869
|
-
_sendBatchesNotification(thePayload
|
|
4950
|
+
_sendBatchesNotification(thePayload[_DYN_BATCHES ], (1000 + (sendReason || 0 )), thePayload[_DYN_SEND_TYPE ], true);
|
|
4870
4951
|
var orgPayloadData = {
|
|
4871
4952
|
data: thePayload.payloadBlob,
|
|
4872
4953
|
urlString: requestDetails_1.url,
|
|
4873
|
-
headers: requestDetails_1
|
|
4954
|
+
headers: requestDetails_1[_DYN_HDRS ],
|
|
4874
4955
|
_thePayload: thePayload,
|
|
4875
4956
|
_sendReason: sendReason,
|
|
4876
4957
|
timeout: _xhrTimeout,
|
|
@@ -4878,25 +4959,25 @@ var HttpManager = /** @class */ (function () {
|
|
|
4878
4959
|
disableFetchKeepAlive: _disableFetchKeepAlive
|
|
4879
4960
|
};
|
|
4880
4961
|
if (useHeaders_1) {
|
|
4881
|
-
if (!_hasHeader(orgPayloadData
|
|
4882
|
-
orgPayloadData
|
|
4962
|
+
if (!_hasHeader(orgPayloadData[_DYN_HEADERS ], STR_CACHE_CONTROL)) {
|
|
4963
|
+
orgPayloadData[_DYN_HEADERS ][STR_CACHE_CONTROL] = DEFAULT_CACHE_CONTROL;
|
|
4883
4964
|
}
|
|
4884
|
-
if (!_hasHeader(orgPayloadData
|
|
4885
|
-
orgPayloadData
|
|
4965
|
+
if (!_hasHeader(orgPayloadData[_DYN_HEADERS ], STR_CONTENT_TYPE_HEADER)) {
|
|
4966
|
+
orgPayloadData[_DYN_HEADERS ][STR_CONTENT_TYPE_HEADER] = DEFAULT_CONTENT_TYPE;
|
|
4886
4967
|
}
|
|
4887
4968
|
}
|
|
4888
4969
|
var sender = null;
|
|
4889
4970
|
if (sendInterface_1) {
|
|
4890
4971
|
sender = function (payload) {
|
|
4891
|
-
_clockSkewManager
|
|
4972
|
+
_clockSkewManager[_DYN_FIRST_REQUEST_SENT ]();
|
|
4892
4973
|
var onComplete = function (status, headers) {
|
|
4893
4974
|
_retryRequestIfNeeded(status, headers, thePayload, sendReason);
|
|
4894
4975
|
};
|
|
4895
|
-
var isSync = thePayload
|
|
4976
|
+
var isSync = thePayload[_DYN_IS_TEARDOWN ] || thePayload[_DYN_IS_SYNC ];
|
|
4896
4977
|
try {
|
|
4897
|
-
sendInterface_1
|
|
4978
|
+
sendInterface_1[_DYN_SEND_POST ](payload, onComplete, isSync);
|
|
4898
4979
|
if (_sendListener) {
|
|
4899
|
-
_sendListener(orgPayloadData, payload, isSync, thePayload
|
|
4980
|
+
_sendListener(orgPayloadData, payload, isSync, thePayload[_DYN_IS_BEACON ]);
|
|
4900
4981
|
}
|
|
4901
4982
|
}
|
|
4902
4983
|
catch (ex) {
|
|
@@ -4907,29 +4988,29 @@ var HttpManager = /** @class */ (function () {
|
|
|
4907
4988
|
}
|
|
4908
4989
|
doPerf(_core, function () { return "HttpManager:_doPayloadSend.sender"; }, function () {
|
|
4909
4990
|
if (sender) {
|
|
4910
|
-
if (thePayload
|
|
4991
|
+
if (thePayload[_DYN_SEND_TYPE ] === 0 ) {
|
|
4911
4992
|
_outstandingRequests++;
|
|
4912
4993
|
}
|
|
4913
|
-
if (useSendHook_1 && !thePayload.isBeacon && sendInterface_1
|
|
4994
|
+
if (useSendHook_1 && !thePayload.isBeacon && sendInterface_1[_DYN__TRANSPORT ] !== 3 ) {
|
|
4914
4995
|
var hookData_1 = {
|
|
4915
|
-
data: orgPayloadData
|
|
4916
|
-
urlString: orgPayloadData
|
|
4917
|
-
headers: extend({}, orgPayloadData
|
|
4918
|
-
timeout: orgPayloadData
|
|
4919
|
-
disableXhrSync: orgPayloadData
|
|
4920
|
-
disableFetchKeepAlive: orgPayloadData
|
|
4996
|
+
data: orgPayloadData[_DYN_DATA ],
|
|
4997
|
+
urlString: orgPayloadData[_DYN_URL_STRING ],
|
|
4998
|
+
headers: extend({}, orgPayloadData[_DYN_HEADERS ]),
|
|
4999
|
+
timeout: orgPayloadData[_DYN_TIMEOUT ],
|
|
5000
|
+
disableXhrSync: orgPayloadData[_DYN_DISABLE_XHR_SYNC ],
|
|
5001
|
+
disableFetchKeepAlive: orgPayloadData[_DYN_DISABLE_FETCH_KEEP_A6 ]
|
|
4921
5002
|
};
|
|
4922
5003
|
var senderCalled_1 = false;
|
|
4923
5004
|
doPerf(_core, function () { return "HttpManager:_doPayloadSend.sendHook"; }, function () {
|
|
4924
5005
|
try {
|
|
4925
5006
|
_sendHook(hookData_1, function (payload) {
|
|
4926
5007
|
senderCalled_1 = true;
|
|
4927
|
-
if (!_customHttpInterface && !payload
|
|
4928
|
-
payload
|
|
4929
|
-
payload
|
|
5008
|
+
if (!_customHttpInterface && !payload[_DYN__THE_PAYLOAD ]) {
|
|
5009
|
+
payload[_DYN__THE_PAYLOAD ] = payload[_DYN__THE_PAYLOAD ] || orgPayloadData[_DYN__THE_PAYLOAD ];
|
|
5010
|
+
payload[_DYN__SEND_REASON ] = payload[_DYN__SEND_REASON ] || orgPayloadData[_DYN__SEND_REASON ];
|
|
4930
5011
|
}
|
|
4931
5012
|
sender(payload);
|
|
4932
|
-
}, thePayload.isSync || thePayload
|
|
5013
|
+
}, thePayload.isSync || thePayload[_DYN_IS_TEARDOWN ]);
|
|
4933
5014
|
}
|
|
4934
5015
|
catch (ex) {
|
|
4935
5016
|
if (!senderCalled_1) {
|
|
@@ -4943,19 +5024,19 @@ var HttpManager = /** @class */ (function () {
|
|
|
4943
5024
|
}
|
|
4944
5025
|
}
|
|
4945
5026
|
});
|
|
4946
|
-
}, function () { return ({ thePayload: thePayload, serializationStart: serializationStart, serializationCompleted: serializationCompleted, sendReason: sendReason }); }, thePayload
|
|
5027
|
+
}, function () { return ({ thePayload: thePayload, serializationStart: serializationStart, serializationCompleted: serializationCompleted, sendReason: sendReason }); }, thePayload[_DYN_IS_SYNC ]);
|
|
4947
5028
|
}
|
|
4948
|
-
if (thePayload.sizeExceed && thePayload.sizeExceed
|
|
4949
|
-
_sendBatchesNotification(thePayload.sizeExceed, 8003 , thePayload
|
|
5029
|
+
if (thePayload.sizeExceed && thePayload.sizeExceed[_DYN_LENGTH ] > 0) {
|
|
5030
|
+
_sendBatchesNotification(thePayload.sizeExceed, 8003 , thePayload[_DYN_SEND_TYPE ]);
|
|
4950
5031
|
}
|
|
4951
|
-
if (thePayload.failedEvts && thePayload.failedEvts
|
|
4952
|
-
_sendBatchesNotification(thePayload.failedEvts, 8002 , thePayload
|
|
5032
|
+
if (thePayload.failedEvts && thePayload.failedEvts[_DYN_LENGTH ] > 0) {
|
|
5033
|
+
_sendBatchesNotification(thePayload.failedEvts, 8002 , thePayload[_DYN_SEND_TYPE ]);
|
|
4953
5034
|
}
|
|
4954
5035
|
}
|
|
4955
5036
|
function _addEventCompletedTimings(theEvents, sendEventCompleted) {
|
|
4956
5037
|
if (_enableEventTimings) {
|
|
4957
5038
|
arrForEach(theEvents, function (theEvent) {
|
|
4958
|
-
var timings = theEvent
|
|
5039
|
+
var timings = theEvent[_DYN_TIMINGS ] = theEvent[_DYN_TIMINGS ] || {};
|
|
4959
5040
|
_setTimingValue(timings, "sendEventCompleted", sendEventCompleted);
|
|
4960
5041
|
});
|
|
4961
5042
|
}
|
|
@@ -4969,15 +5050,15 @@ var HttpManager = /** @class */ (function () {
|
|
|
4969
5050
|
var shouldRetry = true;
|
|
4970
5051
|
if (typeof status !== strShimUndefined) {
|
|
4971
5052
|
if (headers) {
|
|
4972
|
-
_clockSkewManager
|
|
5053
|
+
_clockSkewManager[_DYN_SET_CLOCK_SKEW ](headers[STR_TIME_DELTA_HEADER]);
|
|
4973
5054
|
var killDuration = headers[STR_KILL_DURATION_HEADER] || headers["kill-duration-seconds"];
|
|
4974
|
-
arrForEach(_killSwitch
|
|
4975
|
-
arrForEach(thePayload
|
|
4976
|
-
if (theBatch
|
|
5055
|
+
arrForEach(_killSwitch[_DYN_SET_KILL_SWITCH_TENA10 ](headers[STR_KILL_TOKENS_HEADER], killDuration), function (killToken) {
|
|
5056
|
+
arrForEach(thePayload[_DYN_BATCHES ], function (theBatch) {
|
|
5057
|
+
if (theBatch[_DYN_I_KEY ]() === killToken) {
|
|
4977
5058
|
droppedBatches = droppedBatches || [];
|
|
4978
|
-
var removedEvents = theBatch
|
|
4979
|
-
thePayload.numEvents -= removedEvents
|
|
4980
|
-
droppedBatches
|
|
5059
|
+
var removedEvents = theBatch[_DYN_SPLIT ](0);
|
|
5060
|
+
thePayload.numEvents -= removedEvents[_DYN_COUNT ]();
|
|
5061
|
+
droppedBatches[_DYN_PUSH ](removedEvents);
|
|
4981
5062
|
}
|
|
4982
5063
|
});
|
|
4983
5064
|
});
|
|
@@ -4994,14 +5075,14 @@ var HttpManager = /** @class */ (function () {
|
|
|
4994
5075
|
if (shouldRetry) {
|
|
4995
5076
|
reason = 100 ;
|
|
4996
5077
|
var retryCount_1 = thePayload.retryCnt;
|
|
4997
|
-
if (thePayload
|
|
5078
|
+
if (thePayload[_DYN_SEND_TYPE ] === 0 ) {
|
|
4998
5079
|
if (retryCount_1 < maxRequestRetriesBeforeBackoff) {
|
|
4999
5080
|
isRetrying = true;
|
|
5000
5081
|
_doAction(function () {
|
|
5001
|
-
if (thePayload
|
|
5082
|
+
if (thePayload[_DYN_SEND_TYPE ] === 0 ) {
|
|
5002
5083
|
_outstandingRequests--;
|
|
5003
5084
|
}
|
|
5004
|
-
_sendBatches(thePayload
|
|
5085
|
+
_sendBatches(thePayload[_DYN_BATCHES ], retryCount_1 + 1, thePayload[_DYN_IS_TEARDOWN ], _isUnloading ? 2 : thePayload[_DYN_SEND_TYPE ], 5 );
|
|
5005
5086
|
}, _isUnloading, retryPolicyGetMillisToBackoffForRetry(retryCount_1));
|
|
5006
5087
|
}
|
|
5007
5088
|
else {
|
|
@@ -5015,30 +5096,30 @@ var HttpManager = /** @class */ (function () {
|
|
|
5015
5096
|
}
|
|
5016
5097
|
finally {
|
|
5017
5098
|
if (!isRetrying) {
|
|
5018
|
-
_clockSkewManager
|
|
5099
|
+
_clockSkewManager[_DYN_SET_CLOCK_SKEW ]();
|
|
5019
5100
|
_handleRequestFinished(thePayload, reason, sendReason, backOffTrans);
|
|
5020
5101
|
}
|
|
5021
|
-
_sendBatchesNotification(droppedBatches, 8004 , thePayload
|
|
5102
|
+
_sendBatchesNotification(droppedBatches, 8004 , thePayload[_DYN_SEND_TYPE ]);
|
|
5022
5103
|
}
|
|
5023
5104
|
}
|
|
5024
5105
|
function _handleRequestFinished(thePayload, batchReason, sendReason, backOffTrans) {
|
|
5025
5106
|
try {
|
|
5026
5107
|
if (backOffTrans) {
|
|
5027
|
-
_postManager
|
|
5108
|
+
_postManager[_DYN__BACK_OFF_TRANSMISSI11 ]();
|
|
5028
5109
|
}
|
|
5029
5110
|
if (batchReason === 200 ) {
|
|
5030
|
-
if (!backOffTrans && !thePayload
|
|
5111
|
+
if (!backOffTrans && !thePayload[_DYN_IS_SYNC ]) {
|
|
5031
5112
|
_postManager._clearBackOff();
|
|
5032
5113
|
}
|
|
5033
|
-
_addCompleteTimings(thePayload
|
|
5114
|
+
_addCompleteTimings(thePayload[_DYN_BATCHES ]);
|
|
5034
5115
|
}
|
|
5035
|
-
_sendBatchesNotification(thePayload
|
|
5116
|
+
_sendBatchesNotification(thePayload[_DYN_BATCHES ], batchReason, thePayload[_DYN_SEND_TYPE ], true);
|
|
5036
5117
|
}
|
|
5037
5118
|
finally {
|
|
5038
|
-
if (thePayload
|
|
5119
|
+
if (thePayload[_DYN_SEND_TYPE ] === 0 ) {
|
|
5039
5120
|
_outstandingRequests--;
|
|
5040
5121
|
if (sendReason !== 5 ) {
|
|
5041
|
-
_self.sendQueuedRequests(thePayload
|
|
5122
|
+
_self.sendQueuedRequests(thePayload[_DYN_SEND_TYPE ], sendReason);
|
|
5042
5123
|
}
|
|
5043
5124
|
}
|
|
5044
5125
|
}
|
|
@@ -5047,8 +5128,8 @@ var HttpManager = /** @class */ (function () {
|
|
|
5047
5128
|
if (_enableEventTimings) {
|
|
5048
5129
|
var sendEventCompleted_1 = getTime();
|
|
5049
5130
|
arrForEach(theBatches, function (theBatch) {
|
|
5050
|
-
if (theBatch && theBatch
|
|
5051
|
-
_addEventCompletedTimings(theBatch
|
|
5131
|
+
if (theBatch && theBatch[_DYN_COUNT ]() > 0) {
|
|
5132
|
+
_addEventCompletedTimings(theBatch[_DYN_EVENTS ](), sendEventCompleted_1);
|
|
5052
5133
|
}
|
|
5053
5134
|
});
|
|
5054
5135
|
}
|
|
@@ -5064,12 +5145,12 @@ var HttpManager = /** @class */ (function () {
|
|
|
5064
5145
|
function _convertAllHeadersToMap(headersString) {
|
|
5065
5146
|
var headers = {};
|
|
5066
5147
|
if (isString(headersString)) {
|
|
5067
|
-
var headersArray = strTrim(headersString)
|
|
5148
|
+
var headersArray = strTrim(headersString)[_DYN_SPLIT ](/[\r\n]+/);
|
|
5068
5149
|
arrForEach(headersArray, function (headerEntry) {
|
|
5069
5150
|
if (headerEntry) {
|
|
5070
5151
|
var idx = headerEntry.indexOf(": ");
|
|
5071
5152
|
if (idx !== -1) {
|
|
5072
|
-
var header = strTrim(headerEntry.substring(0, idx))
|
|
5153
|
+
var header = strTrim(headerEntry.substring(0, idx))[_DYN_TO_LOWER_CASE ]();
|
|
5073
5154
|
var value = strTrim(headerEntry.substring(idx + 1));
|
|
5074
5155
|
headers[header] = value;
|
|
5075
5156
|
}
|
|
@@ -5082,8 +5163,8 @@ var HttpManager = /** @class */ (function () {
|
|
|
5082
5163
|
return headers;
|
|
5083
5164
|
}
|
|
5084
5165
|
function _getMsfpc(thePayload) {
|
|
5085
|
-
for (var lp = 0; lp < thePayload.batches
|
|
5086
|
-
var msfpc = thePayload
|
|
5166
|
+
for (var lp = 0; lp < thePayload.batches[_DYN_LENGTH ]; lp++) {
|
|
5167
|
+
var msfpc = thePayload[_DYN_BATCHES ][lp].Msfpc();
|
|
5087
5168
|
if (msfpc) {
|
|
5088
5169
|
return encodeURIComponent(msfpc);
|
|
5089
5170
|
}
|
|
@@ -5093,7 +5174,7 @@ var HttpManager = /** @class */ (function () {
|
|
|
5093
5174
|
function _handleCollectorResponse(responseText) {
|
|
5094
5175
|
var responseHandlers = _responseHandlers;
|
|
5095
5176
|
try {
|
|
5096
|
-
for (var i = 0; i < responseHandlers
|
|
5177
|
+
for (var i = 0; i < responseHandlers[_DYN_LENGTH ]; i++) {
|
|
5097
5178
|
try {
|
|
5098
5179
|
responseHandlers[i](responseText);
|
|
5099
5180
|
}
|
|
@@ -5112,7 +5193,7 @@ var HttpManager = /** @class */ (function () {
|
|
|
5112
5193
|
}
|
|
5113
5194
|
}
|
|
5114
5195
|
function _sendBatchesNotification(theBatches, batchReason, sendType, sendSync) {
|
|
5115
|
-
if (theBatches && theBatches
|
|
5196
|
+
if (theBatches && theBatches[_DYN_LENGTH ] > 0 && actions) {
|
|
5116
5197
|
var theAction_1 = actions[_getNotificationAction(batchReason)];
|
|
5117
5198
|
if (theAction_1) {
|
|
5118
5199
|
var isSyncRequest_1 = sendType !== 0 ;
|
|
@@ -5194,7 +5275,7 @@ var defaultPostChannelConfig = objDeepFreeze({
|
|
|
5194
5275
|
addNoResponse: undefValue
|
|
5195
5276
|
});
|
|
5196
5277
|
function isOverrideFn(httpXHROverride) {
|
|
5197
|
-
return httpXHROverride && httpXHROverride
|
|
5278
|
+
return httpXHROverride && httpXHROverride[_DYN_SEND_POST ];
|
|
5198
5279
|
}
|
|
5199
5280
|
var PostChannel = /** @class */ (function (_super) {
|
|
5200
5281
|
__extendsFn(PostChannel, _super);
|
|
@@ -5202,7 +5283,7 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5202
5283
|
var _this = _super.call(this) || this;
|
|
5203
5284
|
_this.identifier = "PostChannel";
|
|
5204
5285
|
_this.priority = 1011;
|
|
5205
|
-
_this.version = '4.0.
|
|
5286
|
+
_this.version = '4.0.2-nightly3.2307-25';
|
|
5206
5287
|
var _postConfig;
|
|
5207
5288
|
var _isTeardownCalled = false;
|
|
5208
5289
|
var _flushCallbackQueue = [];
|
|
@@ -5241,29 +5322,29 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5241
5322
|
_self["_getDbgPlgTargets"] = function () {
|
|
5242
5323
|
return [_httpManager, _postConfig];
|
|
5243
5324
|
};
|
|
5244
|
-
_self
|
|
5325
|
+
_self[_DYN_INITIALIZE ] = function (theConfig, core, extensions) {
|
|
5245
5326
|
doPerf(core, function () { return "PostChannel:initialize"; }, function () {
|
|
5246
|
-
_base
|
|
5327
|
+
_base[_DYN_INITIALIZE ](theConfig, core, extensions);
|
|
5247
5328
|
_notificationManager = core.getNotifyMgr();
|
|
5248
5329
|
try {
|
|
5249
|
-
_evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self
|
|
5330
|
+
_evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self[_DYN_IDENTIFIER ]), core.evtNamespace && core.evtNamespace());
|
|
5250
5331
|
_self._addHook(onConfigChange(theConfig, function (details) {
|
|
5251
5332
|
var coreConfig = details.cfg;
|
|
5252
5333
|
var ctx = createProcessTelemetryContext(null, coreConfig, core);
|
|
5253
|
-
_postConfig = ctx.getExtCfg(_self
|
|
5254
|
-
_timeoutWrapper = createTimeoutWrapper(_postConfig
|
|
5255
|
-
_optimizeObject = !_postConfig
|
|
5256
|
-
_ignoreMc1Ms0CookieProcessing = _postConfig
|
|
5334
|
+
_postConfig = ctx.getExtCfg(_self[_DYN_IDENTIFIER ], defaultPostChannelConfig);
|
|
5335
|
+
_timeoutWrapper = createTimeoutWrapper(_postConfig[_DYN_SET_TIMEOUT_OVERRIDE ], _postConfig[_DYN_CLEAR_TIMEOUT_OVERRI3 ]);
|
|
5336
|
+
_optimizeObject = !_postConfig[_DYN_DISABLE_OPTIMIZE_OBJ ] && isChromium();
|
|
5337
|
+
_ignoreMc1Ms0CookieProcessing = _postConfig[_DYN_IGNORE_MC1_MS0_COOKI12 ];
|
|
5257
5338
|
_hookWParam(core);
|
|
5258
|
-
_queueSizeLimit = _postConfig
|
|
5339
|
+
_queueSizeLimit = _postConfig[_DYN_EVENTS_LIMIT_IN_MEM ];
|
|
5259
5340
|
_immediateQueueSizeLimit = _postConfig.immediateEventLimit;
|
|
5260
|
-
_autoFlushEventsLimit = _postConfig
|
|
5341
|
+
_autoFlushEventsLimit = _postConfig[_DYN_AUTO_FLUSH_EVENTS_LI13 ];
|
|
5261
5342
|
_maxEventSendAttempts = _postConfig.maxEventRetryAttempts;
|
|
5262
5343
|
_maxUnloadEventSendAttempts = _postConfig.maxUnloadEventRetryAttempts;
|
|
5263
|
-
_disableAutoBatchFlushLimit = _postConfig
|
|
5344
|
+
_disableAutoBatchFlushLimit = _postConfig[_DYN_DISABLE_AUTO_BATCH_F14 ];
|
|
5264
5345
|
_setAutoLimits();
|
|
5265
|
-
_overrideInstrumentationKey = _postConfig
|
|
5266
|
-
_disableTelemetry = !!_postConfig
|
|
5346
|
+
_overrideInstrumentationKey = _postConfig[_DYN_OVERRIDE_INSTRUMENTA15 ];
|
|
5347
|
+
_disableTelemetry = !!_postConfig[_DYN_DISABLE_TELEMETRY ];
|
|
5267
5348
|
if (_unloadHandlersAdded) {
|
|
5268
5349
|
_removeUnloadHandlers();
|
|
5269
5350
|
}
|
|
@@ -5272,7 +5353,7 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5272
5353
|
_unloadHandlersAdded = addPageHideEventListener(_handleUnloadEvents, excludePageUnloadEvents, _evtNamespace) || _unloadHandlersAdded;
|
|
5273
5354
|
_unloadHandlersAdded = addPageShowEventListener(_handleShowEvents, coreConfig.disablePageShowEvents, _evtNamespace) || _unloadHandlersAdded;
|
|
5274
5355
|
}));
|
|
5275
|
-
_httpManager
|
|
5356
|
+
_httpManager[_DYN_INITIALIZE ](theConfig, _self.core, _self);
|
|
5276
5357
|
}
|
|
5277
5358
|
catch (e) {
|
|
5278
5359
|
_self.setInitialized(false);
|
|
@@ -5281,12 +5362,12 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5281
5362
|
}, function () { return ({ theConfig: theConfig, core: core, extensions: extensions }); });
|
|
5282
5363
|
};
|
|
5283
5364
|
_self.processTelemetry = function (ev, itemCtx) {
|
|
5284
|
-
setProcessTelemetryTimings(ev, _self
|
|
5365
|
+
setProcessTelemetryTimings(ev, _self[_DYN_IDENTIFIER ]);
|
|
5285
5366
|
itemCtx = itemCtx || _self._getTelCtx(itemCtx);
|
|
5286
5367
|
var event = ev;
|
|
5287
5368
|
if (!_disableTelemetry && !_isTeardownCalled) {
|
|
5288
5369
|
if (_overrideInstrumentationKey) {
|
|
5289
|
-
event
|
|
5370
|
+
event[_DYN_I_KEY ] = _overrideInstrumentationKey;
|
|
5290
5371
|
}
|
|
5291
5372
|
_addEventToQueues(event, true);
|
|
5292
5373
|
if (_isPageUnloadTriggered) {
|
|
@@ -5311,8 +5392,8 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5311
5392
|
removePageShowEventListener(null, _evtNamespace);
|
|
5312
5393
|
}
|
|
5313
5394
|
function _hookWParam(core) {
|
|
5314
|
-
var existingGetWParamMethod = core
|
|
5315
|
-
core
|
|
5395
|
+
var existingGetWParamMethod = core[_DYN_GET_WPARAM ];
|
|
5396
|
+
core[_DYN_GET_WPARAM ] = function () {
|
|
5316
5397
|
var wparam = 0;
|
|
5317
5398
|
if (_ignoreMc1Ms0CookieProcessing) {
|
|
5318
5399
|
wparam = wparam | 2;
|
|
@@ -5324,20 +5405,20 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5324
5405
|
var theEvt = evt || getWindow().event;
|
|
5325
5406
|
if (theEvt.type !== "beforeunload") {
|
|
5326
5407
|
_isPageUnloadTriggered = true;
|
|
5327
|
-
_httpManager
|
|
5408
|
+
_httpManager[_DYN_SET_UNLOADING ](_isPageUnloadTriggered);
|
|
5328
5409
|
}
|
|
5329
5410
|
_releaseAllQueues(2 , 2 );
|
|
5330
5411
|
}
|
|
5331
5412
|
function _handleShowEvents(evt) {
|
|
5332
5413
|
_isPageUnloadTriggered = false;
|
|
5333
|
-
_httpManager
|
|
5414
|
+
_httpManager[_DYN_SET_UNLOADING ](_isPageUnloadTriggered);
|
|
5334
5415
|
}
|
|
5335
5416
|
function _addEventToQueues(event, append) {
|
|
5336
|
-
if (!event
|
|
5337
|
-
event
|
|
5417
|
+
if (!event[_DYN_SEND_ATTEMPT ]) {
|
|
5418
|
+
event[_DYN_SEND_ATTEMPT ] = 0;
|
|
5338
5419
|
}
|
|
5339
|
-
if (!event
|
|
5340
|
-
event
|
|
5420
|
+
if (!event[_DYN_LATENCY ]) {
|
|
5421
|
+
event[_DYN_LATENCY ] = 1 ;
|
|
5341
5422
|
}
|
|
5342
5423
|
if (event.ext && event.ext[STR_TRACE]) {
|
|
5343
5424
|
delete (event.ext[STR_TRACE]);
|
|
@@ -5347,29 +5428,29 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5347
5428
|
}
|
|
5348
5429
|
if (_optimizeObject) {
|
|
5349
5430
|
event.ext = optimizeObject(event.ext);
|
|
5350
|
-
if (event
|
|
5351
|
-
event
|
|
5431
|
+
if (event[_DYN_BASE_DATA ]) {
|
|
5432
|
+
event[_DYN_BASE_DATA ] = optimizeObject(event[_DYN_BASE_DATA ]);
|
|
5352
5433
|
}
|
|
5353
|
-
if (event
|
|
5354
|
-
event
|
|
5434
|
+
if (event[_DYN_DATA ]) {
|
|
5435
|
+
event[_DYN_DATA ] = optimizeObject(event[_DYN_DATA ]);
|
|
5355
5436
|
}
|
|
5356
5437
|
}
|
|
5357
|
-
if (event
|
|
5438
|
+
if (event[_DYN_SYNC ]) {
|
|
5358
5439
|
if (_currentBackoffCount || _paused) {
|
|
5359
|
-
event
|
|
5360
|
-
event
|
|
5440
|
+
event[_DYN_LATENCY ] = 3 ;
|
|
5441
|
+
event[_DYN_SYNC ] = false;
|
|
5361
5442
|
}
|
|
5362
5443
|
else {
|
|
5363
5444
|
if (_httpManager) {
|
|
5364
5445
|
if (_optimizeObject) {
|
|
5365
5446
|
event = optimizeObject(event);
|
|
5366
5447
|
}
|
|
5367
|
-
_httpManager
|
|
5448
|
+
_httpManager[_DYN_SEND_SYNCHRONOUS_BAT9 ](EventBatch.create(event[_DYN_I_KEY ], [event]), event[_DYN_SYNC ] === true ? 1 : event[_DYN_SYNC ], 3 );
|
|
5368
5449
|
return;
|
|
5369
5450
|
}
|
|
5370
5451
|
}
|
|
5371
5452
|
}
|
|
5372
|
-
var evtLatency = event
|
|
5453
|
+
var evtLatency = event[_DYN_LATENCY ];
|
|
5373
5454
|
var queueSize = _queueSize;
|
|
5374
5455
|
var queueLimit = _queueSizeLimit;
|
|
5375
5456
|
if (evtLatency === 4 ) {
|
|
@@ -5388,7 +5469,7 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5388
5469
|
dropNumber = 1;
|
|
5389
5470
|
}
|
|
5390
5471
|
eventDropped = true;
|
|
5391
|
-
if (_dropEventWithLatencyOrLess(event
|
|
5472
|
+
if (_dropEventWithLatencyOrLess(event[_DYN_I_KEY ], event[_DYN_LATENCY ], dropLatency, dropNumber)) {
|
|
5392
5473
|
eventDropped = !_addEventToProperQueue(event, append);
|
|
5393
5474
|
}
|
|
5394
5475
|
}
|
|
@@ -5397,16 +5478,16 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5397
5478
|
}
|
|
5398
5479
|
}
|
|
5399
5480
|
_self.setEventQueueLimits = function (eventLimit, autoFlushLimit) {
|
|
5400
|
-
_postConfig
|
|
5401
|
-
_postConfig
|
|
5481
|
+
_postConfig[_DYN_EVENTS_LIMIT_IN_MEM ] = _queueSizeLimit = isGreaterThanZero(eventLimit) ? eventLimit : MaxEventsLimitInMem;
|
|
5482
|
+
_postConfig[_DYN_AUTO_FLUSH_EVENTS_LI13 ] = _autoFlushEventsLimit = isGreaterThanZero(autoFlushLimit) ? autoFlushLimit : 0;
|
|
5402
5483
|
_setAutoLimits();
|
|
5403
5484
|
var doFlush = _queueSize > eventLimit;
|
|
5404
5485
|
if (!doFlush && _autoFlushBatchLimit > 0) {
|
|
5405
5486
|
for (var latency = 1 ; !doFlush && latency <= 3 ; latency++) {
|
|
5406
5487
|
var batchQueue = _batchQueues[latency];
|
|
5407
|
-
if (batchQueue && batchQueue
|
|
5408
|
-
arrForEach(batchQueue
|
|
5409
|
-
if (theBatch && theBatch
|
|
5488
|
+
if (batchQueue && batchQueue[_DYN_BATCHES ]) {
|
|
5489
|
+
arrForEach(batchQueue[_DYN_BATCHES ], function (theBatch) {
|
|
5490
|
+
if (theBatch && theBatch[_DYN_COUNT ]() >= _autoFlushBatchLimit) {
|
|
5410
5491
|
doFlush = true;
|
|
5411
5492
|
}
|
|
5412
5493
|
});
|
|
@@ -5428,10 +5509,10 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5428
5509
|
_self._loadTransmitProfiles = function (profiles) {
|
|
5429
5510
|
_resetTransmitProfiles();
|
|
5430
5511
|
objForEachKey(profiles, function (profileName, profileValue) {
|
|
5431
|
-
var profLen = profileValue
|
|
5512
|
+
var profLen = profileValue[_DYN_LENGTH ];
|
|
5432
5513
|
if (profLen >= 2) {
|
|
5433
5514
|
var directValue = (profLen > 2 ? profileValue[2] : 0);
|
|
5434
|
-
profileValue
|
|
5515
|
+
profileValue[_DYN_SPLICE ](0, profLen - 2);
|
|
5435
5516
|
if (profileValue[1] < 0) {
|
|
5436
5517
|
profileValue[0] = -1;
|
|
5437
5518
|
}
|
|
@@ -5442,7 +5523,7 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5442
5523
|
if (directValue >= 0 && profileValue[1] >= 0 && directValue > profileValue[1]) {
|
|
5443
5524
|
directValue = profileValue[1];
|
|
5444
5525
|
}
|
|
5445
|
-
profileValue
|
|
5526
|
+
profileValue[_DYN_PUSH ](directValue);
|
|
5446
5527
|
_profiles[profileName] = profileValue;
|
|
5447
5528
|
}
|
|
5448
5529
|
});
|
|
@@ -5467,7 +5548,7 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5467
5548
|
}, 0);
|
|
5468
5549
|
}
|
|
5469
5550
|
else {
|
|
5470
|
-
_flushCallbackQueue
|
|
5551
|
+
_flushCallbackQueue[_DYN_PUSH ](callback);
|
|
5471
5552
|
}
|
|
5472
5553
|
}
|
|
5473
5554
|
else {
|
|
@@ -5495,7 +5576,7 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5495
5576
|
proxyFunctions(_self, function () { return _httpManager; }, ["addResponseHandler"]);
|
|
5496
5577
|
function _sendEventsForLatencyAndAbove(latency, sendType, sendReason) {
|
|
5497
5578
|
var queued = _queueBatches(latency, sendType, sendReason);
|
|
5498
|
-
_httpManager
|
|
5579
|
+
_httpManager[_DYN_SEND_QUEUED_REQUESTS ](sendType, sendReason);
|
|
5499
5580
|
return queued;
|
|
5500
5581
|
}
|
|
5501
5582
|
function _hasEvents() {
|
|
@@ -5503,7 +5584,7 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5503
5584
|
}
|
|
5504
5585
|
function _scheduleTimer() {
|
|
5505
5586
|
if (_delayedBatchSendLatency >= 0 && _queueBatches(_delayedBatchSendLatency, 0 , _delayedBatchReason)) {
|
|
5506
|
-
_httpManager
|
|
5587
|
+
_httpManager[_DYN_SEND_QUEUED_REQUESTS ](0 , _delayedBatchReason);
|
|
5507
5588
|
}
|
|
5508
5589
|
if (_immediateQueueSize > 0 && !_immediateTimer && !_paused) {
|
|
5509
5590
|
var immediateTimeOut = _profiles[_currentProfile][2];
|
|
@@ -5531,7 +5612,7 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5531
5612
|
}
|
|
5532
5613
|
}
|
|
5533
5614
|
}
|
|
5534
|
-
_self
|
|
5615
|
+
_self[_DYN__BACK_OFF_TRANSMISSI11 ] = function () {
|
|
5535
5616
|
if (_currentBackoffCount < MaxBackoffCount) {
|
|
5536
5617
|
_currentBackoffCount++;
|
|
5537
5618
|
_clearScheduledTimer();
|
|
@@ -5643,13 +5724,13 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5643
5724
|
var eventBatch = batchQueue.iKeyMap[iKey];
|
|
5644
5725
|
if (!eventBatch && create) {
|
|
5645
5726
|
eventBatch = EventBatch.create(iKey);
|
|
5646
|
-
batchQueue.batches
|
|
5727
|
+
batchQueue.batches[_DYN_PUSH ](eventBatch);
|
|
5647
5728
|
batchQueue.iKeyMap[iKey] = eventBatch;
|
|
5648
5729
|
}
|
|
5649
5730
|
return eventBatch;
|
|
5650
5731
|
}
|
|
5651
5732
|
function _performAutoFlush(isAsync, doFlush) {
|
|
5652
|
-
if (_httpManager
|
|
5733
|
+
if (_httpManager[_DYN_CAN_SEND_REQUEST ]() && !_currentBackoffCount) {
|
|
5653
5734
|
if (_autoFlushEventsLimit > 0 && _queueSize > _autoFlushEventsLimit) {
|
|
5654
5735
|
doFlush = true;
|
|
5655
5736
|
}
|
|
@@ -5662,13 +5743,13 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5662
5743
|
if (_optimizeObject) {
|
|
5663
5744
|
event = optimizeObject(event);
|
|
5664
5745
|
}
|
|
5665
|
-
var latency = event
|
|
5666
|
-
var eventBatch = _getEventBatch(event
|
|
5746
|
+
var latency = event[_DYN_LATENCY ];
|
|
5747
|
+
var eventBatch = _getEventBatch(event[_DYN_I_KEY ], latency, true);
|
|
5667
5748
|
if (eventBatch.addEvent(event)) {
|
|
5668
5749
|
if (latency !== 4 ) {
|
|
5669
5750
|
_queueSize++;
|
|
5670
|
-
if (append && event
|
|
5671
|
-
_performAutoFlush(!event.sync, _autoFlushBatchLimit > 0 && eventBatch
|
|
5751
|
+
if (append && event[_DYN_SEND_ATTEMPT ] === 0) {
|
|
5752
|
+
_performAutoFlush(!event.sync, _autoFlushBatchLimit > 0 && eventBatch[_DYN_COUNT ]() >= _autoFlushBatchLimit);
|
|
5672
5753
|
}
|
|
5673
5754
|
}
|
|
5674
5755
|
else {
|
|
@@ -5681,9 +5762,9 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5681
5762
|
function _dropEventWithLatencyOrLess(iKey, latency, currentLatency, dropNumber) {
|
|
5682
5763
|
while (currentLatency <= latency) {
|
|
5683
5764
|
var eventBatch = _getEventBatch(iKey, latency, true);
|
|
5684
|
-
if (eventBatch && eventBatch
|
|
5685
|
-
var droppedEvents = eventBatch
|
|
5686
|
-
var droppedCount = droppedEvents
|
|
5765
|
+
if (eventBatch && eventBatch[_DYN_COUNT ]() > 0) {
|
|
5766
|
+
var droppedEvents = eventBatch[_DYN_SPLIT ](0, dropNumber);
|
|
5767
|
+
var droppedCount = droppedEvents[_DYN_COUNT ]();
|
|
5687
5768
|
if (droppedCount > 0) {
|
|
5688
5769
|
if (currentLatency === 4 ) {
|
|
5689
5770
|
_immediateQueueSize -= droppedCount;
|
|
@@ -5705,13 +5786,13 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5705
5786
|
var normalQueue = 0;
|
|
5706
5787
|
var _loop_1 = function (latency) {
|
|
5707
5788
|
var batchQueue = _batchQueues[latency];
|
|
5708
|
-
if (batchQueue && batchQueue
|
|
5709
|
-
arrForEach(batchQueue
|
|
5789
|
+
if (batchQueue && batchQueue[_DYN_BATCHES ]) {
|
|
5790
|
+
arrForEach(batchQueue[_DYN_BATCHES ], function (theBatch) {
|
|
5710
5791
|
if (latency === 4 ) {
|
|
5711
|
-
immediateQueue += theBatch
|
|
5792
|
+
immediateQueue += theBatch[_DYN_COUNT ]();
|
|
5712
5793
|
}
|
|
5713
5794
|
else {
|
|
5714
|
-
normalQueue += theBatch
|
|
5795
|
+
normalQueue += theBatch[_DYN_COUNT ]();
|
|
5715
5796
|
}
|
|
5716
5797
|
});
|
|
5717
5798
|
}
|
|
@@ -5725,33 +5806,33 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5725
5806
|
function _queueBatches(latency, sendType, sendReason) {
|
|
5726
5807
|
var eventsQueued = false;
|
|
5727
5808
|
var isAsync = sendType === 0 ;
|
|
5728
|
-
if (!isAsync || _httpManager
|
|
5809
|
+
if (!isAsync || _httpManager[_DYN_CAN_SEND_REQUEST ]()) {
|
|
5729
5810
|
doPerf(_self.core, function () { return "PostChannel._queueBatches"; }, function () {
|
|
5730
5811
|
var droppedEvents = [];
|
|
5731
5812
|
var latencyToProcess = 4 ;
|
|
5732
5813
|
while (latencyToProcess >= latency) {
|
|
5733
5814
|
var batchQueue = _batchQueues[latencyToProcess];
|
|
5734
|
-
if (batchQueue && batchQueue.batches && batchQueue.batches
|
|
5735
|
-
arrForEach(batchQueue
|
|
5815
|
+
if (batchQueue && batchQueue.batches && batchQueue.batches[_DYN_LENGTH ] > 0) {
|
|
5816
|
+
arrForEach(batchQueue[_DYN_BATCHES ], function (theBatch) {
|
|
5736
5817
|
if (!_httpManager.addBatch(theBatch)) {
|
|
5737
|
-
droppedEvents = droppedEvents
|
|
5818
|
+
droppedEvents = droppedEvents[_DYN_CONCAT ](theBatch[_DYN_EVENTS ]());
|
|
5738
5819
|
}
|
|
5739
5820
|
else {
|
|
5740
|
-
eventsQueued = eventsQueued || (theBatch && theBatch
|
|
5821
|
+
eventsQueued = eventsQueued || (theBatch && theBatch[_DYN_COUNT ]() > 0);
|
|
5741
5822
|
}
|
|
5742
5823
|
if (latencyToProcess === 4 ) {
|
|
5743
|
-
_immediateQueueSize -= theBatch
|
|
5824
|
+
_immediateQueueSize -= theBatch[_DYN_COUNT ]();
|
|
5744
5825
|
}
|
|
5745
5826
|
else {
|
|
5746
|
-
_queueSize -= theBatch
|
|
5827
|
+
_queueSize -= theBatch[_DYN_COUNT ]();
|
|
5747
5828
|
}
|
|
5748
5829
|
});
|
|
5749
|
-
batchQueue
|
|
5830
|
+
batchQueue[_DYN_BATCHES ] = [];
|
|
5750
5831
|
batchQueue.iKeyMap = {};
|
|
5751
5832
|
}
|
|
5752
5833
|
latencyToProcess--;
|
|
5753
5834
|
}
|
|
5754
|
-
if (droppedEvents
|
|
5835
|
+
if (droppedEvents[_DYN_LENGTH ] > 0) {
|
|
5755
5836
|
_notifyEvents(strEventsDiscarded, droppedEvents, EventsDiscardedReason.KillSwitch);
|
|
5756
5837
|
}
|
|
5757
5838
|
if (eventsQueued && _delayedBatchSendLatency >= latency) {
|
|
@@ -5773,7 +5854,7 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5773
5854
|
if (callback) {
|
|
5774
5855
|
callback();
|
|
5775
5856
|
}
|
|
5776
|
-
if (_flushCallbackQueue
|
|
5857
|
+
if (_flushCallbackQueue[_DYN_LENGTH ] > 0) {
|
|
5777
5858
|
_flushCallbackTimer = _createTimer(function () {
|
|
5778
5859
|
_flushCallbackTimer = null;
|
|
5779
5860
|
_flushImpl(_flushCallbackQueue.shift(), sendReason);
|
|
@@ -5786,7 +5867,7 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5786
5867
|
});
|
|
5787
5868
|
}
|
|
5788
5869
|
function _waitForIdleManager(callback) {
|
|
5789
|
-
if (_httpManager
|
|
5870
|
+
if (_httpManager[_DYN_IS_COMPLETELY_IDLE ]()) {
|
|
5790
5871
|
callback();
|
|
5791
5872
|
}
|
|
5792
5873
|
else {
|
|
@@ -5815,25 +5896,25 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5815
5896
|
maxSendAttempts = _maxUnloadEventSendAttempts;
|
|
5816
5897
|
}
|
|
5817
5898
|
arrForEach(batches, function (theBatch) {
|
|
5818
|
-
if (theBatch && theBatch
|
|
5819
|
-
arrForEach(theBatch
|
|
5899
|
+
if (theBatch && theBatch[_DYN_COUNT ]() > 0) {
|
|
5900
|
+
arrForEach(theBatch[_DYN_EVENTS ](), function (theEvent) {
|
|
5820
5901
|
if (theEvent) {
|
|
5821
|
-
if (theEvent
|
|
5822
|
-
theEvent
|
|
5823
|
-
theEvent
|
|
5902
|
+
if (theEvent[_DYN_SYNC ]) {
|
|
5903
|
+
theEvent[_DYN_LATENCY ] = 4 ;
|
|
5904
|
+
theEvent[_DYN_SYNC ] = false;
|
|
5824
5905
|
}
|
|
5825
|
-
if (theEvent
|
|
5826
|
-
setProcessTelemetryTimings(theEvent, _self
|
|
5906
|
+
if (theEvent[_DYN_SEND_ATTEMPT ] < maxSendAttempts) {
|
|
5907
|
+
setProcessTelemetryTimings(theEvent, _self[_DYN_IDENTIFIER ]);
|
|
5827
5908
|
_addEventToQueues(theEvent, false);
|
|
5828
5909
|
}
|
|
5829
5910
|
else {
|
|
5830
|
-
droppedEvents
|
|
5911
|
+
droppedEvents[_DYN_PUSH ](theEvent);
|
|
5831
5912
|
}
|
|
5832
5913
|
}
|
|
5833
5914
|
});
|
|
5834
5915
|
}
|
|
5835
5916
|
});
|
|
5836
|
-
if (droppedEvents
|
|
5917
|
+
if (droppedEvents[_DYN_LENGTH ] > 0) {
|
|
5837
5918
|
_notifyEvents(strEventsDiscarded, droppedEvents, EventsDiscardedReason.NonRetryableStatus);
|
|
5838
5919
|
}
|
|
5839
5920
|
if (_isPageUnloadTriggered) {
|
|
@@ -5857,8 +5938,8 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5857
5938
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
5858
5939
|
extraArgs[_i - 2] = arguments[_i];
|
|
5859
5940
|
}
|
|
5860
|
-
if (theEvents && theEvents
|
|
5861
|
-
_callNotification(evtName, [theEvents]
|
|
5941
|
+
if (theEvents && theEvents[_DYN_LENGTH ] > 0) {
|
|
5942
|
+
_callNotification(evtName, [theEvents][_DYN_CONCAT ](extraArgs));
|
|
5862
5943
|
}
|
|
5863
5944
|
}
|
|
5864
5945
|
function _notifyBatchEvents(evtName, batches) {
|
|
@@ -5866,16 +5947,16 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5866
5947
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
5867
5948
|
extraArgs[_i - 2] = arguments[_i];
|
|
5868
5949
|
}
|
|
5869
|
-
if (batches && batches
|
|
5950
|
+
if (batches && batches[_DYN_LENGTH ] > 0) {
|
|
5870
5951
|
arrForEach(batches, function (theBatch) {
|
|
5871
|
-
if (theBatch && theBatch
|
|
5872
|
-
_callNotification(evtName, [theBatch.events()]
|
|
5952
|
+
if (theBatch && theBatch[_DYN_COUNT ]() > 0) {
|
|
5953
|
+
_callNotification(evtName, [theBatch.events()][_DYN_CONCAT ](extraArgs));
|
|
5873
5954
|
}
|
|
5874
5955
|
});
|
|
5875
5956
|
}
|
|
5876
5957
|
}
|
|
5877
5958
|
function _sendingEvent(batches, reason, isSyncRequest) {
|
|
5878
|
-
if (batches && batches
|
|
5959
|
+
if (batches && batches[_DYN_LENGTH ] > 0) {
|
|
5879
5960
|
_callNotification("eventsSendRequest", [(reason >= 1000 && reason <= 1999 ?
|
|
5880
5961
|
reason - 1000 :
|
|
5881
5962
|
0 ), isSyncRequest !== true]);
|
|
@@ -5919,4 +6000,4 @@ exports.PostChannel = PostChannel;
|
|
|
5919
6000
|
exports.RT_PROFILE = RT_PROFILE;
|
|
5920
6001
|
|
|
5921
6002
|
}));
|
|
5922
|
-
//# sourceMappingURL=ms.post-4.0.
|
|
6003
|
+
//# sourceMappingURL=ms.post-4.0.2-nightly3.2307-25.js.map
|