"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = exports.LocalStorage = void 0;

var _bsGlobal = require("./bs-global");

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }

var LocalStorage = /*#__PURE__*/function () {
  function LocalStorage() {
    _classCallCheck(this, LocalStorage);

    this.userId = (0, _bsGlobal.getUserInfo)().Id;
  }

  _createClass(LocalStorage, [{
    key: "setItem",
    value: function setItem(name, value) {
      window.localStorage.setItem("".concat(name, "__").concat(this.userId), JSON.stringify(value));
    }
  }, {
    key: "getItem",
    value: function getItem(name) {
      var data = window.localStorage.getItem("".concat(name, "__").concat(this.userId));
      data = JSON.parse(data);
      return data;
    }
  }]);

  return LocalStorage;
}();

exports.LocalStorage = LocalStorage;
var _default = LocalStorage;
exports["default"] = _default;