code: function StateManager(generator, config, logger, documentManager) {
          EventEmitter.call(this);
  
          this._generator = generator;
          this._config = config;
          this._logger = logger;
  
          this._enabledDocumentIds = {};
          this._menuPromise = this._generator.addMenuItem(MENU_ID, MENU_LABEL, false, false)
              .finally(this._processNextMenuOperation.bind(this, false, false));
  
          documentManager.on("activeDocumentChanged",
              this._handleActiveDocumentChanged.bind(this));
          documentManager.on("openDocumentsChanged",
              this._handleOpenDocumentsChanged.bind(this));
          this._generator.onPhotoshopEvent("generatorMenuChanged",
              this._handleMenuClicked.bind(this));
      }
docs: Manages the state image asset generation for all documents. Emits "active"
  and "inactive" events with the following parameter when the state of image
  asset generation state changes:
  1. @param {number} The ID of the document for which image asset
  generation is now active or inactive.
  
  @constructor
  @param {Generator} generator
  @param {object} config
  @param {Logger} logger
  @param {DocumentManager} documentManager