text: import 'core-js/modules/es6.object.define-property';
  import 'core-js/modules/es6.object.define-properties';
  import 'core-js/modules/es7.object.get-own-property-descriptors';
  import 'core-js/modules/es6.array.for-each';
  import 'core-js/modules/es6.array.filter';
  import 'core-js/modules/web.dom.iterable';
  import 'core-js/modules/es6.array.iterator';
  import 'core-js/modules/es6.object.keys';
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
  import 'core-js/modules/es6.function.bind';
  import _newArrowCheck from '@babel/runtime/helpers/newArrowCheck';
  import 'core-js/modules/es6.function.name';
  
  var _this = undefined;
  
  var getNotifier = function getNotifier(handlerName, payload) {
    var _this2 = this;
  
    _newArrowCheck(this, _this);
  
    return function (observer) {
      _newArrowCheck(this, _this2);
  
      return observer[handlerName] && observer[handlerName](payload);
    }.bind(this);
  }.bind(undefined);
  
  var getHandlerName = function getHandlerName(_ref) {
    var name = _ref.name;
  
    _newArrowCheck(this, _this);
  
    return "on".concat(name);
  }.bind(undefined);
  
  var notifyAll = function notifyAll(observers, event) {
    _newArrowCheck(this, _this);
  
    return observers.forEach(getNotifier(getHandlerName(event), event.payload));
  }.bind(undefined);
  
  var _this$1 = undefined;
  
  var notifyCanceled = function notifyCanceled(notifier, event) {
    _newArrowCheck(this, _this$1);
  
    notifyAll(notifier.canceledObservers, event);
    return notifier;
  }.bind(undefined);
  
  var eventNames = {
    abort: "Abort",
    cancel: "Cancel",
    error: "Error",
    result: "Result",
    start: "Start"
  };
  
  var _this$2 = undefined;
  
  var createStartEvent = function createStartEvent(payload) {
    _newArrowCheck(this, _this$2);
  
    return {
      payload: payload,
      name: eventNames.start
    };
  }.bind(undefined);
  
  var createResultEvent = function createResultEvent(payload) {
    _newArrowCheck(this, _this$2);
  
    return {
      payload: payload,
      name: eventNames.result
    };
  }.bind(undefined);
  
  var createErrorEvent = function createErrorEvent(payload) {
    _newArrowCheck(this, _this$2);
  
    return {
      payload: payload,
      name: eventNames.error
    };
  }.bind(undefined);
  
  var createCancelEvent = function createCancelEvent() {
    _newArrowCheck(this, _this$2);
  
    return {
      name: eventNames.cancel,
      payload: undefined
    };
  }.bind(undefined);
  
  var createAbortEvent = function createAbortEvent(payload) {
    _newArrowCheck(this, _this$2);
  
    return {
      payload: payload,
      name: eventNames.abort
    };
  }.bind(undefined);
  
  var _this$3 = undefined;
  
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  
  var clearCanceled = function clearCanceled(notifier) {
    _newArrowCheck(this, _this$3);
  
    return _objectSpread(_objectSpread({}, notifier), {}, {
      canceledObservers: []
    });
  }.bind(undefined);
  
  var flushCanceled = function flushCanceled(notifier) {
    _newArrowCheck(this, _this$3);
  
    return notifier.canceledObservers.length > 0 ? clearCanceled(notifyCanceled(notifier, createCancelEvent())) : notifier;
  }.bind(undefined);
  
  export default flushCanceled;
  //# sourceMappingURL=flushCanceled.js.map
  