var unsupportedIterableToArray = require('./unsupportedIterableToArray')
function _createForOfIteratorHelper (r, e) {
  var t
  if (typeof Symbol === 'undefined' || r[Symbol.iterator] == null) {
    if (Array.isArray(r) || (t = unsupportedIterableToArray(r)) || e && r && typeof r.length === 'number') {
      t && (r = t)
      var n = 0; var o = function () {}
      return {
        s: o,
        n: function () {
          return n >= r.length ? {
            done: !0
          } : {
            done: !1,
            value: r[n++]
          }
        },
        e: function (r) {
          throw r
        },
        f: o
      }
    }
    throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
  }
  var a; var u = !0; var i = !1
  return {
    s: function () {
      t = r[Symbol.iterator]()
    },
    n: function () {
      var r = t.next()
      return (u = r.done, r)
    },
    e: function (r) {
      (i = !0, a = r)
    },
    f: function () {
      try {
        u || t.return == null || t.return()
      } finally {
        if (i) throw a
      }
    }
  }
}
module.exports = _createForOfIteratorHelper
