@microsoft/1ds-core-js 4.4.0-nightlybeta3.2504-05 → 4.4.0-nightlybeta3.2504-20

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 (42) hide show
  1. package/bundle/es5/{ms.core-4.4.0-nightlybeta3.2504-05.gbl.js → ms.core-4.4.0-nightlybeta3.2504-20.gbl.js} +340 -237
  2. package/bundle/es5/ms.core-4.4.0-nightlybeta3.2504-20.gbl.js.map +1 -0
  3. package/bundle/es5/ms.core-4.4.0-nightlybeta3.2504-20.gbl.min.js +7 -0
  4. package/bundle/es5/ms.core-4.4.0-nightlybeta3.2504-20.gbl.min.js.map +1 -0
  5. package/bundle/es5/ms.core-4.4.0-nightlybeta3.2504-20.integrity.json +46 -0
  6. package/bundle/es5/{ms.core-4.4.0-nightlybeta3.2504-05.js → ms.core-4.4.0-nightlybeta3.2504-20.js} +340 -237
  7. package/bundle/es5/ms.core-4.4.0-nightlybeta3.2504-20.js.map +1 -0
  8. package/bundle/es5/ms.core-4.4.0-nightlybeta3.2504-20.min.js +7 -0
  9. package/bundle/es5/ms.core-4.4.0-nightlybeta3.2504-20.min.js.map +1 -0
  10. package/bundle/es5/ms.core.gbl.js +339 -236
  11. package/bundle/es5/ms.core.gbl.js.map +1 -1
  12. package/bundle/es5/ms.core.gbl.min.js +2 -2
  13. package/bundle/es5/ms.core.gbl.min.js.map +1 -1
  14. package/bundle/es5/ms.core.integrity.json +17 -17
  15. package/bundle/es5/ms.core.js +339 -236
  16. package/bundle/es5/ms.core.js.map +1 -1
  17. package/bundle/es5/ms.core.min.js +2 -2
  18. package/bundle/es5/ms.core.min.js.map +1 -1
  19. package/dist/es5/ms.core.js +337 -234
  20. package/dist/es5/ms.core.js.map +1 -1
  21. package/dist/es5/ms.core.min.js +2 -2
  22. package/dist/es5/ms.core.min.js.map +1 -1
  23. package/dist-es5/AppInsightsCore.js +1 -1
  24. package/dist-es5/BaseCore.js +1 -1
  25. package/dist-es5/DataModels.js +1 -1
  26. package/dist-es5/Enums.js +1 -1
  27. package/dist-es5/Index.js +1 -1
  28. package/dist-es5/InternalConstants.js +1 -1
  29. package/dist-es5/Utils.js +2 -2
  30. package/dist-es5/Utils.js.map +1 -1
  31. package/dist-es5/ValueSanitizer.js +1 -1
  32. package/dist-es5/__DynamicConstants.js +1 -1
  33. package/package.json +2 -2
  34. package/types/1ds-core-js.d.ts +2 -2
  35. package/types/1ds-core-js.namespaced.d.ts +57 -2
  36. package/bundle/es5/ms.core-4.4.0-nightlybeta3.2504-05.gbl.js.map +0 -1
  37. package/bundle/es5/ms.core-4.4.0-nightlybeta3.2504-05.gbl.min.js +0 -7
  38. package/bundle/es5/ms.core-4.4.0-nightlybeta3.2504-05.gbl.min.js.map +0 -1
  39. package/bundle/es5/ms.core-4.4.0-nightlybeta3.2504-05.integrity.json +0 -46
  40. package/bundle/es5/ms.core-4.4.0-nightlybeta3.2504-05.js.map +0 -1
  41. package/bundle/es5/ms.core-4.4.0-nightlybeta3.2504-05.min.js +0 -7
  42. package/bundle/es5/ms.core-4.4.0-nightlybeta3.2504-05.min.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * 1DS JS SDK Core, 4.4.0-nightlybeta3.2504-05
2
+ * 1DS JS SDK Core, 4.4.0-nightlybeta3.2504-20
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  * (Microsoft Internal Only)
5
5
  */
@@ -16,7 +16,7 @@
16
16
  var ObjClass$1 = Object;
17
17
  var ObjProto$1 = ObjClass$1[strShimPrototype];
18
18
 
19
- /*! https://github.com/nevware21/ts-utils v0.11.8 */
19
+ /*! https://github.com/nevware21/ts-utils v0.12.2 */
20
20
  /*#__NO_SIDE_EFFECTS__*/
21
21
  function _pureAssign(func1, func2) {
22
22
  return func1 || func2;
@@ -35,7 +35,6 @@
35
35
  var UNDEFINED = "undefined";
36
36
  var CONSTRUCTOR = "constructor";
37
37
  var SYMBOL = "Symbol";
38
- var POLYFILL_TAG = "_polyfill";
39
38
  var LENGTH = "length";
40
39
  var NAME = "name";
41
40
  var CALL = "call";
@@ -48,6 +47,8 @@
48
47
  var ArrCls = ( /*#__PURE__*/_pureAssign(Array));
49
48
  var ArrProto = ( /*#__PURE__*/_pureRef(ArrCls, PROTOTYPE));
50
49
  var ArrSlice = ( /*#__PURE__*/_pureRef(ArrProto, "slice"));
50
+ var POLYFILL_TAG = "_polyfill";
51
+ var POLYFILL_TYPE_NAME = "__nw21$polytype__";
51
52
  function safe(func, argArray) {
52
53
  try {
53
54
  return {
@@ -91,7 +92,7 @@
91
92
  }
92
93
  /*#__NO_SIDE_EFFECTS__*/
93
94
  function isStrictUndefined(arg) {
94
- return !isDefined(arg);
95
+ return arg === UNDEF_VALUE;
95
96
  }
96
97
  /*#__NO_SIDE_EFFECTS__*/
97
98
  function isNullOrUndefined(value) {
@@ -99,7 +100,7 @@
99
100
  }
100
101
  /*#__NO_SIDE_EFFECTS__*/
101
102
  function isStrictNullOrUndefined(value) {
102
- return value === NULL_VALUE || !isDefined(value);
103
+ return value === NULL_VALUE || value === UNDEF_VALUE;
103
104
  }
104
105
  /*#__NO_SIDE_EFFECTS__*/
105
106
  function isDefined(arg) {
@@ -136,18 +137,56 @@
136
137
  function isTruthy(value) {
137
138
  return !(!value || safeGet(function () { return !(value && (0 + value)); }, !value));
138
139
  }
139
- var objGetOwnPropertyDescriptor = ( /* #__PURE__ */_pureRef(ObjClass, "getOwnPropertyDescriptor"));
140
+ var asString = ( /* #__PURE__ */_pureAssign(StrCls));
141
+ var ERROR_TYPE = "[object Error]";
142
+ /*#__NO_SIDE_EFFECTS__*/
143
+ function dumpObj(object, format) {
144
+ var propertyValueDump = EMPTY;
145
+ var objType = ObjProto[TO_STRING][CALL](object);
146
+ if (objType === ERROR_TYPE) {
147
+ object = { stack: asString(object.stack), message: asString(object.message), name: asString(object.name) };
148
+ }
149
+ try {
150
+ propertyValueDump = JSON.stringify(object, NULL_VALUE, format ? ((typeof format === "number") ? format : 4) : UNDEF_VALUE);
151
+ propertyValueDump = (propertyValueDump ? propertyValueDump.replace(/"(\w+)"\s*:\s{0,1}/g, "$1: ") : NULL_VALUE) || asString(object);
152
+ }
153
+ catch (e) {
154
+ propertyValueDump = " - " + dumpObj(e, format);
155
+ }
156
+ return objType + ": " + propertyValueDump;
157
+ }
158
+ function throwError(message) {
159
+ throw new Error(message);
160
+ }
161
+ function throwTypeError(message) {
162
+ throw new TypeError(message);
163
+ }
164
+ function _throwIfNullOrUndefined(obj) {
165
+ if (isStrictNullOrUndefined(obj)) {
166
+ throwTypeError("Cannot convert undefined or null to object");
167
+ }
168
+ }
169
+ function _throwIfNotString(value) {
170
+ if (!isString(value)) {
171
+ throwTypeError("'" + dumpObj(value) + "' is not a string");
172
+ }
173
+ }
174
+ function _returnNothing() {
175
+ return UNDEF_VALUE;
176
+ }
177
+ var objGetOwnPropertyDescriptor = ( /* #__PURE__ */_pureAssign(( /* #__PURE__ */_pureRef(ObjClass, "getOwnPropertyDescriptor")), _returnNothing));
140
178
  /*#__NO_SIDE_EFFECTS__*/
141
179
  function objHasOwnProperty(obj, prop) {
142
180
  return !!obj && ObjProto.hasOwnProperty[CALL](obj, prop);
143
181
  }
144
- var objHasOwn = ( /*#__PURE__*/_pureAssign(( /* #__PURE__ */_pureRef(ObjClass, "hasOwn")), polyObjHasOwn));
145
182
  /*#__NO_SIDE_EFFECTS__*/
146
183
  function polyObjHasOwn(obj, prop) {
184
+ _throwIfNullOrUndefined(obj);
147
185
  return objHasOwnProperty(obj, prop) || !!objGetOwnPropertyDescriptor(obj, prop);
148
186
  }
187
+ var objHasOwn = ( /*#__PURE__*/_pureAssign(( /* #__PURE__ */_pureRef(ObjClass, "hasOwn")), polyObjHasOwn));
149
188
  function objForEachKey(theObject, callbackfn, thisArg) {
150
- if (theObject && isObject(theObject)) {
189
+ if (theObject && (isObject(theObject) || isFunction(theObject))) {
151
190
  for (var prop in theObject) {
152
191
  if (objHasOwn(theObject, prop)) {
153
192
  if (callbackfn[CALL](thisArg || theObject, prop, theObject[prop]) === -1) {
@@ -157,6 +196,37 @@
157
196
  }
158
197
  }
159
198
  }
199
+ function arrForEach(theArray, callbackfn, thisArg) {
200
+ if (theArray) {
201
+ var len = theArray[LENGTH] >>> 0;
202
+ for (var idx = 0; idx < len; idx++) {
203
+ if (idx in theArray) {
204
+ if (callbackfn[CALL](thisArg || theArray, theArray[idx], idx, theArray) === -1) {
205
+ break;
206
+ }
207
+ }
208
+ }
209
+ }
210
+ }
211
+ var _unwrapFunction = ( _unwrapFunctionWithPoly);
212
+ /*#__NO_SIDE_EFFECTS__*/
213
+ function _unwrapFunctionWithPoly(funcName, clsProto, polyFunc) {
214
+ var clsFn = clsProto ? clsProto[funcName] : NULL_VALUE;
215
+ return function (thisArg) {
216
+ var theFunc = (thisArg ? thisArg[funcName] : NULL_VALUE) || clsFn;
217
+ if (theFunc || polyFunc) {
218
+ var theArgs = arguments;
219
+ return (theFunc || polyFunc).apply(thisArg, theFunc ? ArrSlice[CALL](theArgs, 1) : theArgs);
220
+ }
221
+ throwTypeError("\"" + asString(funcName) + "\" not defined for " + dumpObj(thisArg));
222
+ };
223
+ }
224
+ /*#__NO_SIDE_EFFECTS__*/
225
+ function _unwrapProp(propName) {
226
+ return function (thisArg) {
227
+ return thisArg[propName];
228
+ };
229
+ }
160
230
  var propMap = {
161
231
  e: "enumerable",
162
232
  c: "configurable",
@@ -185,6 +255,7 @@
185
255
  return prop;
186
256
  }
187
257
  var objDefineProp = ( /*#__PURE__*/_pureRef(ObjClass, "defineProperty"));
258
+ var objDefineProperties = ( /*#__PURE__*/_pureRef(ObjClass, "defineProperties"));
188
259
  function objDefineAccessors(target, prop, getProp, setProp, configurable, enumerable) {
189
260
  var desc = {
190
261
  e: enumerable,
@@ -217,49 +288,38 @@
217
288
  writable: false
218
289
  });
219
290
  }
220
- var asString = ( /* #__PURE__ */_pureAssign(StrCls));
221
- var ERROR_TYPE = "[object Error]";
222
- /*#__NO_SIDE_EFFECTS__*/
223
- function dumpObj(object, format) {
224
- var propertyValueDump = EMPTY;
225
- var objType = ObjProto[TO_STRING][CALL](object);
226
- if (objType === ERROR_TYPE) {
227
- object = { stack: asString(object.stack), message: asString(object.message), name: asString(object.name) };
228
- }
229
- try {
230
- propertyValueDump = JSON.stringify(object, NULL_VALUE, format ? ((typeof format === "number") ? format : 4) : UNDEF_VALUE);
231
- propertyValueDump = (propertyValueDump ? propertyValueDump.replace(/"(\w+)"\s*:\s{0,1}/g, "$1: ") : NULL_VALUE) || asString(object);
232
- }
233
- catch (e) {
234
- propertyValueDump = " - " + dumpObj(e, format);
235
- }
236
- return objType + ": " + propertyValueDump;
237
- }
238
- function throwError(message) {
239
- throw new Error(message);
240
- }
241
- function throwTypeError(message) {
242
- throw new TypeError(message);
291
+ function _returnFalse() {
292
+ return false;
243
293
  }
294
+ var objIsFrozen = ( /* #__PURE__*/_pureAssign(( /* #__PURE__ */_pureRef(ObjClass, "isFrozen")), _returnFalse));
244
295
  var _objFreeze = ( /* #__PURE__ */_pureRef(ObjClass, "freeze"));
245
296
  function _doNothing(value) {
246
297
  return value;
247
298
  }
248
299
  /*#__NO_SIDE_EFFECTS__*/
249
300
  function _getProto(value) {
301
+ _throwIfNullOrUndefined(value);
250
302
  return value[__PROTO__] || NULL_VALUE;
251
303
  }
252
304
  var objAssign = ( /*#__PURE__*/_pureRef(ObjClass, "assign"));
253
305
  var objKeys = ( /*#__PURE__*/_pureRef(ObjClass, "keys"));
254
- function objDeepFreeze(value) {
255
- if (_objFreeze) {
256
- objForEachKey(value, function (key, value) {
257
- if (isArray(value) || isObject(value)) {
258
- objDeepFreeze(value);
306
+ function _deepFreeze(val, visited) {
307
+ if ((isArray(val) || isObject(val) || isFunction(val)) && !objIsFrozen(val)) {
308
+ for (var lp = 0; lp < visited.length; lp++) {
309
+ if (visited[lp] === val) {
310
+ return val;
259
311
  }
312
+ }
313
+ visited.push(val);
314
+ objForEachKey(val, function (_key, propValue) {
315
+ _deepFreeze(propValue, visited);
260
316
  });
317
+ objFreeze(val);
261
318
  }
262
- return objFreeze(value);
319
+ return val;
320
+ }
321
+ function objDeepFreeze(value) {
322
+ return _objFreeze ? _deepFreeze(value, []) : value;
263
323
  }
264
324
  var objFreeze = ( /* #__PURE__*/_pureAssign(_objFreeze, _doNothing));
265
325
  var objSeal = ( /* #__PURE__*/_pureAssign(( /* #__PURE__*/_pureRef(ObjClass, "seal")), _doNothing));
@@ -314,34 +374,13 @@
314
374
  }
315
375
  return _globalCfg;
316
376
  }
317
- var _unwrapFunction = ( _unwrapFunctionWithPoly);
318
- /*#__NO_SIDE_EFFECTS__*/
319
- function _unwrapFunctionWithPoly(funcName, clsProto, polyFunc) {
320
- var clsFn = clsProto ? clsProto[funcName] : NULL_VALUE;
321
- return function (thisArg) {
322
- var theFunc = (thisArg ? thisArg[funcName] : NULL_VALUE) || clsFn;
323
- if (theFunc || polyFunc) {
324
- var theArgs = arguments;
325
- return (theFunc || polyFunc).apply(thisArg, theFunc ? ArrSlice[CALL](theArgs, 1) : theArgs);
326
- }
327
- throwTypeError("\"" + asString(funcName) + "\" not defined for " + dumpObj(thisArg));
328
- };
329
- }
330
- /*#__NO_SIDE_EFFECTS__*/
331
- function _unwrapProp(propName) {
332
- return function (thisArg) {
333
- return thisArg[propName];
334
- };
335
- }
336
377
  var mathMax = ( /*#__PURE__*/_pureRef(MathCls, "max"));
337
378
  var strSlice = ( /*#__PURE__*/_unwrapFunction("slice", StrProto));
338
379
  var strSubstring = ( /*#__PURE__*/_unwrapFunction("substring", StrProto));
339
380
  var strSubstr = ( /*#__PURE__*/_unwrapFunctionWithPoly("substr", StrProto, polyStrSubstr));
340
381
  /*#__NO_SIDE_EFFECTS__*/
341
382
  function polyStrSubstr(value, start, length) {
342
- if (isNullOrUndefined(value)) {
343
- throwTypeError("Invalid " + dumpObj(value));
344
- }
383
+ _throwIfNullOrUndefined(value);
345
384
  if (length < 0) {
346
385
  return EMPTY;
347
386
  }
@@ -358,8 +397,94 @@
358
397
  function strLeft(value, count) {
359
398
  return strSubstring(value, 0, count);
360
399
  }
400
+ function _tagAsPolyfill(target, polyfillTypeName) {
401
+ if (target) {
402
+ safe(function () {
403
+ target[POLYFILL_TAG] = true;
404
+ target[POLYFILL_TYPE_NAME] = polyfillTypeName;
405
+ });
406
+ safe(objDefine, [target, POLYFILL_TAG, {
407
+ v: true,
408
+ w: false,
409
+ e: false
410
+ }]);
411
+ safe(objDefine, [target, POLYFILL_TYPE_NAME, {
412
+ v: polyfillTypeName,
413
+ w: false,
414
+ e: false
415
+ }]);
416
+ }
417
+ return target;
418
+ }
419
+ var objCreate = ( /* #__PURE__*/_pureAssign(( /* #__PURE__*/_pureRef(ObjClass, "create")), polyObjCreate));
420
+ /*#__NO_SIDE_EFFECTS__*/
421
+ function polyObjCreate(obj, properties) {
422
+ var newObj = null;
423
+ function tempFunc() { }
424
+ if (!isStrictNullOrUndefined(obj)) {
425
+ var type = typeof obj;
426
+ if (type !== OBJECT && type !== FUNCTION) {
427
+ throwTypeError("Prototype must be an Object or function: " + dumpObj(obj));
428
+ }
429
+ tempFunc[PROTOTYPE] = obj;
430
+ safe(function () {
431
+ tempFunc[__PROTO__] = obj;
432
+ });
433
+ newObj = new tempFunc();
434
+ }
435
+ else {
436
+ newObj = {};
437
+ }
438
+ if (properties) {
439
+ safe(objDefineProperties, [newObj, properties]);
440
+ }
441
+ return newObj;
442
+ }
443
+ /*#__NO_SIDE_EFFECTS__*/
444
+ function utcNow() {
445
+ return (Date.now || polyUtcNow)();
446
+ }
447
+ /*#__NO_SIDE_EFFECTS__*/
448
+ function polyUtcNow() {
449
+ return new Date().getTime();
450
+ }
451
+ var _globalLazyTestHooks;
452
+ function _initTestHooks() {
453
+ _globalLazyTestHooks = _getGlobalConfig();
454
+ }
455
+ /*#__NO_SIDE_EFFECTS__*/
456
+ function getLazy(cb) {
457
+ var lazyValue = {};
458
+ !_globalLazyTestHooks && _initTestHooks();
459
+ lazyValue.b = _globalLazyTestHooks.lzy;
460
+ objDefineProp(lazyValue, "v", {
461
+ configurable: true,
462
+ get: function () {
463
+ var result = cb();
464
+ if (!_globalLazyTestHooks.lzy) {
465
+ objDefineProp(lazyValue, "v", {
466
+ value: result
467
+ });
468
+ }
469
+ lazyValue.b = _globalLazyTestHooks.lzy;
470
+ return result;
471
+ }
472
+ });
473
+ return lazyValue;
474
+ }
475
+ var mathRandom = ( /*#__PURE__*/_pureRef(MathCls, "random"));
476
+ var _uniqueInstanceId = ( /*#__PURE__*/getLazy(function () {
477
+ var value = (utcNow().toString(36).slice(2));
478
+ while (value.length < 16) {
479
+ value += mathRandom().toString(36).slice(2);
480
+ }
481
+ value = value.substring(0, 16);
482
+ return value;
483
+ }));
361
484
  var UNIQUE_REGISTRY_ID = "_urid";
485
+ var POLY_SYM = "$nw21sym";
362
486
  var _polySymbols;
487
+ var _polyId = 0;
363
488
  /*#__NO_SIDE_EFFECTS__*/
364
489
  function _globalSymbolRegistry() {
365
490
  if (!_polySymbols) {
@@ -371,12 +496,22 @@
371
496
  var _wellKnownSymbolCache;
372
497
  /*#__NO_SIDE_EFFECTS__*/
373
498
  function polyNewSymbol(description) {
374
- var theSymbol = {
375
- description: asString(description),
376
- toString: function () { return SYMBOL + "(" + description + ")"; }
377
- };
378
- theSymbol[POLYFILL_TAG] = true;
379
- return theSymbol;
499
+ var uniqueId = "_" + _polyId++ + "_" + _uniqueInstanceId.v;
500
+ var symString = SYMBOL + "(" + description + ")";
501
+ function _setProp(name, value) {
502
+ objDefine(theSymbol, name, {
503
+ v: value,
504
+ e: false,
505
+ w: false
506
+ });
507
+ }
508
+ var theSymbol = objCreate(null);
509
+ _setProp("description", asString(description));
510
+ _setProp(TO_STRING, function () { return symString + POLY_SYM + uniqueId; });
511
+ _setProp("valueOf", function () { return theSymbol; });
512
+ _setProp("v", symString);
513
+ _setProp("_uid", uniqueId);
514
+ return _tagAsPolyfill(theSymbol, "symbol");
380
515
  }
381
516
  /*#__NO_SIDE_EFFECTS__*/
382
517
  function polySymbolFor(key) {
@@ -400,30 +535,6 @@
400
535
  }
401
536
  return result;
402
537
  }
403
- var _globalLazyTestHooks;
404
- function _initTestHooks() {
405
- _globalLazyTestHooks = _getGlobalConfig();
406
- }
407
- /*#__NO_SIDE_EFFECTS__*/
408
- function getLazy(cb) {
409
- var lazyValue = {};
410
- !_globalLazyTestHooks && _initTestHooks();
411
- lazyValue.b = _globalLazyTestHooks.lzy;
412
- objDefineProp(lazyValue, "v", {
413
- configurable: true,
414
- get: function () {
415
- var result = cb();
416
- if (!_globalLazyTestHooks.lzy) {
417
- objDefineProp(lazyValue, "v", {
418
- value: result
419
- });
420
- }
421
- lazyValue.b = _globalLazyTestHooks.lzy;
422
- return result;
423
- }
424
- });
425
- return lazyValue;
426
- }
427
538
  /*#__NO_SIDE_EFFECTS__*/
428
539
  function createCachedValue(value) {
429
540
  return objDefineProp({
@@ -600,18 +711,6 @@
600
711
  }
601
712
  return target;
602
713
  }
603
- function arrForEach(theArray, callbackfn, thisArg) {
604
- if (theArray) {
605
- var len = theArray[LENGTH] >>> 0;
606
- for (var idx = 0; idx < len; idx++) {
607
- if (idx in theArray) {
608
- if (callbackfn[CALL](thisArg || theArray, theArray[idx], idx, theArray) === -1) {
609
- break;
610
- }
611
- }
612
- }
613
- }
614
- }
615
714
  var arrIndexOf = ( /*#__PURE__*/_unwrapFunction("indexOf", ArrProto));
616
715
  var arrMap = ( /*#__PURE__*/_unwrapFunction("map", ArrProto));
617
716
  function arrSlice(theArray, start, end) {
@@ -623,29 +722,13 @@
623
722
  }
624
723
  var arrIncludes = ( /*#__PURE__*/_unwrapFunctionWithPoly("includes", ArrProto, polyArrIncludes));
625
724
  var arrReduce = ( /*#__PURE__*/_unwrapFunction("reduce", ArrProto));
626
- var objCreate = ( /* #__PURE__*/_pureAssign(( /* #__PURE__*/_pureRef(ObjClass, "create")), polyObjCreate));
627
- /*#__NO_SIDE_EFFECTS__*/
628
- function polyObjCreate(obj) {
629
- if (!obj) {
630
- return {};
631
- }
632
- var type = typeof obj;
633
- if (type !== OBJECT && type !== FUNCTION) {
634
- throwTypeError("Prototype must be an Object or function: " + dumpObj(obj));
635
- }
636
- function tempFunc() { }
637
- tempFunc[PROTOTYPE] = obj;
638
- return new tempFunc();
639
- }
640
725
  var _isProtoArray;
641
- function objSetPrototypeOf(obj, proto) {
642
- var fn = ObjClass["setPrototypeOf"] ||
643
- function (d, b) {
644
- var _a;
645
- !_isProtoArray && (_isProtoArray = createCachedValue((_a = {}, _a[__PROTO__] = [], _a) instanceof Array));
646
- _isProtoArray.v ? d[__PROTO__] = b : objForEachKey(b, function (key, value) { return d[key] = value; });
647
- };
648
- return fn(obj, proto);
726
+ var objSetPrototypeOf = ( /* #__PURE__*/_pureAssign(( /* #__PURE__ */_pureRef(ObjClass, "setPrototypeOf")), _polyObjSetPrototypeOf));
727
+ function _polyObjSetPrototypeOf(obj, proto) {
728
+ var _a;
729
+ !_isProtoArray && (_isProtoArray = createCachedValue((_a = {}, _a[__PROTO__] = [], _a) instanceof Array));
730
+ _isProtoArray.v ? obj[__PROTO__] = proto : objForEachKey(proto, function (key, value) { return obj[key] = value; });
731
+ return obj;
649
732
  }
650
733
  /*#__NO_SIDE_EFFECTS__*/
651
734
  function _createCustomError(name, d, b) {
@@ -688,19 +771,9 @@
688
771
  }, theBaseClass);
689
772
  }
690
773
  /*#__NO_SIDE_EFFECTS__*/
691
- function utcNow() {
692
- return (Date.now || polyUtcNow)();
693
- }
694
- /*#__NO_SIDE_EFFECTS__*/
695
- function polyUtcNow() {
696
- return new Date().getTime();
697
- }
698
- /*#__NO_SIDE_EFFECTS__*/
699
774
  function _createTrimFn(exp) {
700
775
  return function _doTrim(value) {
701
- if (isNullOrUndefined(value)) {
702
- throwTypeError("strTrim called [" + dumpObj(value) + "]");
703
- }
776
+ _throwIfNullOrUndefined(value);
704
777
  if (value && value.replace) {
705
778
  value = value.replace(exp, EMPTY);
706
779
  }
@@ -912,9 +985,7 @@
912
985
  var strEndsWith = ( /*#__PURE__*/_unwrapFunctionWithPoly("endsWith", StrProto, polyStrEndsWith));
913
986
  /*#__NO_SIDE_EFFECTS__*/
914
987
  function polyStrEndsWith(value, searchString, length) {
915
- if (!isString(value)) {
916
- throwTypeError("'" + dumpObj(value) + "' is not a string");
917
- }
988
+ _throwIfNotString(value);
918
989
  var searchValue = isString(searchString) ? searchString : asString(searchString);
919
990
  var end = (!isUndefined(length) && length < value[LENGTH]) ? length : value[LENGTH];
920
991
  return strSubstring(value, end - searchValue[LENGTH], end) === searchValue;
@@ -923,9 +994,7 @@
923
994
  var strStartsWith = ( /*#__PURE__*/_unwrapFunctionWithPoly("startsWith", StrProto, polyStrStartsWith));
924
995
  /*#__NO_SIDE_EFFECTS__*/
925
996
  function polyStrStartsWith(value, searchString, position) {
926
- if (!isString(value)) {
927
- throwTypeError("'" + dumpObj(value) + "' is not a string");
928
- }
997
+ _throwIfNotString(value);
929
998
  var searchValue = isString(searchString) ? searchString : asString(searchString);
930
999
  var pos = position > 0 ? position : 0;
931
1000
  return strSubstring(value, pos, pos + searchValue[LENGTH]) === searchValue;
@@ -1336,12 +1405,12 @@
1336
1405
  var _DYN_REMOVE_NOTIFICATION_0 = "removeNotificationListener";
1337
1406
  var _DYN_ADD_NOTIFICATION_LIS1 = "addNotificationListener";
1338
1407
  var _DYN_IS_INITIALIZED = "isInitialized";
1339
- var _DYN_VALUE$1 = "value";
1340
1408
  var _DYN_GET_NOTIFY_MGR = "getNotifyMgr";
1341
1409
  var _DYN_GET_PLUGIN = "getPlugin";
1342
1410
  var _DYN_NAME = "name";
1343
1411
  var _DYN_PROCESS_NEXT = "processNext";
1344
1412
  var _DYN_GET_PROCESS_TEL_CONT2 = "getProcessTelContext";
1413
+ var _DYN_VALUE$1 = "value";
1345
1414
  var _DYN_ENABLED = "enabled";
1346
1415
  var _DYN_STOP_POLLING_INTERNA3 = "stopPollingInternalLogs";
1347
1416
  var _DYN_UNLOAD = "unload";
@@ -1363,6 +1432,7 @@
1363
1432
  var _DYN_TYPE = "type";
1364
1433
  var _DYN_EVT_NAME = "evtName";
1365
1434
  var _DYN_STATUS = "status";
1435
+ var _DYN_INDEX_OF$1 = "indexOf";
1366
1436
  var _DYN_GET_ALL_RESPONSE_HEA5 = "getAllResponseHeaders";
1367
1437
  var _DYN_IS_CHILD_EVT = "isChildEvt";
1368
1438
  var _DYN_DATA = "data";
@@ -1816,6 +1886,13 @@
1816
1886
  var STR_PATH = "path";
1817
1887
  var STR_NOT_DYNAMIC_ERROR = "Not dynamic - ";
1818
1888
 
1889
+ function cfgDfMerge(defaultValue) {
1890
+ return {
1891
+ mrg: true,
1892
+ v: defaultValue
1893
+ };
1894
+ }
1895
+
1819
1896
  var rCamelCase = /-([a-z])/g;
1820
1897
  var rNormalizeInvalid = /([^\w\d_$])/g;
1821
1898
  var rLeadingNumeric = /^(\d+[\w\d_$])/;
@@ -2014,7 +2091,7 @@
2014
2091
  var headersArray = strTrim(headersString)[_DYN_SPLIT ](/[\r\n]+/);
2015
2092
  arrForEach(headersArray, function (headerEntry) {
2016
2093
  if (headerEntry) {
2017
- var idx = headerEntry.indexOf(": ");
2094
+ var idx = headerEntry[_DYN_INDEX_OF$1 ](": ");
2018
2095
  if (idx !== -1) {
2019
2096
  var header = strTrim(headerEntry.substring(0, idx))[_DYN_TO_LOWER_CASE ]();
2020
2097
  var value = strTrim(headerEntry.substring(idx + 1));
@@ -2310,7 +2387,7 @@
2310
2387
  return result;
2311
2388
  }
2312
2389
 
2313
- var version = '3.4.0-nightlybeta3.2504-05';
2390
+ var version = '3.4.0-nightlybeta3.2504-20';
2314
2391
  var instanceName = "." + newId(6);
2315
2392
  var _dataUid = 0;
2316
2393
  function _canAcceptData(target) {
@@ -3012,13 +3089,6 @@
3012
3089
  var ChannelControllerPriority = 500;
3013
3090
  var DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
3014
3091
 
3015
- function cfgDfMerge(defaultValue) {
3016
- return {
3017
- mrg: true,
3018
- v: defaultValue
3019
- };
3020
- }
3021
-
3022
3092
  var listenerFuncs = [STR_EVENTS_SENT, STR_EVENTS_DISCARDED, STR_EVENTS_SEND_REQUEST, STR_PERF_EVENT];
3023
3093
  var _aiNamespace = null;
3024
3094
  var _debugListener;
@@ -3897,7 +3967,7 @@
3897
3967
  if (!value || !isString(value) || value[_DYN_LENGTH$1 ] > 8192) {
3898
3968
  return null;
3899
3969
  }
3900
- if (value.indexOf(",") !== -1) {
3970
+ if (value[_DYN_INDEX_OF$1 ](",") !== -1) {
3901
3971
  var values = value[_DYN_SPLIT ](",");
3902
3972
  value = values[selectIdx > 0 && values[_DYN_LENGTH$1 ] > selectIdx ? selectIdx : 0];
3903
3973
  }
@@ -4707,6 +4777,9 @@
4707
4777
  _a$1[STR_CREATE_PERF_MGR] = UNDEFINED_VALUE,
4708
4778
  _a$1.loggingLevelConsole = 0 ,
4709
4779
  _a$1.diagnosticLogInterval = UNDEFINED_VALUE,
4780
+ _a$1._sdk = cfgDfMerge({
4781
+ stats: false
4782
+ }),
4710
4783
  _a$1));
4711
4784
  function _createPerfManager(core, notificationMgr) {
4712
4785
  return new PerfManager(notificationMgr);
@@ -4833,6 +4906,7 @@
4833
4906
  var _logger;
4834
4907
  var _eventQueue;
4835
4908
  var _notificationManager;
4909
+ var _statsBeat;
4836
4910
  var _perfManager;
4837
4911
  var _cfgPerfManager;
4838
4912
  var _cookieManager;
@@ -4857,6 +4931,7 @@
4857
4931
  var _endpoint;
4858
4932
  var _initInMemoMaxSize;
4859
4933
  var _isStatusSet;
4934
+ var _initTimer;
4860
4935
  var _internalLogPoller;
4861
4936
  var _internalLogPollerListening;
4862
4937
  var _forceStopInternalLogPoller;
@@ -4881,83 +4956,8 @@
4881
4956
  config = _configHandler.cfg;
4882
4957
  _addUnloadHook(_configHandler[_DYN_WATCH ](function (details) {
4883
4958
  var rootCfg = details.cfg;
4884
- var isPending = _activeStatus === 3 ;
4885
- if (isPending) {
4886
- return;
4887
- }
4888
4959
  _initInMemoMaxSize = rootCfg.initInMemoMaxSize || maxInitQueueSize;
4889
- var ikey = rootCfg.instrumentationKey;
4890
- var endpointUrl = rootCfg.endpointUrl;
4891
- if (isNullOrUndefined(ikey)) {
4892
- _instrumentationKey = null;
4893
- _activeStatus = ActiveStatus.INACTIVE;
4894
- var msg = "Please provide instrumentation key";
4895
- if (!_isInitialized) {
4896
- throwError(msg);
4897
- }
4898
- else {
4899
- _throwInternal(_logger, 1 , 100 , msg);
4900
- _releaseQueues();
4901
- }
4902
- return;
4903
- }
4904
- var promises = [];
4905
- if (isPromiseLike(ikey)) {
4906
- promises[_DYN_PUSH ](ikey);
4907
- _instrumentationKey = null;
4908
- }
4909
- else {
4910
- _instrumentationKey = ikey;
4911
- }
4912
- if (isPromiseLike(endpointUrl)) {
4913
- promises[_DYN_PUSH ](endpointUrl);
4914
- _endpoint = null;
4915
- }
4916
- else {
4917
- _endpoint = endpointUrl;
4918
- }
4919
- if (promises[_DYN_LENGTH$1 ]) {
4920
- _isStatusSet = false;
4921
- _activeStatus = 3 ;
4922
- var initTimeout = isNotNullOrUndefined(rootCfg.initTimeOut) ? rootCfg.initTimeOut : maxInitTimeout;
4923
- var allPromises = createSyncAllSettledPromise(promises);
4924
- scheduleTimeout(function () {
4925
- if (!_isStatusSet) {
4926
- _setStatus();
4927
- }
4928
- }, initTimeout);
4929
- doAwaitResponse(allPromises, function (response) {
4930
- try {
4931
- if (_isStatusSet) {
4932
- return;
4933
- }
4934
- if (!response.rejected) {
4935
- var values = response[_DYN_VALUE$1 ];
4936
- if (values && values[_DYN_LENGTH$1 ]) {
4937
- var ikeyRes = values[0];
4938
- _instrumentationKey = ikeyRes && ikeyRes[_DYN_VALUE$1 ];
4939
- if (values[_DYN_LENGTH$1 ] > 1) {
4940
- var endpointRes = values[1];
4941
- _endpoint = endpointRes && endpointRes[_DYN_VALUE$1 ];
4942
- }
4943
- }
4944
- if (_instrumentationKey) {
4945
- config.instrumentationKey = _instrumentationKey;
4946
- config.endpointUrl = _endpoint;
4947
- }
4948
- }
4949
- _setStatus();
4950
- }
4951
- catch (e) {
4952
- if (!_isStatusSet) {
4953
- _setStatus();
4954
- }
4955
- }
4956
- });
4957
- }
4958
- else {
4959
- _setStatus();
4960
- }
4960
+ _handleIKeyEndpointPromises(rootCfg);
4961
4961
  var extCfg = details.ref(details.cfg, STR_EXTENSION_CONFIG);
4962
4962
  objForEachKey(extCfg, function (key) {
4963
4963
  details.ref(extCfg, key);
@@ -5051,6 +5051,9 @@
5051
5051
  _self[STR_GET_PERF_MGR ] = function () {
5052
5052
  return _perfManager || _cfgPerfManager || getGblPerfMgr();
5053
5053
  };
5054
+ _self.getStatsBeat = function (statsBeatConfig) {
5055
+ return _statsBeat;
5056
+ };
5054
5057
  _self.setPerfMgr = function (perfMgr) {
5055
5058
  _perfManager = perfMgr;
5056
5059
  };
@@ -5078,6 +5081,89 @@
5078
5081
  _internalLogPoller && _internalLogPoller[_DYN_CANCEL ]();
5079
5082
  return _startLogPoller(true);
5080
5083
  };
5084
+ function _handleIKeyEndpointPromises(theConfig) {
5085
+ var ikey = theConfig.instrumentationKey;
5086
+ var endpointUrl = theConfig.endpointUrl;
5087
+ if (_activeStatus !== 3 ) {
5088
+ if (isNullOrUndefined(ikey)) {
5089
+ _instrumentationKey = null;
5090
+ _activeStatus = ActiveStatus.INACTIVE;
5091
+ var msg = "Please provide instrumentation key";
5092
+ if (!_isInitialized) {
5093
+ throwError(msg);
5094
+ }
5095
+ else {
5096
+ _throwInternal(_logger, 1 , 100 , msg);
5097
+ _releaseQueues();
5098
+ }
5099
+ return;
5100
+ }
5101
+ var promises = [];
5102
+ if (isPromiseLike(ikey)) {
5103
+ promises[_DYN_PUSH ](ikey);
5104
+ _instrumentationKey = null;
5105
+ }
5106
+ else {
5107
+ _instrumentationKey = ikey;
5108
+ }
5109
+ if (isPromiseLike(endpointUrl)) {
5110
+ promises[_DYN_PUSH ](endpointUrl);
5111
+ _endpoint = null;
5112
+ }
5113
+ else {
5114
+ _endpoint = endpointUrl;
5115
+ }
5116
+ if (promises[_DYN_LENGTH$1 ]) {
5117
+ _waitForInitPromises(theConfig, promises);
5118
+ }
5119
+ else {
5120
+ _setStatus();
5121
+ }
5122
+ }
5123
+ }
5124
+ function _waitForInitPromises(theConfig, promises) {
5125
+ _isStatusSet = false;
5126
+ _activeStatus = 3 ;
5127
+ var initTimeout = isNotNullOrUndefined(theConfig.initTimeOut) ? theConfig.initTimeOut : maxInitTimeout;
5128
+ var allPromises = createSyncAllSettledPromise(promises);
5129
+ if (_initTimer) {
5130
+ _initTimer[_DYN_CANCEL ]();
5131
+ }
5132
+ _initTimer = scheduleTimeout(function () {
5133
+ _initTimer = null;
5134
+ if (!_isStatusSet) {
5135
+ _setStatus();
5136
+ }
5137
+ }, initTimeout);
5138
+ doAwaitResponse(allPromises, function (response) {
5139
+ try {
5140
+ if (_isStatusSet) {
5141
+ return;
5142
+ }
5143
+ if (!response.rejected) {
5144
+ var values = response[_DYN_VALUE$1 ];
5145
+ if (values && values[_DYN_LENGTH$1 ]) {
5146
+ var ikeyRes = values[0];
5147
+ _instrumentationKey = ikeyRes && ikeyRes[_DYN_VALUE$1 ];
5148
+ if (values[_DYN_LENGTH$1 ] > 1) {
5149
+ var endpointRes = values[1];
5150
+ _endpoint = endpointRes && endpointRes[_DYN_VALUE$1 ];
5151
+ }
5152
+ }
5153
+ if (_instrumentationKey) {
5154
+ theConfig.instrumentationKey = _instrumentationKey;
5155
+ theConfig.endpointUrl = _endpoint;
5156
+ }
5157
+ }
5158
+ _setStatus();
5159
+ }
5160
+ catch (e) {
5161
+ if (!_isStatusSet) {
5162
+ _setStatus();
5163
+ }
5164
+ }
5165
+ });
5166
+ }
5081
5167
  function _setStatus() {
5082
5168
  _isStatusSet = true;
5083
5169
  if (isNullOrUndefined(_instrumentationKey)) {
@@ -5346,6 +5432,7 @@
5346
5432
  runTargetUnload(_notificationManager, false);
5347
5433
  _notificationManager = null;
5348
5434
  _perfManager = null;
5435
+ _statsBeat = null;
5349
5436
  _cfgPerfManager = null;
5350
5437
  runTargetUnload(_cookieManager, false);
5351
5438
  _cookieManager = null;
@@ -5370,6 +5457,7 @@
5370
5457
  _endpoint = null;
5371
5458
  _initInMemoMaxSize = null;
5372
5459
  _isStatusSet = false;
5460
+ _initTimer = null;
5373
5461
  }
5374
5462
  function _createTelCtx() {
5375
5463
  var theCtx = createProcessTelemetryContext(_getPluginChain(), _configHandler.cfg, _self);
@@ -5926,8 +6014,13 @@
5926
6014
  resolveFunc && resolveFunc(false);
5927
6015
  return;
5928
6016
  }
5929
- function _handleError(res) {
5930
- _doOnComplete(oncomplete, _isOneDs ? 0 : 400, {}, _isOneDs ? STR_EMPTY$1 : res);
6017
+ function _handleError(res, statusCode) {
6018
+ if (statusCode) {
6019
+ _doOnComplete(oncomplete, _isOneDs ? 0 : statusCode, {}, _isOneDs ? STR_EMPTY$1 : res);
6020
+ }
6021
+ else {
6022
+ _doOnComplete(oncomplete, _isOneDs ? 0 : 400, {}, _isOneDs ? STR_EMPTY$1 : res);
6023
+ }
5931
6024
  }
5932
6025
  function _onFetchComplete(response, payload, value) {
5933
6026
  var status = response[_DYN_STATUS ];
@@ -5951,7 +6044,12 @@
5951
6044
  var response_1 = result[_DYN_VALUE$1 ];
5952
6045
  try {
5953
6046
  if (!_isOneDs && !response_1.ok) {
5954
- _handleError(response_1.statusText);
6047
+ if (response_1[_DYN_STATUS ]) {
6048
+ _handleError(response_1.statusText, response_1[_DYN_STATUS ]);
6049
+ }
6050
+ else {
6051
+ _handleError(response_1.statusText, 499);
6052
+ }
5955
6053
  resolveFunc && resolveFunc(false);
5956
6054
  }
5957
6055
  else {
@@ -5968,12 +6066,17 @@
5968
6066
  }
5969
6067
  }
5970
6068
  catch (e) {
5971
- _handleError(dumpObj(e));
6069
+ if (response_1 && response_1[_DYN_STATUS ]) {
6070
+ _handleError(dumpObj(e), response_1[_DYN_STATUS ]);
6071
+ }
6072
+ else {
6073
+ _handleError(dumpObj(e), 499);
6074
+ }
5972
6075
  rejectFunc && rejectFunc(e);
5973
6076
  }
5974
6077
  }
5975
6078
  else {
5976
- _handleError(result.reason && result.reason[_DYN_MESSAGE ]);
6079
+ _handleError(result.reason && result.reason[_DYN_MESSAGE ], 499);
5977
6080
  rejectFunc && rejectFunc(result.reason);
5978
6081
  }
5979
6082
  }
@@ -5981,7 +6084,7 @@
5981
6084
  }
5982
6085
  catch (e) {
5983
6086
  if (!responseHandled) {
5984
- _handleError(dumpObj(e));
6087
+ _handleError(dumpObj(e), 499);
5985
6088
  rejectFunc && rejectFunc(e);
5986
6089
  }
5987
6090
  }
@@ -6403,7 +6506,7 @@
6403
6506
  var _DYN_CAN_HANDLE = "canHandle";
6404
6507
 
6405
6508
  var _a;
6406
- var Version = '4.4.0-nightlybeta3.2504-05';
6509
+ var Version = '4.4.0-nightlybeta3.2504-20';
6407
6510
  var FullVersionString = "1DS-Web-JS-" + Version;
6408
6511
  var ObjHasOwnProperty = ObjProto$1.hasOwnProperty;
6409
6512
  var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";