@lognroll/lib 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build.umd.js DELETED
@@ -1,3598 +0,0 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory();
4
- else if(typeof define === 'function' && define.amd)
5
- define([], factory);
6
- else {
7
- var a = factory();
8
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
- }
10
- })(this, function() {
11
- return /******/ (function(modules) { // webpackBootstrap
12
- /******/ // The module cache
13
- /******/ var installedModules = {};
14
- /******/
15
- /******/ // The require function
16
- /******/ function __webpack_require__(moduleId) {
17
- /******/
18
- /******/ // Check if module is in cache
19
- /******/ if(installedModules[moduleId]) {
20
- /******/ return installedModules[moduleId].exports;
21
- /******/ }
22
- /******/ // Create a new module (and put it into the cache)
23
- /******/ var module = installedModules[moduleId] = {
24
- /******/ i: moduleId,
25
- /******/ l: false,
26
- /******/ exports: {}
27
- /******/ };
28
- /******/
29
- /******/ // Execute the module function
30
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
- /******/
32
- /******/ // Flag the module as loaded
33
- /******/ module.l = true;
34
- /******/
35
- /******/ // Return the exports of the module
36
- /******/ return module.exports;
37
- /******/ }
38
- /******/
39
- /******/
40
- /******/ // expose the modules object (__webpack_modules__)
41
- /******/ __webpack_require__.m = modules;
42
- /******/
43
- /******/ // expose the module cache
44
- /******/ __webpack_require__.c = installedModules;
45
- /******/
46
- /******/ // define getter function for harmony exports
47
- /******/ __webpack_require__.d = function(exports, name, getter) {
48
- /******/ if(!__webpack_require__.o(exports, name)) {
49
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
50
- /******/ }
51
- /******/ };
52
- /******/
53
- /******/ // define __esModule on exports
54
- /******/ __webpack_require__.r = function(exports) {
55
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
56
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
57
- /******/ }
58
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
59
- /******/ };
60
- /******/
61
- /******/ // create a fake namespace object
62
- /******/ // mode & 1: value is a module id, require it
63
- /******/ // mode & 2: merge all properties of value into the ns
64
- /******/ // mode & 4: return value when already ns object
65
- /******/ // mode & 8|1: behave like require
66
- /******/ __webpack_require__.t = function(value, mode) {
67
- /******/ if(mode & 1) value = __webpack_require__(value);
68
- /******/ if(mode & 8) return value;
69
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
70
- /******/ var ns = Object.create(null);
71
- /******/ __webpack_require__.r(ns);
72
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
73
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
74
- /******/ return ns;
75
- /******/ };
76
- /******/
77
- /******/ // getDefaultExport function for compatibility with non-harmony modules
78
- /******/ __webpack_require__.n = function(module) {
79
- /******/ var getter = module && module.__esModule ?
80
- /******/ function getDefault() { return module['default']; } :
81
- /******/ function getModuleExports() { return module; };
82
- /******/ __webpack_require__.d(getter, 'a', getter);
83
- /******/ return getter;
84
- /******/ };
85
- /******/
86
- /******/ // Object.prototype.hasOwnProperty.call
87
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
88
- /******/
89
- /******/ // __webpack_public_path__
90
- /******/ __webpack_require__.p = "";
91
- /******/
92
- /******/
93
- /******/ // Load entry module and return exports
94
- /******/ return __webpack_require__(__webpack_require__.s = 0);
95
- /******/ })
96
- /************************************************************************/
97
- /******/ ({
98
-
99
- /***/ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
100
- /*!*****************************************************************!*\
101
- !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
102
- \*****************************************************************/
103
- /*! no static exports found */
104
- /***/ (function(module, exports) {
105
-
106
- function _arrayLikeToArray(arr, len) {
107
- if (len == null || len > arr.length) len = arr.length;
108
-
109
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
110
- arr2[i] = arr[i];
111
- }
112
-
113
- return arr2;
114
- }
115
-
116
- module.exports = _arrayLikeToArray;
117
- module.exports["default"] = module.exports, module.exports.__esModule = true;
118
-
119
- /***/ }),
120
-
121
- /***/ "./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js":
122
- /*!******************************************************************!*\
123
- !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
124
- \******************************************************************/
125
- /*! no static exports found */
126
- /***/ (function(module, exports, __webpack_require__) {
127
-
128
- var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
129
-
130
- function _arrayWithoutHoles(arr) {
131
- if (Array.isArray(arr)) return arrayLikeToArray(arr);
132
- }
133
-
134
- module.exports = _arrayWithoutHoles;
135
- module.exports["default"] = module.exports, module.exports.__esModule = true;
136
-
137
- /***/ }),
138
-
139
- /***/ "./node_modules/@babel/runtime/helpers/classCallCheck.js":
140
- /*!***************************************************************!*\
141
- !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
142
- \***************************************************************/
143
- /*! no static exports found */
144
- /***/ (function(module, exports) {
145
-
146
- function _classCallCheck(instance, Constructor) {
147
- if (!(instance instanceof Constructor)) {
148
- throw new TypeError("Cannot call a class as a function");
149
- }
150
- }
151
-
152
- module.exports = _classCallCheck;
153
- module.exports["default"] = module.exports, module.exports.__esModule = true;
154
-
155
- /***/ }),
156
-
157
- /***/ "./node_modules/@babel/runtime/helpers/createClass.js":
158
- /*!************************************************************!*\
159
- !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
160
- \************************************************************/
161
- /*! no static exports found */
162
- /***/ (function(module, exports) {
163
-
164
- function _defineProperties(target, props) {
165
- for (var i = 0; i < props.length; i++) {
166
- var descriptor = props[i];
167
- descriptor.enumerable = descriptor.enumerable || false;
168
- descriptor.configurable = true;
169
- if ("value" in descriptor) descriptor.writable = true;
170
- Object.defineProperty(target, descriptor.key, descriptor);
171
- }
172
- }
173
-
174
- function _createClass(Constructor, protoProps, staticProps) {
175
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
176
- if (staticProps) _defineProperties(Constructor, staticProps);
177
- return Constructor;
178
- }
179
-
180
- module.exports = _createClass;
181
- module.exports["default"] = module.exports, module.exports.__esModule = true;
182
-
183
- /***/ }),
184
-
185
- /***/ "./node_modules/@babel/runtime/helpers/defineProperty.js":
186
- /*!***************************************************************!*\
187
- !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
188
- \***************************************************************/
189
- /*! no static exports found */
190
- /***/ (function(module, exports) {
191
-
192
- function _defineProperty(obj, key, value) {
193
- if (key in obj) {
194
- Object.defineProperty(obj, key, {
195
- value: value,
196
- enumerable: true,
197
- configurable: true,
198
- writable: true
199
- });
200
- } else {
201
- obj[key] = value;
202
- }
203
-
204
- return obj;
205
- }
206
-
207
- module.exports = _defineProperty;
208
- module.exports["default"] = module.exports, module.exports.__esModule = true;
209
-
210
- /***/ }),
211
-
212
- /***/ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js":
213
- /*!**********************************************************************!*\
214
- !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
215
- \**********************************************************************/
216
- /*! no static exports found */
217
- /***/ (function(module, exports) {
218
-
219
- function _interopRequireDefault(obj) {
220
- return obj && obj.__esModule ? obj : {
221
- "default": obj
222
- };
223
- }
224
-
225
- module.exports = _interopRequireDefault;
226
- module.exports["default"] = module.exports, module.exports.__esModule = true;
227
-
228
- /***/ }),
229
-
230
- /***/ "./node_modules/@babel/runtime/helpers/interopRequireWildcard.js":
231
- /*!***********************************************************************!*\
232
- !*** ./node_modules/@babel/runtime/helpers/interopRequireWildcard.js ***!
233
- \***********************************************************************/
234
- /*! no static exports found */
235
- /***/ (function(module, exports, __webpack_require__) {
236
-
237
- var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/@babel/runtime/helpers/typeof.js")["default"];
238
-
239
- function _getRequireWildcardCache(nodeInterop) {
240
- if (typeof WeakMap !== "function") return null;
241
- var cacheBabelInterop = new WeakMap();
242
- var cacheNodeInterop = new WeakMap();
243
- return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
244
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
245
- })(nodeInterop);
246
- }
247
-
248
- function _interopRequireWildcard(obj, nodeInterop) {
249
- if (!nodeInterop && obj && obj.__esModule) {
250
- return obj;
251
- }
252
-
253
- if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
254
- return {
255
- "default": obj
256
- };
257
- }
258
-
259
- var cache = _getRequireWildcardCache(nodeInterop);
260
-
261
- if (cache && cache.has(obj)) {
262
- return cache.get(obj);
263
- }
264
-
265
- var newObj = {};
266
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
267
-
268
- for (var key in obj) {
269
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
270
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
271
-
272
- if (desc && (desc.get || desc.set)) {
273
- Object.defineProperty(newObj, key, desc);
274
- } else {
275
- newObj[key] = obj[key];
276
- }
277
- }
278
- }
279
-
280
- newObj["default"] = obj;
281
-
282
- if (cache) {
283
- cache.set(obj, newObj);
284
- }
285
-
286
- return newObj;
287
- }
288
-
289
- module.exports = _interopRequireWildcard;
290
- module.exports["default"] = module.exports, module.exports.__esModule = true;
291
-
292
- /***/ }),
293
-
294
- /***/ "./node_modules/@babel/runtime/helpers/iterableToArray.js":
295
- /*!****************************************************************!*\
296
- !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
297
- \****************************************************************/
298
- /*! no static exports found */
299
- /***/ (function(module, exports) {
300
-
301
- function _iterableToArray(iter) {
302
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
303
- }
304
-
305
- module.exports = _iterableToArray;
306
- module.exports["default"] = module.exports, module.exports.__esModule = true;
307
-
308
- /***/ }),
309
-
310
- /***/ "./node_modules/@babel/runtime/helpers/nonIterableSpread.js":
311
- /*!******************************************************************!*\
312
- !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
313
- \******************************************************************/
314
- /*! no static exports found */
315
- /***/ (function(module, exports) {
316
-
317
- function _nonIterableSpread() {
318
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
319
- }
320
-
321
- module.exports = _nonIterableSpread;
322
- module.exports["default"] = module.exports, module.exports.__esModule = true;
323
-
324
- /***/ }),
325
-
326
- /***/ "./node_modules/@babel/runtime/helpers/objectWithoutProperties.js":
327
- /*!************************************************************************!*\
328
- !*** ./node_modules/@babel/runtime/helpers/objectWithoutProperties.js ***!
329
- \************************************************************************/
330
- /*! no static exports found */
331
- /***/ (function(module, exports, __webpack_require__) {
332
-
333
- var objectWithoutPropertiesLoose = __webpack_require__(/*! ./objectWithoutPropertiesLoose.js */ "./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js");
334
-
335
- function _objectWithoutProperties(source, excluded) {
336
- if (source == null) return {};
337
- var target = objectWithoutPropertiesLoose(source, excluded);
338
- var key, i;
339
-
340
- if (Object.getOwnPropertySymbols) {
341
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
342
-
343
- for (i = 0; i < sourceSymbolKeys.length; i++) {
344
- key = sourceSymbolKeys[i];
345
- if (excluded.indexOf(key) >= 0) continue;
346
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
347
- target[key] = source[key];
348
- }
349
- }
350
-
351
- return target;
352
- }
353
-
354
- module.exports = _objectWithoutProperties;
355
- module.exports["default"] = module.exports, module.exports.__esModule = true;
356
-
357
- /***/ }),
358
-
359
- /***/ "./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js":
360
- /*!*****************************************************************************!*\
361
- !*** ./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js ***!
362
- \*****************************************************************************/
363
- /*! no static exports found */
364
- /***/ (function(module, exports) {
365
-
366
- function _objectWithoutPropertiesLoose(source, excluded) {
367
- if (source == null) return {};
368
- var target = {};
369
- var sourceKeys = Object.keys(source);
370
- var key, i;
371
-
372
- for (i = 0; i < sourceKeys.length; i++) {
373
- key = sourceKeys[i];
374
- if (excluded.indexOf(key) >= 0) continue;
375
- target[key] = source[key];
376
- }
377
-
378
- return target;
379
- }
380
-
381
- module.exports = _objectWithoutPropertiesLoose;
382
- module.exports["default"] = module.exports, module.exports.__esModule = true;
383
-
384
- /***/ }),
385
-
386
- /***/ "./node_modules/@babel/runtime/helpers/toConsumableArray.js":
387
- /*!******************************************************************!*\
388
- !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
389
- \******************************************************************/
390
- /*! no static exports found */
391
- /***/ (function(module, exports, __webpack_require__) {
392
-
393
- var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ "./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js");
394
-
395
- var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ "./node_modules/@babel/runtime/helpers/iterableToArray.js");
396
-
397
- var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");
398
-
399
- var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ "./node_modules/@babel/runtime/helpers/nonIterableSpread.js");
400
-
401
- function _toConsumableArray(arr) {
402
- return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
403
- }
404
-
405
- module.exports = _toConsumableArray;
406
- module.exports["default"] = module.exports, module.exports.__esModule = true;
407
-
408
- /***/ }),
409
-
410
- /***/ "./node_modules/@babel/runtime/helpers/typeof.js":
411
- /*!*******************************************************!*\
412
- !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
413
- \*******************************************************/
414
- /*! no static exports found */
415
- /***/ (function(module, exports) {
416
-
417
- function _typeof(obj) {
418
- "@babel/helpers - typeof";
419
-
420
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
421
- module.exports = _typeof = function _typeof(obj) {
422
- return typeof obj;
423
- };
424
-
425
- module.exports["default"] = module.exports, module.exports.__esModule = true;
426
- } else {
427
- module.exports = _typeof = function _typeof(obj) {
428
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
429
- };
430
-
431
- module.exports["default"] = module.exports, module.exports.__esModule = true;
432
- }
433
-
434
- return _typeof(obj);
435
- }
436
-
437
- module.exports = _typeof;
438
- module.exports["default"] = module.exports, module.exports.__esModule = true;
439
-
440
- /***/ }),
441
-
442
- /***/ "./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js":
443
- /*!***************************************************************************!*\
444
- !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
445
- \***************************************************************************/
446
- /*! no static exports found */
447
- /***/ (function(module, exports, __webpack_require__) {
448
-
449
- var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
450
-
451
- function _unsupportedIterableToArray(o, minLen) {
452
- if (!o) return;
453
- if (typeof o === "string") return arrayLikeToArray(o, minLen);
454
- var n = Object.prototype.toString.call(o).slice(8, -1);
455
- if (n === "Object" && o.constructor) n = o.constructor.name;
456
- if (n === "Map" || n === "Set") return Array.from(o);
457
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
458
- }
459
-
460
- module.exports = _unsupportedIterableToArray;
461
- module.exports["default"] = module.exports, module.exports.__esModule = true;
462
-
463
- /***/ }),
464
-
465
- /***/ "./node_modules/webpack/buildin/global.js":
466
- /*!***********************************!*\
467
- !*** (webpack)/buildin/global.js ***!
468
- \***********************************/
469
- /*! no static exports found */
470
- /***/ (function(module, exports) {
471
-
472
- var g;
473
-
474
- // This works in non-strict mode
475
- g = (function() {
476
- return this;
477
- })();
478
-
479
- try {
480
- // This works if eval is allowed (see CSP)
481
- g = g || new Function("return this")();
482
- } catch (e) {
483
- // This works if the window reference is available
484
- if (typeof window === "object") g = window;
485
- }
486
-
487
- // g can still be undefined, but nothing to do about it...
488
- // We return undefined, instead of nothing here, so it's
489
- // easier to handle this case. if(!global) { ...}
490
-
491
- module.exports = g;
492
-
493
-
494
- /***/ }),
495
-
496
- /***/ "./packages/@apphub:logrocket-console/src/index.js":
497
- /*!*********************************************************!*\
498
- !*** ./packages/@apphub:logrocket-console/src/index.js ***!
499
- \*********************************************************/
500
- /*! no static exports found */
501
- /***/ (function(module, exports, __webpack_require__) {
502
-
503
- "use strict";
504
-
505
-
506
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
507
-
508
- Object.defineProperty(exports, "__esModule", {
509
- value: true
510
- });
511
- exports.default = void 0;
512
-
513
- var _registerConsole = _interopRequireDefault(__webpack_require__(/*! ./registerConsole */ "./packages/@apphub:logrocket-console/src/registerConsole.js"));
514
-
515
- var _default = _registerConsole.default;
516
- exports.default = _default;
517
- module.exports = exports.default;
518
-
519
- /***/ }),
520
-
521
- /***/ "./packages/@apphub:logrocket-console/src/registerConsole.js":
522
- /*!*******************************************************************!*\
523
- !*** ./packages/@apphub:logrocket-console/src/registerConsole.js ***!
524
- \*******************************************************************/
525
- /*! no static exports found */
526
- /***/ (function(module, exports, __webpack_require__) {
527
-
528
- "use strict";
529
-
530
-
531
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
532
-
533
- Object.defineProperty(exports, "__esModule", {
534
- value: true
535
- });
536
- exports.default = registerConsole;
537
-
538
- var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/@babel/runtime/helpers/typeof.js"));
539
-
540
- var _enhanceFunc = _interopRequireDefault(__webpack_require__(/*! @apphub/logrocket-utils/src/enhanceFunc */ "./packages/@apphub:logrocket-utils/src/enhanceFunc.js"));
541
-
542
- var _logrocketExceptions = __webpack_require__(/*! @apphub/logrocket-exceptions */ "./packages/@apphub:logrocket-exceptions/src/index.js");
543
-
544
- function registerConsole(logger) {
545
- var unsubFunctions = [];
546
- var methods = ['log', 'warn', 'info', 'error', 'debug'];
547
- methods.forEach(function (method) {
548
- unsubFunctions.push((0, _enhanceFunc.default)(console, method, function () {
549
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
550
- args[_key] = arguments[_key];
551
- }
552
-
553
- logger.addEvent('lr.core.LogEvent', function () {
554
- var consoleOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
555
- var isEnabled = consoleOptions.isEnabled;
556
-
557
- if ((0, _typeof2.default)(isEnabled) === 'object' && isEnabled[method] === false || isEnabled === false) {
558
- return null;
559
- }
560
-
561
- if (method === 'error' && consoleOptions.shouldAggregateConsoleErrors) {
562
- _logrocketExceptions.Capture.captureMessage(logger, args[0], {}, true);
563
- }
564
-
565
- return {
566
- logLevel: method.toUpperCase(),
567
- args: args
568
- };
569
- });
570
- }));
571
- });
572
- return function () {
573
- unsubFunctions.forEach(function (unsubFunction) {
574
- return unsubFunction();
575
- });
576
- };
577
- }
578
-
579
- module.exports = exports.default;
580
-
581
- /***/ }),
582
-
583
- /***/ "./packages/@apphub:logrocket-exceptions/src/Capture.js":
584
- /*!**************************************************************!*\
585
- !*** ./packages/@apphub:logrocket-exceptions/src/Capture.js ***!
586
- \**************************************************************/
587
- /*! no static exports found */
588
- /***/ (function(module, exports, __webpack_require__) {
589
-
590
- "use strict";
591
-
592
-
593
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
594
-
595
- Object.defineProperty(exports, "__esModule", {
596
- value: true
597
- });
598
- exports.captureMessage = captureMessage;
599
- exports.captureException = captureException;
600
-
601
- var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/@babel/runtime/helpers/typeof.js"));
602
-
603
- var _TraceKit = _interopRequireDefault(__webpack_require__(/*! @apphub/logrocket-utils/src/TraceKit */ "./packages/@apphub:logrocket-utils/src/TraceKit.js"));
604
-
605
- var _stackTraceFromError = _interopRequireDefault(__webpack_require__(/*! ./stackTraceFromError */ "./packages/@apphub:logrocket-exceptions/src/stackTraceFromError.js"));
606
-
607
- /* eslint-disable no-param-reassign */
608
- function isScalar(value) {
609
- return /boolean|number|string/.test((0, _typeof2.default)(value));
610
- }
611
-
612
- function scrub(data, options) {
613
- if (options) {
614
- var optionalScalars = [// Valid values for 'level' are 'fatal', 'error', 'warning', 'info',
615
- // and 'debug'. Defaults to 'error'.
616
- 'level', 'logger'];
617
-
618
- for (var _i = 0, _optionalScalars = optionalScalars; _i < _optionalScalars.length; _i++) {
619
- var field = _optionalScalars[_i];
620
- var value = options[field];
621
-
622
- if (isScalar(value)) {
623
- data[field] = value.toString();
624
- }
625
- }
626
-
627
- var optionalMaps = ['tags', 'extra'];
628
-
629
- for (var _i2 = 0, _optionalMaps = optionalMaps; _i2 < _optionalMaps.length; _i2++) {
630
- var _field = _optionalMaps[_i2];
631
- var dirty = options[_field] || {};
632
- var scrubbed = {};
633
-
634
- for (var _i3 = 0, _Object$keys = Object.keys(dirty); _i3 < _Object$keys.length; _i3++) {
635
- var key = _Object$keys[_i3];
636
- var _value = dirty[key];
637
-
638
- if (isScalar(_value)) {
639
- scrubbed[key.toString()] = _value.toString();
640
- }
641
- }
642
-
643
- data[_field] = scrubbed;
644
- }
645
- }
646
- }
647
-
648
- function captureMessage(logger, message) {
649
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
650
- var isConsole = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
651
- var data = {
652
- exceptionType: isConsole ? 'CONSOLE' : 'MESSAGE',
653
- message: message,
654
- browserHref: window.location ? window.location.href : ''
655
- };
656
- scrub(data, options);
657
- logger.addEvent('lr.core.Exception', function () {
658
- return data;
659
- });
660
- }
661
-
662
- function captureException(logger, exception) {
663
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
664
- var preppedTrace = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
665
-
666
- var trace = preppedTrace || _TraceKit.default.computeStackTrace(exception);
667
-
668
- var data = {
669
- exceptionType: 'WINDOW',
670
- errorType: trace.name,
671
- message: trace.message,
672
- browserHref: window.location ? window.location.href : ''
673
- };
674
- scrub(data, options);
675
- var addEventOptions = {
676
- _stackTrace: (0, _stackTraceFromError.default)(trace)
677
- };
678
- logger.addEvent('lr.core.Exception', function () {
679
- return data;
680
- }, addEventOptions);
681
- }
682
-
683
- /***/ }),
684
-
685
- /***/ "./packages/@apphub:logrocket-exceptions/src/index.js":
686
- /*!************************************************************!*\
687
- !*** ./packages/@apphub:logrocket-exceptions/src/index.js ***!
688
- \************************************************************/
689
- /*! no static exports found */
690
- /***/ (function(module, exports, __webpack_require__) {
691
-
692
- "use strict";
693
-
694
-
695
- var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "./node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
696
-
697
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
698
-
699
- Object.defineProperty(exports, "__esModule", {
700
- value: true
701
- });
702
- Object.defineProperty(exports, "registerExceptions", {
703
- enumerable: true,
704
- get: function get() {
705
- return _registerExceptions.default;
706
- }
707
- });
708
- exports.Capture = void 0;
709
-
710
- var _registerExceptions = _interopRequireDefault(__webpack_require__(/*! ./registerExceptions */ "./packages/@apphub:logrocket-exceptions/src/registerExceptions.js"));
711
-
712
- var Capture = _interopRequireWildcard(__webpack_require__(/*! ./Capture */ "./packages/@apphub:logrocket-exceptions/src/Capture.js"));
713
-
714
- exports.Capture = Capture;
715
-
716
- /***/ }),
717
-
718
- /***/ "./packages/@apphub:logrocket-exceptions/src/raven/raven.js":
719
- /*!******************************************************************!*\
720
- !*** ./packages/@apphub:logrocket-exceptions/src/raven/raven.js ***!
721
- \******************************************************************/
722
- /*! no static exports found */
723
- /***/ (function(module, exports, __webpack_require__) {
724
-
725
- "use strict";
726
- /* WEBPACK VAR INJECTION */(function(global) {
727
-
728
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
729
-
730
- Object.defineProperty(exports, "__esModule", {
731
- value: true
732
- });
733
- exports.default = void 0;
734
-
735
- var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js"));
736
-
737
- var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js"));
738
-
739
- var _TraceKit = _interopRequireDefault(__webpack_require__(/*! @apphub/logrocket-utils/src/TraceKit */ "./packages/@apphub:logrocket-utils/src/TraceKit.js"));
740
-
741
- /* eslint-disable */
742
-
743
- /*
744
- Some contents of this file were originaly from raven-js, BSD-2 Clause
745
-
746
- Copyright (c) 2018 Sentry (https://sentry.io) and individual contributors.
747
- All rights reserved.
748
-
749
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
750
-
751
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
752
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
753
-
754
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
755
- */
756
- var objectPrototype = Object.prototype;
757
-
758
- function isUndefined(what) {
759
- return what === void 0;
760
- }
761
-
762
- function isFunction(what) {
763
- return typeof what === 'function';
764
- }
765
-
766
- function each(obj, callback) {
767
- var i, j;
768
-
769
- if (isUndefined(obj.length)) {
770
- for (i in obj) {
771
- if (hasKey(obj, i)) {
772
- callback.call(null, i, obj[i]);
773
- }
774
- }
775
- } else {
776
- j = obj.length;
777
-
778
- if (j) {
779
- for (i = 0; i < j; i++) {
780
- callback.call(null, i, obj[i]);
781
- }
782
- }
783
- }
784
- }
785
- /**
786
- * hasKey, a better form of hasOwnProperty
787
- * Example: hasKey(MainHostObject, property) === true/false
788
- *
789
- * @param {Object} host object to check property
790
- * @param {string} key to check
791
- */
792
-
793
-
794
- function hasKey(object, key) {
795
- return objectPrototype.hasOwnProperty.call(object, key);
796
- }
797
- /**
798
- * Polyfill a method
799
- * @param obj object e.g. `document`
800
- * @param name method name present on object e.g. `addEventListener`
801
- * @param replacement replacement function
802
- * @param track {optional} record instrumentation to an array
803
- */
804
-
805
-
806
- function fill(obj, name, replacement, track) {
807
- var orig = obj[name];
808
- obj[name] = replacement(orig);
809
-
810
- if (track) {
811
- track.push([obj, name, orig]);
812
- }
813
- }
814
-
815
- var _window = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
816
-
817
- var _document = _window.document;
818
-
819
- var Handler = /*#__PURE__*/function () {
820
- function Handler(_ref) {
821
- var captureException = _ref.captureException;
822
- (0, _classCallCheck2.default)(this, Handler);
823
- this._errorHandler = this._errorHandler.bind(this);
824
- this._ignoreOnError = 0;
825
- this._wrappedBuiltIns = [];
826
- this.captureException = captureException;
827
-
828
- _TraceKit.default.report.subscribe(this._errorHandler);
829
-
830
- this._instrumentTryCatch();
831
- }
832
-
833
- (0, _createClass2.default)(Handler, [{
834
- key: "uninstall",
835
- value: function uninstall() {
836
- _TraceKit.default.report.unsubscribe(this._errorHandler); // restore any wrapped builtins
837
-
838
-
839
- var builtin;
840
-
841
- while (this._wrappedBuiltIns.length) {
842
- builtin = this._wrappedBuiltIns.shift();
843
- var obj = builtin[0],
844
- name = builtin[1],
845
- orig = builtin[2];
846
- obj[name] = orig;
847
- }
848
- }
849
- }, {
850
- key: "_errorHandler",
851
- value: function _errorHandler(report) {
852
- if (!this._ignoreOnError) {
853
- this.captureException(report);
854
- }
855
- }
856
- }, {
857
- key: "_ignoreNextOnError",
858
- value: function _ignoreNextOnError() {
859
- var _this = this;
860
-
861
- this._ignoreOnError += 1;
862
- setTimeout(function () {
863
- // onerror should trigger before setTimeout
864
- _this._ignoreOnError -= 1;
865
- });
866
- }
867
- /*
868
- * Wrap code within a context so Handler can capture errors
869
- * reliably across domains that is executed immediately.
870
- *
871
- * @param {object} options A specific set of options for this context [optional]
872
- * @param {function} func The callback to be immediately executed within the context
873
- * @param {array} args An array of arguments to be called with the callback [optional]
874
- */
875
-
876
- }, {
877
- key: "context",
878
- value: function context(options, func, args) {
879
- if (isFunction(options)) {
880
- args = func || [];
881
- func = options;
882
- options = undefined;
883
- }
884
-
885
- return this.wrap(options, func).apply(this, args);
886
- }
887
- }, {
888
- key: "wrap",
889
- value:
890
- /*
891
- * Wrap code within a context and returns back a new function to be executed
892
- *
893
- * @param {object} options A specific set of options for this context [optional]
894
- * @param {function} func The function to be wrapped in a new context
895
- * @param {function} func A function to call before the try/catch wrapper [optional, private]
896
- * @return {function} The newly wrapped functions with a context
897
- */
898
- function wrap(options, func, _before) {
899
- var self = this; // 1 argument has been passed, and it's not a function
900
- // so just return it
901
-
902
- if (isUndefined(func) && !isFunction(options)) {
903
- return options;
904
- } // options is optional
905
-
906
-
907
- if (isFunction(options)) {
908
- func = options;
909
- options = undefined;
910
- } // At this point, we've passed along 2 arguments, and the second one
911
- // is not a function either, so we'll just return the second argument.
912
-
913
-
914
- if (!isFunction(func)) {
915
- return func;
916
- } // We don't wanna wrap it twice!
917
-
918
-
919
- try {
920
- if (func.__lr__) {
921
- return func;
922
- } // If this has already been wrapped in the past, return that
923
-
924
-
925
- if (func.__lr_wrapper__) {
926
- return func.__lr_wrapper__;
927
- } // If func is not extensible, return the function as-is to prevent TypeErrors
928
- // when trying to add new props & to assure immutable funcs aren't changed
929
-
930
-
931
- if (!Object.isExtensible(func)) {
932
- return func;
933
- }
934
- } catch (e) {
935
- // Just accessing custom props in some Selenium environments
936
- // can cause a "Permission denied" exception (see lr-js#495).
937
- // Bail on wrapping and return the function as-is (defers to window.onerror).
938
- return func;
939
- }
940
-
941
- function wrapped() {
942
- var args = [],
943
- i = arguments.length,
944
- deep = !options || options && options.deep !== false;
945
-
946
- if (_before && isFunction(_before)) {
947
- _before.apply(this, arguments);
948
- } // Recursively wrap all of a function's arguments that are
949
- // functions themselves.
950
-
951
-
952
- while (i--) {
953
- args[i] = deep ? self.wrap(options, arguments[i]) : arguments[i];
954
- }
955
-
956
- try {
957
- // Attempt to invoke user-land function. This is part of the LogRocket SDK.
958
- // If you're seeing this frame in a stack trace, it means that LogRocket caught
959
- // an unhandled error thrown by your application code, reported it, then bubbled
960
- // it up. This is expected behavior and is not a bug with LogRocket.
961
- return func.apply(this, args);
962
- } catch (e) {
963
- self._ignoreNextOnError();
964
-
965
- self.captureException(_TraceKit.default.computeStackTrace(e), options);
966
- throw e;
967
- }
968
- } // copy over properties of the old function
969
-
970
-
971
- for (var property in func) {
972
- if (hasKey(func, property)) {
973
- wrapped[property] = func[property];
974
- }
975
- }
976
-
977
- wrapped.prototype = func.prototype;
978
- func.__lr_wrapper__ = wrapped; // Signal that this function has been wrapped already
979
- // for both debugging and to prevent it to being wrapped twice
980
-
981
- wrapped.__lr__ = true;
982
- wrapped.__inner__ = func;
983
- return wrapped;
984
- }
985
- }, {
986
- key: "_instrumentTryCatch",
987
- value:
988
- /**
989
- * Install any queued plugins
990
- */
991
- function _instrumentTryCatch() {
992
- var self = this;
993
- var wrappedBuiltIns = self._wrappedBuiltIns;
994
-
995
- function wrapTimeFn(orig) {
996
- return function (fn, t) {
997
- // preserve arity
998
- // Make a copy of the arguments to prevent deoptimization
999
- // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
1000
- var args = new Array(arguments.length);
1001
-
1002
- for (var i = 0; i < args.length; ++i) {
1003
- args[i] = arguments[i];
1004
- }
1005
-
1006
- var originalCallback = args[0];
1007
-
1008
- if (isFunction(originalCallback)) {
1009
- args[0] = self.wrap(originalCallback);
1010
- } // IE < 9 doesn't support .call/.apply on setInterval/setTimeout, but it
1011
- // also supports only two arguments and doesn't care what this is, so we
1012
- // can just call the original function directly.
1013
-
1014
-
1015
- if (orig.apply) {
1016
- return orig.apply(this, args);
1017
- } else {
1018
- return orig(args[0], args[1]);
1019
- }
1020
- };
1021
- }
1022
-
1023
- function wrapEventTarget(global) {
1024
- var proto = _window[global] && _window[global].prototype;
1025
-
1026
- if (proto && proto.hasOwnProperty && proto.hasOwnProperty('addEventListener')) {
1027
- fill(proto, 'addEventListener', function (orig) {
1028
- return function (evtName, fn, capture, secure) {
1029
- // preserve arity
1030
- try {
1031
- if (fn && fn.handleEvent) {
1032
- fn.handleEvent = self.wrap(fn.handleEvent);
1033
- }
1034
- } catch (err) {// can sometimes get 'Permission denied to access property "handle Event'
1035
- } // More breadcrumb DOM capture ... done here and not in `_instrumentBreadcrumbs`
1036
- // so that we don't have more than one wrapper function
1037
-
1038
-
1039
- var before;
1040
- return orig.call(this, evtName, self.wrap(fn, undefined, before), capture, secure);
1041
- };
1042
- }, wrappedBuiltIns);
1043
- fill(proto, 'removeEventListener', function (orig) {
1044
- return function (evt, fn, capture, secure) {
1045
- try {
1046
- fn = fn && (fn.__lr_wrapper__ ? fn.__lr_wrapper__ : fn);
1047
- } catch (e) {// ignore, accessing __lr_wrapper__ will throw in some Selenium environments
1048
- }
1049
-
1050
- return orig.call(this, evt, fn, capture, secure);
1051
- };
1052
- }, wrappedBuiltIns);
1053
- }
1054
- }
1055
-
1056
- fill(_window, 'setTimeout', wrapTimeFn, wrappedBuiltIns);
1057
- fill(_window, 'setInterval', wrapTimeFn, wrappedBuiltIns);
1058
-
1059
- if (_window.requestAnimationFrame) {
1060
- fill(_window, 'requestAnimationFrame', function (orig) {
1061
- return function (cb) {
1062
- return orig(self.wrap(cb));
1063
- };
1064
- }, wrappedBuiltIns);
1065
- } // event targets borrowed from bugsnag-js:
1066
- // https://github.com/bugsnag/bugsnag-js/blob/master/src/bugsnag.js#L666
1067
-
1068
-
1069
- var eventTargets = ['EventTarget', 'Window', 'Node', 'ApplicationCache', 'AudioTrackList', 'ChannelMergerNode', 'CryptoOperation', 'EventSource', 'FileReader', 'HTMLUnknownElement', 'IDBDatabase', 'IDBRequest', 'IDBTransaction', 'KeyOperation', 'MediaController', 'MessagePort', 'ModalWindow', 'Notification', 'SVGElementInstance', 'Screen', 'TextTrack', 'TextTrackCue', 'TextTrackList', 'WebSocket', 'WebSocketWorker', 'Worker', 'XMLHttpRequest', 'XMLHttpRequestEventTarget', 'XMLHttpRequestUpload'];
1070
-
1071
- for (var i = 0; i < eventTargets.length; i++) {
1072
- wrapEventTarget(eventTargets[i]);
1073
- }
1074
-
1075
- var $ = _window.jQuery || _window.$;
1076
-
1077
- if ($ && $.fn && $.fn.ready) {
1078
- fill($.fn, 'ready', function (orig) {
1079
- return function (fn) {
1080
- return orig.call(this, self.wrap(fn));
1081
- };
1082
- }, wrappedBuiltIns);
1083
- }
1084
- }
1085
- }]);
1086
- return Handler;
1087
- }();
1088
-
1089
- exports.default = Handler;
1090
- ;
1091
- module.exports = exports.default;
1092
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
1093
-
1094
- /***/ }),
1095
-
1096
- /***/ "./packages/@apphub:logrocket-exceptions/src/registerExceptions.js":
1097
- /*!*************************************************************************!*\
1098
- !*** ./packages/@apphub:logrocket-exceptions/src/registerExceptions.js ***!
1099
- \*************************************************************************/
1100
- /*! no static exports found */
1101
- /***/ (function(module, exports, __webpack_require__) {
1102
-
1103
- "use strict";
1104
-
1105
-
1106
- var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "./node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
1107
-
1108
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1109
-
1110
- Object.defineProperty(exports, "__esModule", {
1111
- value: true
1112
- });
1113
- exports.default = registerCore;
1114
-
1115
- var _raven = _interopRequireDefault(__webpack_require__(/*! ./raven/raven */ "./packages/@apphub:logrocket-exceptions/src/raven/raven.js"));
1116
-
1117
- var Capture = _interopRequireWildcard(__webpack_require__(/*! ./Capture */ "./packages/@apphub:logrocket-exceptions/src/Capture.js"));
1118
-
1119
- function registerCore(logger) {
1120
- var raven = new _raven.default({
1121
- captureException: function captureException(errorReport) {
1122
- Capture.captureException(logger, null, null, errorReport);
1123
- }
1124
- });
1125
-
1126
- var rejectionHandler = function rejectionHandler(evt) {
1127
- // http://2ality.com/2016/04/unhandled-rejections.html
1128
- logger.addEvent('lr.core.Exception', function () {
1129
- return {
1130
- exceptionType: 'UNHANDLED_REJECTION',
1131
- message: evt.reason || 'Unhandled Promise rejection'
1132
- };
1133
- });
1134
- };
1135
-
1136
- window.addEventListener('unhandledrejection', rejectionHandler);
1137
- return function () {
1138
- window.removeEventListener('unhandledrejection', rejectionHandler);
1139
- raven.uninstall();
1140
- };
1141
- }
1142
-
1143
- module.exports = exports.default;
1144
-
1145
- /***/ }),
1146
-
1147
- /***/ "./packages/@apphub:logrocket-exceptions/src/stackTraceFromError.js":
1148
- /*!**************************************************************************!*\
1149
- !*** ./packages/@apphub:logrocket-exceptions/src/stackTraceFromError.js ***!
1150
- \**************************************************************************/
1151
- /*! no static exports found */
1152
- /***/ (function(module, exports, __webpack_require__) {
1153
-
1154
- "use strict";
1155
-
1156
-
1157
- Object.defineProperty(exports, "__esModule", {
1158
- value: true
1159
- });
1160
- exports.default = stackTraceFromError;
1161
-
1162
- function stackTraceFromError(errorReport) {
1163
- function makeNotNull(val) {
1164
- return val === null ? undefined : val;
1165
- }
1166
-
1167
- return errorReport.stack ? errorReport.stack.map(function (frame) {
1168
- return {
1169
- lineNumber: makeNotNull(frame.line),
1170
- columnNumber: makeNotNull(frame.column),
1171
- fileName: makeNotNull(frame.url),
1172
- functionName: makeNotNull(frame.func)
1173
- };
1174
- }) : undefined;
1175
- }
1176
-
1177
- module.exports = exports.default;
1178
-
1179
- /***/ }),
1180
-
1181
- /***/ "./packages/@apphub:logrocket-network/src/fetchIntercept.js":
1182
- /*!******************************************************************!*\
1183
- !*** ./packages/@apphub:logrocket-network/src/fetchIntercept.js ***!
1184
- \******************************************************************/
1185
- /*! no static exports found */
1186
- /***/ (function(module, exports, __webpack_require__) {
1187
-
1188
- "use strict";
1189
-
1190
-
1191
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1192
-
1193
- Object.defineProperty(exports, "__esModule", {
1194
- value: true
1195
- });
1196
- exports.default = void 0;
1197
-
1198
- var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js"));
1199
-
1200
- var _registerXHR = __webpack_require__(/*! ./registerXHR */ "./packages/@apphub:logrocket-network/src/registerXHR.js");
1201
-
1202
- var interceptors = [];
1203
-
1204
- function makeInterceptor(fetch, fetchId) {
1205
- var reversedInterceptors = interceptors.reduce(function (array, interceptor) {
1206
- return [interceptor].concat(array);
1207
- }, []);
1208
-
1209
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
1210
- args[_key - 2] = arguments[_key];
1211
- }
1212
-
1213
- var promise = Promise.resolve(args); // Register request interceptors
1214
-
1215
- reversedInterceptors.forEach(function (_ref) {
1216
- var request = _ref.request,
1217
- requestError = _ref.requestError;
1218
-
1219
- if (request || requestError) {
1220
- promise = promise.then(function (args) {
1221
- return request.apply(void 0, [fetchId].concat((0, _toConsumableArray2.default)(args)));
1222
- }, function (args) {
1223
- return requestError.apply(void 0, [fetchId].concat((0, _toConsumableArray2.default)(args)));
1224
- });
1225
- }
1226
- });
1227
- promise = promise.then(function (args) {
1228
- (0, _registerXHR.setActive)(false);
1229
- var res;
1230
- var err;
1231
-
1232
- try {
1233
- res = fetch.apply(void 0, (0, _toConsumableArray2.default)(args));
1234
- } catch (_err) {
1235
- err = _err;
1236
- }
1237
-
1238
- (0, _registerXHR.setActive)(true);
1239
-
1240
- if (err) {
1241
- throw err;
1242
- }
1243
-
1244
- return res;
1245
- });
1246
- reversedInterceptors.forEach(function (_ref2) {
1247
- var response = _ref2.response,
1248
- responseError = _ref2.responseError;
1249
-
1250
- if (response || responseError) {
1251
- promise = promise.then(function (res) {
1252
- return response(fetchId, res);
1253
- }, function (err) {
1254
- return responseError && responseError(fetchId, err);
1255
- });
1256
- }
1257
- });
1258
- return promise;
1259
- }
1260
-
1261
- function attach(env) {
1262
- if (!env.fetch || !env.Promise) {
1263
- // Make sure fetch is available in the given environment. If it's not, then
1264
- // default to using XHR intercept.
1265
- return;
1266
- }
1267
-
1268
- var isPolyfill = env.fetch.polyfill; // eslint-disable-next-line no-param-reassign
1269
-
1270
- env.fetch = function (fetch) {
1271
- var fetchId = 0;
1272
- return function () {
1273
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
1274
- args[_key2] = arguments[_key2];
1275
- }
1276
-
1277
- return makeInterceptor.apply(void 0, [fetch, fetchId++].concat(args));
1278
- };
1279
- }(env.fetch); // Forward the polyfill properly from fetch (set by github/whatwg-fetch).
1280
-
1281
-
1282
- if (isPolyfill) {
1283
- // eslint-disable-next-line no-param-reassign
1284
- env.fetch.polyfill = isPolyfill;
1285
- }
1286
- } // TODO: React Native
1287
- // attach(global);
1288
-
1289
-
1290
- var didAttach = false;
1291
- var _default = {
1292
- register: function register(interceptor) {
1293
- if (!didAttach) {
1294
- didAttach = true;
1295
- attach(window);
1296
- }
1297
-
1298
- interceptors.push(interceptor);
1299
- return function () {
1300
- var index = interceptors.indexOf(interceptor);
1301
-
1302
- if (index >= 0) {
1303
- interceptors.splice(index, 1);
1304
- }
1305
- };
1306
- },
1307
- clear: function clear() {
1308
- interceptors = [];
1309
- }
1310
- };
1311
- exports.default = _default;
1312
- module.exports = exports.default;
1313
-
1314
- /***/ }),
1315
-
1316
- /***/ "./packages/@apphub:logrocket-network/src/index.js":
1317
- /*!*********************************************************!*\
1318
- !*** ./packages/@apphub:logrocket-network/src/index.js ***!
1319
- \*********************************************************/
1320
- /*! no static exports found */
1321
- /***/ (function(module, exports, __webpack_require__) {
1322
-
1323
- "use strict";
1324
-
1325
-
1326
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1327
-
1328
- Object.defineProperty(exports, "__esModule", {
1329
- value: true
1330
- });
1331
- exports.default = registerNetwork;
1332
-
1333
- var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js"));
1334
-
1335
- var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/@babel/runtime/helpers/typeof.js"));
1336
-
1337
- var _registerFetch = _interopRequireDefault(__webpack_require__(/*! ./registerFetch */ "./packages/@apphub:logrocket-network/src/registerFetch.js"));
1338
-
1339
- var _registerNetworkInformation = _interopRequireDefault(__webpack_require__(/*! ./registerNetworkInformation */ "./packages/@apphub:logrocket-network/src/registerNetworkInformation.js"));
1340
-
1341
- var _registerXHR = _interopRequireDefault(__webpack_require__(/*! ./registerXHR */ "./packages/@apphub:logrocket-network/src/registerXHR.js"));
1342
-
1343
- var _mapValues = _interopRequireDefault(__webpack_require__(/*! @apphub/logrocket-utils/src/mapValues */ "./packages/@apphub:logrocket-utils/src/mapValues.js"));
1344
-
1345
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
1346
-
1347
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
1348
-
1349
- function registerNetwork(logger) {
1350
- var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
1351
- isReactNative: false
1352
- };
1353
- var isReactNative = config.isReactNative;
1354
- var ignoredNetwork = {}; // truncate if > 4MB in size
1355
-
1356
- var truncate = function truncate(data) {
1357
- var limit = 1024 * 1000 * 4;
1358
- var str = data;
1359
-
1360
- if ((0, _typeof2.default)(data) === 'object' && data != null) {
1361
- var proto = Object.getPrototypeOf(data);
1362
-
1363
- if (proto === Object.prototype || proto === null) {
1364
- // plain object - jsonify for the size check
1365
- str = JSON.stringify(data);
1366
- }
1367
- }
1368
-
1369
- if (str && str.length && str.length > limit && typeof str === 'string') {
1370
- var beginning = str.substring(0, 1000);
1371
- return "".concat(beginning, " ... LogRocket truncating to first 1000 characters.\n Keep data under 4MB to prevent truncation. https://docs.logrocket.com/reference#network");
1372
- }
1373
-
1374
- return data;
1375
- };
1376
-
1377
- var addRequest = function addRequest(reqId, request) {
1378
- var method = request.method;
1379
- logger.addEvent('lr.network.RequestEvent', function () {
1380
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1381
- _ref$isEnabled = _ref.isEnabled,
1382
- isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled,
1383
- _ref$requestSanitizer = _ref.requestSanitizer,
1384
- requestSanitizer = _ref$requestSanitizer === void 0 ? function (f) {
1385
- return f;
1386
- } : _ref$requestSanitizer;
1387
-
1388
- if (!isEnabled) {
1389
- return null;
1390
- }
1391
-
1392
- var sanitized = null;
1393
-
1394
- try {
1395
- // only try catch user defined functions
1396
- sanitized = requestSanitizer(_objectSpread(_objectSpread({}, request), {}, {
1397
- reqId: reqId
1398
- }));
1399
- } catch (err) {
1400
- console.error(err);
1401
- }
1402
-
1403
- if (sanitized) {
1404
- var url = sanitized.url;
1405
-
1406
- if (typeof document !== 'undefined' && typeof document.createElement === 'function') {
1407
- // Writing and then reading from an a tag turns a relative
1408
- // url into an absolute one.
1409
- var a = document.createElement('a');
1410
- a.href = sanitized.url;
1411
- url = a.href;
1412
- }
1413
-
1414
- return {
1415
- reqId: reqId,
1416
- // default
1417
- url: url,
1418
- // sanitized
1419
- headers: (0, _mapValues.default)(sanitized.headers, function (headerValue) {
1420
- // sanitized
1421
- return "".concat(headerValue);
1422
- }),
1423
- body: truncate(sanitized.body),
1424
- // sanitized
1425
- method: method,
1426
- // default
1427
- referrer: sanitized.referrer || undefined,
1428
- // sanitized
1429
- mode: sanitized.mode || undefined,
1430
- // sanitized
1431
- credentials: sanitized.credentials || undefined // sanitized
1432
-
1433
- };
1434
- }
1435
-
1436
- ignoredNetwork[reqId] = true;
1437
- return null;
1438
- });
1439
- };
1440
-
1441
- var addResponse = function addResponse(reqId, response) {
1442
- var method = response.method,
1443
- status = response.status;
1444
- logger.addEvent('lr.network.ResponseEvent', function () {
1445
- var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1446
- _ref2$isEnabled = _ref2.isEnabled,
1447
- isEnabled = _ref2$isEnabled === void 0 ? true : _ref2$isEnabled,
1448
- _ref2$responseSanitiz = _ref2.responseSanitizer,
1449
- responseSanitizer = _ref2$responseSanitiz === void 0 ? function (f) {
1450
- return f;
1451
- } : _ref2$responseSanitiz;
1452
-
1453
- if (!isEnabled) {
1454
- return null;
1455
- } else if (ignoredNetwork[reqId]) {
1456
- delete ignoredNetwork[reqId];
1457
- return null;
1458
- }
1459
-
1460
- var sanitized = null;
1461
-
1462
- try {
1463
- // only try catch user defined functions
1464
- sanitized = responseSanitizer(_objectSpread(_objectSpread({}, response), {}, {
1465
- reqId: reqId
1466
- }));
1467
- } catch (err) {
1468
- console.error(err); // fall through to redacted log
1469
- }
1470
-
1471
- if (sanitized) {
1472
- return {
1473
- reqId: reqId,
1474
- // default
1475
- status: sanitized.status,
1476
- // sanitized
1477
- headers: (0, _mapValues.default)(sanitized.headers, function (headerValue) {
1478
- // sanitized
1479
- return "".concat(headerValue);
1480
- }),
1481
- body: truncate(sanitized.body),
1482
- // sanitized
1483
- method: method // default
1484
-
1485
- };
1486
- }
1487
-
1488
- return {
1489
- reqId: reqId,
1490
- // default
1491
- status: status,
1492
- // default
1493
- headers: {},
1494
- // redacted
1495
- body: null,
1496
- // redacted
1497
- method: method // default
1498
-
1499
- };
1500
- });
1501
- };
1502
-
1503
- var isIgnored = function isIgnored(reqId) {
1504
- return logger.isDisabled || ignoredNetwork[reqId] === true;
1505
- };
1506
-
1507
- var unsubFetch = (0, _registerFetch.default)({
1508
- addRequest: addRequest,
1509
- addResponse: addResponse,
1510
- isIgnored: isIgnored
1511
- });
1512
- var unsubXHR = (0, _registerXHR.default)({
1513
- addRequest: addRequest,
1514
- addResponse: addResponse,
1515
- isIgnored: isIgnored,
1516
- logger: logger
1517
- });
1518
- var unsubNetworkInformation = isReactNative ? function () {} : (0, _registerNetworkInformation.default)(logger);
1519
- return function () {
1520
- unsubNetworkInformation();
1521
- unsubFetch();
1522
- unsubXHR();
1523
- };
1524
- }
1525
-
1526
- module.exports = exports.default;
1527
-
1528
- /***/ }),
1529
-
1530
- /***/ "./packages/@apphub:logrocket-network/src/registerFetch.js":
1531
- /*!*****************************************************************!*\
1532
- !*** ./packages/@apphub:logrocket-network/src/registerFetch.js ***!
1533
- \*****************************************************************/
1534
- /*! no static exports found */
1535
- /***/ (function(module, exports, __webpack_require__) {
1536
-
1537
- "use strict";
1538
-
1539
-
1540
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1541
-
1542
- Object.defineProperty(exports, "__esModule", {
1543
- value: true
1544
- });
1545
- exports.default = registerFetch;
1546
-
1547
- var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js"));
1548
-
1549
- var _mapValues = _interopRequireDefault(__webpack_require__(/*! @apphub/logrocket-utils/src/mapValues */ "./packages/@apphub:logrocket-utils/src/mapValues.js"));
1550
-
1551
- var _fetchIntercept = _interopRequireDefault(__webpack_require__(/*! ./fetchIntercept */ "./packages/@apphub:logrocket-network/src/fetchIntercept.js"));
1552
-
1553
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
1554
-
1555
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
1556
-
1557
- function makeObjectFromHeaders(headers) {
1558
- // If using real fetch, we must stringify the Headers object.
1559
- if (headers == null || typeof headers.forEach !== 'function') {
1560
- return headers;
1561
- }
1562
-
1563
- var result = {};
1564
- headers.forEach(function (value, key) {
1565
- if (result[key]) {
1566
- result[key] = "".concat(result[key], ",").concat(value);
1567
- } else {
1568
- result[key] = "".concat(value);
1569
- }
1570
- });
1571
- return result;
1572
- } // XHR specification is unclear of what types to allow in value so using toString method for now
1573
-
1574
-
1575
- var stringifyHeaders = function stringifyHeaders(headers) {
1576
- return (0, _mapValues.default)(makeObjectFromHeaders(headers), function (value) {
1577
- return "".concat(value);
1578
- });
1579
- };
1580
-
1581
- function pluckFetchFields() {
1582
- var arg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1583
- return {
1584
- url: arg.url,
1585
- headers: stringifyHeaders(arg.headers),
1586
- method: arg.method && arg.method.toUpperCase(),
1587
- referrer: arg.referrer || undefined,
1588
- mode: arg.mode || undefined,
1589
- credentials: arg.credentials || undefined
1590
- };
1591
- }
1592
-
1593
- function registerFetch(_ref) {
1594
- var addRequest = _ref.addRequest,
1595
- addResponse = _ref.addResponse,
1596
- isIgnored = _ref.isIgnored;
1597
- var LOGROCKET_FETCH_LABEL = 'fetch-';
1598
- var fetchMethodMap = {};
1599
-
1600
- var unregister = _fetchIntercept.default.register({
1601
- request: function request(fetchId) {
1602
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1603
- args[_key - 1] = arguments[_key];
1604
- }
1605
-
1606
- var p;
1607
-
1608
- if (typeof Request !== 'undefined' && args[0] instanceof Request) {
1609
- var clonedText; // Request.clone() and Request.text() may throw in Safari (e.g., when
1610
- // request body contains FormData)
1611
-
1612
- try {
1613
- clonedText = args[0].clone().text();
1614
- } catch (err) {
1615
- clonedText = Promise.resolve("LogRocket fetch error: ".concat(err.message));
1616
- }
1617
-
1618
- p = clonedText.then(function (body) {
1619
- return _objectSpread(_objectSpread({}, pluckFetchFields(args[0])), {}, {
1620
- body: body
1621
- });
1622
- }, function (err) {
1623
- return _objectSpread(_objectSpread({}, pluckFetchFields(args[0])), {}, {
1624
- body: "LogRocket fetch error: ".concat(err.message)
1625
- });
1626
- });
1627
- } else {
1628
- p = Promise.resolve(_objectSpread(_objectSpread({}, pluckFetchFields(args[1])), {}, {
1629
- url: "".concat(args[0]),
1630
- body: (args[1] || {}).body
1631
- }));
1632
- }
1633
-
1634
- return p.then(function (req) {
1635
- fetchMethodMap[fetchId] = req.method;
1636
- addRequest("".concat(LOGROCKET_FETCH_LABEL).concat(fetchId), req);
1637
- return args;
1638
- });
1639
- },
1640
- requestError: function requestError(fetchId, error) {
1641
- return Promise.reject(error);
1642
- },
1643
- response: function response(fetchId, _response) {
1644
- var clonedText;
1645
-
1646
- if (isIgnored("".concat(LOGROCKET_FETCH_LABEL).concat(fetchId))) {
1647
- // Don't even try to read ignored requests
1648
- return _response;
1649
- }
1650
-
1651
- try {
1652
- // TODO: enhance function on original response and future clones for:
1653
- // text(), json(), blob(), formdata(), arraybuffer()
1654
- clonedText = _response.clone().text();
1655
- } catch (err) {
1656
- // safari has a bug where cloning can fail
1657
- clonedText = Promise.resolve("LogRocket fetch error: ".concat(err.message));
1658
- }
1659
-
1660
- return clonedText.then(function (data) {
1661
- var responseHash = {
1662
- url: _response.url,
1663
- status: _response.status,
1664
- headers: stringifyHeaders(_response.headers),
1665
- body: data,
1666
- method: fetchMethodMap[fetchId]
1667
- };
1668
- delete fetchMethodMap[fetchId];
1669
- addResponse("".concat(LOGROCKET_FETCH_LABEL).concat(fetchId), responseHash);
1670
- return _response;
1671
- });
1672
- },
1673
- responseError: function responseError(fetchId, error) {
1674
- var response = {
1675
- url: undefined,
1676
- status: 0,
1677
- headers: {},
1678
- body: "".concat(error)
1679
- };
1680
- addResponse("".concat(LOGROCKET_FETCH_LABEL).concat(fetchId), response);
1681
- return Promise.reject(error);
1682
- }
1683
- });
1684
-
1685
- return unregister;
1686
- }
1687
-
1688
- module.exports = exports.default;
1689
-
1690
- /***/ }),
1691
-
1692
- /***/ "./packages/@apphub:logrocket-network/src/registerNetworkInformation.js":
1693
- /*!******************************************************************************!*\
1694
- !*** ./packages/@apphub:logrocket-network/src/registerNetworkInformation.js ***!
1695
- \******************************************************************************/
1696
- /*! no static exports found */
1697
- /***/ (function(module, exports, __webpack_require__) {
1698
-
1699
- "use strict";
1700
-
1701
-
1702
- Object.defineProperty(exports, "__esModule", {
1703
- value: true
1704
- });
1705
- exports.default = registerNetworkInformation;
1706
- var EFFECTIVE_TYPE_VALS = {
1707
- 'slow-2g': 'SLOW2G',
1708
- '2g': 'TWOG',
1709
- '3g': 'THREEG',
1710
- '4g': 'FOURG'
1711
- };
1712
-
1713
- function registerNetworkInformation(logger) {
1714
- var lastStatus = undefined;
1715
-
1716
- function sendNetworkInformation() {
1717
- var newStatus = {
1718
- online: window.navigator.onLine,
1719
- effectiveType: 'UNKOWN'
1720
- };
1721
-
1722
- if (!window.navigator.onLine) {
1723
- newStatus.effectiveType = 'NONE';
1724
- } else if (window.navigator.connection && window.navigator.connection.effectiveType) {
1725
- newStatus.effectiveType = EFFECTIVE_TYPE_VALS[window.navigator.connection.effectiveType] || 'UNKNOWN';
1726
- }
1727
-
1728
- if (lastStatus && newStatus.online === lastStatus.online && newStatus.effectiveType === lastStatus.effectiveType) {
1729
- return;
1730
- }
1731
-
1732
- lastStatus = newStatus;
1733
- logger.addEvent('lr.network.NetworkStatusEvent', function () {
1734
- return newStatus;
1735
- });
1736
- }
1737
-
1738
- setTimeout(sendNetworkInformation);
1739
-
1740
- if (window.navigator.connection && typeof window.navigator.connection.addEventListener === 'function') {
1741
- window.navigator.connection.addEventListener('change', sendNetworkInformation);
1742
- }
1743
-
1744
- window.addEventListener('online', sendNetworkInformation);
1745
- window.addEventListener('offline', sendNetworkInformation);
1746
- return function () {
1747
- window.removeEventListener('offline', sendNetworkInformation);
1748
- window.removeEventListener('online', sendNetworkInformation);
1749
-
1750
- if (window.navigator.connection && typeof window.navigator.connection.removeEventListener === 'function') {
1751
- window.navigator.connection.removeEventListener('change', sendNetworkInformation);
1752
- }
1753
- };
1754
- }
1755
-
1756
- module.exports = exports.default;
1757
-
1758
- /***/ }),
1759
-
1760
- /***/ "./packages/@apphub:logrocket-network/src/registerXHR.js":
1761
- /*!***************************************************************!*\
1762
- !*** ./packages/@apphub:logrocket-network/src/registerXHR.js ***!
1763
- \***************************************************************/
1764
- /*! no static exports found */
1765
- /***/ (function(module, exports, __webpack_require__) {
1766
-
1767
- "use strict";
1768
-
1769
-
1770
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1771
-
1772
- Object.defineProperty(exports, "__esModule", {
1773
- value: true
1774
- });
1775
- exports.setActive = setActive;
1776
- exports.default = registerXHR;
1777
-
1778
- var _mapValues = _interopRequireDefault(__webpack_require__(/*! @apphub/logrocket-utils/src/mapValues */ "./packages/@apphub:logrocket-utils/src/mapValues.js"));
1779
-
1780
- var _enhanceFunc = _interopRequireDefault(__webpack_require__(/*! @apphub/logrocket-utils/src/enhanceFunc */ "./packages/@apphub:logrocket-utils/src/enhanceFunc.js"));
1781
-
1782
- var _startsWith = _interopRequireDefault(__webpack_require__(/*! @apphub/logrocket-utils/src/startsWith */ "./packages/@apphub:logrocket-utils/src/startsWith.js"));
1783
-
1784
- var _nps = __webpack_require__(/*! @apphub/logrocket-utils/src/constants/nps */ "./packages/@apphub:logrocket-utils/src/constants/nps.js");
1785
-
1786
- var isActive = true;
1787
-
1788
- function setActive(shouldBeActive) {
1789
- isActive = shouldBeActive;
1790
- }
1791
-
1792
- var currentXHRId = 0;
1793
-
1794
- function registerXHR(_ref) {
1795
- var addRequest = _ref.addRequest,
1796
- addResponse = _ref.addResponse,
1797
- isIgnored = _ref.isIgnored,
1798
- logger = _ref.logger;
1799
- var _XHR = XMLHttpRequest;
1800
- var xhrMap = new WeakMap();
1801
- var unsubscribedFromXhr = false;
1802
- var LOGROCKET_XHR_LABEL = 'xhr-';
1803
- window._lrXMLHttpRequest = XMLHttpRequest; // eslint-disable-next-line no-native-reassign
1804
-
1805
- XMLHttpRequest = function XMLHttpRequest(mozAnon, mozSystem) {
1806
- var xhrObject = new _XHR(mozAnon, mozSystem);
1807
-
1808
- if (!isActive) {
1809
- return xhrObject;
1810
- }
1811
-
1812
- xhrMap.set(xhrObject, {
1813
- xhrId: ++currentXHRId,
1814
- headers: {}
1815
- });
1816
- var openOriginal = xhrObject.open;
1817
-
1818
- function openShim() {
1819
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1820
- args[_key] = arguments[_key];
1821
- }
1822
-
1823
- try {
1824
- var url = args[1];
1825
-
1826
- if (window.URL && typeof window.URL === 'function' && url.search(_nps.WOOTRIC_RESPONSES_REGEX) === 0) {
1827
- var logrocketSessionURL = new window.URL(logger.recordingURL);
1828
- logrocketSessionURL.searchParams.set('nps', 'wootric');
1829
- var urlObj = new window.URL(url);
1830
- var responseText = urlObj.searchParams.get('response[text]');
1831
- var feedback = responseText ? "".concat(responseText, "\n\n") : '';
1832
- urlObj.searchParams.set('response[text]', "".concat(feedback, "<").concat(logrocketSessionURL.href, "|View LogRocket session>"));
1833
- args[1] = urlObj.href; // eslint-disable-line no-param-reassign
1834
- }
1835
- } catch (e) {
1836
- /* do nothing */
1837
- }
1838
-
1839
- return openOriginal.apply(this, args);
1840
- }
1841
-
1842
- xhrObject.open = openShim;
1843
- var sendOriginal = xhrObject.send;
1844
-
1845
- function sendShim() {
1846
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
1847
- args[_key2] = arguments[_key2];
1848
- }
1849
-
1850
- try {
1851
- var currentXHR = xhrMap.get(xhrObject);
1852
-
1853
- if (window.URL && typeof window.URL === 'function' && currentXHR && currentXHR.url && currentXHR.url.search(_nps.DELIGHTED_RESPONSES_REGEX) === 0 && args.length && args[0].indexOf(_nps.DELIGHTED_FEEDBACK_PREFIX) !== -1) {
1854
- var recordingURL = new window.URL(logger.recordingURL);
1855
- recordingURL.searchParams.set('nps', 'delighted');
1856
- var logrocketSessionURL = encodeURIComponent(recordingURL.href);
1857
- var data = args[0].split('&').map(function (dataString) {
1858
- if ((0, _startsWith.default)(dataString, _nps.DELIGHTED_FEEDBACK_PREFIX)) {
1859
- var isEmpty = dataString === _nps.DELIGHTED_FEEDBACK_PREFIX;
1860
- return "".concat(dataString).concat(isEmpty ? '' : '\n\n', "<").concat(logrocketSessionURL, "|View LogRocket session>");
1861
- }
1862
-
1863
- return dataString;
1864
- }).join('&');
1865
- args[0] = data; // eslint-disable-line no-param-reassign
1866
- }
1867
- } catch (e) {
1868
- /* do nothing */
1869
- }
1870
-
1871
- return sendOriginal.apply(this, args);
1872
- }
1873
-
1874
- xhrObject.send = sendShim; // ..., 'open', (method, url, async, username, password) => {
1875
-
1876
- (0, _enhanceFunc.default)(xhrObject, 'open', function (method, url) {
1877
- if (unsubscribedFromXhr) {
1878
- return;
1879
- }
1880
-
1881
- var currentXHR = xhrMap.get(xhrObject);
1882
- currentXHR.method = method;
1883
- currentXHR.url = url;
1884
- });
1885
- (0, _enhanceFunc.default)(xhrObject, 'send', function (data) {
1886
- if (unsubscribedFromXhr) {
1887
- return;
1888
- }
1889
-
1890
- var currentXHR = xhrMap.get(xhrObject);
1891
-
1892
- if (!currentXHR) {
1893
- return;
1894
- }
1895
-
1896
- var request = {
1897
- url: currentXHR.url,
1898
- method: currentXHR.method && currentXHR.method.toUpperCase(),
1899
- headers: (0, _mapValues.default)(currentXHR.headers || {}, function (headerValues) {
1900
- return headerValues.join(', ');
1901
- }),
1902
- body: data
1903
- };
1904
- addRequest("".concat(LOGROCKET_XHR_LABEL).concat(currentXHR.xhrId), request);
1905
- });
1906
- (0, _enhanceFunc.default)(xhrObject, 'setRequestHeader', function (header, value) {
1907
- if (unsubscribedFromXhr) {
1908
- return;
1909
- }
1910
-
1911
- var currentXHR = xhrMap.get(xhrObject);
1912
-
1913
- if (!currentXHR) {
1914
- return;
1915
- }
1916
-
1917
- currentXHR.headers = currentXHR.headers || {};
1918
- currentXHR.headers[header] = currentXHR.headers[header] || [];
1919
- currentXHR.headers[header].push(value);
1920
- });
1921
- var xhrListeners = {
1922
- readystatechange: function readystatechange() {
1923
- if (unsubscribedFromXhr) {
1924
- return;
1925
- }
1926
-
1927
- if (xhrObject.readyState === 4) {
1928
- var currentXHR = xhrMap.get(xhrObject);
1929
-
1930
- if (!currentXHR) {
1931
- return;
1932
- } // Do not read ignored requests at all.
1933
-
1934
-
1935
- if (isIgnored("".concat(LOGROCKET_XHR_LABEL).concat(currentXHR.xhrId))) {
1936
- return;
1937
- }
1938
-
1939
- var headerString = xhrObject.getAllResponseHeaders();
1940
- var headers = headerString.split(/[\r\n]+/).reduce(function (previous, current) {
1941
- var next = previous;
1942
- var headerParts = current.split(': ');
1943
-
1944
- if (headerParts.length > 0) {
1945
- var key = headerParts.shift(); // first index of the array
1946
-
1947
- var value = headerParts.join(': '); // rest of the array repaired
1948
-
1949
- if (previous[key]) {
1950
- next[key] += ", ".concat(value);
1951
- } else {
1952
- next[key] = value;
1953
- }
1954
- }
1955
-
1956
- return next;
1957
- }, {});
1958
- var body; // IE 11 sometimes throws when trying to access large responses
1959
-
1960
- try {
1961
- switch (xhrObject.responseType) {
1962
- case 'json':
1963
- body = logger._shouldCloneResponse ? JSON.parse(JSON.stringify(xhrObject.response)) : xhrObject.response;
1964
- break;
1965
-
1966
- case 'arraybuffer':
1967
- case 'blob':
1968
- {
1969
- body = xhrObject.response;
1970
- break;
1971
- }
1972
-
1973
- case 'document':
1974
- {
1975
- body = xhrObject.responseXML;
1976
- break;
1977
- }
1978
-
1979
- case 'text':
1980
- case '':
1981
- {
1982
- body = xhrObject.responseText;
1983
- break;
1984
- }
1985
-
1986
- default:
1987
- {
1988
- body = '';
1989
- }
1990
- }
1991
- } catch (err) {
1992
- body = 'LogRocket: Error accessing response.';
1993
- }
1994
-
1995
- var response = {
1996
- url: currentXHR.url,
1997
- status: xhrObject.status,
1998
- headers: headers,
1999
- body: body,
2000
- method: (currentXHR.method || '').toUpperCase()
2001
- };
2002
- addResponse("".concat(LOGROCKET_XHR_LABEL).concat(currentXHR.xhrId), response);
2003
- }
2004
- } // // Unused Event Listeners
2005
- // loadstart: () => {},
2006
- // progress: () => {},
2007
- // abort: () => {},
2008
- // error: () => {},
2009
- // load: () => {},
2010
- // timeout: () => {},
2011
- // loadend: () => {},
2012
-
2013
- };
2014
- Object.keys(xhrListeners).forEach(function (key) {
2015
- xhrObject.addEventListener(key, xhrListeners[key]);
2016
- });
2017
- return xhrObject;
2018
- }; // this allows "instanceof XMLHttpRequest" to work
2019
-
2020
-
2021
- XMLHttpRequest.prototype = _XHR.prototype; // Persist the static variables.
2022
-
2023
- ['UNSENT', 'OPENED', 'HEADERS_RECEIVED', 'LOADING', 'DONE'].forEach(function (variable) {
2024
- XMLHttpRequest[variable] = _XHR[variable];
2025
- });
2026
- return function () {
2027
- unsubscribedFromXhr = true; // eslint-disable-next-line no-native-reassign
2028
-
2029
- XMLHttpRequest = _XHR;
2030
- };
2031
- }
2032
-
2033
- /***/ }),
2034
-
2035
- /***/ "./packages/@apphub:logrocket-redux/src/createEnhancer.js":
2036
- /*!****************************************************************!*\
2037
- !*** ./packages/@apphub:logrocket-redux/src/createEnhancer.js ***!
2038
- \****************************************************************/
2039
- /*! no static exports found */
2040
- /***/ (function(module, exports, __webpack_require__) {
2041
-
2042
- "use strict";
2043
-
2044
-
2045
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2046
-
2047
- Object.defineProperty(exports, "__esModule", {
2048
- value: true
2049
- });
2050
- exports.default = createEnhancer;
2051
-
2052
- var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js"));
2053
-
2054
- var _now = _interopRequireDefault(__webpack_require__(/*! @apphub/now */ "./packages/@apphub:now/src/index.js"));
2055
-
2056
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
2057
-
2058
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
2059
-
2060
- var storeIdCounter = 0;
2061
-
2062
- function createEnhancer(logger) {
2063
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
2064
- _ref$stateSanitizer = _ref.stateSanitizer,
2065
- stateSanitizer = _ref$stateSanitizer === void 0 ? function (f) {
2066
- return f;
2067
- } : _ref$stateSanitizer,
2068
- _ref$actionSanitizer = _ref.actionSanitizer,
2069
- actionSanitizer = _ref$actionSanitizer === void 0 ? function (f) {
2070
- return f;
2071
- } : _ref$actionSanitizer;
2072
-
2073
- // an enhancer is a function that returns a Store
2074
- return function (createStore) {
2075
- return function (reducer, initialState, enhancer) {
2076
- var store = createStore(reducer, initialState, enhancer);
2077
- var originalDispatch = store.dispatch;
2078
- var storeId = storeIdCounter++;
2079
- logger.addEvent('lr.redux.InitialState', function () {
2080
- var sanitizedState;
2081
-
2082
- try {
2083
- // only try catch user defined functions
2084
- sanitizedState = stateSanitizer(store.getState());
2085
- } catch (err) {
2086
- console.error(err.toString());
2087
- }
2088
-
2089
- return {
2090
- state: sanitizedState,
2091
- storeId: storeId
2092
- };
2093
- });
2094
-
2095
- var dispatch = function dispatch(action) {
2096
- var start = (0, _now.default)();
2097
- var err;
2098
- var res;
2099
-
2100
- try {
2101
- res = originalDispatch(action);
2102
- } catch (_err) {
2103
- err = _err;
2104
- } finally {
2105
- var duration = (0, _now.default)() - start;
2106
- logger.addEvent('lr.redux.ReduxAction', function () {
2107
- var sanitizedState = null;
2108
- var sanitizedAction = null;
2109
-
2110
- try {
2111
- // only try catch user defined functions
2112
- sanitizedState = stateSanitizer(store.getState());
2113
- sanitizedAction = actionSanitizer(action);
2114
- } catch (err) {
2115
- console.error(err.toString());
2116
- }
2117
-
2118
- if (sanitizedState && sanitizedAction) {
2119
- return {
2120
- storeId: storeId,
2121
- action: sanitizedAction,
2122
- duration: duration,
2123
- stateDelta: sanitizedState
2124
- };
2125
- }
2126
-
2127
- return null;
2128
- });
2129
- }
2130
-
2131
- if (err) {
2132
- throw err;
2133
- }
2134
-
2135
- return res;
2136
- };
2137
-
2138
- return _objectSpread(_objectSpread({}, store), {}, {
2139
- dispatch: dispatch
2140
- });
2141
- };
2142
- };
2143
- }
2144
-
2145
- module.exports = exports.default;
2146
-
2147
- /***/ }),
2148
-
2149
- /***/ "./packages/@apphub:logrocket-redux/src/createMiddleware.js":
2150
- /*!******************************************************************!*\
2151
- !*** ./packages/@apphub:logrocket-redux/src/createMiddleware.js ***!
2152
- \******************************************************************/
2153
- /*! no static exports found */
2154
- /***/ (function(module, exports, __webpack_require__) {
2155
-
2156
- "use strict";
2157
-
2158
-
2159
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2160
-
2161
- Object.defineProperty(exports, "__esModule", {
2162
- value: true
2163
- });
2164
- exports.default = createMiddleware;
2165
-
2166
- var _now = _interopRequireDefault(__webpack_require__(/*! @apphub/now */ "./packages/@apphub:now/src/index.js"));
2167
-
2168
- var storeIdCounter = 0;
2169
-
2170
- function createMiddleware(logger) {
2171
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
2172
- _ref$stateSanitizer = _ref.stateSanitizer,
2173
- stateSanitizer = _ref$stateSanitizer === void 0 ? function (f) {
2174
- return f;
2175
- } : _ref$stateSanitizer,
2176
- _ref$actionSanitizer = _ref.actionSanitizer,
2177
- actionSanitizer = _ref$actionSanitizer === void 0 ? function (f) {
2178
- return f;
2179
- } : _ref$actionSanitizer;
2180
-
2181
- return function (store) {
2182
- var storeId = storeIdCounter++;
2183
- logger.addEvent('lr.redux.InitialState', function () {
2184
- var sanitizedState;
2185
-
2186
- try {
2187
- // only try catch user defined functions
2188
- sanitizedState = stateSanitizer(store.getState());
2189
- } catch (err) {
2190
- console.error(err.toString());
2191
- }
2192
-
2193
- return {
2194
- state: sanitizedState,
2195
- storeId: storeId
2196
- };
2197
- });
2198
- return function (next) {
2199
- return function (action) {
2200
- var start = (0, _now.default)();
2201
- var err;
2202
- var res;
2203
-
2204
- try {
2205
- res = next(action);
2206
- } catch (_err) {
2207
- err = _err;
2208
- } finally {
2209
- var duration = (0, _now.default)() - start;
2210
- logger.addEvent('lr.redux.ReduxAction', function () {
2211
- var sanitizedState = null;
2212
- var sanitizedAction = null;
2213
-
2214
- try {
2215
- // only try catch user defined functions
2216
- sanitizedState = stateSanitizer(store.getState());
2217
- sanitizedAction = actionSanitizer(action);
2218
- } catch (err) {
2219
- console.error(err.toString());
2220
- }
2221
-
2222
- if (sanitizedState && sanitizedAction) {
2223
- return {
2224
- storeId: storeId,
2225
- action: sanitizedAction,
2226
- duration: duration,
2227
- stateDelta: sanitizedState
2228
- };
2229
- }
2230
-
2231
- return null;
2232
- });
2233
- }
2234
-
2235
- if (err) {
2236
- throw err;
2237
- }
2238
-
2239
- return res;
2240
- };
2241
- };
2242
- };
2243
- }
2244
-
2245
- module.exports = exports.default;
2246
-
2247
- /***/ }),
2248
-
2249
- /***/ "./packages/@apphub:logrocket-redux/src/index.js":
2250
- /*!*******************************************************!*\
2251
- !*** ./packages/@apphub:logrocket-redux/src/index.js ***!
2252
- \*******************************************************/
2253
- /*! no static exports found */
2254
- /***/ (function(module, exports, __webpack_require__) {
2255
-
2256
- "use strict";
2257
-
2258
-
2259
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2260
-
2261
- Object.defineProperty(exports, "__esModule", {
2262
- value: true
2263
- });
2264
- Object.defineProperty(exports, "createEnhancer", {
2265
- enumerable: true,
2266
- get: function get() {
2267
- return _createEnhancer.default;
2268
- }
2269
- });
2270
- Object.defineProperty(exports, "createMiddleware", {
2271
- enumerable: true,
2272
- get: function get() {
2273
- return _createMiddleware.default;
2274
- }
2275
- });
2276
-
2277
- var _createEnhancer = _interopRequireDefault(__webpack_require__(/*! ./createEnhancer */ "./packages/@apphub:logrocket-redux/src/createEnhancer.js"));
2278
-
2279
- var _createMiddleware = _interopRequireDefault(__webpack_require__(/*! ./createMiddleware */ "./packages/@apphub:logrocket-redux/src/createMiddleware.js"));
2280
-
2281
- /***/ }),
2282
-
2283
- /***/ "./packages/@apphub:logrocket-utils/src/TraceKit.js":
2284
- /*!**********************************************************!*\
2285
- !*** ./packages/@apphub:logrocket-utils/src/TraceKit.js ***!
2286
- \**********************************************************/
2287
- /*! no static exports found */
2288
- /***/ (function(module, exports, __webpack_require__) {
2289
-
2290
- "use strict";
2291
- /* WEBPACK VAR INJECTION */(function(global) {/* eslint-disable */
2292
-
2293
- /*
2294
- TraceKit - Cross brower stack traces - github.com/occ/TraceKit
2295
-
2296
- This was originally forked from github.com/occ/TraceKit, but has since been
2297
- largely re-written and is now maintained as part of raven-js. Tests for
2298
- this are in test/vendor.
2299
-
2300
- MIT license
2301
- */
2302
-
2303
- Object.defineProperty(exports, "__esModule", {
2304
- value: true
2305
- });
2306
- exports.default = void 0;
2307
- var TraceKit = {
2308
- collectWindowErrors: true,
2309
- debug: false
2310
- }; // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
2311
-
2312
- var _window = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; // global reference to slice
2313
-
2314
-
2315
- var _slice = [].slice;
2316
- var UNKNOWN_FUNCTION = '?'; // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types
2317
-
2318
- var ERROR_TYPES_RE = /^(?:Uncaught (?:exception: )?)?((?:Eval|Internal|Range|Reference|Syntax|Type|URI)Error): ?(.*)$/;
2319
-
2320
- function getLocationHref() {
2321
- if (typeof document === 'undefined' || typeof document.location === 'undefined') return '';
2322
- return document.location.href;
2323
- }
2324
- /**
2325
- * TraceKit.report: cross-browser processing of unhandled exceptions
2326
- *
2327
- * Syntax:
2328
- * TraceKit.report.subscribe(function(stackInfo) { ... })
2329
- * TraceKit.report.unsubscribe(function(stackInfo) { ... })
2330
- * TraceKit.report(exception)
2331
- * try { ...code... } catch(ex) { TraceKit.report(ex); }
2332
- *
2333
- * Supports:
2334
- * - Firefox: full stack trace with line numbers, plus column number
2335
- * on top frame; column number is not guaranteed
2336
- * - Opera: full stack trace with line and column numbers
2337
- * - Chrome: full stack trace with line and column numbers
2338
- * - Safari: line and column number for the top frame only; some frames
2339
- * may be missing, and column number is not guaranteed
2340
- * - IE: line and column number for the top frame only; some frames
2341
- * may be missing, and column number is not guaranteed
2342
- *
2343
- * In theory, TraceKit should work on all of the following versions:
2344
- * - IE5.5+ (only 8.0 tested)
2345
- * - Firefox 0.9+ (only 3.5+ tested)
2346
- * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require
2347
- * Exceptions Have Stacktrace to be enabled in opera:config)
2348
- * - Safari 3+ (only 4+ tested)
2349
- * - Chrome 1+ (only 5+ tested)
2350
- * - Konqueror 3.5+ (untested)
2351
- *
2352
- * Requires TraceKit.computeStackTrace.
2353
- *
2354
- * Tries to catch all unhandled exceptions and report them to the
2355
- * subscribed handlers. Please note that TraceKit.report will rethrow the
2356
- * exception. This is REQUIRED in order to get a useful stack trace in IE.
2357
- * If the exception does not reach the top of the browser, you will only
2358
- * get a stack trace from the point where TraceKit.report was called.
2359
- *
2360
- * Handlers receive a stackInfo object as described in the
2361
- * TraceKit.computeStackTrace docs.
2362
- */
2363
-
2364
-
2365
- TraceKit.report = function reportModuleWrapper() {
2366
- var handlers = [],
2367
- lastArgs = null,
2368
- lastException = null,
2369
- lastExceptionStack = null;
2370
- /**
2371
- * Add a crash handler.
2372
- * @param {Function} handler
2373
- */
2374
-
2375
- function subscribe(handler) {
2376
- installGlobalHandler();
2377
- handlers.push(handler);
2378
- }
2379
- /**
2380
- * Remove a crash handler.
2381
- * @param {Function} handler
2382
- */
2383
-
2384
-
2385
- function unsubscribe(handler) {
2386
- for (var i = handlers.length - 1; i >= 0; --i) {
2387
- if (handlers[i] === handler) {
2388
- handlers.splice(i, 1);
2389
- }
2390
- }
2391
- }
2392
- /**
2393
- * Remove all crash handlers.
2394
- */
2395
-
2396
-
2397
- function unsubscribeAll() {
2398
- uninstallGlobalHandler();
2399
- handlers = [];
2400
- }
2401
- /**
2402
- * Dispatch stack information to all handlers.
2403
- * @param {Object.<string, *>} stack
2404
- */
2405
-
2406
-
2407
- function notifyHandlers(stack, isWindowError) {
2408
- var exception = null;
2409
-
2410
- if (isWindowError && !TraceKit.collectWindowErrors) {
2411
- return;
2412
- }
2413
-
2414
- for (var i in handlers) {
2415
- if (handlers.hasOwnProperty(i)) {
2416
- try {
2417
- handlers[i].apply(null, [stack].concat(_slice.call(arguments, 2)));
2418
- } catch (inner) {
2419
- exception = inner;
2420
- }
2421
- }
2422
- }
2423
-
2424
- if (exception) {
2425
- throw exception;
2426
- }
2427
- }
2428
-
2429
- var _oldOnerrorHandler, _onErrorHandlerInstalled;
2430
- /**
2431
- * Ensures all global unhandled exceptions are recorded.
2432
- * Supported by Gecko and IE.
2433
- * @param {string} message Error message.
2434
- * @param {string} url URL of script that generated the exception.
2435
- * @param {(number|string)} lineNo The line number at which the error
2436
- * occurred.
2437
- * @param {?(number|string)} colNo The column number at which the error
2438
- * occurred.
2439
- * @param {?Error} ex The actual Error object.
2440
- */
2441
-
2442
-
2443
- function traceKitWindowOnError(message, url, lineNo, colNo, ex) {
2444
- var stack = null;
2445
-
2446
- if (lastExceptionStack) {
2447
- TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(lastExceptionStack, url, lineNo, message);
2448
- processLastException();
2449
- } else if (ex) {
2450
- // New chrome and blink send along a real error object
2451
- // Let's just report that like a normal error.
2452
- // See: https://mikewest.org/2013/08/debugging-runtime-errors-with-window-onerror
2453
- stack = TraceKit.computeStackTrace(ex);
2454
- notifyHandlers(stack, true);
2455
- } else {
2456
- var location = {
2457
- 'url': url,
2458
- 'line': lineNo,
2459
- 'column': colNo
2460
- };
2461
- var name = undefined;
2462
- var msg = message; // must be new var or will modify original `arguments`
2463
-
2464
- var groups;
2465
-
2466
- if ({}.toString.call(message) === '[object String]') {
2467
- var groups = message.match(ERROR_TYPES_RE);
2468
-
2469
- if (groups) {
2470
- name = groups[1];
2471
- msg = groups[2];
2472
- }
2473
- }
2474
-
2475
- location.func = UNKNOWN_FUNCTION;
2476
- stack = {
2477
- 'name': name,
2478
- 'message': msg,
2479
- 'url': getLocationHref(),
2480
- 'stack': [location]
2481
- };
2482
- notifyHandlers(stack, true);
2483
- }
2484
-
2485
- if (_oldOnerrorHandler) {
2486
- return _oldOnerrorHandler.apply(this, arguments);
2487
- }
2488
-
2489
- return false;
2490
- }
2491
-
2492
- function installGlobalHandler() {
2493
- if (_onErrorHandlerInstalled) {
2494
- return;
2495
- }
2496
-
2497
- _oldOnerrorHandler = _window.onerror;
2498
- _window.onerror = traceKitWindowOnError;
2499
- _onErrorHandlerInstalled = true;
2500
- }
2501
-
2502
- function uninstallGlobalHandler() {
2503
- if (!_onErrorHandlerInstalled) {
2504
- return;
2505
- }
2506
-
2507
- _window.onerror = _oldOnerrorHandler;
2508
- _onErrorHandlerInstalled = false;
2509
- _oldOnerrorHandler = undefined;
2510
- }
2511
-
2512
- function processLastException() {
2513
- var _lastExceptionStack = lastExceptionStack,
2514
- _lastArgs = lastArgs;
2515
- lastArgs = null;
2516
- lastExceptionStack = null;
2517
- lastException = null;
2518
- notifyHandlers.apply(null, [_lastExceptionStack, false].concat(_lastArgs));
2519
- }
2520
- /**
2521
- * Reports an unhandled Error to TraceKit.
2522
- * @param {Error} ex
2523
- * @param {?boolean} rethrow If false, do not re-throw the exception.
2524
- * Only used for window.onerror to not cause an infinite loop of
2525
- * rethrowing.
2526
- */
2527
-
2528
-
2529
- function report(ex, rethrow) {
2530
- var args = _slice.call(arguments, 1);
2531
-
2532
- if (lastExceptionStack) {
2533
- if (lastException === ex) {
2534
- return; // already caught by an inner catch block, ignore
2535
- } else {
2536
- processLastException();
2537
- }
2538
- }
2539
-
2540
- var stack = TraceKit.computeStackTrace(ex);
2541
- lastExceptionStack = stack;
2542
- lastException = ex;
2543
- lastArgs = args; // If the stack trace is incomplete, wait for 2 seconds for
2544
- // slow slow IE to see if onerror occurs or not before reporting
2545
- // this exception; otherwise, we will end up with an incomplete
2546
- // stack trace
2547
-
2548
- setTimeout(function () {
2549
- if (lastException === ex) {
2550
- processLastException();
2551
- }
2552
- }, stack.incomplete ? 2000 : 0);
2553
-
2554
- if (rethrow !== false) {
2555
- throw ex; // re-throw to propagate to the top level (and cause window.onerror)
2556
- }
2557
- }
2558
-
2559
- report.subscribe = subscribe;
2560
- report.unsubscribe = unsubscribe;
2561
- report.uninstall = unsubscribeAll;
2562
- return report;
2563
- }();
2564
- /**
2565
- * TraceKit.computeStackTrace: cross-browser stack traces in JavaScript
2566
- *
2567
- * Syntax:
2568
- * s = TraceKit.computeStackTrace(exception) // consider using TraceKit.report instead (see below)
2569
- * Returns:
2570
- * s.name - exception name
2571
- * s.message - exception message
2572
- * s.stack[i].url - JavaScript or HTML file URL
2573
- * s.stack[i].func - function name, or empty for anonymous functions (if guessing did not work)
2574
- * s.stack[i].args - arguments passed to the function, if known
2575
- * s.stack[i].line - line number, if known
2576
- * s.stack[i].column - column number, if known
2577
- *
2578
- * Supports:
2579
- * - Firefox: full stack trace with line numbers and unreliable column
2580
- * number on top frame
2581
- * - Opera 10: full stack trace with line and column numbers
2582
- * - Opera 9-: full stack trace with line numbers
2583
- * - Chrome: full stack trace with line and column numbers
2584
- * - Safari: line and column number for the topmost stacktrace element
2585
- * only
2586
- * - IE: no line numbers whatsoever
2587
- *
2588
- * Tries to guess names of anonymous functions by looking for assignments
2589
- * in the source code. In IE and Safari, we have to guess source file names
2590
- * by searching for function bodies inside all page scripts. This will not
2591
- * work for scripts that are loaded cross-domain.
2592
- * Here be dragons: some function names may be guessed incorrectly, and
2593
- * duplicate functions may be mismatched.
2594
- *
2595
- * TraceKit.computeStackTrace should only be used for tracing purposes.
2596
- * Logging of unhandled exceptions should be done with TraceKit.report,
2597
- * which builds on top of TraceKit.computeStackTrace and provides better
2598
- * IE support by utilizing the window.onerror event to retrieve information
2599
- * about the top of the stack.
2600
- *
2601
- * Note: In IE and Safari, no stack trace is recorded on the Error object,
2602
- * so computeStackTrace instead walks its *own* chain of callers.
2603
- * This means that:
2604
- * * in Safari, some methods may be missing from the stack trace;
2605
- * * in IE, the topmost function in the stack trace will always be the
2606
- * caller of computeStackTrace.
2607
- *
2608
- * This is okay for tracing (because you are likely to be calling
2609
- * computeStackTrace from the function you want to be the topmost element
2610
- * of the stack trace anyway), but not okay for logging unhandled
2611
- * exceptions (because your catch block will likely be far away from the
2612
- * inner function that actually caused the exception).
2613
- *
2614
- */
2615
-
2616
-
2617
- TraceKit.computeStackTrace = function computeStackTraceWrapper() {
2618
- /**
2619
- * Escapes special characters, except for whitespace, in a string to be
2620
- * used inside a regular expression as a string literal.
2621
- * @param {string} text The string.
2622
- * @return {string} The escaped string literal.
2623
- */
2624
- function escapeRegExp(text) {
2625
- return text.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g, '\\$&');
2626
- }
2627
- /**
2628
- * Escapes special characters in a string to be used inside a regular
2629
- * expression as a string literal. Also ensures that HTML entities will
2630
- * be matched the same as their literal friends.
2631
- * @param {string} body The string.
2632
- * @return {string} The escaped string.
2633
- */
2634
-
2635
-
2636
- function escapeCodeAsRegExpForMatchingInsideHTML(body) {
2637
- return escapeRegExp(body).replace('<', '(?:<|&lt;)').replace('>', '(?:>|&gt;)').replace('&', '(?:&|&amp;)').replace('"', '(?:"|&quot;)').replace(/\s+/g, '\\s+');
2638
- } // Contents of Exception in various browsers.
2639
- //
2640
- // SAFARI:
2641
- // ex.message = Can't find variable: qq
2642
- // ex.line = 59
2643
- // ex.sourceId = 580238192
2644
- // ex.sourceURL = http://...
2645
- // ex.expressionBeginOffset = 96
2646
- // ex.expressionCaretOffset = 98
2647
- // ex.expressionEndOffset = 98
2648
- // ex.name = ReferenceError
2649
- //
2650
- // FIREFOX:
2651
- // ex.message = qq is not defined
2652
- // ex.fileName = http://...
2653
- // ex.lineNumber = 59
2654
- // ex.columnNumber = 69
2655
- // ex.stack = ...stack trace... (see the example below)
2656
- // ex.name = ReferenceError
2657
- //
2658
- // CHROME:
2659
- // ex.message = qq is not defined
2660
- // ex.name = ReferenceError
2661
- // ex.type = not_defined
2662
- // ex.arguments = ['aa']
2663
- // ex.stack = ...stack trace...
2664
- //
2665
- // INTERNET EXPLORER:
2666
- // ex.message = ...
2667
- // ex.name = ReferenceError
2668
- //
2669
- // OPERA:
2670
- // ex.message = ...message... (see the example below)
2671
- // ex.name = ReferenceError
2672
- // ex.opera#sourceloc = 11 (pretty much useless, duplicates the info in ex.message)
2673
- // ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'
2674
-
2675
- /**
2676
- * Computes stack trace information from the stack property.
2677
- * Chrome and Gecko use this property.
2678
- * @param {Error} ex
2679
- * @return {?Object.<string, *>} Stack trace information.
2680
- */
2681
-
2682
-
2683
- function computeStackTraceFromStackProp(ex) {
2684
- if (typeof ex.stack === 'undefined' || !ex.stack) return;
2685
- var chrome = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|<anonymous>).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,
2686
- gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|resource|\[native).*?)(?::(\d+))?(?::(\d+))?\s*$/i,
2687
- winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
2688
- lines = ex.stack.split('\n'),
2689
- stack = [],
2690
- parts,
2691
- element,
2692
- reference = /^(.*) is undefined$/.exec(ex.message);
2693
-
2694
- for (var i = 0, j = lines.length; i < j; ++i) {
2695
- if (parts = chrome.exec(lines[i])) {
2696
- var isNative = parts[2] && parts[2].indexOf('native') !== -1;
2697
- element = {
2698
- 'url': !isNative ? parts[2] : null,
2699
- 'func': parts[1] || UNKNOWN_FUNCTION,
2700
- 'args': isNative ? [parts[2]] : [],
2701
- 'line': parts[3] ? +parts[3] : null,
2702
- 'column': parts[4] ? +parts[4] : null
2703
- };
2704
- } else if (parts = winjs.exec(lines[i])) {
2705
- element = {
2706
- 'url': parts[2],
2707
- 'func': parts[1] || UNKNOWN_FUNCTION,
2708
- 'args': [],
2709
- 'line': +parts[3],
2710
- 'column': parts[4] ? +parts[4] : null
2711
- };
2712
- } else if (parts = gecko.exec(lines[i])) {
2713
- element = {
2714
- 'url': parts[3],
2715
- 'func': parts[1] || UNKNOWN_FUNCTION,
2716
- 'args': parts[2] ? parts[2].split(',') : [],
2717
- 'line': parts[4] ? +parts[4] : null,
2718
- 'column': parts[5] ? +parts[5] : null
2719
- };
2720
- } else {
2721
- continue;
2722
- }
2723
-
2724
- if (!element.func && element.line) {
2725
- element.func = UNKNOWN_FUNCTION;
2726
- }
2727
-
2728
- stack.push(element);
2729
- }
2730
-
2731
- if (!stack.length) {
2732
- return null;
2733
- }
2734
-
2735
- if (!stack[0].column && typeof ex.columnNumber !== 'undefined') {
2736
- // FireFox uses this awesome columnNumber property for its top frame
2737
- // Also note, Firefox's column number is 0-based and everything else expects 1-based,
2738
- // so adding 1
2739
- stack[0].column = ex.columnNumber + 1;
2740
- }
2741
-
2742
- return {
2743
- 'name': ex.name,
2744
- 'message': ex.message,
2745
- 'url': getLocationHref(),
2746
- 'stack': stack
2747
- };
2748
- }
2749
- /**
2750
- * Adds information about the first frame to incomplete stack traces.
2751
- * Safari and IE require this to get complete data on the first frame.
2752
- * @param {Object.<string, *>} stackInfo Stack trace information from
2753
- * one of the compute* methods.
2754
- * @param {string} url The URL of the script that caused an error.
2755
- * @param {(number|string)} lineNo The line number of the script that
2756
- * caused an error.
2757
- * @param {string=} message The error generated by the browser, which
2758
- * hopefully contains the name of the object that caused the error.
2759
- * @return {boolean} Whether or not the stack information was
2760
- * augmented.
2761
- */
2762
-
2763
-
2764
- function augmentStackTraceWithInitialElement(stackInfo, url, lineNo, message) {
2765
- var initial = {
2766
- 'url': url,
2767
- 'line': lineNo
2768
- };
2769
-
2770
- if (initial.url && initial.line) {
2771
- stackInfo.incomplete = false;
2772
-
2773
- if (!initial.func) {
2774
- initial.func = UNKNOWN_FUNCTION;
2775
- }
2776
-
2777
- if (stackInfo.stack.length > 0) {
2778
- if (stackInfo.stack[0].url === initial.url) {
2779
- if (stackInfo.stack[0].line === initial.line) {
2780
- return false; // already in stack trace
2781
- } else if (!stackInfo.stack[0].line && stackInfo.stack[0].func === initial.func) {
2782
- stackInfo.stack[0].line = initial.line;
2783
- return false;
2784
- }
2785
- }
2786
- }
2787
-
2788
- stackInfo.stack.unshift(initial);
2789
- stackInfo.partial = true;
2790
- return true;
2791
- } else {
2792
- stackInfo.incomplete = true;
2793
- }
2794
-
2795
- return false;
2796
- }
2797
- /**
2798
- * Computes stack trace information by walking the arguments.caller
2799
- * chain at the time the exception occurred. This will cause earlier
2800
- * frames to be missed but is the only way to get any stack trace in
2801
- * Safari and IE. The top frame is restored by
2802
- * {@link augmentStackTraceWithInitialElement}.
2803
- * @param {Error} ex
2804
- * @return {?Object.<string, *>} Stack trace information.
2805
- */
2806
-
2807
-
2808
- function computeStackTraceByWalkingCallerChain(ex, depth) {
2809
- var functionName = /function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,
2810
- stack = [],
2811
- funcs = {},
2812
- recursion = false,
2813
- parts,
2814
- item,
2815
- source;
2816
-
2817
- for (var curr = computeStackTraceByWalkingCallerChain.caller; curr && !recursion; curr = curr.caller) {
2818
- if (curr === computeStackTrace || curr === TraceKit.report) {
2819
- // console.log('skipping internal function');
2820
- continue;
2821
- }
2822
-
2823
- item = {
2824
- 'url': null,
2825
- 'func': UNKNOWN_FUNCTION,
2826
- 'line': null,
2827
- 'column': null
2828
- };
2829
-
2830
- if (curr.name) {
2831
- item.func = curr.name;
2832
- } else if (parts = functionName.exec(curr.toString())) {
2833
- item.func = parts[1];
2834
- }
2835
-
2836
- if (typeof item.func === 'undefined') {
2837
- try {
2838
- item.func = parts.input.substring(0, parts.input.indexOf('{'));
2839
- } catch (e) {}
2840
- }
2841
-
2842
- if (funcs['' + curr]) {
2843
- recursion = true;
2844
- } else {
2845
- funcs['' + curr] = true;
2846
- }
2847
-
2848
- stack.push(item);
2849
- }
2850
-
2851
- if (depth) {
2852
- // console.log('depth is ' + depth);
2853
- // console.log('stack is ' + stack.length);
2854
- stack.splice(0, depth);
2855
- }
2856
-
2857
- var result = {
2858
- 'name': ex.name,
2859
- 'message': ex.message,
2860
- 'url': getLocationHref(),
2861
- 'stack': stack
2862
- };
2863
- augmentStackTraceWithInitialElement(result, ex.sourceURL || ex.fileName, ex.line || ex.lineNumber, ex.message || ex.description);
2864
- return result;
2865
- }
2866
- /**
2867
- * Computes a stack trace for an exception.
2868
- * @param {Error} ex
2869
- * @param {(string|number)=} depth
2870
- */
2871
-
2872
-
2873
- function computeStackTrace(ex, depth) {
2874
- var stack = null;
2875
- depth = depth == null ? 0 : +depth;
2876
-
2877
- try {
2878
- stack = computeStackTraceFromStackProp(ex);
2879
-
2880
- if (stack) {
2881
- return stack;
2882
- }
2883
- } catch (e) {
2884
- if (TraceKit.debug) {
2885
- throw e;
2886
- }
2887
- }
2888
-
2889
- try {
2890
- stack = computeStackTraceByWalkingCallerChain(ex, depth + 1);
2891
-
2892
- if (stack) {
2893
- return stack;
2894
- }
2895
- } catch (e) {
2896
- if (TraceKit.debug) {
2897
- throw e;
2898
- }
2899
- }
2900
-
2901
- return {
2902
- 'name': ex.name,
2903
- 'message': ex.message,
2904
- 'url': getLocationHref()
2905
- };
2906
- }
2907
-
2908
- computeStackTrace.augmentStackTraceWithInitialElement = augmentStackTraceWithInitialElement;
2909
- computeStackTrace.computeStackTraceFromStackProp = computeStackTraceFromStackProp;
2910
- return computeStackTrace;
2911
- }();
2912
-
2913
- var _default = TraceKit;
2914
- exports.default = _default;
2915
- module.exports = exports.default;
2916
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
2917
-
2918
- /***/ }),
2919
-
2920
- /***/ "./packages/@apphub:logrocket-utils/src/constants/nps.js":
2921
- /*!***************************************************************!*\
2922
- !*** ./packages/@apphub:logrocket-utils/src/constants/nps.js ***!
2923
- \***************************************************************/
2924
- /*! no static exports found */
2925
- /***/ (function(module, exports, __webpack_require__) {
2926
-
2927
- "use strict";
2928
-
2929
-
2930
- Object.defineProperty(exports, "__esModule", {
2931
- value: true
2932
- });
2933
- exports.DELIGHTED_FEEDBACK_PREFIX = exports.DELIGHTED_RESPONSES_REGEX = exports.WOOTRIC_RESPONSES_REGEX = void 0;
2934
- var WOOTRIC_RESPONSES_REGEX = /^https:\/\/production.wootric.com\/responses/;
2935
- exports.WOOTRIC_RESPONSES_REGEX = WOOTRIC_RESPONSES_REGEX;
2936
- var DELIGHTED_RESPONSES_REGEX = /^https:\/\/web.delighted.com\/e\/[a-zA-Z-]*\/c/;
2937
- exports.DELIGHTED_RESPONSES_REGEX = DELIGHTED_RESPONSES_REGEX;
2938
- var DELIGHTED_FEEDBACK_PREFIX = 'comment=';
2939
- exports.DELIGHTED_FEEDBACK_PREFIX = DELIGHTED_FEEDBACK_PREFIX;
2940
-
2941
- /***/ }),
2942
-
2943
- /***/ "./packages/@apphub:logrocket-utils/src/enhanceFunc.js":
2944
- /*!*************************************************************!*\
2945
- !*** ./packages/@apphub:logrocket-utils/src/enhanceFunc.js ***!
2946
- \*************************************************************/
2947
- /*! no static exports found */
2948
- /***/ (function(module, exports, __webpack_require__) {
2949
-
2950
- "use strict";
2951
-
2952
-
2953
- Object.defineProperty(exports, "__esModule", {
2954
- value: true
2955
- });
2956
- exports.default = enhanceFunc;
2957
-
2958
- /* eslint no-param-reassign: ["error", { "props": false }] */
2959
- function enhanceFunc(obj, method, handler) {
2960
- var original = obj[method];
2961
-
2962
- function shim() {
2963
- var res;
2964
-
2965
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2966
- args[_key] = arguments[_key];
2967
- }
2968
-
2969
- if (original) {
2970
- res = original.apply(this, args);
2971
- }
2972
-
2973
- handler.apply(this, args);
2974
- return res;
2975
- }
2976
-
2977
- obj[method] = shim;
2978
- return function () {
2979
- obj[method] = original;
2980
- };
2981
- }
2982
-
2983
- module.exports = exports.default;
2984
-
2985
- /***/ }),
2986
-
2987
- /***/ "./packages/@apphub:logrocket-utils/src/mapValues.js":
2988
- /*!***********************************************************!*\
2989
- !*** ./packages/@apphub:logrocket-utils/src/mapValues.js ***!
2990
- \***********************************************************/
2991
- /*! no static exports found */
2992
- /***/ (function(module, exports, __webpack_require__) {
2993
-
2994
- "use strict";
2995
-
2996
-
2997
- Object.defineProperty(exports, "__esModule", {
2998
- value: true
2999
- });
3000
- exports.default = mapValues;
3001
-
3002
- function mapValues(obj, f) {
3003
- if (obj == null) {
3004
- return {};
3005
- }
3006
-
3007
- var res = {};
3008
- Object.keys(obj).forEach(function (key) {
3009
- res[key] = f(obj[key]);
3010
- });
3011
- return res;
3012
- }
3013
-
3014
- module.exports = exports.default;
3015
-
3016
- /***/ }),
3017
-
3018
- /***/ "./packages/@apphub:logrocket-utils/src/startsWith.js":
3019
- /*!************************************************************!*\
3020
- !*** ./packages/@apphub:logrocket-utils/src/startsWith.js ***!
3021
- \************************************************************/
3022
- /*! no static exports found */
3023
- /***/ (function(module, exports, __webpack_require__) {
3024
-
3025
- "use strict";
3026
-
3027
-
3028
- Object.defineProperty(exports, "__esModule", {
3029
- value: true
3030
- });
3031
- exports.default = startsWith;
3032
-
3033
- function startsWith(value, search) {
3034
- var pos = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
3035
- return value && search && value.substring(pos, pos + search.length) === search;
3036
- }
3037
-
3038
- module.exports = exports.default;
3039
-
3040
- /***/ }),
3041
-
3042
- /***/ "./packages/@apphub:now/src/index.js":
3043
- /*!*******************************************!*\
3044
- !*** ./packages/@apphub:now/src/index.js ***!
3045
- \*******************************************/
3046
- /*! no static exports found */
3047
- /***/ (function(module, exports, __webpack_require__) {
3048
-
3049
- "use strict";
3050
-
3051
-
3052
- Object.defineProperty(exports, "__esModule", {
3053
- value: true
3054
- });
3055
- exports.default = void 0;
3056
- var dateNow = Date.now.bind(Date);
3057
- var loadTime = dateNow();
3058
-
3059
- var _default = typeof performance !== 'undefined' && performance.now ? performance.now.bind(performance) : function () {
3060
- return dateNow() - loadTime;
3061
- };
3062
-
3063
- exports.default = _default;
3064
- module.exports = exports.default;
3065
-
3066
- /***/ }),
3067
-
3068
- /***/ "./packages/logrocket/src/LogRocket.js":
3069
- /*!*********************************************!*\
3070
- !*** ./packages/logrocket/src/LogRocket.js ***!
3071
- \*********************************************/
3072
- /*! no static exports found */
3073
- /***/ (function(module, exports, __webpack_require__) {
3074
-
3075
- "use strict";
3076
-
3077
-
3078
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
3079
-
3080
- Object.defineProperty(exports, "__esModule", {
3081
- value: true
3082
- });
3083
- exports.default = exports.MAX_QUEUE_SIZE = void 0;
3084
-
3085
- var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js"));
3086
-
3087
- var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js"));
3088
-
3089
- var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js"));
3090
-
3091
- var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/objectWithoutProperties.js"));
3092
-
3093
- var _logrocketNetwork = _interopRequireDefault(__webpack_require__(/*! @apphub/logrocket-network */ "./packages/@apphub:logrocket-network/src/index.js"));
3094
-
3095
- var _logrocketExceptions = __webpack_require__(/*! @apphub/logrocket-exceptions */ "./packages/@apphub:logrocket-exceptions/src/index.js");
3096
-
3097
- var _logrocketConsole = _interopRequireDefault(__webpack_require__(/*! @apphub/logrocket-console */ "./packages/@apphub:logrocket-console/src/index.js"));
3098
-
3099
- var _logrocketRedux = __webpack_require__(/*! @apphub/logrocket-redux */ "./packages/@apphub:logrocket-redux/src/index.js");
3100
-
3101
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
3102
-
3103
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
3104
-
3105
- var MAX_QUEUE_SIZE = 1000;
3106
- exports.MAX_QUEUE_SIZE = MAX_QUEUE_SIZE;
3107
-
3108
- var considerIngestServerOption = function considerIngestServerOption() {
3109
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
3110
- ingestServer = _ref.ingestServer,
3111
- options = (0, _objectWithoutProperties2.default)(_ref, ["ingestServer"]);
3112
-
3113
- if (ingestServer) {
3114
- return _objectSpread({
3115
- serverURL: "".concat(ingestServer, "/i"),
3116
- statsURL: "".concat(ingestServer, "/s")
3117
- }, options);
3118
- }
3119
-
3120
- return options;
3121
- };
3122
-
3123
- var LogRocket = /*#__PURE__*/function () {
3124
- function LogRocket() {
3125
- var _this = this;
3126
-
3127
- (0, _classCallCheck2.default)(this, LogRocket);
3128
- this._buffer = [];
3129
- // TODO: tests for these exposed methods.
3130
- ['log', 'info', 'warn', 'error', 'debug'].forEach(function (method) {
3131
- _this[method] = function () {
3132
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3133
- args[_key] = arguments[_key];
3134
- }
3135
-
3136
- _this.addEvent('lr.core.LogEvent', function () {
3137
- var consoleOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3138
-
3139
- if (method === 'error' && consoleOptions.shouldAggregateConsoleErrors) {
3140
- _logrocketExceptions.Capture.captureMessage(_this, args[0], {}, true);
3141
- }
3142
-
3143
- return {
3144
- logLevel: method.toUpperCase(),
3145
- args: args
3146
- };
3147
- }, {
3148
- shouldCaptureStackTrace: true
3149
- });
3150
- };
3151
- });
3152
- this._isInitialized = false;
3153
- this._installed = [];
3154
- }
3155
-
3156
- (0, _createClass2.default)(LogRocket, [{
3157
- key: "addEvent",
3158
- value: function addEvent(type, getMessage) {
3159
- var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3160
- var time = Date.now();
3161
-
3162
- this._run(function (logger) {
3163
- logger.addEvent(type, getMessage, _objectSpread(_objectSpread({}, opts), {}, {
3164
- timeOverride: time
3165
- }));
3166
- });
3167
- }
3168
- }, {
3169
- key: "onLogger",
3170
- value: function onLogger(logger) {
3171
- this._logger = logger;
3172
-
3173
- while (this._buffer.length > 0) {
3174
- var f = this._buffer.shift();
3175
-
3176
- f(this._logger);
3177
- }
3178
- }
3179
- }, {
3180
- key: "_run",
3181
- value: function _run(f) {
3182
- if (this._isDisabled) {
3183
- return;
3184
- }
3185
-
3186
- if (this._logger) {
3187
- f(this._logger);
3188
- } else {
3189
- if (this._buffer.length >= MAX_QUEUE_SIZE) {
3190
- this._isDisabled = true;
3191
- console.warn('LogRocket: script did not load. Check that you have a valid network connection.');
3192
- this.uninstall();
3193
- return;
3194
- }
3195
-
3196
- this._buffer.push(f.bind(this));
3197
- }
3198
- }
3199
- }, {
3200
- key: "init",
3201
- value: function init(appID, opts) {
3202
- if (!this._isInitialized) {
3203
- this._installed.push((0, _logrocketExceptions.registerExceptions)(this));
3204
-
3205
- this._installed.push((0, _logrocketNetwork.default)(this));
3206
-
3207
- this._installed.push((0, _logrocketConsole.default)(this));
3208
-
3209
- this._isInitialized = true;
3210
-
3211
- this._run(function (logger) {
3212
- logger.init(appID, considerIngestServerOption(opts));
3213
- });
3214
- }
3215
- }
3216
- }, {
3217
- key: "start",
3218
- value: function start() {
3219
- this._run(function (logger) {
3220
- logger.start();
3221
- });
3222
- }
3223
- }, {
3224
- key: "uninstall",
3225
- value: function uninstall() {
3226
- this._installed.forEach(function (f) {
3227
- return f();
3228
- });
3229
-
3230
- this._buffer = [];
3231
-
3232
- this._run(function (logger) {
3233
- logger.uninstall();
3234
- });
3235
- }
3236
- }, {
3237
- key: "identify",
3238
- value: function identify(id, opts) {
3239
- this._run(function (logger) {
3240
- logger.identify(id, opts);
3241
- });
3242
- }
3243
- }, {
3244
- key: "startNewSession",
3245
- value: function startNewSession() {
3246
- this._run(function (logger) {
3247
- logger.startNewSession();
3248
- });
3249
- }
3250
- }, {
3251
- key: "track",
3252
- value: function track(customEventName, eventProperties) {
3253
- this._run(function (logger) {
3254
- logger.track(customEventName, eventProperties);
3255
- });
3256
- }
3257
- }, {
3258
- key: "getSessionURL",
3259
- value: function getSessionURL(cb) {
3260
- if (typeof cb !== 'function') {
3261
- throw new Error('LogRocket: must pass callback to getSessionURL()');
3262
- }
3263
-
3264
- this._run(function (logger) {
3265
- if (logger.getSessionURL) {
3266
- logger.getSessionURL(cb);
3267
- } else {
3268
- cb(logger.recordingURL);
3269
- }
3270
- });
3271
- }
3272
- }, {
3273
- key: "getVersion",
3274
- value: function getVersion(cb) {
3275
- this._run(function (logger) {
3276
- cb(logger.version);
3277
- });
3278
- }
3279
- }, {
3280
- key: "captureMessage",
3281
- value: function captureMessage(message) {
3282
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3283
-
3284
- _logrocketExceptions.Capture.captureMessage(this, message, options);
3285
- }
3286
- }, {
3287
- key: "captureException",
3288
- value: function captureException(exception) {
3289
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3290
-
3291
- _logrocketExceptions.Capture.captureException(this, exception, options);
3292
- }
3293
- }, {
3294
- key: "version",
3295
- get: function get() {
3296
- return this._logger && this._logger.version;
3297
- }
3298
- }, {
3299
- key: "sessionURL",
3300
- get: function get() {
3301
- return this._logger && this._logger.recordingURL;
3302
- }
3303
- }, {
3304
- key: "recordingURL",
3305
- get: function get() {
3306
- return this._logger && this._logger.recordingURL;
3307
- }
3308
- }, {
3309
- key: "recordingID",
3310
- get: function get() {
3311
- return this._logger && this._logger.recordingID;
3312
- }
3313
- }, {
3314
- key: "threadID",
3315
- get: function get() {
3316
- return this._logger && this._logger.threadID;
3317
- }
3318
- }, {
3319
- key: "tabID",
3320
- get: function get() {
3321
- return this._logger && this._logger.tabID;
3322
- }
3323
- }, {
3324
- key: "reduxEnhancer",
3325
- value: function reduxEnhancer() {
3326
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3327
- return (0, _logrocketRedux.createEnhancer)(this, options);
3328
- }
3329
- }, {
3330
- key: "reduxMiddleware",
3331
- value: function reduxMiddleware() {
3332
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3333
- return (0, _logrocketRedux.createMiddleware)(this, options);
3334
- }
3335
- }, {
3336
- key: "isDisabled",
3337
- get: function get() {
3338
- return !!(this._isDisabled || this._logger && this._logger._isDisabled);
3339
- }
3340
- }]);
3341
- return LogRocket;
3342
- }();
3343
-
3344
- exports.default = LogRocket;
3345
-
3346
- /***/ }),
3347
-
3348
- /***/ "./packages/logrocket/src/makeLogRocket.js":
3349
- /*!*************************************************!*\
3350
- !*** ./packages/logrocket/src/makeLogRocket.js ***!
3351
- \*************************************************/
3352
- /*! no static exports found */
3353
- /***/ (function(module, exports, __webpack_require__) {
3354
-
3355
- "use strict";
3356
-
3357
-
3358
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
3359
-
3360
- Object.defineProperty(exports, "__esModule", {
3361
- value: true
3362
- });
3363
- exports.default = makeLogRocket;
3364
-
3365
- var _LogRocket = _interopRequireDefault(__webpack_require__(/*! ./LogRocket */ "./packages/logrocket/src/LogRocket.js"));
3366
-
3367
- var REACT_NATIVE_NOTICE = 'LogRocket does not yet support React Native.';
3368
-
3369
- var makeNoopPolyfill = function makeNoopPolyfill() {
3370
- return {
3371
- init: function init() {},
3372
- uninstall: function uninstall() {},
3373
- log: function log() {},
3374
- info: function info() {},
3375
- warn: function warn() {},
3376
- error: function error() {},
3377
- debug: function debug() {},
3378
- addEvent: function addEvent() {},
3379
- identify: function identify() {},
3380
- start: function start() {},
3381
-
3382
- get threadID() {
3383
- return null;
3384
- },
3385
-
3386
- get recordingID() {
3387
- return null;
3388
- },
3389
-
3390
- get recordingURL() {
3391
- return null;
3392
- },
3393
-
3394
- reduxEnhancer: function reduxEnhancer() {
3395
- return function (store) {
3396
- return function () {
3397
- return store.apply(void 0, arguments);
3398
- };
3399
- };
3400
- },
3401
- reduxMiddleware: function reduxMiddleware() {
3402
- return function () {
3403
- return function (next) {
3404
- return function (action) {
3405
- return next(action);
3406
- };
3407
- };
3408
- };
3409
- },
3410
- track: function track() {},
3411
- getSessionURL: function getSessionURL() {},
3412
- getVersion: function getVersion() {},
3413
- startNewSession: function startNewSession() {},
3414
- onLogger: function onLogger() {},
3415
- setClock: function setClock() {},
3416
- captureMessage: function captureMessage() {},
3417
- captureException: function captureException() {}
3418
- };
3419
- };
3420
-
3421
- function makeLogRocket() {
3422
- var getLogger = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};
3423
-
3424
- if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
3425
- throw new Error(REACT_NATIVE_NOTICE);
3426
- }
3427
-
3428
- if (typeof window !== 'undefined') {
3429
- if (window._disableLogRocket) {
3430
- return makeNoopPolyfill();
3431
- }
3432
-
3433
- if (window.MutationObserver && window.WeakMap) {
3434
- // Save window globals that we rely on.
3435
- window._lrMutationObserver = window.MutationObserver;
3436
- var instance = new _LogRocket.default();
3437
- getLogger(instance);
3438
- return instance;
3439
- }
3440
- }
3441
-
3442
- return makeNoopPolyfill();
3443
- }
3444
-
3445
- module.exports = exports.default;
3446
-
3447
- /***/ }),
3448
-
3449
- /***/ "./packages/logrocket/src/module-npm.js":
3450
- /*!**********************************************!*\
3451
- !*** ./packages/logrocket/src/module-npm.js ***!
3452
- \**********************************************/
3453
- /*! no static exports found */
3454
- /***/ (function(module, exports, __webpack_require__) {
3455
-
3456
- "use strict";
3457
-
3458
-
3459
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
3460
-
3461
- Object.defineProperty(exports, "__esModule", {
3462
- value: true
3463
- });
3464
- exports.default = void 0;
3465
-
3466
- var _setup = _interopRequireDefault(__webpack_require__(/*! ./setup */ "./packages/logrocket/src/setup.js"));
3467
-
3468
- var instance = (0, _setup.default)();
3469
- var _default = instance;
3470
- exports.default = _default;
3471
- module.exports = exports.default;
3472
-
3473
- /***/ }),
3474
-
3475
- /***/ "./packages/logrocket/src/setup.js":
3476
- /*!*****************************************!*\
3477
- !*** ./packages/logrocket/src/setup.js ***!
3478
- \*****************************************/
3479
- /*! no static exports found */
3480
- /***/ (function(module, exports, __webpack_require__) {
3481
-
3482
- "use strict";
3483
-
3484
-
3485
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
3486
-
3487
- Object.defineProperty(exports, "__esModule", {
3488
- value: true
3489
- });
3490
- exports.default = setup;
3491
-
3492
- var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/objectWithoutProperties.js"));
3493
-
3494
- var _makeLogRocket = _interopRequireDefault(__webpack_require__(/*! ./makeLogRocket */ "./packages/logrocket/src/makeLogRocket.js"));
3495
-
3496
- var CDN_SERVER_MAP = {
3497
- 'cdn.logrocket.io': 'https://r.logrocket.io',
3498
- 'cdn.lr-ingest.io': 'https://r.lr-ingest.io',
3499
- 'cdn-staging.logrocket.io': 'https://staging-i.logrocket.io',
3500
- 'cdn-staging.lr-ingest.io': 'https://staging-i.lr-ingest.io'
3501
- };
3502
-
3503
- function setup() {
3504
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
3505
- enterpriseServer = _ref.enterpriseServer,
3506
- _ref$sdkVersion = _ref.sdkVersion,
3507
- sdkVersion = _ref$sdkVersion === void 0 ? "1.2.3" : _ref$sdkVersion,
3508
- opts = (0, _objectWithoutProperties2.default)(_ref, ["enterpriseServer", "sdkVersion"]);
3509
-
3510
- var scriptOrigin = undefined === 'staging' ? 'https://cdn-staging.logrocket.io' : 'https://cdn.logrocket.io';
3511
- var scriptIngest;
3512
-
3513
- if (sdkVersion === 'script') {
3514
- try {
3515
- var scriptTag = document.currentScript;
3516
- var matches = scriptTag.src.match(/^(https?:\/\/([^\\]+))\/.+$/);
3517
- var scriptHostname = matches && matches[2];
3518
-
3519
- if (scriptHostname && CDN_SERVER_MAP[scriptHostname]) {
3520
- scriptOrigin = matches && matches[1];
3521
- scriptIngest = CDN_SERVER_MAP[scriptHostname];
3522
- }
3523
- } catch (_) {
3524
- /* no-op */
3525
- }
3526
- } else {
3527
- // NPM
3528
- scriptOrigin = undefined === 'staging' ? 'https://cdn-staging.lr-ingest.io' : 'https://cdn.lr-ingest.io';
3529
- scriptIngest = undefined === 'staging' ? 'https://staging-i.lr-ingest.io' : 'https://r.lr-ingest.io';
3530
- }
3531
-
3532
- var sdkServer = opts.sdkServer || enterpriseServer;
3533
- var ingestServer = opts.ingestServer || enterpriseServer || scriptIngest;
3534
- var instance = (0, _makeLogRocket.default)(function () {
3535
- var script = document.createElement('script');
3536
-
3537
- if (ingestServer) {
3538
- if (typeof window.__SDKCONFIG__ === 'undefined') {
3539
- window.__SDKCONFIG__ = {};
3540
- }
3541
-
3542
- window.__SDKCONFIG__.serverURL = "".concat(ingestServer, "/i");
3543
- window.__SDKCONFIG__.statsURL = "".concat(ingestServer, "/s");
3544
- }
3545
-
3546
- if (sdkServer) {
3547
- script.src = "".concat(sdkServer, "/logger.min.js");
3548
- } else if (window.__SDKCONFIG__ && window.__SDKCONFIG__.loggerURL) {
3549
- script.src = window.__SDKCONFIG__.loggerURL;
3550
- } else if (window._lrAsyncScript) {
3551
- script.src = window._lrAsyncScript;
3552
- } else {
3553
- script.src = "".concat(scriptOrigin, "/logger-1.min.js");
3554
- }
3555
-
3556
- script.async = true;
3557
- document.head.appendChild(script);
3558
-
3559
- script.onload = function () {
3560
- // Brave browser: Advertises its user-agent as Chrome ##.##... then
3561
- // loads logger.min.js, but blocks the execution of the script
3562
- // causing _LRlogger to be undefined. Let's make sure its there first.
3563
- if (typeof window._LRLogger === 'function') {
3564
- instance.onLogger(new window._LRLogger({
3565
- sdkVersion: sdkVersion
3566
- }));
3567
- } else {
3568
- console.warn('LogRocket: script execution has been blocked by a product or service.');
3569
- instance.uninstall();
3570
- }
3571
- };
3572
-
3573
- script.onerror = function () {
3574
- console.warn('LogRocket: script could not load. Check that you have a valid network connection.');
3575
- instance.uninstall();
3576
- };
3577
- });
3578
- return instance;
3579
- }
3580
-
3581
- module.exports = exports.default;
3582
-
3583
- /***/ }),
3584
-
3585
- /***/ 0:
3586
- /*!****************************************************!*\
3587
- !*** multi ./packages/logrocket/src/module-npm.js ***!
3588
- \****************************************************/
3589
- /*! no static exports found */
3590
- /***/ (function(module, exports, __webpack_require__) {
3591
-
3592
- module.exports = __webpack_require__(/*! /root/project/packages/logrocket/src/module-npm.js */"./packages/logrocket/src/module-npm.js");
3593
-
3594
-
3595
- /***/ })
3596
-
3597
- /******/ });
3598
- });