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

  var Stack, __SystemJSRewritingHack;
  function pushIfMissing(array, item) {
    // check for already existing.
    var exists = false;
    var len = array.length;
    for (var i = 0; i < len; i++) if (array[i] == item) {
      exists = true;
      break;
    }

    // do not add an already existing item
    if (!exists) {
      array.push(item);
    }

    // return true if the given element was pushed, otherwise false
    return !exists;
  }
  function removeIfExisting(array, item) {
    var index = array.indexOf(item);
    if (index !== -1) {
      array.splice(index, 1);
      // return true if the given element was actually removed
      return true;
    }
    return false;
  }
  function isPrimitive(elem) {
    var getType = function (elem) {
      return Object.prototype.toString.call(elem).slice(8, -1);
    };
    var type = getType(elem);
    return type === 'String' || type === 'RegExp' || type === 'Boolean' || type === 'Number' || type === 'Null' || type === 'Undefined';
  }
  function identity(x) {
    return x;
  }
  _export({
    pushIfMissing: pushIfMissing,
    removeIfExisting: removeIfExisting,
    Stack: void 0,
    isPrimitive: isPrimitive,
    identity: identity
  });
  return {
    setters: [],
    execute: function () {
      __SystemJSRewritingHack = {};
      _recorder_._https__lively_kernel_org_lively4_lively4_ansgar_src_client_reactive_active_group_utils_js = _recorder_._https__lively_kernel_org_lively4_lively4_ansgar_src_client_reactive_active_group_utils_js || {};
      Object.defineProperty(_recorder_._https__lively_kernel_org_lively4_lively4_ansgar_src_client_reactive_active_group_utils_js, "identity", {
        get() {
          return identity;
        },
        set(thisIsVererySecretVariableName) {
          _export("identity", identity = thisIsVererySecretVariableName);
          return true;
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(_recorder_._https__lively_kernel_org_lively4_lively4_ansgar_src_client_reactive_active_group_utils_js, "isPrimitive", {
        get() {
          return isPrimitive;
        },
        set(thisIsVererySecretVariableName) {
          _export("isPrimitive", isPrimitive = thisIsVererySecretVariableName);
          return true;
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(_recorder_._https__lively_kernel_org_lively4_lively4_ansgar_src_client_reactive_active_group_utils_js, "removeIfExisting", {
        get() {
          return removeIfExisting;
        },
        set(thisIsVererySecretVariableName) {
          _export("removeIfExisting", removeIfExisting = thisIsVererySecretVariableName);
          return true;
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(_recorder_._https__lively_kernel_org_lively4_lively4_ansgar_src_client_reactive_active_group_utils_js, "pushIfMissing", {
        get() {
          return pushIfMissing;
        },
        set(thisIsVererySecretVariableName) {
          _export("pushIfMissing", pushIfMissing = thisIsVererySecretVariableName);
          return true;
        },
        enumerable: true,
        configurable: true
      });
      _export("Stack", Stack = class Stack {
        constructor() {
          this.arr = [];
        }
        push(el) {
          this.arr.push(el);
        }
        pop() {
          this.arr.length--;
        }
        top() {
          return this.arr.last();
        }
      });
      Object.defineProperty(_recorder_._https__lively_kernel_org_lively4_lively4_ansgar_src_client_reactive_active_group_utils_js, "Stack", {
        get() {
          return Stack;
        },
        set(thisIsVererySecretVariableName) {
          _export("Stack", Stack = thisIsVererySecretVariableName);
          return true;
        },
        enumerable: true,
        configurable: true
      });
    }
  };
});