All files / build index.js

74.74% Statements 71/95
54.29% Branches 38/70
69.57% Functions 16/23
75.34% Lines 55/73

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138    1x     1x   3x   1x   1x   1x   1x   4x   4x   1x   1x   1x 8x     1x                       1x 1x     4x   4x   4x 4x 4x 4x     4x       4x 1x 1x 1x 1x   1x 1x           1x 1x   1x 1x 1x 1x 1x 1x       1x     1x 1x   1x     1x     1x           1x     4x     1x     1x         1x   1x   1x         4x       1x     1x     1x    
'use strict';
 
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.FullStoryAPI = exports.getWindowFullStory = undefined;
 
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; Eif ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { Eif (protoProps) defineProperties(Constructor.prototype, protoProps); Iif (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
 
var _react = require('react');
 
var _propTypes = require('prop-types');
 
var _propTypes2 = _interopRequireDefault(_propTypes);
 
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
function _classCallCheck(instance, Constructor) { Iif (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
function _possibleConstructorReturn(self, call) { Iif (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
 
function _inherits(subClass, superClass) { Iif (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); Eif (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
 
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
 
var getWindowFullStory = exports.getWindowFullStory = function getWindowFullStory() {
  return window[window['_fs_namespace']];
};
 
var FullStoryAPI = exports.FullStoryAPI = function FullStoryAPI(fn) {
  for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
    args[_key - 1] = arguments[_key];
  }
 
  if (canUseDOM && getWindowFullStory()) {
    getWindowFullStory().apply(fn, args);
  } else {
    console.warn('FullStory not initialized yet');
  }
};
 
var FullStory = function (_Component) {
  _inherits(FullStory, _Component);
 
  function FullStory(props) {
    _classCallCheck(this, FullStory);
 
    var _this = _possibleConstructorReturn(this, (FullStory.__proto__ || Object.getPrototypeOf(FullStory)).call(this, props));
 
    var org = props.org,
        debug = props.debug,
        host = props.host,
        namespace = props.namespace;
 
 
    Iif (!org || !canUseDOM) {
      return _possibleConstructorReturn(_this);
    }
 
    if (!getWindowFullStory()) {
      window['_fs_debug'] = debug || false;
      window['_fs_host'] = host || 'fullstory.com';
      window['_fs_org'] = org;
      window['_fs_namespace'] = namespace || 'FS';
 
      (function (w, d, ns, t, l, o, g, y) {
        Iif (ns in w) {
          if (w.console && w.console.log) {
            w.console.log('FullStory namespace conflict. Please set window["_fs_namespace"]');
          }
          return;
        }
        g = w[ns] = function (a, b) {
          g.q ? g.q.push([a, b]) : g._api(a, b);
        };
        g.q = [];
        o = d.createElement(t);
        o.async = 1;
        o.src = 'https://' + window['_fs_host'] + '/s/fs.js';
        d.head.appendChild(o);
        g.identify = function (i, v) {
          g(l, { uid: i });
          if (v) g(l, v);
        };
        g.setUserVars = function (v) {
          g(l, v);
        };
        g.shutdown = function () {
          g('rec', !1);
        };
        g.restart = function () {
          g('rec', !0);
        };
        g.consent = function (a) {
          g('consent', !arguments.length || a);
        };
        g.identifyAccount = function (i, v) {
          o = 'account';
          v = v || {};
          v.acctId = i;
          g(o, v);
        };
        g.clearUserCookie = function () {};
      })(window, document, window['_fs_namespace'], 'script', 'user');
    }
    return _this;
  }
 
  _createClass(FullStory, [{
    key: 'shouldComponentUpdate',
    value: function shouldComponentUpdate() {
      return false;
    }
  }, {
    key: 'componentWillUnmount',
    value: function componentWillUnmount() {
      Iif (!canUseDOM || !getWindowFullStory()) return false;
 
      getWindowFullStory().shutdown();
 
      delete getWindowFullStory();
    }
  }, {
    key: 'render',
    value: function render() {
      return false;
    }
  }]);
 
  return FullStory;
}(_react.Component);
 
exports.default = FullStory;
 
 
FullStory.propTypes = {
  org: _propTypes2.default.string.isRequired
};