@microsoft/applicationinsights-channel-js 3.1.2-nightly3.2403-07 → 3.1.2

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.
Files changed (55) hide show
  1. package/browser/es5/{applicationinsights-channel-js.3.1.2-nightly3.2403-07.cjs.js → applicationinsights-channel-js.3.1.2.cjs.js} +528 -543
  2. package/browser/es5/applicationinsights-channel-js.3.1.2.cjs.js.map +1 -0
  3. package/browser/es5/applicationinsights-channel-js.3.1.2.cjs.min.js +6 -0
  4. package/browser/es5/applicationinsights-channel-js.3.1.2.cjs.min.js.map +1 -0
  5. package/browser/es5/{applicationinsights-channel-js.3.1.2-nightly3.2403-07.gbl.js → applicationinsights-channel-js.3.1.2.gbl.js} +530 -545
  6. package/browser/es5/applicationinsights-channel-js.3.1.2.gbl.js.map +1 -0
  7. package/browser/es5/applicationinsights-channel-js.3.1.2.gbl.min.js +6 -0
  8. package/browser/es5/applicationinsights-channel-js.3.1.2.gbl.min.js.map +1 -0
  9. package/browser/es5/applicationinsights-channel-js.3.1.2.integrity.json +66 -0
  10. package/browser/es5/{applicationinsights-channel-js.3.1.2-nightly3.2403-07.js → applicationinsights-channel-js.3.1.2.js} +530 -545
  11. package/browser/es5/applicationinsights-channel-js.3.1.2.js.map +1 -0
  12. package/browser/es5/applicationinsights-channel-js.3.1.2.min.js +6 -0
  13. package/browser/es5/applicationinsights-channel-js.3.1.2.min.js.map +1 -0
  14. package/browser/es5/applicationinsights-channel-js.3.cjs.js +527 -542
  15. package/browser/es5/applicationinsights-channel-js.3.cjs.js.map +1 -1
  16. package/browser/es5/applicationinsights-channel-js.3.cjs.min.js +2 -2
  17. package/browser/es5/applicationinsights-channel-js.3.cjs.min.js.map +1 -1
  18. package/browser/es5/applicationinsights-channel-js.3.gbl.js +529 -544
  19. package/browser/es5/applicationinsights-channel-js.3.gbl.js.map +1 -1
  20. package/browser/es5/applicationinsights-channel-js.3.gbl.min.js +2 -2
  21. package/browser/es5/applicationinsights-channel-js.3.gbl.min.js.map +1 -1
  22. package/browser/es5/applicationinsights-channel-js.3.integrity.json +25 -25
  23. package/browser/es5/applicationinsights-channel-js.3.js +529 -544
  24. package/browser/es5/applicationinsights-channel-js.3.js.map +1 -1
  25. package/browser/es5/applicationinsights-channel-js.3.min.js +2 -2
  26. package/browser/es5/applicationinsights-channel-js.3.min.js.map +1 -1
  27. package/dist/es5/applicationinsights-channel-js.js +527 -542
  28. package/dist/es5/applicationinsights-channel-js.js.map +1 -1
  29. package/dist/es5/applicationinsights-channel-js.min.js +2 -2
  30. package/dist/es5/applicationinsights-channel-js.min.js.map +1 -1
  31. package/dist-es5/EnvelopeCreator.js +2 -2
  32. package/dist-es5/EnvelopeCreator.js.map +1 -1
  33. package/dist-es5/Interfaces.js +1 -1
  34. package/dist-es5/InternalConstants.js +1 -1
  35. package/dist-es5/SendBuffer.js +1 -1
  36. package/dist-es5/Sender.js +1 -1
  37. package/dist-es5/Serializer.js +1 -1
  38. package/dist-es5/TelemetryProcessors/Sample.js +1 -1
  39. package/dist-es5/TelemetryProcessors/SamplingScoreGenerators/HashCodeScoreGenerator.js +1 -1
  40. package/dist-es5/TelemetryProcessors/SamplingScoreGenerators/SamplingScoreGenerator.js +1 -1
  41. package/dist-es5/__DynamicConstants.js +1 -1
  42. package/dist-es5/applicationinsights-channel-js.js +1 -1
  43. package/package.json +62 -65
  44. package/types/applicationinsights-channel-js.d.ts +1 -1
  45. package/types/applicationinsights-channel-js.namespaced.d.ts +2 -1
  46. package/browser/es5/applicationinsights-channel-js.3.1.2-nightly3.2403-07.cjs.js.map +0 -1
  47. package/browser/es5/applicationinsights-channel-js.3.1.2-nightly3.2403-07.cjs.min.js +0 -6
  48. package/browser/es5/applicationinsights-channel-js.3.1.2-nightly3.2403-07.cjs.min.js.map +0 -1
  49. package/browser/es5/applicationinsights-channel-js.3.1.2-nightly3.2403-07.gbl.js.map +0 -1
  50. package/browser/es5/applicationinsights-channel-js.3.1.2-nightly3.2403-07.gbl.min.js +0 -6
  51. package/browser/es5/applicationinsights-channel-js.3.1.2-nightly3.2403-07.gbl.min.js.map +0 -1
  52. package/browser/es5/applicationinsights-channel-js.3.1.2-nightly3.2403-07.integrity.json +0 -66
  53. package/browser/es5/applicationinsights-channel-js.3.1.2-nightly3.2403-07.js.map +0 -1
  54. package/browser/es5/applicationinsights-channel-js.3.1.2-nightly3.2403-07.min.js +0 -6
  55. package/browser/es5/applicationinsights-channel-js.3.1.2-nightly3.2403-07.min.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Channel, 3.1.2-nightly3.2403-07
2
+ * Application Insights JavaScript SDK - Channel, 3.1.2
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -18,23 +18,16 @@
18
18
  var UNDEF_VALUE = undefined;
19
19
  var NULL_VALUE = null;
20
20
  var EMPTY = "";
21
- var BOOLEAN = "boolean";
22
21
  var FUNCTION = "function";
23
- var NUMBER = "number";
24
22
  var OBJECT = "object";
25
23
  var PROTOTYPE = "prototype";
26
24
  var __PROTO__ = "__proto__";
27
- var STRING = "string";
28
25
  var UNDEFINED = "undefined";
29
26
  var CONSTRUCTOR = "constructor";
30
27
  var SYMBOL = "Symbol";
31
28
  var POLYFILL_TAG = "_polyfill";
32
- var INDEX_OF = "indexOf";
33
29
  var LENGTH = "length";
34
- var DONE = "done";
35
- var VALUE = "value";
36
30
  var NAME = "name";
37
- var SLICE = "slice";
38
31
  var CALL = "call";
39
32
  var TO_STRING = "toString";
40
33
  var ObjClass = Object;
@@ -44,6 +37,7 @@
44
37
  var MathCls = Math;
45
38
  var ArrCls = Array;
46
39
  var ArrProto = ArrCls[PROTOTYPE];
40
+ var ArrSlice = ArrProto["slice"];
47
41
 
48
42
  function safe(func, argArray) {
49
43
  try {
@@ -56,6 +50,7 @@
56
50
  }
57
51
  }
58
52
 
53
+ /*#__NO_SIDE_EFFECTS__*/
59
54
  function safeGet(cb, defValue) {
60
55
  var result = safe(cb);
61
56
  return result.e ? defValue : result.v;
@@ -94,7 +89,7 @@
94
89
  function isDefined(arg) {
95
90
  return !!arg || arg !== UNDEF_VALUE;
96
91
  }
97
- var isString = ( /*#__PURE__*/_createIs(STRING));
92
+ var isString = ( /*#__PURE__*/_createIs("string"));
98
93
  var isFunction = ( /*#__PURE__*/_createIs(FUNCTION));
99
94
  /*#__NO_SIDE_EFFECTS__*/
100
95
  function isObject(value) {
@@ -104,8 +99,8 @@
104
99
  return !!value && typeof value === OBJECT;
105
100
  }
106
101
  var isArray = ArrCls.isArray;
107
- var isNumber = ( /*#__PURE__*/_createIs(NUMBER));
108
- var isBoolean = ( /*#__PURE__*/_createIs(BOOLEAN));
102
+ var isNumber = ( /*#__PURE__*/_createIs("number"));
103
+ var isBoolean = ( /*#__PURE__*/_createIs("boolean"));
109
104
  var isError = ( /*#__PURE__*/_createObjIs("Error"));
110
105
  /*#__NO_SIDE_EFFECTS__*/
111
106
  function isPromiseLike(value) {
@@ -220,6 +215,7 @@
220
215
 
221
216
  var GLOBAL_CONFIG_KEY = "__tsUtils$gblCfg";
222
217
  var _globalCfg;
218
+ /*#__NO_SIDE_EFFECTS__*/
223
219
  function _getGlobalValue() {
224
220
  var result;
225
221
  if (typeof globalThis !== UNDEFINED) {
@@ -254,7 +250,7 @@
254
250
  object = { stack: asString(object.stack), message: asString(object.message), name: asString(object.name) };
255
251
  }
256
252
  try {
257
- propertyValueDump = JSON.stringify(object, NULL_VALUE, format ? ((typeof format === NUMBER) ? format : 4) : UNDEF_VALUE);
253
+ propertyValueDump = JSON.stringify(object, NULL_VALUE, format ? ((typeof format === "number") ? format : 4) : UNDEF_VALUE);
258
254
  propertyValueDump = (propertyValueDump && propertyValueDump.replace(/"(\w+)"\s*:\s{0,1}/g, "$1: ")) || asString(object);
259
255
  }
260
256
  catch (e) {
@@ -263,18 +259,15 @@
263
259
  return objType + ": " + propertyValueDump;
264
260
  }
265
261
 
266
- var _slice;
267
- var _unwrapInstFunction = _unwrapFunctionWithPoly;
268
262
  var _unwrapFunction = _unwrapFunctionWithPoly;
269
263
  /*#__NO_SIDE_EFFECTS__*/
270
264
  function _unwrapFunctionWithPoly(funcName, clsProto, polyFunc) {
271
- _slice = _slice || ArrProto[SLICE];
272
265
  var clsFn = clsProto && clsProto[funcName];
273
266
  return function (thisArg) {
274
267
  var theFunc = (thisArg && thisArg[funcName]) || clsFn;
275
268
  if (theFunc || polyFunc) {
276
269
  var theArgs = arguments;
277
- return (theFunc || polyFunc).apply(thisArg, theFunc ? _slice[CALL](theArgs, 1) : theArgs);
270
+ return (theFunc || polyFunc).apply(thisArg, theFunc ? ArrSlice[CALL](theArgs, 1) : theArgs);
278
271
  }
279
272
  throwTypeError("\"" + asString(funcName) + "\" not defined for " + dumpObj(thisArg));
280
273
  };
@@ -282,7 +275,7 @@
282
275
 
283
276
  var mathMax = MathCls.max;
284
277
 
285
- var strSlice = ( /*#__PURE__*/_unwrapFunction(SLICE, StrProto));
278
+ var strSlice = ( /*#__PURE__*/_unwrapFunction("slice", StrProto));
286
279
 
287
280
  var strSubstring = ( /*#__PURE__*/_unwrapFunction("substring", StrProto));
288
281
  var strSubstr = ( /*#__PURE__*/_unwrapFunctionWithPoly("substr", StrProto, polyStrSubstr));
@@ -350,7 +343,7 @@
350
343
  var propMap = {
351
344
  e: "enumerable",
352
345
  c: "configurable",
353
- v: VALUE,
346
+ v: "value",
354
347
  w: "writable",
355
348
  g: "get",
356
349
  s: "set"
@@ -383,6 +376,7 @@
383
376
  function _initTestHooks() {
384
377
  _globalLazyTestHooks = _getGlobalConfig();
385
378
  }
379
+ /*#__NO_SIDE_EFFECTS__*/
386
380
  function getLazy(cb) {
387
381
  var lazyValue = {};
388
382
  !_globalLazyTestHooks && _initTestHooks();
@@ -420,10 +414,14 @@
420
414
 
421
415
  var WINDOW = "window";
422
416
  var _cachedGlobal;
423
- var _cachedWindow;
424
- var _cachedDocument;
425
- var _cachedNavigator;
426
- var _isNode;
417
+ function _getGlobalInstFn(getFn, theArgs) {
418
+ var cachedValue;
419
+ return function () {
420
+ !_globalLazyTestHooks && _initTestHooks();
421
+ (!cachedValue || _globalLazyTestHooks.lzy) && (cachedValue = createCachedValue(safe(getFn, theArgs).v));
422
+ return cachedValue.v;
423
+ };
424
+ }
427
425
  /*#__NO_SIDE_EFFECTS__*/
428
426
  function lazySafeGetInst(name) {
429
427
  return getLazy(function () { return safe((getInst), [name]).v || UNDEF_VALUE; });
@@ -440,41 +438,25 @@
440
438
  if (gbl && gbl[name]) {
441
439
  return gbl[name];
442
440
  }
443
- if (name === WINDOW && _cachedWindow) {
444
- return _cachedWindow.v;
441
+ if (name === WINDOW) {
442
+ return getWindow();
445
443
  }
446
444
  return NULL_VALUE;
447
445
  }
448
- /*#__NO_SIDE_EFFECTS__*/
449
- function getDocument() {
450
- !_globalLazyTestHooks && _initTestHooks();
451
- (!_cachedDocument || _globalLazyTestHooks.lzy) && (_cachedDocument = createCachedValue(safe((getInst), ["document"]).v));
452
- return _cachedDocument.v;
453
- }
446
+ var getDocument = ( /*#__PURE__*/_getGlobalInstFn(getInst, ["document"]));
454
447
  /*#__NO_SIDE_EFFECTS__*/
455
448
  function hasWindow() {
456
449
  return !!getWindow();
457
450
  }
458
- /*#__NO_SIDE_EFFECTS__*/
459
- function getWindow() {
460
- !_globalLazyTestHooks && _initTestHooks();
461
- (!_cachedWindow || _globalLazyTestHooks.lzy) && (_cachedWindow = createCachedValue(safe((getInst), [WINDOW]).v));
462
- return _cachedWindow.v;
463
- }
451
+ var getWindow = ( /*#__PURE__*/_getGlobalInstFn(getInst, [WINDOW]));
464
452
  /*#__NO_SIDE_EFFECTS__*/
465
453
  function hasNavigator() {
466
454
  return !!getNavigator();
467
455
  }
468
- /*#__NO_SIDE_EFFECTS__*/
469
- function getNavigator() {
470
- !_globalLazyTestHooks && _initTestHooks();
471
- (!_cachedNavigator || _globalLazyTestHooks.lzy) && (_cachedNavigator = createCachedValue(safe((getInst), ["navigator"]).v));
472
- return _cachedNavigator.v;
473
- }
474
- function isNode() {
475
- !_isNode && (_isNode = createCachedValue(!!safe(function () { return (process && (process.versions || {}).node); }).v));
476
- return _isNode.v;
477
- }
456
+ var getNavigator = ( /*#__PURE__*/_getGlobalInstFn(getInst, ["navigator"]));
457
+ var isNode = ( /*#__PURE__*/_getGlobalInstFn(function () {
458
+ return !!safe(function () { return (process && (process.versions || {}).node); }).v;
459
+ }));
478
460
 
479
461
  var _symbol;
480
462
  var _symbolFor;
@@ -535,8 +517,8 @@
535
517
  var iterResult = void 0;
536
518
  try {
537
519
  var count = 0;
538
- while (!(iterResult = iter.next())[DONE]) {
539
- if (callbackfn[CALL](thisArg || iter, iterResult[VALUE], count, iter) === -1) {
520
+ while (!(iterResult = iter.next()).done) {
521
+ if (callbackfn[CALL](thisArg || iter, iterResult.value, count, iter) === -1) {
540
522
  break;
541
523
  }
542
524
  count++;
@@ -551,7 +533,7 @@
551
533
  }
552
534
  finally {
553
535
  try {
554
- if (iterResult && !iterResult[DONE]) {
536
+ if (iterResult && !iterResult.done) {
555
537
  iter.return && iter.return(iterResult);
556
538
  }
557
539
  }
@@ -565,7 +547,9 @@
565
547
  }
566
548
  }
567
549
 
568
- var fnApply = ( /*#__PURE__*/_unwrapInstFunction("apply"));
550
+ function fnApply(fn, thisArg, argArray) {
551
+ return fn.apply(thisArg, argArray);
552
+ }
569
553
 
570
554
  function arrAppend(target, elms) {
571
555
  if (!isUndefined(elms) && target) {
@@ -597,11 +581,13 @@
597
581
  }
598
582
  }
599
583
 
600
- var arrIndexOf = ( /*#__PURE__*/_unwrapFunction(INDEX_OF, ArrProto));
584
+ var arrIndexOf = ( /*#__PURE__*/_unwrapFunction("indexOf", ArrProto));
601
585
 
602
586
  var arrMap = ( /*#__PURE__*/_unwrapFunction("map", ArrProto));
603
587
 
604
- var arrSlice = ( /*#__PURE__*/_unwrapFunction(SLICE, ArrProto));
588
+ function arrSlice(theArray, start, end) {
589
+ return ((theArray && theArray["slice"]) || ArrSlice).apply(theArray, ArrSlice[CALL](arguments, 1));
590
+ }
605
591
 
606
592
  var objCreate = ObjClass["create"] || polyObjCreate;
607
593
  /*#__NO_SIDE_EFFECTS__*/
@@ -631,6 +617,7 @@
631
617
  return fn(obj, proto);
632
618
  }
633
619
 
620
+ /*#__NO_SIDE_EFFECTS__*/
634
621
  function _createCustomError(name, d, b) {
635
622
  safe(objDefine, [d, NAME, { v: name, c: true, e: false }]);
636
623
  d = objSetPrototypeOf(d, b);
@@ -654,7 +641,7 @@
654
641
  var theArgs = arguments;
655
642
  try {
656
643
  safe(_setName, [theBaseClass, name]);
657
- var _self = fnApply(theBaseClass, _this, ArrProto[SLICE][CALL](theArgs)) || _this;
644
+ var _self = fnApply(theBaseClass, _this, ArrSlice[CALL](theArgs)) || _this;
658
645
  if (_self !== _this) {
659
646
  var orgProto = objGetPrototypeOf(_this);
660
647
  if (orgProto !== objGetPrototypeOf(_self)) {
@@ -729,58 +716,54 @@
729
716
  return result;
730
717
  }
731
718
 
732
- var strIndexOf = ( /*#__PURE__*/_unwrapFunction(INDEX_OF, StrProto));
719
+ var strIndexOf = ( /*#__PURE__*/_unwrapFunction("indexOf", StrProto));
733
720
 
734
721
  var REF = "ref";
735
- var UNREF = "un" + REF;
722
+ var UNREF = "unref";
736
723
  var HAS_REF = "hasRef";
737
724
  var ENABLED = "enabled";
725
+ /*#__NO_SIDE_EFFECTS__*/
738
726
  function _createTimerHandler(startTimer, refreshFn, cancelFn) {
739
- var _a;
740
727
  var ref = true;
741
728
  var timerId = startTimer ? refreshFn(NULL_VALUE) : NULL_VALUE;
742
729
  var theTimerHandler;
743
- var _unref = function () {
730
+ function _unref() {
744
731
  ref = false;
745
732
  timerId && timerId[UNREF] && timerId[UNREF]();
746
733
  return theTimerHandler;
747
- };
748
- var _ref = function () {
749
- ref = true;
750
- timerId && timerId[REF] && timerId[REF]();
734
+ }
735
+ function _cancel() {
736
+ timerId && cancelFn(timerId);
737
+ timerId = NULL_VALUE;
738
+ }
739
+ function _refresh() {
740
+ timerId = refreshFn(timerId);
741
+ if (!ref) {
742
+ _unref();
743
+ }
751
744
  return theTimerHandler;
745
+ }
746
+ function _setEnabled(value) {
747
+ !value && timerId && _cancel();
748
+ value && !timerId && _refresh();
749
+ }
750
+ theTimerHandler = {
751
+ cancel: _cancel,
752
+ refresh: _refresh
752
753
  };
753
- var _hasRef = function () {
754
+ theTimerHandler[HAS_REF] = function () {
754
755
  if (timerId && timerId[HAS_REF]) {
755
756
  return timerId[HAS_REF]();
756
757
  }
757
758
  return ref;
758
759
  };
759
- var _refresh = function () {
760
- timerId = refreshFn(timerId);
761
- if (!ref) {
762
- _unref();
763
- }
760
+ theTimerHandler[REF] = function () {
761
+ ref = true;
762
+ timerId && timerId[REF] && timerId[REF]();
764
763
  return theTimerHandler;
765
764
  };
766
- var _cancel = function () {
767
- timerId && cancelFn(timerId);
768
- timerId = NULL_VALUE;
769
- };
770
- var _setEnabled = function (value) {
771
- !value && timerId && _cancel();
772
- value && !timerId && _refresh();
773
- };
774
- theTimerHandler = (_a = {
775
- cancel: _cancel,
776
- refresh: _refresh
777
- },
778
- _a[HAS_REF] = _hasRef,
779
- _a[REF] = _ref,
780
- _a[UNREF] = _unref,
781
- _a[ENABLED] = false,
782
- _a);
783
- objDefineProp(theTimerHandler, ENABLED, {
765
+ theTimerHandler[UNREF] = _unref;
766
+ theTimerHandler = objDefineProp(theTimerHandler, ENABLED, {
784
767
  get: function () { return !!timerId; },
785
768
  set: _setEnabled
786
769
  });
@@ -792,7 +775,7 @@
792
775
  };
793
776
  }
794
777
 
795
- function _createTimeoutWith(self, startTimer, overrideFn, theArgs) {
778
+ function _createTimeoutWith(startTimer, overrideFn, theArgs) {
796
779
  var isArr = isArray(overrideFn);
797
780
  var len = isArr ? overrideFn.length : 0;
798
781
  var setFn = (len > 0 ? overrideFn[0] : (!isArr ? overrideFn : UNDEF_VALUE)) || setTimeout;
@@ -800,7 +783,7 @@
800
783
  var timerFn = theArgs[0];
801
784
  theArgs[0] = function () {
802
785
  handler.dn();
803
- fnApply(timerFn, self, ArrProto[SLICE][CALL](arguments));
786
+ fnApply(timerFn, UNDEF_VALUE, ArrSlice[CALL](arguments));
804
787
  };
805
788
  var handler = _createTimerHandler(startTimer, function (timerId) {
806
789
  if (timerId) {
@@ -808,16 +791,16 @@
808
791
  timerId.refresh();
809
792
  return timerId;
810
793
  }
811
- fnApply(clearFn, self, [timerId]);
794
+ fnApply(clearFn, UNDEF_VALUE, [timerId]);
812
795
  }
813
- return fnApply(setFn, self, theArgs);
796
+ return fnApply(setFn, UNDEF_VALUE, theArgs);
814
797
  }, function (timerId) {
815
- fnApply(clearFn, self, [timerId]);
798
+ fnApply(clearFn, UNDEF_VALUE, [timerId]);
816
799
  });
817
800
  return handler.h;
818
801
  }
819
802
  function scheduleTimeout(callback, timeout) {
820
- return _createTimeoutWith(this, true, UNDEF_VALUE, ArrProto[SLICE][CALL](arguments));
803
+ return _createTimeoutWith(true, UNDEF_VALUE, ArrSlice[CALL](arguments));
821
804
  }
822
805
 
823
806
  var strHasOwnProperty = "hasOwnProperty";
@@ -1133,7 +1116,7 @@
1133
1116
  var _DYN_NAME$2 = "name";
1134
1117
  var _DYN_TIME = "time";
1135
1118
  var _DYN_PROCESS_NEXT = "processNext";
1136
- var _DYN_GET_PROCESS_TEL_CONT0 = "getProcessTelContext";
1119
+ var _DYN_GET_PROCESS_TEL_CONT2 = "getProcessTelContext";
1137
1120
  var _DYN_UNLOAD = "unload";
1138
1121
  var _DYN_LOGGING_LEVEL_CONSOL4 = "loggingLevelConsole";
1139
1122
  var _DYN_CREATE_NEW$1 = "createNew";
@@ -1155,7 +1138,6 @@
1155
1138
  var _DYN_TYPE = "type";
1156
1139
  var _DYN_HANDLER = "handler";
1157
1140
  var _DYN_STATUS = "status";
1158
- var _DYN_ITEMS_RECEIVED$1 = "itemsReceived";
1159
1141
  var _DYN_GET_RESPONSE_HEADER = "getResponseHeader";
1160
1142
  var _DYN_GET_ALL_RESPONSE_HEA5 = "getAllResponseHeaders";
1161
1143
  var _DYN_IS_CHILD_EVT = "isChildEvt";
@@ -1163,6 +1145,7 @@
1163
1145
  var _DYN_GET_CTX = "getCtx";
1164
1146
  var _DYN_SET_CTX = "setCtx";
1165
1147
  var _DYN_COMPLETE = "complete";
1148
+ var _DYN_ITEMS_RECEIVED$1 = "itemsReceived";
1166
1149
  var _DYN_URL_STRING = "urlString";
1167
1150
  var _DYN_SEND_POST = "sendPOST";
1168
1151
  var _DYN_HEADERS = "headers";
@@ -1495,435 +1478,95 @@
1495
1478
  var STR_GET_PERF_MGR = "getPerfMgr";
1496
1479
  var STR_NOT_DYNAMIC_ERROR = "Not dynamic - ";
1497
1480
 
1498
- var _aiNamespace = null;
1499
- function _getExtensionNamespace() {
1500
- var target = getInst("Microsoft");
1501
- if (target) {
1502
- _aiNamespace = target["ApplicationInsights"];
1503
- }
1504
- return _aiNamespace;
1505
- }
1506
- function getDebugExt(config) {
1507
- var ns = _aiNamespace;
1508
- if (!ns && config.disableDbgExt !== true) {
1509
- ns = _aiNamespace || _getExtensionNamespace();
1510
- }
1511
- return ns ? ns["ChromeDbgExt"] : null;
1512
- }
1513
-
1514
- var strDocumentMode = "documentMode";
1515
- var strLocation = "location";
1516
- var strConsole = "console";
1517
- var strJSON = "JSON";
1518
- var strCrypto = "crypto";
1519
- var strMsCrypto = "msCrypto";
1520
- var strMsie = "msie";
1521
- var strTrident = "trident/";
1522
- var strXMLHttpRequest = "XMLHttpRequest";
1523
- var _isTrident = null;
1524
- var _navUserAgentCheck = null;
1525
- var _enableMocks = false;
1526
- var _useXDomainRequest = null;
1527
- var _beaconsSupported = null;
1528
- function _hasProperty(theClass, property) {
1529
- var supported = false;
1530
- if (theClass) {
1531
- try {
1532
- supported = property in theClass;
1533
- if (!supported) {
1534
- var proto = theClass[strShimPrototype];
1535
- if (proto) {
1536
- supported = property in proto;
1537
- }
1538
- }
1539
- }
1540
- catch (e) {
1541
- }
1542
- if (!supported) {
1543
- try {
1544
- var tmp = new theClass();
1545
- supported = !isUndefined(tmp[property]);
1546
- }
1547
- catch (e) {
1548
- }
1549
- }
1550
- }
1551
- return supported;
1481
+ var rCamelCase = /-([a-z])/g;
1482
+ var rNormalizeInvalid = /([^\w\d_$])/g;
1483
+ var rLeadingNumeric = /^(\d+[\w\d_$])/;
1484
+ function isNotNullOrUndefined(value) {
1485
+ return !isNullOrUndefined(value);
1552
1486
  }
1553
- function getLocation(checkForMock) {
1554
- if (checkForMock && _enableMocks) {
1555
- var mockLocation = getInst("__mockLocation");
1556
- if (mockLocation) {
1557
- return mockLocation;
1558
- }
1559
- }
1560
- if (typeof location === strShimObject && location) {
1561
- return location;
1487
+ function normalizeJsName(name) {
1488
+ var value = name;
1489
+ if (value && isString(value)) {
1490
+ value = value[_DYN_REPLACE ](rCamelCase, function (_all, letter) {
1491
+ return letter.toUpperCase();
1492
+ });
1493
+ value = value[_DYN_REPLACE ](rNormalizeInvalid, "_");
1494
+ value = value[_DYN_REPLACE ](rLeadingNumeric, function (_all, match) {
1495
+ return "_" + match;
1496
+ });
1562
1497
  }
1563
- return getInst(strLocation);
1498
+ return value;
1564
1499
  }
1565
- function getConsole() {
1566
- if (typeof console !== strShimUndefined) {
1567
- return console;
1500
+ function strContains(value, search) {
1501
+ if (value && search) {
1502
+ return strIndexOf(value, search) !== -1;
1568
1503
  }
1569
- return getInst(strConsole);
1504
+ return false;
1570
1505
  }
1571
- function hasJSON() {
1572
- return Boolean((typeof JSON === strShimObject && JSON) || getInst(strJSON) !== null);
1506
+ function toISOString(date) {
1507
+ return date && date.toISOString() || "";
1573
1508
  }
1574
- function getJSON() {
1575
- if (hasJSON()) {
1576
- return JSON || getInst(strJSON);
1509
+ function getExceptionName(object) {
1510
+ if (isError(object)) {
1511
+ return object[_DYN_NAME$2 ];
1577
1512
  }
1578
- return null;
1579
- }
1580
- function getCrypto() {
1581
- return getInst(strCrypto);
1582
- }
1583
- function getMsCrypto() {
1584
- return getInst(strMsCrypto);
1513
+ return STR_EMPTY$1;
1585
1514
  }
1586
- function isIE() {
1587
- var nav = getNavigator();
1588
- if (nav && (nav[_DYN_USER_AGENT ] !== _navUserAgentCheck || _isTrident === null)) {
1589
- _navUserAgentCheck = nav[_DYN_USER_AGENT ];
1590
- var userAgent = (_navUserAgentCheck || STR_EMPTY$1)[_DYN_TO_LOWER_CASE$1 ]();
1591
- _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));
1515
+ function setValue(target, field, value, valChk, srcChk) {
1516
+ var theValue = value;
1517
+ if (target) {
1518
+ theValue = target[field];
1519
+ if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) {
1520
+ theValue = value;
1521
+ target[field] = theValue;
1522
+ }
1592
1523
  }
1593
- return _isTrident;
1524
+ return theValue;
1594
1525
  }
1595
- function getIEVersion(userAgentStr) {
1596
- if (userAgentStr === void 0) { userAgentStr = null; }
1597
- if (!userAgentStr) {
1598
- var navigator_1 = getNavigator() || {};
1599
- userAgentStr = navigator_1 ? (navigator_1.userAgent || STR_EMPTY$1)[_DYN_TO_LOWER_CASE$1 ]() : STR_EMPTY$1;
1526
+ function _createProxyFunction(source, funcName) {
1527
+ var srcFunc = null;
1528
+ var src = null;
1529
+ if (isFunction(source)) {
1530
+ srcFunc = source;
1600
1531
  }
1601
- var ua = (userAgentStr || STR_EMPTY$1)[_DYN_TO_LOWER_CASE$1 ]();
1602
- if (strContains(ua, strMsie)) {
1603
- var doc = getDocument() || {};
1604
- return Math.max(parseInt(ua[_DYN_SPLIT$1 ](strMsie)[1]), (doc[strDocumentMode] || 0));
1532
+ else {
1533
+ src = source;
1605
1534
  }
1606
- else if (strContains(ua, strTrident)) {
1607
- var tridentVer = parseInt(ua[_DYN_SPLIT$1 ](strTrident)[1]);
1608
- if (tridentVer) {
1609
- return tridentVer + 4;
1535
+ return function () {
1536
+ var originalArguments = arguments;
1537
+ if (srcFunc) {
1538
+ src = srcFunc();
1610
1539
  }
1611
- }
1612
- return null;
1613
- }
1614
- function isBeaconsSupported(useCached) {
1615
- if (_beaconsSupported === null || useCached === false) {
1616
- _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon);
1617
- }
1618
- return _beaconsSupported;
1540
+ if (src) {
1541
+ return src[funcName][_DYN_APPLY ](src, originalArguments);
1542
+ }
1543
+ };
1619
1544
  }
1620
- function isFetchSupported(withKeepAlive) {
1621
- var isSupported = false;
1622
- try {
1623
- isSupported = !!getInst("fetch");
1624
- var request = getInst("Request");
1625
- if (isSupported && withKeepAlive && request) {
1626
- isSupported = _hasProperty(request, "keepalive");
1545
+ function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) {
1546
+ if (target && name && source) {
1547
+ if (overwriteTarget !== false || isUndefined(target[name])) {
1548
+ target[name] = _createProxyFunction(source, theFunc);
1627
1549
  }
1628
1550
  }
1629
- catch (e) {
1630
- }
1631
- return isSupported;
1632
1551
  }
1633
- function useXDomainRequest() {
1634
- if (_useXDomainRequest === null) {
1635
- _useXDomainRequest = (typeof XDomainRequest !== strShimUndefined);
1636
- if (_useXDomainRequest && isXhrSupported()) {
1637
- _useXDomainRequest = _useXDomainRequest && !_hasProperty(getInst(strXMLHttpRequest), "withCredentials");
1552
+ function createClassFromInterface(defaults) {
1553
+ return /** @class */ (function () {
1554
+ function class_1() {
1555
+ var _this = this;
1556
+ if (defaults) {
1557
+ objForEachKey(defaults, function (field, value) {
1558
+ _this[field] = value;
1559
+ });
1560
+ }
1638
1561
  }
1639
- }
1640
- return _useXDomainRequest;
1562
+ return class_1;
1563
+ }());
1641
1564
  }
1642
- function isXhrSupported() {
1643
- var isSupported = false;
1644
- try {
1645
- var xmlHttpRequest = getInst(strXMLHttpRequest);
1646
- isSupported = !!xmlHttpRequest;
1647
- }
1648
- catch (e) {
1565
+ function optimizeObject(theObject) {
1566
+ if (theObject && objAssign) {
1567
+ theObject = ObjClass$1(objAssign({}, theObject));
1649
1568
  }
1650
- return isSupported;
1651
- }
1652
-
1653
- var _a$2;
1654
- var STR_WARN_TO_CONSOLE = "warnToConsole";
1655
- var AiNonUserActionablePrefix = "AI (Internal): ";
1656
- var AiUserActionablePrefix = "AI: ";
1657
- var AIInternalMessagePrefix = "AITR_";
1658
- var defaultValues$1 = {
1659
- loggingLevelConsole: 0,
1660
- loggingLevelTelemetry: 1,
1661
- maxMessageLimit: 25,
1662
- enableDebug: false
1663
- };
1664
- var _logFuncs = (_a$2 = {},
1665
- _a$2[0 ] = null,
1666
- _a$2[1 ] = "errorToConsole",
1667
- _a$2[2 ] = STR_WARN_TO_CONSOLE,
1668
- _a$2[3 ] = "debugToConsole",
1669
- _a$2);
1670
- function _sanitizeDiagnosticText(text) {
1671
- if (text) {
1672
- return "\"" + text[_DYN_REPLACE ](/\"/g, STR_EMPTY$1) + "\"";
1673
- }
1674
- return STR_EMPTY$1;
1675
- }
1676
- function _logToConsole(func, message) {
1677
- var theConsole = getConsole();
1678
- if (!!theConsole) {
1679
- var logFunc = "log";
1680
- if (theConsole[func]) {
1681
- logFunc = func;
1682
- }
1683
- if (isFunction(theConsole[logFunc])) {
1684
- theConsole[logFunc](message);
1685
- }
1686
- }
1687
- }
1688
- var _InternalLogMessage = /** @class */ (function () {
1689
- function _InternalLogMessage(msgId, msg, isUserAct, properties) {
1690
- if (isUserAct === void 0) { isUserAct = false; }
1691
- var _self = this;
1692
- _self[_DYN_MESSAGE_ID ] = msgId;
1693
- _self[_DYN_MESSAGE$1 ] =
1694
- (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +
1695
- msgId;
1696
- var strProps = STR_EMPTY$1;
1697
- if (hasJSON()) {
1698
- strProps = getJSON().stringify(properties);
1699
- }
1700
- var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : STR_EMPTY$1) +
1701
- (properties ? " props:" + _sanitizeDiagnosticText(strProps) : STR_EMPTY$1);
1702
- _self[_DYN_MESSAGE$1 ] += diagnosticText;
1703
- }
1704
- _InternalLogMessage.dataType = "MessageData";
1705
- return _InternalLogMessage;
1706
- }());
1707
- function safeGetLogger(core, config) {
1708
- return (core || {})[_DYN_LOGGER ] || new DiagnosticLogger(config);
1709
- }
1710
- var DiagnosticLogger = /** @class */ (function () {
1711
- function DiagnosticLogger(config) {
1712
- this.identifier = "DiagnosticLogger";
1713
- this.queue = [];
1714
- var _messageCount = 0;
1715
- var _messageLogged = {};
1716
- var _loggingLevelConsole;
1717
- var _loggingLevelTelemetry;
1718
- var _maxInternalMessageLimit;
1719
- var _enableDebug;
1720
- var _unloadHandler;
1721
- dynamicProto(DiagnosticLogger, this, function (_self) {
1722
- _unloadHandler = _setDefaultsFromConfig(config || {});
1723
- _self.consoleLoggingLevel = function () { return _loggingLevelConsole; };
1724
- _self[_DYN_THROW_INTERNAL ] = function (severity, msgId, msg, properties, isUserAct) {
1725
- if (isUserAct === void 0) { isUserAct = false; }
1726
- var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
1727
- if (_enableDebug) {
1728
- throw dumpObj(message);
1729
- }
1730
- else {
1731
- var logFunc = _logFuncs[severity] || STR_WARN_TO_CONSOLE;
1732
- if (!isUndefined(message[_DYN_MESSAGE$1 ])) {
1733
- if (isUserAct) {
1734
- var messageKey = +message[_DYN_MESSAGE_ID ];
1735
- if (!_messageLogged[messageKey] && _loggingLevelConsole >= severity) {
1736
- _self[logFunc](message[_DYN_MESSAGE$1 ]);
1737
- _messageLogged[messageKey] = true;
1738
- }
1739
- }
1740
- else {
1741
- if (_loggingLevelConsole >= severity) {
1742
- _self[logFunc](message[_DYN_MESSAGE$1 ]);
1743
- }
1744
- }
1745
- _logInternalMessage(severity, message);
1746
- }
1747
- else {
1748
- _debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message);
1749
- }
1750
- }
1751
- };
1752
- _self.debugToConsole = function (message) {
1753
- _logToConsole("debug", message);
1754
- _debugExtMsg("warning", message);
1755
- };
1756
- _self[_DYN_WARN_TO_CONSOLE ] = function (message) {
1757
- _logToConsole("warn", message);
1758
- _debugExtMsg("warning", message);
1759
- };
1760
- _self.errorToConsole = function (message) {
1761
- _logToConsole("error", message);
1762
- _debugExtMsg("error", message);
1763
- };
1764
- _self.resetInternalMessageCount = function () {
1765
- _messageCount = 0;
1766
- _messageLogged = {};
1767
- };
1768
- _self[_DYN_LOG_INTERNAL_MESSAGE ] = _logInternalMessage;
1769
- _self[_DYN_UNLOAD ] = function (isAsync) {
1770
- _unloadHandler && _unloadHandler.rm();
1771
- _unloadHandler = null;
1772
- };
1773
- function _logInternalMessage(severity, message) {
1774
- if (_areInternalMessagesThrottled()) {
1775
- return;
1776
- }
1777
- var logMessage = true;
1778
- var messageKey = AIInternalMessagePrefix + message[_DYN_MESSAGE_ID ];
1779
- if (_messageLogged[messageKey]) {
1780
- logMessage = false;
1781
- }
1782
- else {
1783
- _messageLogged[messageKey] = true;
1784
- }
1785
- if (logMessage) {
1786
- if (severity <= _loggingLevelTelemetry) {
1787
- _self.queue[_DYN_PUSH$2 ](message);
1788
- _messageCount++;
1789
- _debugExtMsg((severity === 1 ? "error" : "warn"), message);
1790
- }
1791
- if (_messageCount === _maxInternalMessageLimit) {
1792
- var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
1793
- var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false);
1794
- _self.queue[_DYN_PUSH$2 ](throttleMessage);
1795
- if (severity === 1 ) {
1796
- _self.errorToConsole(throttleLimitMessage);
1797
- }
1798
- else {
1799
- _self[_DYN_WARN_TO_CONSOLE ](throttleLimitMessage);
1800
- }
1801
- }
1802
- }
1803
- }
1804
- function _setDefaultsFromConfig(config) {
1805
- return onConfigChange(createDynamicConfig(config, defaultValues$1, _self).cfg, function (details) {
1806
- var config = details.cfg;
1807
- _loggingLevelConsole = config[_DYN_LOGGING_LEVEL_CONSOL4 ];
1808
- _loggingLevelTelemetry = config.loggingLevelTelemetry;
1809
- _maxInternalMessageLimit = config.maxMessageLimit;
1810
- _enableDebug = config.enableDebug;
1811
- });
1812
- }
1813
- function _areInternalMessagesThrottled() {
1814
- return _messageCount >= _maxInternalMessageLimit;
1815
- }
1816
- function _debugExtMsg(name, data) {
1817
- var dbgExt = getDebugExt(config || {});
1818
- if (dbgExt && dbgExt[_DYN_DIAG_LOG$1 ]) {
1819
- dbgExt[_DYN_DIAG_LOG$1 ](name, data);
1820
- }
1821
- }
1822
- });
1823
- }
1824
- DiagnosticLogger.__ieDyn=1;
1825
- return DiagnosticLogger;
1826
- }());
1827
- function _getLogger(logger) {
1828
- return (logger || new DiagnosticLogger());
1829
- }
1830
- function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
1831
- if (isUserAct === void 0) { isUserAct = false; }
1832
- _getLogger(logger)[_DYN_THROW_INTERNAL ](severity, msgId, msg, properties, isUserAct);
1833
- }
1834
- function _warnToConsole(logger, message) {
1835
- _getLogger(logger)[_DYN_WARN_TO_CONSOLE ](message);
1836
- }
1837
-
1838
- var rCamelCase = /-([a-z])/g;
1839
- var rNormalizeInvalid = /([^\w\d_$])/g;
1840
- var rLeadingNumeric = /^(\d+[\w\d_$])/;
1841
- function isNotNullOrUndefined(value) {
1842
- return !isNullOrUndefined(value);
1843
- }
1844
- function normalizeJsName(name) {
1845
- var value = name;
1846
- if (value && isString(value)) {
1847
- value = value[_DYN_REPLACE ](rCamelCase, function (_all, letter) {
1848
- return letter.toUpperCase();
1849
- });
1850
- value = value[_DYN_REPLACE ](rNormalizeInvalid, "_");
1851
- value = value[_DYN_REPLACE ](rLeadingNumeric, function (_all, match) {
1852
- return "_" + match;
1853
- });
1854
- }
1855
- return value;
1856
- }
1857
- function strContains(value, search) {
1858
- if (value && search) {
1859
- return strIndexOf(value, search) !== -1;
1860
- }
1861
- return false;
1862
- }
1863
- function toISOString(date) {
1864
- return date && date.toISOString() || "";
1865
- }
1866
- function getExceptionName(object) {
1867
- if (isError(object)) {
1868
- return object[_DYN_NAME$2 ];
1869
- }
1870
- return STR_EMPTY$1;
1871
- }
1872
- function setValue(target, field, value, valChk, srcChk) {
1873
- var theValue = value;
1874
- if (target) {
1875
- theValue = target[field];
1876
- if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) {
1877
- theValue = value;
1878
- target[field] = theValue;
1879
- }
1880
- }
1881
- return theValue;
1882
- }
1883
- function _createProxyFunction(source, funcName) {
1884
- var srcFunc = null;
1885
- var src = null;
1886
- if (isFunction(source)) {
1887
- srcFunc = source;
1888
- }
1889
- else {
1890
- src = source;
1891
- }
1892
- return function () {
1893
- var originalArguments = arguments;
1894
- if (srcFunc) {
1895
- src = srcFunc();
1896
- }
1897
- if (src) {
1898
- return src[funcName][_DYN_APPLY ](src, originalArguments);
1899
- }
1900
- };
1901
- }
1902
- function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) {
1903
- if (target && name && source) {
1904
- if (overwriteTarget !== false || isUndefined(target[name])) {
1905
- target[name] = _createProxyFunction(source, theFunc);
1906
- }
1907
- }
1908
- }
1909
- function createClassFromInterface(defaults) {
1910
- return /** @class */ (function () {
1911
- function class_1() {
1912
- var _this = this;
1913
- if (defaults) {
1914
- objForEachKey(defaults, function (field, value) {
1915
- _this[field] = value;
1916
- });
1917
- }
1918
- }
1919
- return class_1;
1920
- }());
1921
- }
1922
- function optimizeObject(theObject) {
1923
- if (theObject && objAssign) {
1924
- theObject = ObjClass$1(objAssign({}, theObject));
1925
- }
1926
- return theObject;
1569
+ return theObject;
1927
1570
  }
1928
1571
  function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) {
1929
1572
  var theArgs = arguments;
@@ -2000,23 +1643,6 @@
2000
1643
  }
2001
1644
  return theTransports;
2002
1645
  }
2003
- function parseResponse(response, diagLog) {
2004
- try {
2005
- if (response && response !== "") {
2006
- var result = getJSON().parse(response);
2007
- if (result && result[_DYN_ITEMS_RECEIVED$1 ] && result[_DYN_ITEMS_RECEIVED$1 ] >= result.itemsAccepted &&
2008
- result.itemsReceived - result.itemsAccepted === result.errors[_DYN_LENGTH$2 ]) {
2009
- return result;
2010
- }
2011
- }
2012
- }
2013
- catch (e) {
2014
- _throwInternal(diagLog, 1 , 43 , "Cannot parse the response. " + getExceptionName(e), {
2015
- response: response
2016
- });
2017
- }
2018
- return null;
2019
- }
2020
1646
  var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
2021
1647
  var strWithCredentials = "withCredentials";
2022
1648
  var strTimeout = "timeout";
@@ -2064,33 +1690,172 @@
2064
1690
  }
2065
1691
  });
2066
1692
  }
2067
- return headers;
1693
+ return headers;
1694
+ }
1695
+ function _appendHeader(theHeaders, xhr, name) {
1696
+ if (!theHeaders[name] && xhr && xhr[_DYN_GET_RESPONSE_HEADER ]) {
1697
+ var value = xhr[_DYN_GET_RESPONSE_HEADER ](name);
1698
+ if (value) {
1699
+ theHeaders[name] = strTrim(value);
1700
+ }
1701
+ }
1702
+ return theHeaders;
1703
+ }
1704
+ var STR_KILL_DURATION_HEADER = "kill-duration";
1705
+ var STR_KILL_DURATION_SECONDS_HEADER = "kill-duration-seconds";
1706
+ var STR_TIME_DELTA_HEADER = "time-delta-millis";
1707
+ function _getAllResponseHeaders(xhr, isOneDs) {
1708
+ var theHeaders = {};
1709
+ if (!xhr[_DYN_GET_ALL_RESPONSE_HEA5 ]) {
1710
+ if (!!isOneDs) {
1711
+ theHeaders = _appendHeader(theHeaders, xhr, STR_TIME_DELTA_HEADER);
1712
+ theHeaders = _appendHeader(theHeaders, xhr, STR_KILL_DURATION_HEADER);
1713
+ theHeaders = _appendHeader(theHeaders, xhr, STR_KILL_DURATION_SECONDS_HEADER);
1714
+ }
1715
+ }
1716
+ else {
1717
+ theHeaders = convertAllHeadersToMap(xhr[_DYN_GET_ALL_RESPONSE_HEA5 ]());
1718
+ }
1719
+ return theHeaders;
1720
+ }
1721
+
1722
+ var strDocumentMode = "documentMode";
1723
+ var strLocation = "location";
1724
+ var strConsole = "console";
1725
+ var strJSON = "JSON";
1726
+ var strCrypto = "crypto";
1727
+ var strMsCrypto = "msCrypto";
1728
+ var strMsie = "msie";
1729
+ var strTrident = "trident/";
1730
+ var strXMLHttpRequest = "XMLHttpRequest";
1731
+ var _isTrident = null;
1732
+ var _navUserAgentCheck = null;
1733
+ var _enableMocks = false;
1734
+ var _useXDomainRequest = null;
1735
+ var _beaconsSupported = null;
1736
+ function _hasProperty(theClass, property) {
1737
+ var supported = false;
1738
+ if (theClass) {
1739
+ try {
1740
+ supported = property in theClass;
1741
+ if (!supported) {
1742
+ var proto = theClass[strShimPrototype];
1743
+ if (proto) {
1744
+ supported = property in proto;
1745
+ }
1746
+ }
1747
+ }
1748
+ catch (e) {
1749
+ }
1750
+ if (!supported) {
1751
+ try {
1752
+ var tmp = new theClass();
1753
+ supported = !isUndefined(tmp[property]);
1754
+ }
1755
+ catch (e) {
1756
+ }
1757
+ }
1758
+ }
1759
+ return supported;
1760
+ }
1761
+ function getLocation(checkForMock) {
1762
+ if (checkForMock && _enableMocks) {
1763
+ var mockLocation = getInst("__mockLocation");
1764
+ if (mockLocation) {
1765
+ return mockLocation;
1766
+ }
1767
+ }
1768
+ if (typeof location === strShimObject && location) {
1769
+ return location;
1770
+ }
1771
+ return getInst(strLocation);
1772
+ }
1773
+ function getConsole() {
1774
+ if (typeof console !== strShimUndefined) {
1775
+ return console;
1776
+ }
1777
+ return getInst(strConsole);
1778
+ }
1779
+ function hasJSON() {
1780
+ return Boolean((typeof JSON === strShimObject && JSON) || getInst(strJSON) !== null);
1781
+ }
1782
+ function getJSON() {
1783
+ if (hasJSON()) {
1784
+ return JSON || getInst(strJSON);
1785
+ }
1786
+ return null;
1787
+ }
1788
+ function getCrypto() {
1789
+ return getInst(strCrypto);
1790
+ }
1791
+ function getMsCrypto() {
1792
+ return getInst(strMsCrypto);
1793
+ }
1794
+ function isIE() {
1795
+ var nav = getNavigator();
1796
+ if (nav && (nav[_DYN_USER_AGENT ] !== _navUserAgentCheck || _isTrident === null)) {
1797
+ _navUserAgentCheck = nav[_DYN_USER_AGENT ];
1798
+ var userAgent = (_navUserAgentCheck || STR_EMPTY$1)[_DYN_TO_LOWER_CASE$1 ]();
1799
+ _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));
1800
+ }
1801
+ return _isTrident;
1802
+ }
1803
+ function getIEVersion(userAgentStr) {
1804
+ if (userAgentStr === void 0) { userAgentStr = null; }
1805
+ if (!userAgentStr) {
1806
+ var navigator_1 = getNavigator() || {};
1807
+ userAgentStr = navigator_1 ? (navigator_1.userAgent || STR_EMPTY$1)[_DYN_TO_LOWER_CASE$1 ]() : STR_EMPTY$1;
1808
+ }
1809
+ var ua = (userAgentStr || STR_EMPTY$1)[_DYN_TO_LOWER_CASE$1 ]();
1810
+ if (strContains(ua, strMsie)) {
1811
+ var doc = getDocument() || {};
1812
+ return Math.max(parseInt(ua[_DYN_SPLIT$1 ](strMsie)[1]), (doc[strDocumentMode] || 0));
1813
+ }
1814
+ else if (strContains(ua, strTrident)) {
1815
+ var tridentVer = parseInt(ua[_DYN_SPLIT$1 ](strTrident)[1]);
1816
+ if (tridentVer) {
1817
+ return tridentVer + 4;
1818
+ }
1819
+ }
1820
+ return null;
1821
+ }
1822
+ function isBeaconsSupported(useCached) {
1823
+ if (_beaconsSupported === null || useCached === false) {
1824
+ _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon);
1825
+ }
1826
+ return _beaconsSupported;
1827
+ }
1828
+ function isFetchSupported(withKeepAlive) {
1829
+ var isSupported = false;
1830
+ try {
1831
+ isSupported = !!getInst("fetch");
1832
+ var request = getInst("Request");
1833
+ if (isSupported && withKeepAlive && request) {
1834
+ isSupported = _hasProperty(request, "keepalive");
1835
+ }
1836
+ }
1837
+ catch (e) {
1838
+ }
1839
+ return isSupported;
2068
1840
  }
2069
- function _appendHeader(theHeaders, xhr, name) {
2070
- if (!theHeaders[name] && xhr && xhr[_DYN_GET_RESPONSE_HEADER ]) {
2071
- var value = xhr[_DYN_GET_RESPONSE_HEADER ](name);
2072
- if (value) {
2073
- theHeaders[name] = strTrim(value);
1841
+ function useXDomainRequest() {
1842
+ if (_useXDomainRequest === null) {
1843
+ _useXDomainRequest = (typeof XDomainRequest !== strShimUndefined);
1844
+ if (_useXDomainRequest && isXhrSupported()) {
1845
+ _useXDomainRequest = _useXDomainRequest && !_hasProperty(getInst(strXMLHttpRequest), "withCredentials");
2074
1846
  }
2075
1847
  }
2076
- return theHeaders;
1848
+ return _useXDomainRequest;
2077
1849
  }
2078
- var STR_KILL_DURATION_HEADER = "kill-duration";
2079
- var STR_KILL_DURATION_SECONDS_HEADER = "kill-duration-seconds";
2080
- var STR_TIME_DELTA_HEADER = "time-delta-millis";
2081
- function _getAllResponseHeaders(xhr, isOneDs) {
2082
- var theHeaders = {};
2083
- if (!xhr[_DYN_GET_ALL_RESPONSE_HEA5 ]) {
2084
- if (!!isOneDs) {
2085
- theHeaders = _appendHeader(theHeaders, xhr, STR_TIME_DELTA_HEADER);
2086
- theHeaders = _appendHeader(theHeaders, xhr, STR_KILL_DURATION_HEADER);
2087
- theHeaders = _appendHeader(theHeaders, xhr, STR_KILL_DURATION_SECONDS_HEADER);
2088
- }
1850
+ function isXhrSupported() {
1851
+ var isSupported = false;
1852
+ try {
1853
+ var xmlHttpRequest = getInst(strXMLHttpRequest);
1854
+ isSupported = !!xmlHttpRequest;
2089
1855
  }
2090
- else {
2091
- theHeaders = convertAllHeadersToMap(xhr[_DYN_GET_ALL_RESPONSE_HEA5 ]());
1856
+ catch (e) {
2092
1857
  }
2093
- return theHeaders;
1858
+ return isSupported;
2094
1859
  }
2095
1860
 
2096
1861
  var UInt32Mask = 0x100000000;
@@ -2722,6 +2487,7 @@
2722
2487
  configHandler = null;
2723
2488
  }
2724
2489
  };
2490
+ objDefine(handler, "toJSON", { v: function () { return "WatcherHandler" + (handler.fn ? "" : "[X]"); } });
2725
2491
  state.use(handler, configHandler);
2726
2492
  return handler;
2727
2493
  }
@@ -2864,6 +2630,207 @@
2864
2630
  };
2865
2631
  }
2866
2632
 
2633
+ var _aiNamespace = null;
2634
+ function _getExtensionNamespace() {
2635
+ var target = getInst("Microsoft");
2636
+ if (target) {
2637
+ _aiNamespace = target["ApplicationInsights"];
2638
+ }
2639
+ return _aiNamespace;
2640
+ }
2641
+ function getDebugExt(config) {
2642
+ var ns = _aiNamespace;
2643
+ if (!ns && config.disableDbgExt !== true) {
2644
+ ns = _aiNamespace || _getExtensionNamespace();
2645
+ }
2646
+ return ns ? ns["ChromeDbgExt"] : null;
2647
+ }
2648
+
2649
+ var _a$2;
2650
+ var STR_WARN_TO_CONSOLE = "warnToConsole";
2651
+ var AiNonUserActionablePrefix = "AI (Internal): ";
2652
+ var AiUserActionablePrefix = "AI: ";
2653
+ var AIInternalMessagePrefix = "AITR_";
2654
+ var defaultValues$1 = {
2655
+ loggingLevelConsole: 0,
2656
+ loggingLevelTelemetry: 1,
2657
+ maxMessageLimit: 25,
2658
+ enableDebug: false
2659
+ };
2660
+ var _logFuncs = (_a$2 = {},
2661
+ _a$2[0 ] = null,
2662
+ _a$2[1 ] = "errorToConsole",
2663
+ _a$2[2 ] = STR_WARN_TO_CONSOLE,
2664
+ _a$2[3 ] = "debugToConsole",
2665
+ _a$2);
2666
+ function _sanitizeDiagnosticText(text) {
2667
+ if (text) {
2668
+ return "\"" + text[_DYN_REPLACE ](/\"/g, STR_EMPTY$1) + "\"";
2669
+ }
2670
+ return STR_EMPTY$1;
2671
+ }
2672
+ function _logToConsole(func, message) {
2673
+ var theConsole = getConsole();
2674
+ if (!!theConsole) {
2675
+ var logFunc = "log";
2676
+ if (theConsole[func]) {
2677
+ logFunc = func;
2678
+ }
2679
+ if (isFunction(theConsole[logFunc])) {
2680
+ theConsole[logFunc](message);
2681
+ }
2682
+ }
2683
+ }
2684
+ var _InternalLogMessage = /** @class */ (function () {
2685
+ function _InternalLogMessage(msgId, msg, isUserAct, properties) {
2686
+ if (isUserAct === void 0) { isUserAct = false; }
2687
+ var _self = this;
2688
+ _self[_DYN_MESSAGE_ID ] = msgId;
2689
+ _self[_DYN_MESSAGE$1 ] =
2690
+ (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +
2691
+ msgId;
2692
+ var strProps = STR_EMPTY$1;
2693
+ if (hasJSON()) {
2694
+ strProps = getJSON().stringify(properties);
2695
+ }
2696
+ var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : STR_EMPTY$1) +
2697
+ (properties ? " props:" + _sanitizeDiagnosticText(strProps) : STR_EMPTY$1);
2698
+ _self[_DYN_MESSAGE$1 ] += diagnosticText;
2699
+ }
2700
+ _InternalLogMessage.dataType = "MessageData";
2701
+ return _InternalLogMessage;
2702
+ }());
2703
+ function safeGetLogger(core, config) {
2704
+ return (core || {})[_DYN_LOGGER ] || new DiagnosticLogger(config);
2705
+ }
2706
+ var DiagnosticLogger = /** @class */ (function () {
2707
+ function DiagnosticLogger(config) {
2708
+ this.identifier = "DiagnosticLogger";
2709
+ this.queue = [];
2710
+ var _messageCount = 0;
2711
+ var _messageLogged = {};
2712
+ var _loggingLevelConsole;
2713
+ var _loggingLevelTelemetry;
2714
+ var _maxInternalMessageLimit;
2715
+ var _enableDebug;
2716
+ var _unloadHandler;
2717
+ dynamicProto(DiagnosticLogger, this, function (_self) {
2718
+ _unloadHandler = _setDefaultsFromConfig(config || {});
2719
+ _self.consoleLoggingLevel = function () { return _loggingLevelConsole; };
2720
+ _self[_DYN_THROW_INTERNAL ] = function (severity, msgId, msg, properties, isUserAct) {
2721
+ if (isUserAct === void 0) { isUserAct = false; }
2722
+ var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
2723
+ if (_enableDebug) {
2724
+ throw dumpObj(message);
2725
+ }
2726
+ else {
2727
+ var logFunc = _logFuncs[severity] || STR_WARN_TO_CONSOLE;
2728
+ if (!isUndefined(message[_DYN_MESSAGE$1 ])) {
2729
+ if (isUserAct) {
2730
+ var messageKey = +message[_DYN_MESSAGE_ID ];
2731
+ if (!_messageLogged[messageKey] && _loggingLevelConsole >= severity) {
2732
+ _self[logFunc](message[_DYN_MESSAGE$1 ]);
2733
+ _messageLogged[messageKey] = true;
2734
+ }
2735
+ }
2736
+ else {
2737
+ if (_loggingLevelConsole >= severity) {
2738
+ _self[logFunc](message[_DYN_MESSAGE$1 ]);
2739
+ }
2740
+ }
2741
+ _logInternalMessage(severity, message);
2742
+ }
2743
+ else {
2744
+ _debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message);
2745
+ }
2746
+ }
2747
+ };
2748
+ _self.debugToConsole = function (message) {
2749
+ _logToConsole("debug", message);
2750
+ _debugExtMsg("warning", message);
2751
+ };
2752
+ _self[_DYN_WARN_TO_CONSOLE ] = function (message) {
2753
+ _logToConsole("warn", message);
2754
+ _debugExtMsg("warning", message);
2755
+ };
2756
+ _self.errorToConsole = function (message) {
2757
+ _logToConsole("error", message);
2758
+ _debugExtMsg("error", message);
2759
+ };
2760
+ _self.resetInternalMessageCount = function () {
2761
+ _messageCount = 0;
2762
+ _messageLogged = {};
2763
+ };
2764
+ _self[_DYN_LOG_INTERNAL_MESSAGE ] = _logInternalMessage;
2765
+ _self[_DYN_UNLOAD ] = function (isAsync) {
2766
+ _unloadHandler && _unloadHandler.rm();
2767
+ _unloadHandler = null;
2768
+ };
2769
+ function _logInternalMessage(severity, message) {
2770
+ if (_areInternalMessagesThrottled()) {
2771
+ return;
2772
+ }
2773
+ var logMessage = true;
2774
+ var messageKey = AIInternalMessagePrefix + message[_DYN_MESSAGE_ID ];
2775
+ if (_messageLogged[messageKey]) {
2776
+ logMessage = false;
2777
+ }
2778
+ else {
2779
+ _messageLogged[messageKey] = true;
2780
+ }
2781
+ if (logMessage) {
2782
+ if (severity <= _loggingLevelTelemetry) {
2783
+ _self.queue[_DYN_PUSH$2 ](message);
2784
+ _messageCount++;
2785
+ _debugExtMsg((severity === 1 ? "error" : "warn"), message);
2786
+ }
2787
+ if (_messageCount === _maxInternalMessageLimit) {
2788
+ var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
2789
+ var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false);
2790
+ _self.queue[_DYN_PUSH$2 ](throttleMessage);
2791
+ if (severity === 1 ) {
2792
+ _self.errorToConsole(throttleLimitMessage);
2793
+ }
2794
+ else {
2795
+ _self[_DYN_WARN_TO_CONSOLE ](throttleLimitMessage);
2796
+ }
2797
+ }
2798
+ }
2799
+ }
2800
+ function _setDefaultsFromConfig(config) {
2801
+ return onConfigChange(createDynamicConfig(config, defaultValues$1, _self).cfg, function (details) {
2802
+ var config = details.cfg;
2803
+ _loggingLevelConsole = config[_DYN_LOGGING_LEVEL_CONSOL4 ];
2804
+ _loggingLevelTelemetry = config.loggingLevelTelemetry;
2805
+ _maxInternalMessageLimit = config.maxMessageLimit;
2806
+ _enableDebug = config.enableDebug;
2807
+ });
2808
+ }
2809
+ function _areInternalMessagesThrottled() {
2810
+ return _messageCount >= _maxInternalMessageLimit;
2811
+ }
2812
+ function _debugExtMsg(name, data) {
2813
+ var dbgExt = getDebugExt(config || {});
2814
+ if (dbgExt && dbgExt[_DYN_DIAG_LOG$1 ]) {
2815
+ dbgExt[_DYN_DIAG_LOG$1 ](name, data);
2816
+ }
2817
+ }
2818
+ });
2819
+ }
2820
+ DiagnosticLogger.__ieDyn=1;
2821
+ return DiagnosticLogger;
2822
+ }());
2823
+ function _getLogger(logger) {
2824
+ return (logger || new DiagnosticLogger());
2825
+ }
2826
+ function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
2827
+ if (isUserAct === void 0) { isUserAct = false; }
2828
+ _getLogger(logger)[_DYN_THROW_INTERNAL ](severity, msgId, msg, properties, isUserAct);
2829
+ }
2830
+ function _warnToConsole(logger, message) {
2831
+ _getLogger(logger)[_DYN_WARN_TO_CONSOLE ](message);
2832
+ }
2833
+
2867
2834
  var strExecutionContextKey = "ctx";
2868
2835
  var strParentContextKey = "ParentContextKey";
2869
2836
  var strChildrenContextKey = "ChildrenContextKey";
@@ -3509,7 +3476,7 @@
3509
3476
  function _setDefaults(config, core, pluginChain) {
3510
3477
  createDynamicConfig(config, defaultValues, safeGetLogger(core));
3511
3478
  if (!pluginChain && core) {
3512
- pluginChain = core[_DYN_GET_PROCESS_TEL_CONT0 ]()[_DYN_GET_NEXT ]();
3479
+ pluginChain = core[_DYN_GET_PROCESS_TEL_CONT2 ]()[_DYN_GET_NEXT ]();
3513
3480
  }
3514
3481
  var nextPlugin = _nextPlugin;
3515
3482
  if (_nextPlugin && _nextPlugin[strGetPlugin]) {
@@ -3531,6 +3498,24 @@
3531
3498
  return BaseTelemetryPlugin;
3532
3499
  }());
3533
3500
 
3501
+ function parseResponse(response, diagLog) {
3502
+ try {
3503
+ if (response && response !== "") {
3504
+ var result = getJSON().parse(response);
3505
+ if (result && result[_DYN_ITEMS_RECEIVED$1 ] && result[_DYN_ITEMS_RECEIVED$1 ] >= result.itemsAccepted &&
3506
+ result.itemsReceived - result.itemsAccepted === result.errors[_DYN_LENGTH$2 ]) {
3507
+ return result;
3508
+ }
3509
+ }
3510
+ }
3511
+ catch (e) {
3512
+ _throwInternal(diagLog, 1 , 43 , "Cannot parse the response. " + (e[_DYN_NAME$2 ] || dumpObj(e)), {
3513
+ response: response
3514
+ });
3515
+ }
3516
+ return null;
3517
+ }
3518
+
3534
3519
  var STR_EMPTY = "";
3535
3520
  var STR_NO_RESPONSE_BODY = "NoResponseBody";
3536
3521
  var _noResponseQs = "&" + STR_NO_RESPONSE_BODY + "=true";
@@ -5547,7 +5532,7 @@
5547
5532
  }
5548
5533
  }
5549
5534
  var EnvelopeCreator = {
5550
- Version: '3.1.2-nightly3.2403-07'
5535
+ Version: '3.1.2'
5551
5536
  };
5552
5537
  function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
5553
5538
  EnvelopeCreatorInit(logger, telemetryItem);