@microsoft/applicationinsights-channel-js 3.4.0-nightlybeta3.2504-05 → 3.4.0-nightlybeta3.2504-17

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 (58) hide show
  1. package/browser/es5/{applicationinsights-channel-js.3.4.0-nightlybeta3.2504-05.js → applicationinsights-channel-js.3.4.0-nightlybeta3.2504-17.cjs.js} +320 -179
  2. package/browser/es5/applicationinsights-channel-js.3.4.0-nightlybeta3.2504-17.cjs.js.map +1 -0
  3. package/browser/es5/applicationinsights-channel-js.3.4.0-nightlybeta3.2504-17.cjs.min.js +6 -0
  4. package/browser/es5/applicationinsights-channel-js.3.4.0-nightlybeta3.2504-17.cjs.min.js.map +1 -0
  5. package/browser/es5/{applicationinsights-channel-js.3.4.0-nightlybeta3.2504-05.gbl.js → applicationinsights-channel-js.3.4.0-nightlybeta3.2504-17.gbl.js} +322 -154
  6. package/browser/es5/applicationinsights-channel-js.3.4.0-nightlybeta3.2504-17.gbl.js.map +1 -0
  7. package/browser/es5/applicationinsights-channel-js.3.4.0-nightlybeta3.2504-17.gbl.min.js +6 -0
  8. package/browser/es5/applicationinsights-channel-js.3.4.0-nightlybeta3.2504-17.gbl.min.js.map +1 -0
  9. package/browser/es5/applicationinsights-channel-js.3.4.0-nightlybeta3.2504-17.integrity.json +66 -0
  10. package/browser/es5/{applicationinsights-channel-js.3.4.0-nightlybeta3.2504-05.cjs.js → applicationinsights-channel-js.3.4.0-nightlybeta3.2504-17.js} +347 -152
  11. package/browser/es5/applicationinsights-channel-js.3.4.0-nightlybeta3.2504-17.js.map +1 -0
  12. package/browser/es5/applicationinsights-channel-js.3.4.0-nightlybeta3.2504-17.min.js +6 -0
  13. package/browser/es5/applicationinsights-channel-js.3.4.0-nightlybeta3.2504-17.min.js.map +1 -0
  14. package/browser/es5/applicationinsights-channel-js.3.cjs.js +319 -151
  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 +321 -153
  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 +321 -153
  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 +319 -151
  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 +2 -1
  36. package/dist-es5/SendBuffer.js.map +1 -1
  37. package/dist-es5/Sender.js +84 -15
  38. package/dist-es5/Sender.js.map +1 -1
  39. package/dist-es5/Serializer.js +1 -1
  40. package/dist-es5/TelemetryProcessors/Sample.js +1 -1
  41. package/dist-es5/TelemetryProcessors/SamplingScoreGenerators/HashCodeScoreGenerator.js +1 -1
  42. package/dist-es5/TelemetryProcessors/SamplingScoreGenerators/SamplingScoreGenerator.js +1 -1
  43. package/dist-es5/__DynamicConstants.js +5 -5
  44. package/dist-es5/__DynamicConstants.js.map +1 -1
  45. package/dist-es5/applicationinsights-channel-js.js +1 -1
  46. package/package.json +3 -3
  47. package/types/applicationinsights-channel-js.d.ts +17 -4
  48. package/types/applicationinsights-channel-js.namespaced.d.ts +49 -4
  49. package/browser/es5/applicationinsights-channel-js.3.4.0-nightlybeta3.2504-05.cjs.js.map +0 -1
  50. package/browser/es5/applicationinsights-channel-js.3.4.0-nightlybeta3.2504-05.cjs.min.js +0 -6
  51. package/browser/es5/applicationinsights-channel-js.3.4.0-nightlybeta3.2504-05.cjs.min.js.map +0 -1
  52. package/browser/es5/applicationinsights-channel-js.3.4.0-nightlybeta3.2504-05.gbl.js.map +0 -1
  53. package/browser/es5/applicationinsights-channel-js.3.4.0-nightlybeta3.2504-05.gbl.min.js +0 -6
  54. package/browser/es5/applicationinsights-channel-js.3.4.0-nightlybeta3.2504-05.gbl.min.js.map +0 -1
  55. package/browser/es5/applicationinsights-channel-js.3.4.0-nightlybeta3.2504-05.integrity.json +0 -66
  56. package/browser/es5/applicationinsights-channel-js.3.4.0-nightlybeta3.2504-05.js.map +0 -1
  57. package/browser/es5/applicationinsights-channel-js.3.4.0-nightlybeta3.2504-05.min.js +0 -6
  58. package/browser/es5/applicationinsights-channel-js.3.4.0-nightlybeta3.2504-05.min.js.map +0 -1
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Channel, 3.4.0-nightlybeta3.2504-05
2
+ * Application Insights JavaScript SDK - Channel, 3.4.0-nightlybeta3.2504-17
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
6
6
  var undef = "undefined";
7
- var nsKey, key, nm, theExports = {}, modName = "es5_applicationinsights_channel_js_3_4_0_nightlybeta3_2504_05", msMod="__ms$mod__";
8
- var mods={}, modDetail=mods[modName]={}, ver="3.4.0-nightlybeta3.2504-05";
7
+ var nsKey, key, nm, theExports = {}, modName = "es5_applicationinsights_channel_js_3_4_0_nightlybeta3_2504_17", msMod="__ms$mod__";
8
+ var mods={}, modDetail=mods[modName]={}, ver="3.4.0-nightlybeta3.2504-17";
9
9
  var baseNs=global, nsKey="Microsoft", baseNs=baseNs[nsKey]=(baseNs[nsKey]||{});
10
10
  // Versioned namespace "Microsoft.ApplicationInsights3"
11
11
  var exportNs=baseNs, nsKey="ApplicationInsights3", exportNs=exportNs[nsKey]=(exportNs[nsKey]||{});
@@ -33,7 +33,7 @@ var strShimPrototype = "prototype";
33
33
  var ObjClass$1 = Object;
34
34
  var ObjProto$1 = ObjClass$1[strShimPrototype];
35
35
 
36
- /*! https://github.com/nevware21/ts-utils v0.11.8 */
36
+ /*! https://github.com/nevware21/ts-utils v0.12.2 */
37
37
  /*#__NO_SIDE_EFFECTS__*/
38
38
  function _pureAssign(func1, func2) {
39
39
  return func1 || func2;
@@ -52,7 +52,6 @@ var __PROTO__ = "__proto__";
52
52
  var UNDEFINED = "undefined";
53
53
  var CONSTRUCTOR = "constructor";
54
54
  var SYMBOL = "Symbol";
55
- var POLYFILL_TAG = "_polyfill";
56
55
  var LENGTH = "length";
57
56
  var NAME = "name";
58
57
  var CALL = "call";
@@ -65,6 +64,8 @@ var MathCls = ( /*#__PURE__*/_pureAssign(Math));
65
64
  var ArrCls = ( /*#__PURE__*/_pureAssign(Array));
66
65
  var ArrProto = ( /*#__PURE__*/_pureRef(ArrCls, PROTOTYPE));
67
66
  var ArrSlice = ( /*#__PURE__*/_pureRef(ArrProto, "slice"));
67
+ var POLYFILL_TAG = "_polyfill";
68
+ var POLYFILL_TYPE_NAME = "__nw21$polytype__";
68
69
  function safe(func, argArray) {
69
70
  try {
70
71
  return {
@@ -103,7 +104,7 @@ function isUndefined(value) {
103
104
  }
104
105
  /*#__NO_SIDE_EFFECTS__*/
105
106
  function isStrictUndefined(arg) {
106
- return !isDefined(arg);
107
+ return arg === UNDEF_VALUE;
107
108
  }
108
109
  /*#__NO_SIDE_EFFECTS__*/
109
110
  function isNullOrUndefined(value) {
@@ -111,7 +112,7 @@ function isNullOrUndefined(value) {
111
112
  }
112
113
  /*#__NO_SIDE_EFFECTS__*/
113
114
  function isStrictNullOrUndefined(value) {
114
- return value === NULL_VALUE || !isDefined(value);
115
+ return value === NULL_VALUE || value === UNDEF_VALUE;
115
116
  }
116
117
  /*#__NO_SIDE_EFFECTS__*/
117
118
  function isDefined(arg) {
@@ -138,18 +139,48 @@ function isPromiseLike(value) {
138
139
  function isTruthy(value) {
139
140
  return !(!value || safeGet(function () { return !(value && (0 + value)); }, !value));
140
141
  }
141
- var objGetOwnPropertyDescriptor = ( /* #__PURE__ */_pureRef(ObjClass, "getOwnPropertyDescriptor"));
142
+ var asString = ( /* #__PURE__ */_pureAssign(StrCls));
143
+ var ERROR_TYPE = "[object Error]";
144
+ /*#__NO_SIDE_EFFECTS__*/
145
+ function dumpObj(object, format) {
146
+ var propertyValueDump = EMPTY;
147
+ var objType = ObjProto[TO_STRING][CALL](object);
148
+ if (objType === ERROR_TYPE) {
149
+ object = { stack: asString(object.stack), message: asString(object.message), name: asString(object.name) };
150
+ }
151
+ try {
152
+ propertyValueDump = JSON.stringify(object, NULL_VALUE, format ? ((typeof format === "number") ? format : 4) : UNDEF_VALUE);
153
+ propertyValueDump = (propertyValueDump ? propertyValueDump.replace(/"(\w+)"\s*:\s{0,1}/g, "$1: ") : NULL_VALUE) || asString(object);
154
+ }
155
+ catch (e) {
156
+ propertyValueDump = " - " + dumpObj(e, format);
157
+ }
158
+ return objType + ": " + propertyValueDump;
159
+ }
160
+ function throwTypeError(message) {
161
+ throw new TypeError(message);
162
+ }
163
+ function _throwIfNullOrUndefined(obj) {
164
+ if (isStrictNullOrUndefined(obj)) {
165
+ throwTypeError("Cannot convert undefined or null to object");
166
+ }
167
+ }
168
+ function _returnNothing() {
169
+ return UNDEF_VALUE;
170
+ }
171
+ var objGetOwnPropertyDescriptor = ( /* #__PURE__ */_pureAssign(( /* #__PURE__ */_pureRef(ObjClass, "getOwnPropertyDescriptor")), _returnNothing));
142
172
  /*#__NO_SIDE_EFFECTS__*/
143
173
  function objHasOwnProperty(obj, prop) {
144
174
  return !!obj && ObjProto.hasOwnProperty[CALL](obj, prop);
145
175
  }
146
- var objHasOwn = ( /*#__PURE__*/_pureAssign(( /* #__PURE__ */_pureRef(ObjClass, "hasOwn")), polyObjHasOwn));
147
176
  /*#__NO_SIDE_EFFECTS__*/
148
177
  function polyObjHasOwn(obj, prop) {
178
+ _throwIfNullOrUndefined(obj);
149
179
  return objHasOwnProperty(obj, prop) || !!objGetOwnPropertyDescriptor(obj, prop);
150
180
  }
181
+ var objHasOwn = ( /*#__PURE__*/_pureAssign(( /* #__PURE__ */_pureRef(ObjClass, "hasOwn")), polyObjHasOwn));
151
182
  function objForEachKey(theObject, callbackfn, thisArg) {
152
- if (theObject && isObject(theObject)) {
183
+ if (theObject && (isObject(theObject) || isFunction(theObject))) {
153
184
  for (var prop in theObject) {
154
185
  if (objHasOwn(theObject, prop)) {
155
186
  if (callbackfn[CALL](thisArg || theObject, prop, theObject[prop]) === -1) {
@@ -159,6 +190,31 @@ function objForEachKey(theObject, callbackfn, thisArg) {
159
190
  }
160
191
  }
161
192
  }
193
+ function arrForEach(theArray, callbackfn, thisArg) {
194
+ if (theArray) {
195
+ var len = theArray[LENGTH] >>> 0;
196
+ for (var idx = 0; idx < len; idx++) {
197
+ if (idx in theArray) {
198
+ if (callbackfn[CALL](thisArg || theArray, theArray[idx], idx, theArray) === -1) {
199
+ break;
200
+ }
201
+ }
202
+ }
203
+ }
204
+ }
205
+ var _unwrapFunction = ( _unwrapFunctionWithPoly);
206
+ /*#__NO_SIDE_EFFECTS__*/
207
+ function _unwrapFunctionWithPoly(funcName, clsProto, polyFunc) {
208
+ var clsFn = clsProto ? clsProto[funcName] : NULL_VALUE;
209
+ return function (thisArg) {
210
+ var theFunc = (thisArg ? thisArg[funcName] : NULL_VALUE) || clsFn;
211
+ if (theFunc || polyFunc) {
212
+ var theArgs = arguments;
213
+ return (theFunc || polyFunc).apply(thisArg, theFunc ? ArrSlice[CALL](theArgs, 1) : theArgs);
214
+ }
215
+ throwTypeError("\"" + asString(funcName) + "\" not defined for " + dumpObj(thisArg));
216
+ };
217
+ }
162
218
  var propMap = {
163
219
  e: "enumerable",
164
220
  c: "configurable",
@@ -187,6 +243,7 @@ function _createProp(value) {
187
243
  return prop;
188
244
  }
189
245
  var objDefineProp = ( /*#__PURE__*/_pureRef(ObjClass, "defineProperty"));
246
+ var objDefineProperties = ( /*#__PURE__*/_pureRef(ObjClass, "defineProperties"));
190
247
  function objDefine(target, key, propDesc) {
191
248
  return objDefineProp(target, key, _createProp(propDesc));
192
249
  }
@@ -206,46 +263,38 @@ function _assignMapValue(theMap, key, value, writable) {
206
263
  writable: false
207
264
  });
208
265
  }
209
- var asString = ( /* #__PURE__ */_pureAssign(StrCls));
210
- var ERROR_TYPE = "[object Error]";
211
- /*#__NO_SIDE_EFFECTS__*/
212
- function dumpObj(object, format) {
213
- var propertyValueDump = EMPTY;
214
- var objType = ObjProto[TO_STRING][CALL](object);
215
- if (objType === ERROR_TYPE) {
216
- object = { stack: asString(object.stack), message: asString(object.message), name: asString(object.name) };
217
- }
218
- try {
219
- propertyValueDump = JSON.stringify(object, NULL_VALUE, format ? ((typeof format === "number") ? format : 4) : UNDEF_VALUE);
220
- propertyValueDump = (propertyValueDump ? propertyValueDump.replace(/"(\w+)"\s*:\s{0,1}/g, "$1: ") : NULL_VALUE) || asString(object);
221
- }
222
- catch (e) {
223
- propertyValueDump = " - " + dumpObj(e, format);
224
- }
225
- return objType + ": " + propertyValueDump;
226
- }
227
- function throwTypeError(message) {
228
- throw new TypeError(message);
266
+ function _returnFalse() {
267
+ return false;
229
268
  }
269
+ var objIsFrozen = ( /* #__PURE__*/_pureAssign(( /* #__PURE__ */_pureRef(ObjClass, "isFrozen")), _returnFalse));
230
270
  var _objFreeze = ( /* #__PURE__ */_pureRef(ObjClass, "freeze"));
231
271
  function _doNothing(value) {
232
272
  return value;
233
273
  }
234
274
  /*#__NO_SIDE_EFFECTS__*/
235
275
  function _getProto(value) {
276
+ _throwIfNullOrUndefined(value);
236
277
  return value[__PROTO__] || NULL_VALUE;
237
278
  }
238
279
  var objAssign = ( /*#__PURE__*/_pureRef(ObjClass, "assign"));
239
280
  var objKeys = ( /*#__PURE__*/_pureRef(ObjClass, "keys"));
240
- function objDeepFreeze(value) {
241
- if (_objFreeze) {
242
- objForEachKey(value, function (key, value) {
243
- if (isArray(value) || isObject(value)) {
244
- objDeepFreeze(value);
281
+ function _deepFreeze(val, visited) {
282
+ if ((isArray(val) || isObject(val) || isFunction(val)) && !objIsFrozen(val)) {
283
+ for (var lp = 0; lp < visited.length; lp++) {
284
+ if (visited[lp] === val) {
285
+ return val;
245
286
  }
287
+ }
288
+ visited.push(val);
289
+ objForEachKey(val, function (_key, propValue) {
290
+ _deepFreeze(propValue, visited);
246
291
  });
292
+ objFreeze(val);
247
293
  }
248
- return objFreeze(value);
294
+ return val;
295
+ }
296
+ function objDeepFreeze(value) {
297
+ return _objFreeze ? _deepFreeze(value, []) : value;
249
298
  }
250
299
  var objFreeze = ( /* #__PURE__*/_pureAssign(_objFreeze, _doNothing));
251
300
  var objGetPrototypeOf = ( /* #__PURE__*/_pureAssign(( /* #__PURE__*/_pureRef(ObjClass, "getPrototypeOf")), _getProto));
@@ -312,19 +361,6 @@ function _getGlobalConfig() {
312
361
  }
313
362
  return _globalCfg;
314
363
  }
315
- var _unwrapFunction = ( _unwrapFunctionWithPoly);
316
- /*#__NO_SIDE_EFFECTS__*/
317
- function _unwrapFunctionWithPoly(funcName, clsProto, polyFunc) {
318
- var clsFn = clsProto ? clsProto[funcName] : NULL_VALUE;
319
- return function (thisArg) {
320
- var theFunc = (thisArg ? thisArg[funcName] : NULL_VALUE) || clsFn;
321
- if (theFunc || polyFunc) {
322
- var theArgs = arguments;
323
- return (theFunc || polyFunc).apply(thisArg, theFunc ? ArrSlice[CALL](theArgs, 1) : theArgs);
324
- }
325
- throwTypeError("\"" + asString(funcName) + "\" not defined for " + dumpObj(thisArg));
326
- };
327
- }
328
364
  var mathMin = ( /*#__PURE__*/_pureRef(MathCls, "min"));
329
365
  var mathMax = ( /*#__PURE__*/_pureRef(MathCls, "max"));
330
366
  var strSlice = ( /*#__PURE__*/_unwrapFunction("slice", StrProto));
@@ -332,9 +368,7 @@ var strSubstring = ( /*#__PURE__*/_unwrapFunction("substring", StrProto));
332
368
  var strSubstr = ( /*#__PURE__*/_unwrapFunctionWithPoly("substr", StrProto, polyStrSubstr));
333
369
  /*#__NO_SIDE_EFFECTS__*/
334
370
  function polyStrSubstr(value, start, length) {
335
- if (isNullOrUndefined(value)) {
336
- throwTypeError("Invalid " + dumpObj(value));
337
- }
371
+ _throwIfNullOrUndefined(value);
338
372
  if (length < 0) {
339
373
  return EMPTY;
340
374
  }
@@ -347,8 +381,94 @@ function polyStrSubstr(value, start, length) {
347
381
  }
348
382
  return strSlice(value, start, start + length);
349
383
  }
384
+ function _tagAsPolyfill(target, polyfillTypeName) {
385
+ if (target) {
386
+ safe(function () {
387
+ target[POLYFILL_TAG] = true;
388
+ target[POLYFILL_TYPE_NAME] = polyfillTypeName;
389
+ });
390
+ safe(objDefine, [target, POLYFILL_TAG, {
391
+ v: true,
392
+ w: false,
393
+ e: false
394
+ }]);
395
+ safe(objDefine, [target, POLYFILL_TYPE_NAME, {
396
+ v: polyfillTypeName,
397
+ w: false,
398
+ e: false
399
+ }]);
400
+ }
401
+ return target;
402
+ }
403
+ var objCreate = ( /* #__PURE__*/_pureAssign(( /* #__PURE__*/_pureRef(ObjClass, "create")), polyObjCreate));
404
+ /*#__NO_SIDE_EFFECTS__*/
405
+ function polyObjCreate(obj, properties) {
406
+ var newObj = null;
407
+ function tempFunc() { }
408
+ if (!isStrictNullOrUndefined(obj)) {
409
+ var type = typeof obj;
410
+ if (type !== OBJECT && type !== FUNCTION) {
411
+ throwTypeError("Prototype must be an Object or function: " + dumpObj(obj));
412
+ }
413
+ tempFunc[PROTOTYPE] = obj;
414
+ safe(function () {
415
+ tempFunc[__PROTO__] = obj;
416
+ });
417
+ newObj = new tempFunc();
418
+ }
419
+ else {
420
+ newObj = {};
421
+ }
422
+ if (properties) {
423
+ safe(objDefineProperties, [newObj, properties]);
424
+ }
425
+ return newObj;
426
+ }
427
+ /*#__NO_SIDE_EFFECTS__*/
428
+ function utcNow() {
429
+ return (Date.now || polyUtcNow)();
430
+ }
431
+ /*#__NO_SIDE_EFFECTS__*/
432
+ function polyUtcNow() {
433
+ return new Date().getTime();
434
+ }
435
+ var _globalLazyTestHooks;
436
+ function _initTestHooks() {
437
+ _globalLazyTestHooks = _getGlobalConfig();
438
+ }
439
+ /*#__NO_SIDE_EFFECTS__*/
440
+ function getLazy(cb) {
441
+ var lazyValue = {};
442
+ !_globalLazyTestHooks && _initTestHooks();
443
+ lazyValue.b = _globalLazyTestHooks.lzy;
444
+ objDefineProp(lazyValue, "v", {
445
+ configurable: true,
446
+ get: function () {
447
+ var result = cb();
448
+ if (!_globalLazyTestHooks.lzy) {
449
+ objDefineProp(lazyValue, "v", {
450
+ value: result
451
+ });
452
+ }
453
+ lazyValue.b = _globalLazyTestHooks.lzy;
454
+ return result;
455
+ }
456
+ });
457
+ return lazyValue;
458
+ }
459
+ var mathRandom = ( /*#__PURE__*/_pureRef(MathCls, "random"));
460
+ var _uniqueInstanceId = ( /*#__PURE__*/getLazy(function () {
461
+ var value = (utcNow().toString(36).slice(2));
462
+ while (value.length < 16) {
463
+ value += mathRandom().toString(36).slice(2);
464
+ }
465
+ value = value.substring(0, 16);
466
+ return value;
467
+ }));
350
468
  var UNIQUE_REGISTRY_ID = "_urid";
469
+ var POLY_SYM = "$nw21sym";
351
470
  var _polySymbols;
471
+ var _polyId = 0;
352
472
  /*#__NO_SIDE_EFFECTS__*/
353
473
  function _globalSymbolRegistry() {
354
474
  if (!_polySymbols) {
@@ -360,12 +480,22 @@ function _globalSymbolRegistry() {
360
480
  var _wellKnownSymbolCache;
361
481
  /*#__NO_SIDE_EFFECTS__*/
362
482
  function polyNewSymbol(description) {
363
- var theSymbol = {
364
- description: asString(description),
365
- toString: function () { return SYMBOL + "(" + description + ")"; }
366
- };
367
- theSymbol[POLYFILL_TAG] = true;
368
- return theSymbol;
483
+ var uniqueId = "_" + _polyId++ + "_" + _uniqueInstanceId.v;
484
+ var symString = SYMBOL + "(" + description + ")";
485
+ function _setProp(name, value) {
486
+ objDefine(theSymbol, name, {
487
+ v: value,
488
+ e: false,
489
+ w: false
490
+ });
491
+ }
492
+ var theSymbol = objCreate(null);
493
+ _setProp("description", asString(description));
494
+ _setProp(TO_STRING, function () { return symString + POLY_SYM + uniqueId; });
495
+ _setProp("valueOf", function () { return theSymbol; });
496
+ _setProp("v", symString);
497
+ _setProp("_uid", uniqueId);
498
+ return _tagAsPolyfill(theSymbol, "symbol");
369
499
  }
370
500
  /*#__NO_SIDE_EFFECTS__*/
371
501
  function polySymbolFor(key) {
@@ -389,10 +519,6 @@ function polyGetKnownSymbol(name) {
389
519
  }
390
520
  return result;
391
521
  }
392
- var _globalLazyTestHooks;
393
- function _initTestHooks() {
394
- _globalLazyTestHooks = _getGlobalConfig();
395
- }
396
522
  /*#__NO_SIDE_EFFECTS__*/
397
523
  function createCachedValue(value) {
398
524
  return objDefineProp({
@@ -560,46 +686,18 @@ function arrAppend(target, elms) {
560
686
  }
561
687
  return target;
562
688
  }
563
- function arrForEach(theArray, callbackfn, thisArg) {
564
- if (theArray) {
565
- var len = theArray[LENGTH] >>> 0;
566
- for (var idx = 0; idx < len; idx++) {
567
- if (idx in theArray) {
568
- if (callbackfn[CALL](thisArg || theArray, theArray[idx], idx, theArray) === -1) {
569
- break;
570
- }
571
- }
572
- }
573
- }
574
- }
575
689
  var arrIndexOf = ( /*#__PURE__*/_unwrapFunction("indexOf", ArrProto));
576
690
  var arrMap = ( /*#__PURE__*/_unwrapFunction("map", ArrProto));
577
691
  function arrSlice(theArray, start, end) {
578
692
  return ((theArray ? theArray["slice"] : NULL_VALUE) || ArrSlice).apply(theArray, ArrSlice[CALL](arguments, 1));
579
693
  }
580
- var objCreate = ( /* #__PURE__*/_pureAssign(( /* #__PURE__*/_pureRef(ObjClass, "create")), polyObjCreate));
581
- /*#__NO_SIDE_EFFECTS__*/
582
- function polyObjCreate(obj) {
583
- if (!obj) {
584
- return {};
585
- }
586
- var type = typeof obj;
587
- if (type !== OBJECT && type !== FUNCTION) {
588
- throwTypeError("Prototype must be an Object or function: " + dumpObj(obj));
589
- }
590
- function tempFunc() { }
591
- tempFunc[PROTOTYPE] = obj;
592
- return new tempFunc();
593
- }
594
694
  var _isProtoArray;
595
- function objSetPrototypeOf(obj, proto) {
596
- var fn = ObjClass["setPrototypeOf"] ||
597
- function (d, b) {
598
- var _a;
599
- !_isProtoArray && (_isProtoArray = createCachedValue((_a = {}, _a[__PROTO__] = [], _a) instanceof Array));
600
- _isProtoArray.v ? d[__PROTO__] = b : objForEachKey(b, function (key, value) { return d[key] = value; });
601
- };
602
- return fn(obj, proto);
695
+ var objSetPrototypeOf = ( /* #__PURE__*/_pureAssign(( /* #__PURE__ */_pureRef(ObjClass, "setPrototypeOf")), _polyObjSetPrototypeOf));
696
+ function _polyObjSetPrototypeOf(obj, proto) {
697
+ var _a;
698
+ !_isProtoArray && (_isProtoArray = createCachedValue((_a = {}, _a[__PROTO__] = [], _a) instanceof Array));
699
+ _isProtoArray.v ? obj[__PROTO__] = proto : objForEachKey(proto, function (key, value) { return obj[key] = value; });
700
+ return obj;
603
701
  }
604
702
  /*#__NO_SIDE_EFFECTS__*/
605
703
  function _createCustomError(name, d, b) {
@@ -642,19 +740,9 @@ function createCustomError(name, constructCb, errorBase) {
642
740
  }, theBaseClass);
643
741
  }
644
742
  /*#__NO_SIDE_EFFECTS__*/
645
- function utcNow() {
646
- return (Date.now || polyUtcNow)();
647
- }
648
- /*#__NO_SIDE_EFFECTS__*/
649
- function polyUtcNow() {
650
- return new Date().getTime();
651
- }
652
- /*#__NO_SIDE_EFFECTS__*/
653
743
  function _createTrimFn(exp) {
654
744
  return function _doTrim(value) {
655
- if (isNullOrUndefined(value)) {
656
- throwTypeError("strTrim called [" + dumpObj(value) + "]");
657
- }
745
+ _throwIfNullOrUndefined(value);
658
746
  if (value && value.replace) {
659
747
  value = value.replace(exp, EMPTY);
660
748
  }
@@ -1095,11 +1183,11 @@ var _DYN_CANCEL = "cancel";
1095
1183
  var _DYN_INITIALIZE$1 = "initialize";
1096
1184
  var _DYN_IDENTIFIER = "identifier";
1097
1185
  var _DYN_IS_INITIALIZED = "isInitialized";
1098
- var _DYN_VALUE = "value";
1099
1186
  var _DYN_GET_PLUGIN = "getPlugin";
1100
1187
  var _DYN_NAME$2 = "name";
1101
1188
  var _DYN_PROCESS_NEXT = "processNext";
1102
1189
  var _DYN_GET_PROCESS_TEL_CONT2 = "getProcessTelContext";
1190
+ var _DYN_VALUE = "value";
1103
1191
  var _DYN_UNLOAD = "unload";
1104
1192
  var _DYN_LOGGING_LEVEL_CONSOL4 = "loggingLevelConsole";
1105
1193
  var _DYN_CREATE_NEW = "createNew";
@@ -1117,6 +1205,7 @@ var _DYN_REPLACE = "replace";
1117
1205
  var _DYN_TYPE = "type";
1118
1206
  var _DYN_EVT_NAME = "evtName";
1119
1207
  var _DYN_STATUS = "status";
1208
+ var _DYN_INDEX_OF = "indexOf";
1120
1209
  var _DYN_GET_ALL_RESPONSE_HEA5 = "getAllResponseHeaders";
1121
1210
  var _DYN_IS_CHILD_EVT = "isChildEvt";
1122
1211
  var _DYN_DATA$1 = "data";
@@ -1470,6 +1559,30 @@ var STR_PRIORITY = "priority";
1470
1559
  var STR_GET_PERF_MGR = "getPerfMgr";
1471
1560
  var STR_NOT_DYNAMIC_ERROR = "Not dynamic - ";
1472
1561
 
1562
+ function _stringToBoolOrDefault(theValue, defaultValue, theConfig) {
1563
+ if (!theValue && isNullOrUndefined(theValue)) {
1564
+ return defaultValue;
1565
+ }
1566
+ if (isBoolean(theValue)) {
1567
+ return theValue;
1568
+ }
1569
+ return asString(theValue)[_DYN_TO_LOWER_CASE$1 ]() === "true";
1570
+ }
1571
+ function cfgDfValidate(validator, defaultValue, fallBackName) {
1572
+ return {
1573
+ fb: fallBackName,
1574
+ isVal: validator,
1575
+ v: defaultValue
1576
+ };
1577
+ }
1578
+ function cfgDfBoolean(defaultValue, fallBackName) {
1579
+ return {
1580
+ fb: fallBackName,
1581
+ set: _stringToBoolOrDefault,
1582
+ v: !!defaultValue
1583
+ };
1584
+ }
1585
+
1473
1586
  var rCamelCase = /-([a-z])/g;
1474
1587
  var rNormalizeInvalid = /([^\w\d_$])/g;
1475
1588
  var rLeadingNumeric = /^(\d+[\w\d_$])/;
@@ -1670,7 +1783,7 @@ function convertAllHeadersToMap(headersString) {
1670
1783
  var headersArray = strTrim(headersString)[_DYN_SPLIT$1 ](/[\r\n]+/);
1671
1784
  arrForEach(headersArray, function (headerEntry) {
1672
1785
  if (headerEntry) {
1673
- var idx = headerEntry.indexOf(": ");
1786
+ var idx = headerEntry[_DYN_INDEX_OF ](": ");
1674
1787
  if (idx !== -1) {
1675
1788
  var header = strTrim(headerEntry.substring(0, idx))[_DYN_TO_LOWER_CASE$1 ]();
1676
1789
  var value = strTrim(headerEntry.substring(idx + 1));
@@ -1920,7 +2033,7 @@ function newId(maxLength) {
1920
2033
  return result;
1921
2034
  }
1922
2035
 
1923
- var version = '3.4.0-nightlybeta3.2504-05';
2036
+ var version = '3.4.0-nightlybeta3.2504-17';
1924
2037
  var instanceName = "." + newId(6);
1925
2038
  var _dataUid = 0;
1926
2039
  function _canAcceptData(target) {
@@ -2594,30 +2707,6 @@ function runTargetUnload(target, isAsync) {
2594
2707
 
2595
2708
  var DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
2596
2709
 
2597
- function _stringToBoolOrDefault(theValue, defaultValue, theConfig) {
2598
- if (!theValue && isNullOrUndefined(theValue)) {
2599
- return defaultValue;
2600
- }
2601
- if (isBoolean(theValue)) {
2602
- return theValue;
2603
- }
2604
- return asString(theValue)[_DYN_TO_LOWER_CASE$1 ]() === "true";
2605
- }
2606
- function cfgDfValidate(validator, defaultValue, fallBackName) {
2607
- return {
2608
- fb: fallBackName,
2609
- isVal: validator,
2610
- v: defaultValue
2611
- };
2612
- }
2613
- function cfgDfBoolean(defaultValue, fallBackName) {
2614
- return {
2615
- fb: fallBackName,
2616
- set: _stringToBoolOrDefault,
2617
- v: !!defaultValue
2618
- };
2619
- }
2620
-
2621
2710
  var _aiNamespace = null;
2622
2711
  function _getExtensionNamespace() {
2623
2712
  var target = getInst("Microsoft");
@@ -3793,8 +3882,13 @@ var SenderPostManager = /** @class */ (function () {
3793
3882
  resolveFunc && resolveFunc(false);
3794
3883
  return;
3795
3884
  }
3796
- function _handleError(res) {
3797
- _doOnComplete(oncomplete, _isOneDs ? 0 : 400, {}, _isOneDs ? STR_EMPTY : res);
3885
+ function _handleError(res, statusCode) {
3886
+ if (statusCode) {
3887
+ _doOnComplete(oncomplete, _isOneDs ? 0 : statusCode, {}, _isOneDs ? STR_EMPTY : res);
3888
+ }
3889
+ else {
3890
+ _doOnComplete(oncomplete, _isOneDs ? 0 : 400, {}, _isOneDs ? STR_EMPTY : res);
3891
+ }
3798
3892
  }
3799
3893
  function _onFetchComplete(response, payload, value) {
3800
3894
  var status = response[_DYN_STATUS ];
@@ -3818,7 +3912,12 @@ var SenderPostManager = /** @class */ (function () {
3818
3912
  var response_1 = result[_DYN_VALUE ];
3819
3913
  try {
3820
3914
  if (!_isOneDs && !response_1.ok) {
3821
- _handleError(response_1.statusText);
3915
+ if (response_1[_DYN_STATUS ]) {
3916
+ _handleError(response_1.statusText, response_1[_DYN_STATUS ]);
3917
+ }
3918
+ else {
3919
+ _handleError(response_1.statusText, 499);
3920
+ }
3822
3921
  resolveFunc && resolveFunc(false);
3823
3922
  }
3824
3923
  else {
@@ -3835,12 +3934,17 @@ var SenderPostManager = /** @class */ (function () {
3835
3934
  }
3836
3935
  }
3837
3936
  catch (e) {
3838
- _handleError(dumpObj(e));
3937
+ if (response_1 && response_1[_DYN_STATUS ]) {
3938
+ _handleError(dumpObj(e), response_1[_DYN_STATUS ]);
3939
+ }
3940
+ else {
3941
+ _handleError(dumpObj(e), 499);
3942
+ }
3839
3943
  rejectFunc && rejectFunc(e);
3840
3944
  }
3841
3945
  }
3842
3946
  else {
3843
- _handleError(result.reason && result.reason[_DYN_MESSAGE$1 ]);
3947
+ _handleError(result.reason && result.reason[_DYN_MESSAGE$1 ], 499);
3844
3948
  rejectFunc && rejectFunc(result.reason);
3845
3949
  }
3846
3950
  }
@@ -3848,7 +3952,7 @@ var SenderPostManager = /** @class */ (function () {
3848
3952
  }
3849
3953
  catch (e) {
3850
3954
  if (!responseHandled) {
3851
- _handleError(dumpObj(e));
3955
+ _handleError(dumpObj(e), 499);
3852
3956
  rejectFunc && rejectFunc(e);
3853
3957
  }
3854
3958
  }
@@ -5627,7 +5731,7 @@ function EnvelopeCreatorInit(logger, telemetryItem) {
5627
5731
  }
5628
5732
  }
5629
5733
  var EnvelopeCreator = {
5630
- Version: '3.4.0-nightlybeta3.2504-05'
5734
+ Version: '3.4.0-nightlybeta3.2504-17'
5631
5735
  };
5632
5736
  function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
5633
5737
  EnvelopeCreatorInit(logger, telemetryItem);
@@ -6304,8 +6408,10 @@ var defaultAppInsightsChannelConfig = objDeepFreeze((_a = {
6304
6408
  _a[_DYN_ALWAYS_USE_XHR_OVERR4 ] = cfgDfBoolean(),
6305
6409
  _a.transports = UNDEFINED_VALUE,
6306
6410
  _a.retryCodes = UNDEFINED_VALUE,
6411
+ _a.corsPolicy = UNDEFINED_VALUE,
6307
6412
  _a.maxRetryCnt = { isVal: isNumber, v: 10 },
6308
6413
  _a));
6414
+ var CrossOriginResourcePolicyHeader = "X-Set-Cross-Origin-Resource-Policy";
6309
6415
  function _chkSampling(value) {
6310
6416
  return !isNaN(value) && value > 0 && value <= 100;
6311
6417
  }
@@ -6431,6 +6537,15 @@ var Sender = /** @class */ (function (_super) {
6431
6537
  senderConfig[_DYN_ENDPOINT_URL ] = coreUrl;
6432
6538
  }
6433
6539
  }
6540
+ var corsPolicy = senderConfig.corsPolicy;
6541
+ if (corsPolicy) {
6542
+ if (corsPolicy === "same-origin" || corsPolicy === "same-site" || corsPolicy === "cross-origin") {
6543
+ _this.addHeader(CrossOriginResourcePolicyHeader, corsPolicy);
6544
+ }
6545
+ }
6546
+ else {
6547
+ delete _headers[CrossOriginResourcePolicyHeader];
6548
+ }
6434
6549
  if (isPromiseLike(senderConfig[_DYN_INSTRUMENTATION_KEY ])) {
6435
6550
  senderConfig[_DYN_INSTRUMENTATION_KEY ] = config[_DYN_INSTRUMENTATION_KEY ];
6436
6551
  }
@@ -6662,6 +6777,15 @@ var Sender = /** @class */ (function (_super) {
6662
6777
  }
6663
6778
  return _xdrOnLoad(xdr, payload);
6664
6779
  };
6780
+ function _getStatsBeat() {
6781
+ var statsBeatConfig = {
6782
+ ikey: _self._senderConfig[_DYN_INSTRUMENTATION_KEY ],
6783
+ endpoint: _endpointUrl,
6784
+ version: EnvelopeCreator.Version
6785
+ };
6786
+ var core = _self.core;
6787
+ return core ? core.getStatsBeat(statsBeatConfig) : null;
6788
+ }
6665
6789
  function _xdrOnLoad(xdr, payload) {
6666
6790
  var responseText = _getResponseText(xdr);
6667
6791
  if (xdr && (responseText + "" === "200" || responseText === "")) {
@@ -6683,27 +6807,57 @@ var Sender = /** @class */ (function (_super) {
6683
6807
  try {
6684
6808
  var onCompleteFuncs = {
6685
6809
  xdrOnComplete: function (xdr, oncomplete, payload) {
6686
- var data = _getPayloadArr(payload);
6687
- if (!data) {
6810
+ var payloadArr = _getPayloadArr(payload);
6811
+ if (!payloadArr) {
6688
6812
  return;
6689
6813
  }
6690
- return _xdrOnLoad(xdr, data);
6814
+ var responseText = _getResponseText(xdr);
6815
+ var statsbeat = _getStatsBeat();
6816
+ if (statsbeat) {
6817
+ if (xdr && (responseText + "" === "200" || responseText === "")) {
6818
+ _consecutiveErrors = 0;
6819
+ statsbeat[_DYN_COUNT ](200, payload, _endpointUrl);
6820
+ }
6821
+ else {
6822
+ var results = parseResponse(responseText);
6823
+ if (results && results[_DYN_ITEMS_RECEIVED ] && results[_DYN_ITEMS_RECEIVED ] > results[_DYN_ITEMS_ACCEPTED ]
6824
+ && !_isRetryDisabled) {
6825
+ statsbeat[_DYN_COUNT ](206, payload, _endpointUrl);
6826
+ }
6827
+ else {
6828
+ statsbeat[_DYN_COUNT ](499, payload, _endpointUrl);
6829
+ }
6830
+ }
6831
+ }
6832
+ return _xdrOnLoad(xdr, payloadArr);
6691
6833
  },
6692
6834
  fetchOnComplete: function (response, onComplete, resValue, payload) {
6693
- var data = _getPayloadArr(payload);
6694
- if (!data) {
6835
+ var payloadArr = _getPayloadArr(payload);
6836
+ if (!payloadArr) {
6695
6837
  return;
6696
6838
  }
6697
- return _checkResponsStatus(response.status, data, response.url, data[_DYN_LENGTH ], response.statusText, resValue || "");
6839
+ var statsbeat = _getStatsBeat();
6840
+ if (statsbeat) {
6841
+ statsbeat[_DYN_COUNT ](response.status, payload, _endpointUrl);
6842
+ }
6843
+ return _checkResponsStatus(response.status, payloadArr, response.url, payloadArr[_DYN_LENGTH ], response.statusText, resValue || "");
6698
6844
  },
6699
6845
  xhrOnComplete: function (request, oncomplete, payload) {
6700
- var data = _getPayloadArr(payload);
6701
- if (!data) {
6846
+ var payloadArr = _getPayloadArr(payload);
6847
+ if (!payloadArr) {
6702
6848
  return;
6703
6849
  }
6704
- return _xhrReadyStateChange(request, data, data[_DYN_LENGTH ]);
6850
+ var statsbeat = _getStatsBeat();
6851
+ if (statsbeat && request.readyState === 4) {
6852
+ statsbeat[_DYN_COUNT ](request.status, payload, _endpointUrl);
6853
+ }
6854
+ return _xhrReadyStateChange(request, payloadArr, payloadArr[_DYN_LENGTH ]);
6705
6855
  },
6706
6856
  beaconOnRetry: function (data, onComplete, canSend) {
6857
+ var statsbeat = _getStatsBeat();
6858
+ if (statsbeat) {
6859
+ statsbeat[_DYN_COUNT ](499, data, _endpointUrl);
6860
+ }
6707
6861
  return _onBeaconRetry(data, onComplete, canSend);
6708
6862
  }
6709
6863
  };
@@ -6877,9 +7031,16 @@ var Sender = /** @class */ (function (_super) {
6877
7031
  function _doSend(sendInterface, payload, isAsync, markAsSent) {
6878
7032
  if (markAsSent === void 0) { markAsSent = true; }
6879
7033
  var onComplete = function (status, headers, response) {
7034
+ var statsbeat = _getStatsBeat();
7035
+ if (statsbeat) {
7036
+ statsbeat[_DYN_COUNT ](status, payloadData, _endpointUrl);
7037
+ }
6880
7038
  return _getOnComplete(payload, status, headers, response);
6881
7039
  };
6882
7040
  var payloadData = _getPayload(payload);
7041
+ if (payloadData) {
7042
+ payloadData.statsBeatData = { startTime: utcNow() };
7043
+ }
6883
7044
  var sendPostFunc = sendInterface && sendInterface.sendPOST;
6884
7045
  if (sendPostFunc && payloadData) {
6885
7046
  if (markAsSent) {
@@ -7120,10 +7281,17 @@ var Sender = /** @class */ (function (_super) {
7120
7281
  }
7121
7282
  function _getNotifyMgr() {
7122
7283
  var func = "getNotifyMgr";
7123
- if (_self.core[func]) {
7124
- return _self.core[func]();
7284
+ var result;
7285
+ var core = _self.core;
7286
+ if (core) {
7287
+ if (core[func]) {
7288
+ result = core[func]();
7289
+ }
7290
+ else {
7291
+ result = core["_notificationManager"];
7292
+ }
7125
7293
  }
7126
- return _self.core["_notificationManager"];
7294
+ return result;
7127
7295
  }
7128
7296
  function _notifySendRequest(sendRequest, isAsync) {
7129
7297
  var manager = _getNotifyMgr();