text: 'use strict';
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  var NAMESPACE = 'emoji-mart';
  
  var _JSON = JSON;
  
  var isLocalStorageSupported = typeof window !== 'undefined' && 'localStorage' in window;
  
  var getter = void 0;
  var setter = void 0;
  
  function setHandlers(handlers) {
    handlers || (handlers = {});
  
    getter = handlers.getter;
    setter = handlers.setter;
  }
  
  function setNamespace(namespace) {
    NAMESPACE = namespace;
  }
  
  function update(state) {
    for (var key in state) {
      var value = state[key];
      set(key, value);
    }
  }
  
  function set(key, value) {
    if (setter) {
      setter(key, value);
    } else {
      if (!isLocalStorageSupported) return;
      try {
        window.localStorage[NAMESPACE + '.' + key] = _JSON.stringify(value);
      } catch (e) {}
    }
  }
  
  function get(key) {
    if (getter) {
      return getter(key);
    } else {
      if (!isLocalStorageSupported) return;
      try {
        var value = window.localStorage[NAMESPACE + '.' + key];
      } catch (e) {
        return;
      }
  
      if (value) {
        return JSON.parse(value);
      }
    }
  }
  
  exports.default = { update: update, set: set, get: get, setNamespace: setNamespace, setHandlers: setHandlers };