if (process.type === 'browser') { require('source-map-support').install(); }var log = require('common/utils/logger').debugLogger(__filename); var logError = require('common/utils/logger').errorLogger(__filename, false); var logFatal = require('common/utils/logger').errorLogger(__filename, true);'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getUserId = getUserId;

var _nodeUuid = require('node-uuid');

var _nodeUuid2 = _interopRequireDefault(_nodeUuid);

var _prefs = require('common/utils/prefs');

var _prefs2 = _interopRequireDefault(_prefs);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function getUserId() {
  var uid = _prefs2.default.get('analytics-uid');

  // Generate a new one if it doesn't exist
  if (!uid) {
    uid = _nodeUuid2.default.v4();
    _prefs2.default.set('analytics-uid', uid);
  }

  return uid;
}
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbW1vbi91dGlscy9hbmFseXRpY3MuanMiXSwibmFtZXMiOlsiZ2V0VXNlcklkIiwidWlkIiwiZ2V0IiwidjQiLCJzZXQiXSwibWFwcGluZ3MiOiI7Ozs7O1FBSWdCQSxTLEdBQUFBLFM7O0FBSmhCOzs7O0FBRUE7Ozs7OztBQUVPLFNBQVNBLFNBQVQsR0FBc0I7QUFDM0IsTUFBSUMsTUFBTSxnQkFBTUMsR0FBTixDQUFVLGVBQVYsQ0FBVjs7QUFFQTtBQUNBLE1BQUksQ0FBQ0QsR0FBTCxFQUFVO0FBQ1JBLFVBQU0sbUJBQUtFLEVBQUwsRUFBTjtBQUNBLG9CQUFNQyxHQUFOLENBQVUsZUFBVixFQUEyQkgsR0FBM0I7QUFDRDs7QUFFRCxTQUFPQSxHQUFQO0FBQ0QiLCJmaWxlIjoiY29tbW9uL3V0aWxzL2FuYWx5dGljcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB1dWlkIGZyb20gJ25vZGUtdXVpZCc7XG5cbmltcG9ydCBwcmVmcyBmcm9tICdjb21tb24vdXRpbHMvcHJlZnMnO1xuXG5leHBvcnQgZnVuY3Rpb24gZ2V0VXNlcklkICgpIHtcbiAgbGV0IHVpZCA9IHByZWZzLmdldCgnYW5hbHl0aWNzLXVpZCcpO1xuXG4gIC8vIEdlbmVyYXRlIGEgbmV3IG9uZSBpZiBpdCBkb2Vzbid0IGV4aXN0XG4gIGlmICghdWlkKSB7XG4gICAgdWlkID0gdXVpZC52NCgpO1xuICAgIHByZWZzLnNldCgnYW5hbHl0aWNzLXVpZCcsIHVpZCk7XG4gIH1cblxuICByZXR1cm4gdWlkO1xufVxuIl0sInNvdXJjZVJvb3QiOiJzcmMvc2NyaXB0cyJ9
