Inject definition for event structure.
@param   {Object} definition the definition to be injected
@returns {ProcessManagement} to be able to chain...
351625
function (definition) {
    if (!definition || !_.isObject(definition)) {
      var err = new Error('Please pass a valid definition!');
      debug(err);
      throw err;
    }

    this.definitions.event = _.defaults(definition, this.definitions.event);
    return this;
  }
179209
function inject(config) {
    const context = global;
    // setup variables
    // safeAdd( context, 'steps', {} )
    safeAddAll(context, [Functions]);
    context.Workflo = {
        Object: {},
        Array: {},
        String: {},
        Class: {},
        Util: {},
    };
    safeAddAll(context.Workflo.Object, [objectFunctions]);
    safeAddAll(context.Workflo.Array, [arrayFunctions]);
    safeAddAll(context.Workflo.Class, [classFunctions]);
    safeAddAll(context.Workflo.Util, [utilFunctions]);
    context.expectElement = matchers_1.expectElement;
    context.expectList = matchers_1.expectList;
    context.expectMap = matchers_1.expectMap;
    context.expectGroup = matchers_1.expectGroup;
    context.expectPage = matchers_1.expectPage;
    // add enum definitions
    context.Workflo.WaitType = enums_1.WaitType;
    context.Workflo.Comparator = enums_1.Comparator;
}
1216651
function addHandler(node, eventType, handler, thisObject){
    node = getNode(node);

    if (!node)
      throw 'basis.event.addHandler: can\'t attach event listener to undefined';

    if (typeof handler != 'function')
      throw 'basis.event.addHandler: handler is not a function';

    var handlers = node === global ? globalEvents : node[EVENT_HOLDER];

    if (!handlers)
      handlers = node[EVENT_HOLDER] = {};

    var eventTypeHandlers = handlers[eventType];
    var handlerObject = {
      handler: handler,
      thisObject: thisObject
    };

    if (!eventTypeHandlers)
    {
      eventTypeHandlers = handlers[eventType] = [handlerObject];
      eventTypeHandlers.fireEvent = function(event){ // closure
        // simulate capture phase for old browsers
        event = wrap(event);
        if (noCaptureScheme && event && globalHandlers[eventType])
        {
          if (typeof event.returnValue == 'undefined')
          {
            observeGlobalEvents(event);
            if (event.cancelBubble === true)
              return;
            if (typeof event.returnValue == 'undefined')
              event.returnValue = true;
          }
        }

        startFrame(event);

        // call eventType handlers
        for (var i = 0, wrappedEvent = new Event(event), item; item = eventTypeHandlers[i++];)
          item.handler.call(item.thisObject, wrappedEvent);

        finishFrame(event);
      };

      if (W3CSUPPORT)
        // W3C DOM event model
        node.addEventListener(eventType, eventTypeHandlers.fireEvent, false);
      else
        // old IE event model
        node.attachEvent('on' + eventType, eventTypeHandlers.fireEvent);
    }
    else
    {
      // check for duplicates, exit if found
      for (var i = 0, item; item = eventTypeHandlers[i]; i++)
        if (item.handler === handler && item.thisObject === thisObject)
          return;

      // add only unique handlers
      eventTypeHandlers.push(handlerObject);
    }
  }
681738
function Injector(obj){
  var services = {};
  var get = name => {
    if(!(name in services)){
      const err = new Error(`[injector] service "${name}" not found`);
      return Promise.reject(err);
    }
    return services[name];
  };
  if(typeof obj === 'object')
    services = obj;
  if(typeof obj === 'function')
    get = obj;
  function resolve(name) {
    let service = get(name);
    if(typeof service === 'function')
      service = invoke(service);
    return service;
  };
  function invoke(fn, that){
    return Promise
    .all(getParameterNames(fn).map(resolve))
    .then(params => fn.apply(that, params));
  }
  return invoke;
}
346819
function ServiceFactory(injector) {
    this.cache = {};
    this.injector = injector || {};

    // if we are in debug mode, then add the debug handler
    var pattern = this.injector.debugPattern || '*.*.*.*.*';
    var handler = this.injector.debugHandler || debugHandler;
    if (this.injector.debug) {
        eventBus.on(pattern, handler);
    }
}
1358421
function EventDispatcher (structureSearcher, definition) {
  if (!structureSearcher || !_.isObject(structureSearcher) || !_.isFunction(structureSearcher.getSagas)) {
    var err = new Error('Please pass a valid tree!');
    debug(err);
    throw err;
  }

  if (!definition || !_.isObject(definition)) {
    var err = new Error('Please pass a valid command definition!');
    debug(err);
    throw err;
  }

  this.structureSearcher = structureSearcher;
  this.definition = definition;
}
215017
public ErrorEventDefinitionBuilder errorEventDefinition(String id) {
    ErrorEventDefinition errorEventDefinition = createEmptyErrorEventDefinition();
    if (id != null) {
      errorEventDefinition.setId(id);
    }

    element.getEventDefinitions().add(errorEventDefinition);
    return new ErrorEventDefinitionBuilder(modelInstance, errorEventDefinition);
  }
343850
function(options)
	{
		options = conbo.defineDefaults(options, this.options);
		
		if (!!options.context) this.context = options.context;
		this.preinitialize(options);
		
		this._httpService = new conbo.HttpService(options);
		this._command = options.command;
		
		var resultHandler = function(event)
		{
			conbo.makeBindable(this, conbo.variables(event.result));
			conbo.assign(this, event.result);
			
			this.dispatchEvent(event);
		};
		
		this._httpService
			.addEventListener(conbo.ConboEvent.RESULT, resultHandler, this)
			.addEventListener(conbo.ConboEvent.FAULT, this.dispatchEvent, this);
		
		__denumerate(this);
		
		conbo.Hash.prototype.__construct.apply(this, arguments);
	}
27043
function execNewBindingHandlerOnNode(bindingKeyAndHandler, node, getValueAccessor, allBindings, bindingContext, reportBindingError) {
      var bindingKey = bindingKeyAndHandler.key,
          handlerParams = {
              element: node,
              $data: bindingContext.$data,
              $context: bindingContext,
              allBindings: allBindings
          },
          handlerConstructor = bindingKeyAndHandler.handler,
          handlerInstance,
          subscriptions = [];

      Object.defineProperty(handlerParams, 'value', {
          get: function () { return getValueAccessor(bindingKey)(); }
      });

      function handlerConstructorWrapper() {
          handlerInstance = this;

          // The handler instance will have properties `computed` and
          // `subscribe`, which are almost the same as the `ko.-` equivalent
          // except their lifecycle is limited to that of the node (i.e.
          // they are automatically disposed).
          this.computed = function handlerInstanceComputed(functionOrObject) {
              var settings = typeof functionOrObject === 'function' ?
                  { read: functionOrObject, write: functionOrObject } :
                  functionOrObject;
              extend(settings, {
                  owner: handlerInstance,
                  disposeWhenNodeIsRemoved: node
              });
              return computed(settings);
          };

          this.subscribe = function handlerInstanceSubscription(subscribable, callback, eventType) {
              subscriptions.push(
                  subscribable.subscribe(callback, handlerInstance, eventType)
              );
          };

          this.value = this.computed(function () {
              return getValueAccessor(bindingKey)();
          });

          handlerConstructor.call(this, handlerParams);
      }

      // We have to wrap the handler instance in this "subclass" because
      // it's the only way to define this.computed/subscribe before the
      // handlerConstructor is called, and one would expect those
      // utilities to be available in the constructor.
      extend(handlerConstructorWrapper, handlerConstructor);
      handlerConstructorWrapper.prototype = handlerConstructor.prototype;

      try {
          new handlerConstructorWrapper();
      } catch(ex) {
          reportBindingError('construction', ex);
      }

      addDisposeCallback(node, function () {
          if (typeof handlerInstance.dispose === "function") {
              handlerInstance.dispose.call(handlerInstance);
          }
          arrayForEach(subscriptions, function (subs) {
              subs.dispose();
          });
      });

      return handlerConstructor.controlsDescendantBindings || handlerInstance.controlsDescendantBindings;
  }
1075531
function addInject(obj, inject) {
    if(!exists(inject)) {
      return;
    }

    var injectMe;

    if (inject === '$injector') {
      injectMe = new di.Inject(di.Injector);
    } else if (isObject(inject)) {
      if(isString(inject.inject)){
        injectMe = new di.Inject(inject.inject);
      } else if(isString(inject.promise)) {
        injectMe = new di.InjectPromise(inject.promise);
      } else if(isString(inject.lazy)) {
        injectMe = new di.InjectLazy(inject.lazy);
      }
    } else {
      injectMe = new di.Inject(inject);
    }

    di.annotate(obj, injectMe);
  }
789250
function () {
        var self = this;

        if (self[0] && self[0].parentNode) {
          return domManipulate(self, arguments, function (node) {
            this.parentNode.insertBefore(node, this);
          });
        }

        return self;
      }
793862
function DOMViewControllerMixin(view) {

  var _this = this;

  function attachEvents() {

    // Events can be an object or a function that returns an object
    var events;
    if (isFunction(view.events)) {
      events = view.events();
    } else {
      events = view.events || {};
    }

    for (var key in events) {
      if (events.hasOwnProperty(key)) {
        var fn;

        (function () {
          var firstSpaceIndex = key.indexOf(' ');
          var type = undefined;
          var selector = undefined;
          // Event on root element
          if (firstSpaceIndex === -1) {
            type = key;
          } else {
            type = key.substr(0, firstSpaceIndex);
            selector = key.substr(firstSpaceIndex + 1);
          }
          fn = events[key];

          (function (fn) {
            // Use 'on' instead of the elem[type] so that the handlers
            // stay bound if the view is updated with new elements
            view.$el.on(type, selector, function (event) {
              if (_this[fn] === undefined) {
                throw new Error('mixin target has no function: ' + fn);
              }
              _this[fn](event, view);
            });
          })(fn);
        })();
      }
    }
  }

  attachEvents();
}
1258420
function Event (eventstream, event, eventMappings) {
  if (!eventstream) {
    var errStreamMsg = 'eventstream not injected!';
    debug(errStreamMsg);
    throw new Error(errStreamMsg);
  }

  if (!event) {
    var errEvtMsg = 'event not injected!';
    debug(errEvtMsg);
    throw new Error(errEvtMsg);
  }

  if (!eventstream.aggregateId) {
    var errAggIdMsg = 'eventstream.aggregateId not injected!';
    debug(errAggIdMsg);
    throw new Error(errAggIdMsg);
  }

  if (!_.isArray(eventstream.uncommittedEvents)) {
    var errAggIdMsg = 'eventstream.uncommittedEvents not injected!';
    debug(errAggIdMsg);
    throw new Error(errAggIdMsg);
  }

  eventMappings = eventMappings || {};

  this.streamId = eventstream.aggregateId;
  this.aggregateId = eventstream.aggregateId;
  this.aggregate = eventstream.aggregate;
  this.context = eventstream.context;
  this.streamRevision = null;
  this.commitId = null;
  this.commitSequence = null;
  this.commitStamp = null;
  this.payload = event || null;
  this.position = null;

  this.applyMappings = function applyMappings() {
    _.keys(eventMappings).forEach(function (key) {
      if (this[key] !== undefined && this[key] !== null) {
        dotty.put(this.payload, eventMappings[key], this[key]);
      }
    }.bind(this));
  };

  eventstream.uncommittedEvents.push(this);
}
390911
function(events) {
	return {
		remove: function() { // Remove multiple events.
			for (var key in events) {
				events[key].remove();
			}
		},
		add: function() { // Add multiple events.
			for (var key in events) {
				events[key].add();
			}
		}
	};
}
149395
function createEvent(config) {
  const { type, target } = config;
  const eventObject = new Event(type);

  if (target) {
    eventObject.target = target;
    eventObject.srcElement = target;
    eventObject.currentTarget = target;
  }

  return eventObject;
}
903317
function inject(target, source) {
    for (var k in source.prototype) {
        target.prototype[k] = source.prototype[k];
    }
}
155833
function injectCode(code, id) {
  var pre = document.getElementById(id);
  pre.textContent = code;
  code = pre.innerHTML;
  code = prettyPrintOne(code, 'js');
  pre.innerHTML = code;
}