{"id":"FbHg","dependencies":[{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/operators/takeLast.js.map","includedInParent":true,"mtime":499162500000},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/src/internal/operators/takeLast.ts","includedInParent":true,"mtime":499162500000},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/package.json","includedInParent":true,"mtime":1545395749058},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/package.json","includedInParent":true,"mtime":1545395355370},{"name":"tslib","loc":{"line":2,"column":25},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/operators/takeLast.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/tslib/tslib.es6.js"},{"name":"../Subscriber","loc":{"line":3,"column":27},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/operators/takeLast.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/Subscriber.js"},{"name":"../util/ArgumentOutOfRangeError","loc":{"line":4,"column":40},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/operators/takeLast.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/util/ArgumentOutOfRangeError.js"},{"name":"../observable/empty","loc":{"line":5,"column":22},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/operators/takeLast.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/empty.js"}],"generated":{"js":"\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:!0}),exports.takeLast=o;var t=i(require(\"tslib\")),e=require(\"../Subscriber\"),r=require(\"../util/ArgumentOutOfRangeError\"),n=require(\"../observable/empty\");function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,r):{};n.get||n.set?Object.defineProperty(e,r,n):e[r]=t[r]}return e.default=t,e}function o(t){return function(e){return 0===t?(0,n.empty)():e.lift(new u(t))}}var u=function(){function t(t){if(this.total=t,this.total<0)throw new r.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.total))},t}(),s=function(e){function r(t,r){var n=e.call(this,t)||this;return n.total=r,n.ring=new Array,n.count=0,n}return t.__extends(r,e),r.prototype._next=function(t){var e=this.ring,r=this.total,n=this.count++;e.length0)for(var r=this.count>=this.total?this.total:this.count,n=this.ring,i=0;iRemembers the latest `count` values, then emits those\n * only when the source completes.\n *\n * ![](takeLast.png)\n *\n * `takeLast` returns an Observable that emits at most the last `count` values\n * emitted by the source Observable. If the source emits fewer than `count`\n * values then all of its values are emitted. This operator must wait until the\n * `complete` notification emission from the source in order to emit the `next`\n * values on the output Observable, because otherwise it is impossible to know\n * whether or not more values will be emitted on the source. For this reason,\n * all values are emitted synchronously, followed by the complete notification.\n *\n * ## Example\n * Take the last 3 values of an Observable with many values\n * ```javascript\n * const many = range(1, 100);\n * const lastThree = many.pipe(takeLast(3));\n * lastThree.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link take}\n * @see {@link takeUntil}\n * @see {@link takeWhile}\n * @see {@link skip}\n *\n * @throws {ArgumentOutOfRangeError} When using `takeLast(i)`, it delivers an\n * ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0`.\n *\n * @param {number} count The maximum number of values to emit from the end of\n * the sequence of values emitted by the source Observable.\n * @return {Observable} An Observable that emits at most the last count\n * values emitted by the source Observable.\n * @method takeLast\n * @owner Observable\n */\nexport function takeLast(count: number): MonoTypeOperatorFunction {\n return function takeLastOperatorFunction(source: Observable): Observable {\n if (count === 0) {\n return empty();\n } else {\n return source.lift(new TakeLastOperator(count));\n }\n };\n}\n\nclass TakeLastOperator implements Operator {\n constructor(private total: number) {\n if (this.total < 0) {\n throw new ArgumentOutOfRangeError;\n }\n }\n\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new TakeLastSubscriber(subscriber, this.total));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass TakeLastSubscriber extends Subscriber {\n private ring: Array = new Array();\n private count: number = 0;\n\n constructor(destination: Subscriber, private total: number) {\n super(destination);\n }\n\n protected _next(value: T): void {\n const ring = this.ring;\n const total = this.total;\n const count = this.count++;\n\n if (ring.length < total) {\n ring.push(value);\n } else {\n const index = count % total;\n ring[index] = value;\n }\n }\n\n protected _complete(): void {\n const destination = this.destination;\n let count = this.count;\n\n if (count > 0) {\n const total = this.count >= this.total ? this.total : this.count;\n const ring = this.ring;\n\n for (let i = 0; i < total; i++) {\n const idx = (count++) % total;\n destination.next(ring[idx]);\n }\n }\n\n destination.complete();\n }\n}\n"},"lineCount":null}},"hash":"a439392cdbc2e432a50a0d1f19f1dffc","cacheData":{"env":{}}}