{"ast":null,"code":"import { Subscriber } from '../Subscriber';\nimport { Subject } from '../Subject';\nexport function windowCount(windowSize, startWindowEvery = 0) {\n return function windowCountOperatorFunction(source) {\n return source.lift(new WindowCountOperator(windowSize, startWindowEvery));\n };\n}\nclass WindowCountOperator {\n constructor(windowSize, startWindowEvery) {\n this.windowSize = windowSize;\n this.startWindowEvery = startWindowEvery;\n }\n call(subscriber, source) {\n return source.subscribe(new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery));\n }\n}\nclass WindowCountSubscriber extends Subscriber {\n constructor(destination, windowSize, startWindowEvery) {\n super(destination);\n this.destination = destination;\n this.windowSize = windowSize;\n this.startWindowEvery = startWindowEvery;\n this.windows = [new Subject()];\n this.count = 0;\n destination.next(this.windows[0]);\n }\n _next(value) {\n const startWindowEvery = this.startWindowEvery > 0 ? this.startWindowEvery : this.windowSize;\n const destination = this.destination;\n const windowSize = this.windowSize;\n const windows = this.windows;\n const len = windows.length;\n for (let i = 0; i < len && !this.closed; i++) {\n windows[i].next(value);\n }\n const c = this.count - windowSize + 1;\n if (c >= 0 && c % startWindowEvery === 0 && !this.closed) {\n windows.shift().complete();\n }\n if (++this.count % startWindowEvery === 0 && !this.closed) {\n const window = new Subject();\n windows.push(window);\n destination.next(window);\n }\n }\n _error(err) {\n const windows = this.windows;\n if (windows) {\n while (windows.length > 0 && !this.closed) {\n windows.shift().error(err);\n }\n }\n this.destination.error(err);\n }\n _complete() {\n const windows = this.windows;\n if (windows) {\n while (windows.length > 0 && !this.closed) {\n windows.shift().complete();\n }\n }\n this.destination.complete();\n }\n _unsubscribe() {\n this.count = 0;\n this.windows = null;\n }\n}","map":{"version":3,"names":["Subscriber","Subject","windowCount","windowSize","startWindowEvery","windowCountOperatorFunction","source","lift","WindowCountOperator","constructor","call","subscriber","subscribe","WindowCountSubscriber","destination","windows","count","next","_next","value","len","length","i","closed","c","shift","complete","window","push","_error","err","error","_complete","_unsubscribe"],"sources":["/home/arctichawk1/Desktop/Projects/Public/Kargi-Sitesi/node_modules/rxjs/_esm2015/internal/operators/windowCount.js"],"sourcesContent":["import { Subscriber } from '../Subscriber';\nimport { Subject } from '../Subject';\nexport function windowCount(windowSize, startWindowEvery = 0) {\n return function windowCountOperatorFunction(source) {\n return source.lift(new WindowCountOperator(windowSize, startWindowEvery));\n };\n}\nclass WindowCountOperator {\n constructor(windowSize, startWindowEvery) {\n this.windowSize = windowSize;\n this.startWindowEvery = startWindowEvery;\n }\n call(subscriber, source) {\n return source.subscribe(new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery));\n }\n}\nclass WindowCountSubscriber extends Subscriber {\n constructor(destination, windowSize, startWindowEvery) {\n super(destination);\n this.destination = destination;\n this.windowSize = windowSize;\n this.startWindowEvery = startWindowEvery;\n this.windows = [new Subject()];\n this.count = 0;\n destination.next(this.windows[0]);\n }\n _next(value) {\n const startWindowEvery = (this.startWindowEvery > 0) ? this.startWindowEvery : this.windowSize;\n const destination = this.destination;\n const windowSize = this.windowSize;\n const windows = this.windows;\n const len = windows.length;\n for (let i = 0; i < len && !this.closed; i++) {\n windows[i].next(value);\n }\n const c = this.count - windowSize + 1;\n if (c >= 0 && c % startWindowEvery === 0 && !this.closed) {\n windows.shift().complete();\n }\n if (++this.count % startWindowEvery === 0 && !this.closed) {\n const window = new Subject();\n windows.push(window);\n destination.next(window);\n }\n }\n _error(err) {\n const windows = this.windows;\n if (windows) {\n while (windows.length > 0 && !this.closed) {\n windows.shift().error(err);\n }\n }\n this.destination.error(err);\n }\n _complete() {\n const windows = this.windows;\n if (windows) {\n while (windows.length > 0 && !this.closed) {\n windows.shift().complete();\n }\n }\n this.destination.complete();\n }\n _unsubscribe() {\n this.count = 0;\n this.windows = null;\n }\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,eAAe;AAC1C,SAASC,OAAO,QAAQ,YAAY;AACpC,OAAO,SAASC,WAAWA,CAACC,UAAU,EAAEC,gBAAgB,GAAG,CAAC,EAAE;EAC1D,OAAO,SAASC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