System.register([], function (_export, _context) {
  "use strict";

  return {
    setters: [],
    execute: function () {
      const __SystemJSRewritingHack = {};
      _recorder_._src_client_reactive_active_expression_rewriting_dual_key_map_js = _recorder_._src_client_reactive_active_expression_rewriting_dual_key_map_js || {};
      class DualKeyMap {

        constructor() {
          this._leftToMiddle = new Map();
        }

        add(primaryKey, secondaryKey, value) {
          this.getOrCreate(primaryKey, secondaryKey, () => value);
        }

        remove(primaryKey) {
          if (!this.hasPrimary(primaryKey)) return;
          for (const secondaryKey of this.getMiddles(primaryKey)) {
            this._middleToRight.delete(secondaryKey);
          }
          this._leftToMiddle.delete(primaryKey);
        }

        removeSecondary(primaryKey, secondaryKey) {
          if (!this.has(primaryKey, secondaryKey)) return;
          this.getMiddles(primaryKey).delete(secondaryKey);
          if (this.getMiddles(primaryKey).size === 0) {
            this._leftToMiddle.delete(primaryKey);
          }
        }

        clear() {
          this._leftToMiddle.clear();
        }

        hasPrimary(primaryKey) {
          return this._leftToMiddle.has(primaryKey);
        }

        has(primaryKey, secondaryKey) {
          if (!this.hasPrimary(primaryKey)) return false;
          return this.getMiddles(primaryKey).has(secondaryKey);
        }

        getMiddles(primaryKey) {
          return this._leftToMiddle.get(primaryKey);
        }

        get(primaryKey, secondaryKey) {
          if (!this.has(primaryKey, secondaryKey)) return undefined;
          return this._leftToMiddle.get(primaryKey).get(secondaryKey);
        }

        getOrCreate(primaryKey, secondaryKey, creatorFunction) {
          return this._leftToMiddle.getOrCreate(primaryKey, () => new Map()).getOrCreate(secondaryKey, creatorFunction);
        }

        allValues() {
          return [...this._leftToMiddle.values()].flatMap(inner => [...inner.values()]);
        }

      }

      _export("default", DualKeyMap);

      Object.defineProperty(_recorder_._src_client_reactive_active_expression_rewriting_dual_key_map_js, "DualKeyMap", {
        get() {
          return DualKeyMap;
        },

        set(thisIsVererySecretVariableName) {
          _export("default", DualKeyMap = thisIsVererySecretVariableName);

          return true;
        },

        enumerable: true,
        configurable: true
      });
    }
  };
});