{"ast":null,"code":"import _createForOfIteratorHelper from \"C:/Users/lucas.hsilva/Desktop/Nome_do_projeto/thf2/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js\";\nimport { Subject } from '../Subject';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function windowCount(windowSize) {\n  var startWindowEvery = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n  var startEvery = startWindowEvery > 0 ? startWindowEvery : windowSize;\n  return operate(function (source, subscriber) {\n    var windows = [new Subject()];\n    var starts = [];\n    var count = 0;\n    subscriber.next(windows[0].asObservable());\n    source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n      var _iterator = _createForOfIteratorHelper(windows),\n        _step;\n      try {\n        for (_iterator.s(); !(_step = _iterator.n()).done;) {\n          var _window = _step.value;\n          _window.next(value);\n        }\n      } catch (err) {\n        _iterator.e(err);\n      } finally {\n        _iterator.f();\n      }\n      var c = count - windowSize + 1;\n      if (c >= 0 && c % startEvery === 0) {\n        windows.shift().complete();\n      }\n      if (++count % startEvery === 0) {\n        var window = new Subject();\n        windows.push(window);\n        subscriber.next(window.asObservable());\n      }\n    }, function () {\n      while (windows.length > 0) {\n        windows.shift().complete();\n      }\n      subscriber.complete();\n    }, function (err) {\n      while (windows.length > 0) {\n        windows.shift().error(err);\n      }\n      subscriber.error(err);\n    }, function () {\n      starts = null;\n      windows = null;\n    }));\n  });\n}\n//# sourceMappingURL=windowCount.js.map","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}