Take an array of event names and remove default from {@link Lava.schema#system.DEFAULT_EVENTS}
@param {Array.<string>} event_names
@returns {Array.<string>} Filtered array of event names
494939
function(event_names) {

		var i = 0,
			count = event_names.length,
			result = [];

		for (; i < count; i++) {

			if (Lava.schema.system.DEFAULT_EVENTS.indexOf(event_names[i]) == -1) {

				result.push(event_names[i]);

			}

		}

		return result;

	}
651911
function callAllEventHandlers(...fns) {
  return (event, ...args) =>
    fns.some(fn => {
      if (fn) {
        fn(event, ...args)
      }
      return (
        event.preventDownshiftDefault ||
        (event.hasOwnProperty('nativeEvent') &&
          event.nativeEvent.preventDownshiftDefault)
      )
    })
}
346497
function removeEvent ( namespacedEvent ) {

            var event = namespacedEvent && namespacedEvent.split('.')[0];
            var namespace = event && namespacedEvent.substring(event.length);

            Object.keys(scope_Events).forEach(function( bind ){

                var tEvent = bind.split('.')[0],
                    tNamespace = bind.substring(tEvent.length);

                if ( (!event || event === tEvent) && (!namespace || namespace === tNamespace) ) {
                    delete scope_Events[bind];
                }
            });
        }
179115
function(evname) {
    var fns = this._events && this._events[evname] || [],
    args = __slice.call(arguments, 1);
    for (var i = 0, ii = fns.length; i < ii; i++) {
      fns[i].cb.apply(fns[i].ctxt, args);
    }
  }
290328
function ( eventName ) {
        var events = this.events[ eventName ];
        if ( !events || !events.length ) {
            return null;
        }
        events = events.length === 1 ?
            [ events[ 0 ] ] :
            Array.apply( null, events );
        return function ( source, args ) {
            var i,
                length = events.length;
            for ( i = 0; i < length; i++ ) {
                if ( events[ i ] ) {
                    args.eventSource = source;
                    args.userData = events[ i ].userData;
                    events[ i ].handler( args );
                }
            }
        };
    }
1102476
function normalizeEvents(events)
{
  // start with converting falsy events into catch-all placeholder
  events = events || entryPoint;

  if (!Array.isArray(events))
  {
    events = [events];
  }

  // return shallow copy
  return events.concat();
}
313491
function (name)
        {
            for (var i=0; i<ModalDialog.events.length; ++i) {
                if (typeof(ModalDialog.events[i][0]) == 'string' && ModalDialog.events[i][0] == name && typeof(ModalDialog.events[i][1]) == 'function') {
                    ModalDialog.events[i][1]();
                }
            }
        }
774077
function(events, name, callback, context) {
  // Remove all callbacks for all events.
  if (!events || !name && !context && !callback) return;

  var names = name ? [name] : _.keys(events);
  for (var i = 0, length = names.length; i < length; i++) {
    name = names[i];
    var handlers = events[name];

    // Bail out if there are no events stored.
    if (!handlers) break;

    // Find any remaining events.
    var remaining = [];
    if (callback || context) {
      for (var j = 0, k = handlers.length; j < k; j++) {
        var handler = handlers[j];
        if (
          callback && callback !== handler.callback &&
            callback !== handler.callback._callback ||
              context && context !== handler.context
        ) {
          remaining.push(handler);
        }
      }
    }

    // Replace events if there are any remaining.  Otherwise, clean up.
    if (remaining.length) {
      events[name] = remaining;
    } else {
      delete events[name];
    }
  }
  if (!_.isEmpty(events)) return events;
}
554130
function normalizeEventsConfig(events) {
  let newEvents = {}

  Object.keys(events).forEach((eventName) => {
    let event = Object.assign({}, events[eventName])
    newEvents[eventName] = event

    let tags = Object.assign({}, event.tags)
    event.tags = tags

    Object.keys(tags).forEach((tagName) => {
      let tag = Object.assign({}, tags[tagName])
      tags[tagName] = tag

      if (tag.impliedBy) {
        throw new Error('"impliedBy" must not be set explicitly')
      }

      if (tag.goesAfter) {
        tag.goesAfter.forEach((goesAfterTagName) => {
          tags[goesAfterTagName] = tags[goesAfterTagName] || {}
        })
      }

      if (tag.goesBefore) {
        tag.goesBefore.forEach((goesBeforeTagName) => {
          tags[goesBeforeTagName] = tags[goesBeforeTagName] || {}
        })
      }

      if (tag.implies) {
        tag.implies.forEach((impliedTagName) => {
          tags[impliedTagName] = tags[impliedTagName] || {}
          tags[impliedTagName].impliedBy = tags[impliedTagName].impliedBy || []
          tags[impliedTagName].impliedBy.push(tagName)
        })
      }
    })
  })

  return newEvents
}
382692
function (events)
		{
			var event = {};
			for (e in events)
			{
				var ref=events[e],
					e = 'event-'+e.replace('-','.');
				event[e]=ref;
				event[e].class=ref.class || 'wnEvent';
				event[e].eventName = e.split('-').pop();
				if (this.hasEvent(e))
				{
					_.merge(event[e],this.getEvent(e));
				}
				_eventsConfig[e]=_eventsConfig[e] || {};
				_.merge(_eventsConfig[e], event[e]);
			}
			return this;
		}
496395
function() {

		for (var name in this._events_listeners) {

			if (this._events_listeners[name]) {

				Lava.Core.removeGlobalHandler(this._events_listeners[name]);
				this._events_listeners[name] = null;
				this._event_usage_counters[name] = 0;

			}

		}

	}
357377
function(events, name, callback, options) {
    if (!events) return;

    let i = 0,
        listening;
    let context = options.context,
        listeners = options.listeners;

    // Delete all events listeners and "drop" events.
    if (!name && !callback && !context) {
        let ids = Object.keys(listeners);
        for (; i < ids.length; i++) {
            listening = listeners[ids[i]];
            delete listeners[listening.id];
            delete listening.listeningTo[listening.objID];
        }
        return;
    }

    let names = name ? [name] : Object.keys(events);
    for (; i < names.length; i++) {
        name = names[i];
        let handlers = events[name];

        // Bail out if there are no events stored.
        if (!handlers) break;

        // Replace events if there are any remaining.  Otherwise, clean up.
        let remaining = [];
        for (let j = 0; j < handlers.length; j++) {
            let handler = handlers[j];
            if (
                (callback && callback !== handler.callback && callback !== handler.callback._callback) ||
                (context && context !== handler.context)
            ) {
                remaining.push(handler);
            } else {
                listening = handler.listening;
                if (listening && --listening.count === 0) {
                    delete listeners[listening.id];
                    delete listening.listeningTo[listening.objID];
                }
            }
        }

        // Update tail event if the list has any events.  Otherwise, clean up.
        if (remaining.length) {
            events[name] = remaining;
        } else {
            delete events[name];
        }
    }
    return events;
}
594795
function(eventName) {
      var list, calls, ev, callback, args;
      var both = 2;
      if (!(calls = this._callbacks)) return this;
      while (both--) {
        ev = both ? eventName : 'all';
        if (list = calls[ev]) {
          for (var i = 0, l = list.length; i < l; i++) {
            if (!(callback = list[i])) {
              list.splice(i, 1); i--; l--;
            } else {
              args = both ? Array.prototype.slice.call(arguments, 1) : arguments;
              callback[0].apply(callback[1] || this, args);
            }
          }
        }
      }
      return 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();
			}
		}
	};
}
1157330
function(events, handler) {
        if (events === undefined) {
            return;
        }

        var handlers = this.handlers;
        each(splitStr(events), function(event) {
            if (!handler) {
                delete handlers[event];
            } else {
                handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);
            }
        });
        return this;
    }
799713
static function removeEvents( $events = false, $id = false, $version = false )
    {
        if ( is_array( $events ) )
        {
            $db = eZDB::instance();
            $db->begin();
            foreach( $events as $event )
            {
                $event->remove();
            }
            $db->commit();
        }
        else
        {
            $condArray = array();
            if ( $version !== false )
            {
                $condArray['version'] = $version;
            }
            if ( $id !== false )
            {
                $condArray['workflow_id'] = $id;
            }
            eZPersistentObject::removeObject( eZWorkflowEvent::definition(),
                                              $condArray );
        }
    }
979305
function(eventName, selector, callback) {
        if (!isString(selector)) {
            callback = selector;
            selector = '';
        }

        if (callback) {
            var events = this.events[eventName];
            if (events) {
                events = events[selector];
                if (events) {
                    for (var i = 0; i < events.length; i++) {
                        if (events[i] === callback) {
                            events.splice(i, 1);
                            i--;
                        }
                    }
                }
            }
        } else {
            this.events[eventName][selector] = [];
        }
    }